Skip to content
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

Fix 2016 [WIP] #2022

Closed
wants to merge 8 commits into from
Closed

Fix 2016 [WIP] #2022

wants to merge 8 commits into from

Conversation

parrt
Copy link
Member

@parrt parrt commented Sep 21, 2017

Trying to fix #2016 I Have fixed the issue with the template definition but I don't know how to update the various targets. At the moment Java, Swift, C# look like they are now correct.

@parrt parrt added this to the 4.7.1 milestone Sep 21, 2017
@parrt
Copy link
Member Author

parrt commented Sep 21, 2017

@mike-lischke I think I fixed the C++ target but it is failing for another reason maybe in PredictionContext::merge():

Assertion failed: (a && b), function merge, file /Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/src/atn/PredictionContext.cpp, line 97.
execution of 'running test binary' failed with error code: 134

Can you take a look at this branch?

@mike-lischke
Copy link
Member

Is this failure from the new test? The template changes can't be it, I guess.

@parrt
Copy link
Member Author

parrt commented Sep 23, 2017

New test exposed a different bug I believe as it is in a prediction function not about dealing with list labels.

@parrt
Copy link
Member Author

parrt commented Oct 21, 2017

@mike-lischke Any time to look into this? I'd like to include for 4.7.1

@mike-lischke
Copy link
Member

I'll try to get some time for this next weekend. Am pretty busy currently...

@parrt
Copy link
Member Author

parrt commented Dec 6, 2017

@mike-lischke can you peek at this?

@mike-lischke
Copy link
Member

Maybe at the end of the month...

@parrt parrt removed this from the 4.7.1 milestone Dec 7, 2017
@mike-lischke
Copy link
Member

@parrt I can't find the branch with those changes (parrt:fix-2016). But, is that actually required for this problem? From the patch I see only template changes. They certainly aren't the reason for an uncovered C++ problem. So, I wonder where do you see that failure? Obviously master runs fine. What can I do to reproduce the error?

@parrt
Copy link
Member Author

parrt commented Dec 19, 2017

I am running the tests in my branch fix-2016 but so far all I see is a warning:

Building ANTLR4 C++ runtime (if necessary) at /Users/parrt/antlr/code/antlr4/runtime-testsuite/target/classes/Cpp
/Users/parrt/antlr/code/antlr4/runtime-testsuite/target/classes/Cpp/runtime/src/atn/ParserATNSimulator.cpp:56:42: warning: field 'parser' will be initialized after field 'decisionToDFA' [-Wreorder]
: ATNSimulator(atn, sharedContextCache), parser(parser), decisionToDFA(decisionToDFA) {
                                         ^
/Users/parrt/antlr/code/antlr4/runtime-testsuite/target/classes/Cpp/runtime/src/atn/ParserATNSimulator.cpp:56:42: warning: field 'parser' will be initialized after field 'decisionToDFA' [-Wreorder]
: ATNSimulator(atn, sharedContextCache), parser(parser), decisionToDFA(decisionToDFA) {

@parrt
Copy link
Member Author

parrt commented Dec 19, 2017

ok, 1 failure:

C++ runtime build succeeded

.Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 56.462 sec - in org.antlr.v4.test.runtime.cpp.TestCompositeLexers
Running org.antlr.v4.test.runtime.cpp.TestCompositeParsers
...............Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 74.943 sec - in org.antlr.v4.test.runtime.cpp.TestCompositeParsers
Running org.antlr.v4.test.runtime.cpp.TestFullContextParsing
..............Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 73.692 sec - in org.antlr.v4.test.runtime.cpp.TestFullContextParsing
Running org.antlr.v4.test.runtime.cpp.TestLeftRecursion
.................................................................................................Tests run: 99, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 481.083 sec <<< FAILURE! - in org.antlr.v4.test.runtime.cpp.TestLeftRecursion
testOne[Cpp:ListLabelsOnRuleRefStartOfAlt](org.antlr.v4.test.runtime.cpp.TestLeftRecursion)  Time elapsed: 0.037 sec  <<< FAILURE!
java.lang.AssertionError

Running org.antlr.v4.test.runtime.cpp.TestLexerErrors
...Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 17.354 sec - in org.antlr.v4.test.runtime.cpp.TestLexerErrors
Running org.antlr.v4.test.runtime.cpp.TestLexerExec
...........Tests run: 37, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 52.93 sec - in org.antlr.v4.test.runtime.cpp.TestLexerExec
Running org.antlr.v4.test.runtime.cpp.TestListeners
......Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 32.429 sec - in org.antlr.v4.test.runtime.cpp.TestListeners
Running org.antlr.v4.test.runtime.cpp.TestParserErrors
..............................Tests run: 34, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 149.015 sec - in org.antlr.v4.test.runtime.cpp.TestParserErrors
Running org.antlr.v4.test.runtime.cpp.TestParserExec
.................................Tests run: 36, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 165.211 sec - in org.antlr.v4.test.runtime.cpp.TestParserExec
Running org.antlr.v4.test.runtime.cpp.TestParseTrees
........Tests run: 10, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 41.069 sec - in org.antlr.v4.test.runtime.cpp.TestParseTrees
Running org.antlr.v4.test.runtime.cpp.TestPerformance
.......Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.221 sec - in org.antlr.v4.test.runtime.cpp.TestPerformance
Running org.antlr.v4.test.runtime.cpp.TestSemPredEvalLexer
...Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.681 sec - in org.antlr.v4.test.runtime.cpp.TestSemPredEvalLexer
Running org.antlr.v4.test.runtime.cpp.TestSemPredEvalParser
......................Tests run: 26, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 112.005 sec - in org.antlr.v4.test.runtime.cpp.TestSemPredEvalParser
Running org.antlr.v4.test.runtime.cpp.TestSets
............................Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 140.512 sec - in org.antlr.v4.test.runtime.cpp.TestSets

Results :

Failed tests: 
  TestLeftRecursion>BaseRuntimeTest.testOne:118->BaseRuntimeTest.testParser:155

Tests run: 340, Failures: 1, Errors: 0, Skipped: 3

Grammar is

 grammar Test;

 expression: 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 ;

and then:

input = "a and b"

This was referenced Aug 27, 2022
@parrt
Copy link
Member Author

parrt commented Aug 27, 2022

Closing in favor of #3841

@parrt parrt closed this Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cpp, Go, JavaScript, Python2/3: Template rendering error.
2 participants