print parse trace (forces -seq)
-comments
parse comments (ignored unless -ast or -trace is provided)
+ -panic
+ panic on first error
Examples:
printAST = flag.Bool("ast", false, "print AST (forces -seq)")
printTrace = flag.Bool("trace", false, "print parse trace (forces -seq)")
parseComments = flag.Bool("comments", false, "parse comments (ignored unless -ast or -trace is provided)")
+ panicOnError = flag.Bool("panic", false, "panic on first error")
)
var (
}
func report(err error) {
+ if *panicOnError {
+ panic(err)
+ }
scanner.PrintError(os.Stderr, err)
if list, ok := err.(scanner.ErrorList); ok {
errorCount += len(list)