Commits

Tomas Heran committed 8704eb4

Error handling and output to Stderr

Comments (0)

Files changed (1)

 	for i, m := 1, len(os.Args); i < m; i++ {
 		tree, ok := parser.ParseFile(os.Args[i], nil, 0)
 		if ok != nil {
-			println("error parsing file", os.Args[i], ok.String())
-			panic(nil)
+			fmt.Fprintf(os.Stderr, "error parsing file %s - %s\n", os.Args[i], ok.String())
+			os.Exit(1)
 		}
 		output_tag(tree.Name, PKG);
 		for _, node := range tree.Decls {