Skip to content

Commit f41ce7f

Browse files
committed
Fix tests for PR antlr#1844.
1 parent 32a8874 commit f41ce7f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/go-target.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (this *TreeShapeListener) EnterEveryRule(ctx antlr.ParserRuleContext) {
8888
}
8989
9090
func main() {
91-
input := antlr.NewFileStream(os.Args[1])
91+
input, _ := antlr.NewFileStream(os.Args[1])
9292
lexer := parser.NewJSONLexer(input)
9393
stream := antlr.NewCommonTokenStream(lexer,0)
9494
p := parser.NewJSONParser(stream)

runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,11 @@ protected void writeParserTestFile(String parserName, String lexerName,
696696
+ "}\n"
697697
+ "\n"
698698
+ "func main() {\n"
699-
+ " input := antlr.NewFileStream(os.Args[1])\n"
699+
+ " input, err := antlr.NewFileStream(os.Args[1])\n"
700+
+ " if err != nil {\n"
701+
+ " fmt.Printf("Failed to find file: %v", err)\n"
702+
+ " return\n"
703+
+ " }\n"
700704
+ " lexer := parser.New<lexerName>(input)\n"
701705
+ " stream := antlr.NewCommonTokenStream(lexer,0)\n"
702706
+ "<createParser>"

0 commit comments

Comments
 (0)