diff --git a/src/main.nim b/src/main.nim index b781613..e0900ef 100644 --- a/src/main.nim +++ b/src/main.nim @@ -82,7 +82,6 @@ proc repl(warnings: seq[WarningKind] = @[], mismatches: bool = false, mode: Comp input = editor.read() if input == "#reset": compiled = newChunk() - compiler = newBytecodeCompiler(replMode=true) current = "" continue elif input == "#show": @@ -111,7 +110,7 @@ proc repl(warnings: seq[WarningKind] = @[], mismatches: bool = false, mode: Comp for node in tree: styledEcho fgGreen, "\t", $node echo "" - compiled = compiler.compile(tree, "stdin", tokenizer.getLines(), current & input & "\n", showMismatches=mismatches, disabledWarnings=warnings, mode=mode) + compiled = newBytecodeCompiler(replMode=true).compile(tree, "stdin", tokenizer.getLines(), current & input & "\n", showMismatches=mismatches, disabledWarnings=warnings, mode=mode) when debugCompiler: styledEcho fgCyan, "Compilation step:\n" debugger.disassembleChunk(compiled, "stdin")