optimizations
Some checks failed
Build / build (push) Successful in 10m29s
Publish Image / publish (push) Failing after 31s
Test / build (push) Failing after 6m34s

This commit is contained in:
Chuck Smith
2024-04-02 14:08:08 -04:00
parent 4c9ec5aaaa
commit 07fd82b261
23 changed files with 296 additions and 265 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"flag"
"fmt"
"monkey"
"os"
)
@@ -24,6 +25,7 @@ func main() {
flag.Parse()
opts := &monkey.Options{
Args: flag.Args(),
Debug: debug,
Trace: trace,
}
@@ -37,12 +39,15 @@ func main() {
case flag.NArg() > 0:
opts.Args = flag.Args()[1:]
monkey.ExecFile(flag.Arg(0), opts)
if err := monkey.ExecFile(flag.Arg(0), opts); err != nil {
fmt.Fprintf(os.Stderr, "runtime error: %v\n", err)
os.Exit(1)
}
case simple:
monkey.SimpleREPL(flag.Args(), opts)
monkey.SimpleREPL(opts)
default:
monkey.REPL(flag.Args(), opts)
monkey.REPL(opts)
}
}