From f284da76910216940402561a4c717c5b5d02ebe4 Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Thu, 2 Feb 2023 15:29:41 +0100 Subject: [PATCH] Fixed minor bug in the REPL --- src/main.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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")