further improvements
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user