forked from tunnelvisionlabs/antlr4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not explore beyond rule stop states when computing possible next t…
…okens during error recovery Fixes tunnelvisionlabs#84
- Loading branch information
1 parent
79ce72f
commit 0e8c76e
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,4 +280,5 @@ YYYY/MM/DD, github id, Full name, email | |
2020/10/16, adarshbhat, Adarsh Bhat, [email protected] | ||
2020/10/20, adamwojs, Adam Wójs, adam[at]wojs.pl | ||
2020/10/24, cliid, Jiwu Jang, [email protected] | ||
2020/11/05, MichelHartmann, Michel Hartmann, [email protected] | ||
2020/11/05, MichelHartmann, Michel Hartmann, [email protected] | ||
2023/10/26, br0nstein, Aaron Braunstein, aa(last name)@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...e-testsuite/resources/org/antlr/v4/test/runtime/templates/ParserErrors/TokenMismatch4.stg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
TestType() ::= "Parser" | ||
|
||
Options ::= [ | ||
"Debug": false | ||
] | ||
|
||
Grammar ::= [ | ||
"T": {<grammar("T")>} | ||
] | ||
|
||
Input() ::= "SELECT CONCAT() FROM tbl" | ||
|
||
Rule() ::= "s" | ||
|
||
Output() ::= << | ||
(selectStatement (selectQuery SELECT (expr (func CONCAT ( (expr )))) (fromClause FROM tbl)) limitOpt) | ||
Error encountered: [@3,14:14=')',\<7>,1:14]<\n> | ||
>> | ||
|
||
Errors() ::= << | ||
line 1:14 mismatched input ')' expecting {IDENTIFIER, NUMBER}<\n> | ||
>> | ||
|
||
grammar(grammarName) ::= << | ||
grammar <grammarName>; | ||
|
||
<ImportVisitor("T")> | ||
<ErrorVisitor("T")> | ||
|
||
s | ||
@init { | ||
<BuildParseTrees()> | ||
} | ||
@after { | ||
<ToStringTree("$r.ctx"):writeln()> | ||
<WalkVisitor("$ctx")> | ||
} | ||
: r=selectStatement ; | ||
selectStatement : selectQuery limitOpt ; | ||
selectQuery : 'SELECT' (expr | '*') fromClause? ; | ||
limitOpt : ('LIMIT' NUMBER)? ; | ||
expr : func | IDENTIFIER | NUMBER ; | ||
fromClause : 'FROM' IDENTIFIER ; | ||
func : IDENTIFIER '(' expr ',' expr (',' expr)* ')' ; | ||
parenthesizedSelectQueryOrExpr : '(' (selectQuery limitOpt | expr) ')' ; | ||
IDENTIFIER : [a-zA-Z]+ ; | ||
NUMBER : [1-9][0-9]* ; | ||
WS : [ \r\t\n]+ -> skip ; | ||
>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters