aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-10-13 11:52:53 +0000
committernyamatongwe <devnull@localhost>2003-10-13 11:52:53 +0000
commit512b2fe9978069f3a851c0d5215906622ef726c2 (patch)
tree153ff18e1920fb490b65066f89a55e83d0f586d1 /src
parent714115e85a4fc2033b40470362145599b393668f (diff)
downloadscintilla-mirror-512b2fe9978069f3a851c0d5215906622ef726c2.tar.gz
Separated single quote and double quote string styles.
Diffstat (limited to 'src')
-rw-r--r--src/LexSQL.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx
index 3f65b1209..144176855 100644
--- a/src/LexSQL.cxx
+++ b/src/LexSQL.cxx
@@ -88,7 +88,10 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
} else if (ch == '-' && chNext == '-') {
styler.ColourTo(i - 1, state);
state = SCE_C_COMMENTLINE;
- } else if ((ch == '\'') || (ch == '"')) {
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_C_CHARACTER;
+ } else if (ch == '"') {
styler.ColourTo(i - 1, state);
state = SCE_C_STRING;
} else if (isoperator(ch)) {
@@ -103,7 +106,9 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
state = SCE_C_COMMENT;
} else if (ch == '-' && chNext == '-') {
state = SCE_C_COMMENTLINE;
- } else if ((ch == '\'') || (ch == '"')) {
+ } else if (ch == '\'') {
+ state = SCE_C_CHARACTER;
+ } else if (ch == '"') {
state = SCE_C_STRING;
} else if (isoperator(ch)) {
styler.ColourTo(i, SCE_C_OPERATOR);
@@ -123,7 +128,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
styler.ColourTo(i - 1, state);
state = SCE_C_DEFAULT;
}
- } else if (state == SCE_C_STRING) {
+ } else if (state == SCE_C_CHARACTER) {
if (ch == '\'') {
if ( chNext == '\'' ) {
i++;
@@ -134,7 +139,9 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
}
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
- } else if (ch == '"') {
+ }
+ } else if (state == SCE_C_STRING) {
+ if (ch == '"') {
if (chNext == '"') {
i++;
} else {
@@ -151,7 +158,9 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
state = SCE_C_COMMENT;
} else if (ch == '-' && chNext == '-') {
state = SCE_C_COMMENTLINE;
- } else if ((ch == '\'') || (ch == '"')) {
+ } else if (ch == '\'') {
+ state = SCE_C_CHARACTER;
+ } else if (ch == '"') {
state = SCE_C_STRING;
} else if (iswordstart(ch)) {
state = SCE_C_WORD;