-
Couldn't load subscription status.
- Fork 3.4k
Fix 2016 round 2 #3841
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
Fix 2016 round 2 #3841
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
23ae7df
add test for #2016 and fix java.
parrt 50d0edc
ensure all targets have the appropriate argument list for the templat…
parrt ca0540b
Fix other targets
parrt ddbe172
fix format
parrt ff345a6
add check that $args is a list
parrt 891b0f4
change made by @lingyv-li to fix bug in DART exposed by this test.
parrt 2bcfe15
fix AssertIsList in multiple targets. Go doesn't pass test and has no…
parrt 6a3b44b
C++ gets an exception with this test so I'm turning it off. See https…
parrt 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
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 |
|---|---|---|
|
|
@@ -33,3 +33,5 @@ expression | |
| [input] | ||
| a | ||
|
|
||
| [skip] | ||
| Go | ||
34 changes: 34 additions & 0 deletions
34
...ources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelsOnRuleRefStartOfAlt.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,34 @@ | ||
| [notes] | ||
| Checks that this compiles; see https://github.com/antlr/antlr4/issues/2016 | ||
|
|
||
| [type] | ||
| Parser | ||
|
|
||
| [grammar] | ||
| grammar Test; | ||
|
|
||
| expression | ||
| @after { | ||
| <AssertIsList("$args")> | ||
| } | ||
| : op=NOT args+=expression | ||
| | args+=expression (op=AND args+=expression)+ | ||
| | args+=expression (op=OR args+=expression)+ | ||
| | IDENTIFIER | ||
| ; | ||
|
|
||
| AND : 'and' ; | ||
| OR : 'or' ; | ||
| NOT : 'not' ; | ||
| IDENTIFIER : [a-zA-Z_][a-zA-Z0-9_]* ; | ||
| WS : [ \t\r\n]+ -> skip ; | ||
|
|
||
| [start] | ||
| expression | ||
|
|
||
| [input] | ||
| a and b | ||
parrt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [skip] | ||
| Go | ||
| Cpp | ||
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
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
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
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.
By the way, my sample from #3837 looks more succinctly:
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.
Ah. I didn't see that one there. I believe I cut and paste something from code you or someone else was proposing earlier to make that one. Are you suggesting we drop ListLabelsOnRuleRefStartOfAlt.txt because it is redundant? I think it is testing the same thing so maybe we should. Well I guess my checks to type and yours doesn't check the output :)
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.
Yes, it's the same, but in more short form.
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.
OK but maybe we should test the output on yours as I think you asked me to do on this test ha ha I had trouble with the output templates in so I elected to simply check weather the attribute was a list. Maybe create a PR that adds
to yours and then deletes ListLabelsOnRuleRefStartOfAlt.txt?
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.
Yes - I think that this code was with the original issue, so I just made the <AssertIsList()> work. Either way is fine by me. Just tell me if you wish to lose the comments generated by - or you guys can just edit them out of PR #3848 and merge it. The other code in that PR is required for the test to work and fix the bug that was causing it to fail.