-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Some tool bugfixes #3349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Some tool bugfixes #3349
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7b22bc5
Fix weird error if rule has `tree` name, fixes #1960
KvanTTT 7f07af8
Convert INVALID_ESCAPE_SEQUENCE to error, clarify char set errors
KvanTTT f792951
Throw EPSILON_CLOSURE error in lexer, fixes #2860, #1105
KvanTTT f2b93e5
Fix special chars escaping in string literals, clarify error messages…
KvanTTT bab5a9e
Throw EOF_CLOSURE error, fixes #3359
KvanTTT bf37d24
Add TargetType enum, refactor and simplify code
KvanTTT a103ec9
Get rid of reflection in CodeGenerator
KvanTTT 3b1eca9
Rename TargetType -> Language
KvanTTT 6823a90
Remove TargetType enum, use String instead as it was before
KvanTTT 9b5c5d4
Add default branch to appendEscapedCodePoint for unofficial targets (…
KvanTTT d0e52c2
Remove getVersion() overrides from Targets since they return the same…
KvanTTT 6da860e
Remove getLanguage() overrides from Targets since common implementati…
KvanTTT d5d00c2
Rename `CodeGenerator.createCodeGenerator` to `CodeGenerator.create`
KvanTTT 0da84d0
Replace constants on string literals in `appendEscapedCodePoint`
KvanTTT c26ce94
Restore API of Target
KvanTTT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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] |
19 changes: 0 additions & 19 deletions
19
...ime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/EOFInClosure.txt
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
...org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_1.txt
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious why you converted this to a factory method. again I'm looking for gratuitous changes ;)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it returns
nullifCodeGeneratorcan not be created (and throws the errorCANNOT_CREATE_TARGET_GENERATOR). Contructor always returns not null value. Also, I removed duplication of some logic inCodeGnerator.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it makes sense to rename to
CodeGenerator.createinstead ofCodeGenerator.createCodeGenerator(a bit redundancy).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh. yeah. that makes sense.