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
For example, take this Arithmetic.g4 grammar with EOF on only one alt. Then, running the parser on the input "1 2", we don't get any parse errors, and we get a truncated tree.
It's unclear of the intent is. But, it can lead to a lot of problems.
This is changed in #4310 for java/java. It is probably the right thing because a "compilationUnit" should read to the end of the file and report all errors.
The start rule for java/java/ was incorrect because it had an EOF on only one of the alts of the start rule. This can cause two issues: parse errors may not displayed; parse trees may be truncated.
For example, take this Arithmetic.g4 grammar with EOF on only one alt. Then, running the parser on the input "1 2", we don't get any parse errors, and we get a truncated tree.
It's unclear of the intent is. But, it can lead to a lot of problems.
This is changed in #4310 for java/java. It is probably the right thing because a "compilationUnit" should read to the end of the file and report all errors.
Other grammars have the same issue.
As far as I can tell, an EOF in only one alt is equivalent to the empty string.
The text was updated successfully, but these errors were encountered: