-
Notifications
You must be signed in to change notification settings - Fork 365
Support C++/CLI typeid #596
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
Conversation
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.
Is it necessary to remove it from the keyword list? Turns also syntax highlighting off.
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.
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)
|
CxxKeyword.values() is in use by lexer and syntax highlighting. |
|
We should add a string array or collection for highlighting purpose in class CxxHighlighter and add strings used within the CxxGrammarImpl rules. |
|
@Bertk could you rebase this please. Will add it to RC3 this evening. |
|
@guwirth Done. |
related #586, #582