further improvements
Some checks failed
Build / build (push) Successful in 10m40s
Publish Image / publish (push) Failing after 34s
Test / build (push) Has been cancelled

This commit is contained in:
2024-04-01 17:02:44 -04:00
parent aebbe43999
commit f9e6e164b0
26 changed files with 168 additions and 138 deletions

View File

@@ -13,12 +13,14 @@ func main() {
version bool
simple bool
debug bool
trace bool
)
flag.BoolVar(&compile, "c", false, "Compile a monkey file into a '.mc' bytecode file")
flag.BoolVar(&simple, "s", false, "Use simple REPL instead of opening a terminal")
flag.BoolVar(&version, "v", false, "Print Monkey version information")
flag.BoolVar(&debug, "d", false, "Enable debug mode")
flag.BoolVar(&debug, "D", false, "Enable Compiler and VM debugging")
flag.BoolVar(&trace, "T", false, "Enable VM tracing")
flag.Parse()
switch {
@@ -29,12 +31,12 @@ func main() {
monkey.PrintVersionInfo(os.Stdout)
case flag.NArg() > 0:
monkey.ExecFileVM(flag.Arg(0), flag.Args()[1:], debug)
monkey.ExecFileVM(flag.Arg(0), flag.Args()[1:], debug, trace)
case simple:
monkey.SimpleVmREPL(flag.Args(), debug)
monkey.SimpleVmREPL(flag.Args(), debug, trace)
default:
monkey.VmREPL(flag.Args(), debug)
monkey.VmREPL(flag.Args(), debug, trace)
}
}