You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have done a search of the existing issues to make sure I'm not sending in a duplicate
Please include information about the expected behavior, actual behavior, and the smallest grammar or code that reproduces the behavior. If appropriate, please indicate the code generation targets such as Java, C#, ... Pointers into offending code regions are also very welcome.
Expected behavior
Go code that successfully compiles.
Actual behavior
When trying to compile Golang code from a grammar that has a mixture of non-greedy subrules and two or more "?" wildcard characters, the code fails to compile. I'm using this grammar successfully with a Python2 target.
$ go run test_parse.go test.txt
# _/Users/ccrook/git-repos/config_parser/antlr_playground/go_parser
go_parser/test_parser.go:337: no new variables on left side of :=
$ go run test_parse.go test.txt
# _/Users/ccrook/git-repos/config_parser/antlr_playground/go_parser
go_parser/test_parser.go:337: no new variables on left side of :=
The compiled go code attempts to declare the "la_" variable multiple times:
@pboyer - First off, thanks for all your hard work on the Golang target. I think my parsing use-case hits on some uncommon grammar edge-cases. But, I'm really excited to use ANTLR4 to solve some problems my team is facing.
I'm currently testing against ANLTR4 4.6 code, which includes fixes #1423 & #1436
Before submitting an issue to ANTLR, please check off these boxes:
Please include information about the expected behavior, actual behavior, and the smallest grammar or code that reproduces the behavior. If appropriate, please indicate the code generation targets such as Java, C#, ... Pointers into offending code regions are also very welcome.
Expected behavior
Go code that successfully compiles.
Actual behavior
When trying to compile Golang code from a grammar that has a mixture of non-greedy subrules and two or more "?" wildcard characters, the code fails to compile. I'm using this grammar successfully with a Python2 target.
Steps to reproduce the behavior
Directory structure:
Grammar:
Notice multiple "?" wildcard chars in the
foo
parser rule.ANLTR4 command:
Note: I'm pointing to a 4.6 version of the code (compiled from source 12/6).
Attempt to complile/run go code:
The compiled go code attempts to declare the "la_" variable multiple times:
The text was updated successfully, but these errors were encountered: