diff options
Diffstat (limited to 'vm.d')
| -rw-r--r-- | vm.d | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -9,6 +9,7 @@ import compiler; //import obj; import dbg; + enum InterpretResult { OK, COMPILE_ERROR, @@ -569,6 +570,13 @@ InterpretResult interpret(string source, VM vm) { Compiler compiler = new Compiler(ObjType.SCRIPT, &parser); Function func = compiler.compile(); + if (compiler.errors.length > 0) { + foreach (CompileError err ; compiler.errors) { + writefln("error: %s", printableCompilerError(err)); + } + return InterpretResult.COMPILE_ERROR; + } + // vm.globals[":int"] = makeTypeValue(":int"); // reset the frame count (why do i need to do this?) |
