bunch of changes
Some checks failed
Build / build (push) Failing after 5m54s
Publish Image / publish (push) Failing after 35s
Test / build (push) Failing after 5m46s

This commit is contained in:
Chuck Smith
2024-03-28 17:19:23 -04:00
parent 244b71d245
commit fb0cebaf56
16 changed files with 174 additions and 320 deletions

View File

@@ -12,27 +12,29 @@ func main() {
compile bool
version bool
simple bool
debug bool
)
flag.BoolVar(&compile, "c", false, "Compile a monkey file into a '.monkeyc' 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(&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.Parse()
switch {
case compile:
monkey.CompileFiles(flag.Args())
monkey.CompileFiles(flag.Args(), debug)
case version:
monkey.PrintVersionInfo(os.Stdout)
case flag.NArg() > 0:
monkey.ExecFileVM(flag.Arg(0))
monkey.ExecFileVM(flag.Arg(0), flag.Args()[1:], debug)
case simple:
monkey.SimpleVmREPL()
monkey.SimpleVmREPL(flag.Args(), debug)
default:
monkey.VmREPL()
monkey.VmREPL(flag.Args(), debug)
}
}