mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +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
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -10,6 +10,7 @@
|
|||
* QNX Software System
|
||||
* Anton Leherbauer (Wind River Systems)
|
||||
* Andrew Ferguson (Symbian)
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.text;
|
||||
|
||||
|
@ -518,14 +519,25 @@ public final class FastCPartitionScanner implements IPartitionTokenScanner, ICPa
|
|||
case RAW_STRING:
|
||||
switch (rawStringState) {
|
||||
case OPEN_DELIMITER:
|
||||
if (ch == '(') {
|
||||
switch (ch) {
|
||||
case '(':
|
||||
rawStringState = RawStringState.CONTENT;
|
||||
} else if (ch == '"') {
|
||||
return postFix(RAW_STRING);
|
||||
} else if (ch != ' ' && ch != '\\' && ch != ')' && fRawStringDelimiter.length() < 12) {
|
||||
fRawStringDelimiter.append((char) ch);
|
||||
} else {
|
||||
break;
|
||||
case ' ':
|
||||
case '\\':
|
||||
case ')':
|
||||
case '\t':
|
||||
case '\n':
|
||||
case '\f':
|
||||
case 11: // Vertical tab
|
||||
fState = STRING;
|
||||
break;
|
||||
default:
|
||||
if (fRawStringDelimiter.length() < 12) {
|
||||
fRawStringDelimiter.append((char) ch);
|
||||
} else {
|
||||
fState = STRING;
|
||||
}
|
||||
}
|
||||
consume();
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue