mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Bug 396439 - Syntax highlighting is wrong for raw strings
This commit is contained in:
parent
0835b4737d
commit
4a0cfa6cc4
1 changed files with 19 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2011 IBM Corporation and others.
|
* Copyright (c) 2000, 2013 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
* QNX Software System
|
* QNX Software System
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.text;
|
package org.eclipse.cdt.internal.ui.text;
|
||||||
|
|
||||||
|
@ -518,14 +519,25 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
|
||||||
case RAW_STRING:
|
case RAW_STRING:
|
||||||
switch (rawStringState) {
|
switch (rawStringState) {
|
||||||
case OPEN_DELIMITER:
|
case OPEN_DELIMITER:
|
||||||
if (ch == '(') {
|
switch (ch) {
|
||||||
|
case '(':
|
||||||
rawStringState = RawStringState.CONTENT;
|
rawStringState = RawStringState.CONTENT;
|
||||||
} else if (ch == '"') {
|
break;
|
||||||
return postFix(RAW_STRING);
|
case ' ':
|
||||||
} else if (ch != ' ' && ch != '\\' && ch != ')' && fRawStringDelimiter.length() < 12) {
|
case '\\':
|
||||||
fRawStringDelimiter.append((char) ch);
|
case ')':
|
||||||
} else {
|
case '\t':
|
||||||
|
case '\n':
|
||||||
|
case '\f':
|
||||||
|
case 11: // Vertical tab
|
||||||
fState = STRING;
|
fState = STRING;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (fRawStringDelimiter.length() < 12) {
|
||||||
|
fRawStringDelimiter.append((char) ch);
|
||||||
|
} else {
|
||||||
|
fState = STRING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
consume();
|
consume();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue