forked from antlr/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.
Fix special chars escaping in string literals, clarify error messages…
… (display \r\n instead of empty line) fixes antlr#2281, antlr#2885 Restored missed test PredFromAltTestedInLoopBack_1
- Loading branch information
Showing
9 changed files
with
94 additions
and
20 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EscapedCharacters.txt
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,16 @@ | ||
[type] | ||
Lexer | ||
|
||
[grammar] | ||
lexer grammar L; | ||
LF : '\\u000A'; | ||
X : 'x'; | ||
|
||
[input] | ||
"""x | ||
""" | ||
|
||
[output] | ||
[@0,0:0='x',<2>,1:0] | ||
[@1,1:1='\n',<1>,1:1] | ||
[@2,2:1='<EOF>',<-1>,2:0] |
44 changes: 44 additions & 0 deletions
44
...org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_1.txt
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,44 @@ | ||
[notes] | ||
Loopback doesn't eval predicate at start of alt | ||
|
||
[type] | ||
Parser | ||
|
||
[grammar] | ||
grammar T; | ||
file_ | ||
@after {<ToStringTree("$ctx"):writeln()>} | ||
: para para EOF ; | ||
para: paraContent NL NL ; | ||
paraContent : ('s'|'x'|{<LANotEquals("2",{T<ParserToken("Parser", "NL")>})>}? NL)+ ; | ||
NL : '\n' ; | ||
s : 's' ; | ||
X : 'x' ; | ||
|
||
[start] | ||
file_ | ||
|
||
[input] | ||
"""s | ||
|
||
|
||
x | ||
""" | ||
|
||
[output] | ||
"""(file_ (para (paraContent s) \n \n) (para (paraContent \n x \n)) <EOF>) | ||
""" | ||
|
||
[errors] | ||
"""line 5:0 mismatched input '<EOF>' expecting {'s', '\n', 'x'} | ||
""" | ||
|
||
[skip] | ||
Cpp | ||
CSharp | ||
Dart | ||
Go | ||
Node | ||
PHP | ||
Python2 | ||
Python3 |
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
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
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
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
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
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
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