This commit is contained in:
Chuck Smith
2024-03-16 20:02:57 -04:00
parent 83ad72a7fc
commit d454572870
3 changed files with 46 additions and 3 deletions

View File

@@ -126,6 +126,7 @@ func (r *REPL) Exec(f io.Reader) (state *VMState) {
state.constants = code.Constants
machine := vm.NewWithGlobalState(code, state.globals)
machine.Debug = r.opts.Debug
err = machine.Run()
if err != nil {
fmt.Fprintf(os.Stderr, "Woops! Executing bytecode failed:\n %s\n", err)
@@ -206,6 +207,7 @@ func (r *REPL) StartExecLoop(in io.Reader, out io.Writer, state *VMState) {
state.constants = code.Constants
machine := vm.NewWithGlobalState(code, state.globals)
machine.Debug = r.opts.Debug
err = machine.Run()
if err != nil {
fmt.Fprintf(os.Stderr, "Woops! Executing bytecode failed:\n %s\n", err)