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 apologize if this is a duplicate. I did skim the issues, but didn't notice the same thing (unless I misunderstood an existing issue, which is entirely possible).
I have a grammar that parsed correctly with invalid input in 4.5.1 & 4.6, but doesn't report errors in 4.7.
Here's the grammar, which I named Sample.g4 (sorry about the formatting; I used insert code but it didn't format as expected):
Navigate to folder with Sample.g4, then follow the next steps
Steps to follow in shell, within folder containing Sample.g4:
antlr4 Sample.g4
javac *.java
grun Sample expression -gui
a) Enter this string as standard input:
xxx ) yyy (zzz OR hhh)
^D
Expected results:
(This is the behaviour seen using ANTLR 4.6)
The tree should show several nodes, with multiple branches & highlight an error node (the right parenthesis)
Errors should be written to the console:
line 1:4 extraneous input ')' expecting {, '', '(', 'AND', 'OR', TERM_CONTENT}
Actual results:
The tree shows a single branch, with no error nodes highlighted
No error are written to the console
The text was updated successfully, but these errors were encountered:
I apologize if this is a duplicate. I did skim the issues, but didn't notice the same thing (unless I misunderstood an existing issue, which is entirely possible).
I have a grammar that parsed correctly with invalid input in 4.5.1 & 4.6, but doesn't report errors in 4.7.
Here's the grammar, which I named Sample.g4 (sorry about the formatting; I used insert code but it didn't format as expected):
`grammar Sample;
fragment TERM_CHAR
: ~(' ' | '\t' | '\n' | '\r' | '\u3000'
| '"' | '\u201c' | '\u201d' | '(' | ')' | '\')
;
LPAREN : '(' ;
RPAREN : ')' ;
AND : 'AND' ;
OR : 'OR' ;
TERM_CONTENT : (TERM_CHAR)+ ;
WS
: ( ' '
| '\t'
| '\r'
| '\n'
| '\u3000'
)
-> channel(HIDDEN)
;
expression : noneExpression;
noneExpression : (orExpression)+;
orExpression : andExpression (OR andExpression);
andExpression : atom (AND atom);
atom : (term
| parent)
;
term : TERM_CONTENT | '\' ;
parent : LPAREN noneExpression? RPAREN ;`
Steps to reproduce:
Preconditions:
Steps to follow in shell, within folder containing Sample.g4:
a) Enter this string as standard input:
xxx ) yyy (zzz OR hhh)
^D
Expected results:
(This is the behaviour seen using ANTLR 4.6)
The tree should show several nodes, with multiple branches & highlight an error node (the right parenthesis)
Errors should be written to the console:
line 1:4 extraneous input ')' expecting {, '', '(', 'AND', 'OR', TERM_CONTENT}
Actual results:
The tree shows a single branch, with no error nodes highlighted
No error are written to the console
The text was updated successfully, but these errors were encountered: