Fixed minor bug in the REPL
This commit is contained in:
parent
81e10ae1ea
commit
f284da7691
|
@ -82,7 +82,6 @@ proc repl(warnings: seq[WarningKind] = @[], mismatches: bool = false, mode: Comp
|
||||||
input = editor.read()
|
input = editor.read()
|
||||||
if input == "#reset":
|
if input == "#reset":
|
||||||
compiled = newChunk()
|
compiled = newChunk()
|
||||||
compiler = newBytecodeCompiler(replMode=true)
|
|
||||||
current = ""
|
current = ""
|
||||||
continue
|
continue
|
||||||
elif input == "#show":
|
elif input == "#show":
|
||||||
|
@ -111,7 +110,7 @@ proc repl(warnings: seq[WarningKind] = @[], mismatches: bool = false, mode: Comp
|
||||||
for node in tree:
|
for node in tree:
|
||||||
styledEcho fgGreen, "\t", $node
|
styledEcho fgGreen, "\t", $node
|
||||||
echo ""
|
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:
|
when debugCompiler:
|
||||||
styledEcho fgCyan, "Compilation step:\n"
|
styledEcho fgCyan, "Compilation step:\n"
|
||||||
debugger.disassembleChunk(compiled, "stdin")
|
debugger.disassembleChunk(compiled, "stdin")
|
||||||
|
|
Loading…
Reference in New Issue