debug for compilation flows
Some checks failed
Build / build (push) Failing after 1m16s
Test / build (push) Has been cancelled

This commit is contained in:
Chuck Smith
2024-03-18 16:58:54 -04:00
parent 98c8582fdb
commit 0f9638c971
2 changed files with 60 additions and 1 deletions

View File

@@ -116,6 +116,7 @@ func (r *REPL) Exec(f io.Reader) (state *VMState) {
}
c := compiler.NewWithState(state.symbols, state.constants)
c.Debug = r.opts.Debug
err = c.Compile(program)
if err != nil {
fmt.Fprintf(os.Stderr, "Woops! Compilation failed:\n %s\n", err)
@@ -197,6 +198,7 @@ func (r *REPL) StartExecLoop(in io.Reader, out io.Writer, state *VMState) {
}
c := compiler.NewWithState(state.symbols, state.constants)
c.Debug = r.opts.Debug
err := c.Compile(program)
if err != nil {
fmt.Fprintf(os.Stderr, "Woops! Compilation failed:\n %s\n", err)