aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexSQL.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-10-13 11:52:53 +0000
committernyamatongwe <unknown>2003-10-13 11:52:53 +0000
commit550e7b2728fed60bc3455c59580a7109fdba2cc9 (patch)
tree153ff18e1920fb490b65066f89a55e83d0f586d1 /src/LexSQL.cxx
parent5e4144c0555eba67877e439714e315bffb92ed88 (diff)
downloadscintilla-mirror-550e7b2728fed60bc3455c59580a7109fdba2cc9.tar.gz
Separated single quote and double quote string styles.
Diffstat (limited to 'src/LexSQL.cxx')
-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;