Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352544 - the end of certain string definitions (e.g. R"(") is not correctly identified
Summary: the end of certain string definitions (e.g. R"(") is not correctly identified
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 8.0.1   Edit
Assignee: Anton Leherbauer CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-20 04:29 EDT by Christian Matuszewski CLA
Modified: 2011-07-20 11:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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"(") 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"(") is not correctly identified

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