()
| 11 | ) |
| 12 | |
| 13 | func main() { |
| 14 | |
| 15 | if len(os.Args) >= 2 { |
| 16 | file, err := os.ReadFile(os.Args[1]) |
| 17 | if err != nil { |
| 18 | panic(fmt.Sprintf("read script fail, err:%+v", err)) |
| 19 | } |
| 20 | gscript.Args = os.Args |
| 21 | gscript.NewCompiler().Compiler(string(file)) |
| 22 | |
| 23 | } else { |
| 24 | repl() |
| 25 | } |
| 26 | |
| 27 | } |
| 28 | |
| 29 | func repl() { |
| 30 | s := flag.String("x", "run", "debug or run, the debug mode will print the AST tree.") |
nothing calls this directly
no test coverage detected