Skip to content

Conversation

@Bertk
Copy link
Contributor

@Bertk Bertk commented Jul 25, 2015

related #586, #582

@guwirth guwirth added the bug label Jul 25, 2015
@guwirth guwirth added this to the M 0.9.4 milestone Jul 25, 2015
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to remove it from the keyword list? Turns also syntax highlighting off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some unit test fail as soon as the CxxKeyword.TYPEID exist.

Running org.sonar.cxx.parser.ExpressionTest
Tests run: 42, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.061 sec <<< FAILURE! - in org.sonar.cxx.parser.ExpressionTest
postfixExpression_reallife(org.sonar.cxx.parser.ExpressionTest)  Time elapsed: 0.001 sec  <<< FAILURE!
org.sonar.sslr.tests.ParsingResultComparisonFailure: Rule 'postfixExpression' should match:
G::typeid
Parse error at line 1 column 3:

  -->  G::typeidEOF

        at org.sonar.sslr.tests.ParserAssert.matches(ParserAssert.java:72)
        at org.sonar.cxx.parser.ExpressionTest.postfixExpression_reallife(ExpressionTest.java:190)

and

Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.017 sec <<< FAILURE! - in org.sonar.cxx.parser.CxxParserTest
testParsingOnDiverseSourceFiles(org.sonar.cxx.parser.CxxParserTest)  Time elapsed: 0.016 sec  <<< ERROR!
com.sonar.sslr.api.RecognitionException: Parse error at line 9 column 9:

    3: using namespace System;
    4:
    5: ref struct G {
    6:   int i;
    7: };
    8:
  -->  int main() {
   10:   G ^ pG = gcnew G;
   11:   Type ^ pType = pG->GetType();
   12:   Type ^ pType2 = G::typeid;
   13:
   14:   if (pType

        at org.sonar.sslr.internal.vm.Machine.parse(Machine.java:74)
        at com.sonar.sslr.impl.Parser.parse(Parser.java:87)
        at com.sonar.sslr.impl.Parser.parse(Parser.java:72)
        at org.sonar.cxx.parser.CxxParserTest.testParsingOnDiverseSourceFiles(CxxParserTest.java:54)

@guwirth
Copy link
Collaborator

guwirth commented Jul 25, 2015

CxxKeyword.values() is in use by lexer and syntax highlighting.
If we want different lists we have to split this.

@Bertk
Copy link
Contributor Author

Bertk commented Jul 25, 2015

We should add a string array or collection for highlighting purpose in class CxxHighlighter and add strings used within the CxxGrammarImpl rules.

@guwirth
Copy link
Collaborator

guwirth commented Jul 26, 2015

@Bertk could you rebase this please. Will add it to RC3 this evening.

@Bertk
Copy link
Contributor Author

Bertk commented Jul 26, 2015

@guwirth Done.

guwirth added a commit that referenced this pull request Jul 26, 2015
@guwirth guwirth merged commit 3e19650 into SonarOpenCommunity:master Jul 26, 2015
@guwirth guwirth mentioned this pull request Oct 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants