Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352544

Summary: the end of certain string definitions (e.g. R"(") is not correctly identified
Product: [Tools] CDT Reporter: Christian Matuszewski <c.matuszewski>
Component: cdt-editorAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, cdtdoug
Version: 8.0   
Target Milestone: 8.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Christian Matuszewski CLA 2011-07-20 04:29:58 EDT
Build Identifier: 20110615-0604

The end of certain strings is not correctly recognised.

For instance let define BAR as "bar":
#define BAR "bar" and use it in a definition of a string:
char foo[10] = BAR"(";

The semicolon and all code in the next lines is colored blue (color marking a string).

The problem is only present if the define ends with 'R' and the string contains a '(' and there is no space between them.


Reproducible: Always

Steps to Reproduce:
1. Open the following correct code in the CDT-Editor:
#define R "bar"
void main(void) {
	char foo[10] = R"(";
    // all signs after the last '"' are colored blue  
}
Comment 1 Anton Leherbauer CLA 2011-07-20 10:26:54 EDT
I have committed a fix and test to master and cdt_8_0.
Note that R"("; is still interpreted as unterminated raw string even if R is a macro, because the scanner used by the editor has no knowledge about macros.
But that's a minor corner case IMO.
Comment 2 CDT Genie CLA 2011-07-20 11:19:36 EDT
*** cdt git genie on behalf of 352544 ***

    Bug 352544 - the end of certain string definitions (e.g. R&quot;(&quot;) is not correctly identified

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=0f2bc1bb5c9df9c6461d6b48623ee4f0990770df
Comment 3 CDT Genie CLA 2011-07-20 11:19:37 EDT
*** cdt git genie on behalf of 352544 ***

    Bug 352544 - the end of certain string definitions (e.g. R&quot;(&quot;) is not correctly identified

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=f60aad128c86e5294328a1384b95d7cda3202bcf