Fixed minor bug in the REPL

This commit is contained in:
Mattia Giambirtone 2023-02-02 15:29:41 +01:00
parent 81e10ae1ea
commit f284da7691
1 changed files with 1 additions and 2 deletions

View File

@ -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")