antlr4: Matched tokens being marked as error
I found a case where the parser is marking matched tokens found inside error nodes as an error. For instance, given the malformed expression 1 * 2 +++
, this is the resulting tree:
However, it’s the expected tree:
Notice that the operators +
are being marked as an error in the first tree, although they have being recognized as operators.
It worth noting that the former tree was generated using the TestRig, while the latter is a screenshot of the tree generated in the IntelliJ plugin. This issue is most likely related to antlr/intellij-plugin-v4#180.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (23 by maintainers)
Commits related to this issue
- Fixes #1299. matching a set didn't properly notify error strategy of a successful match. — committed to parrt/antlr4 by parrt 8 years ago
- Merge pull request #1498 from parrt/fix-1299 Fixes #1299. matching a set didn't properly notify error strategy of a successful match — committed to antlr/antlr4 by parrt 8 years ago
As soon as I get home I’ll provide small grammar that shows up this bug and then we discuss the best way to fix it.