diff options
author | nyamatongwe <unknown> | 2003-07-21 03:58:27 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-07-21 03:58:27 +0000 |
commit | a05c96f2412efbb37bc496563ad8e952842adbee (patch) | |
tree | 0d85ca5cf3a17a402b9ee1b4f382d3c9ba93e6a7 /src/LexSQL.cxx | |
parent | aac462df2dcc61ca55bffca4026c31aeba0d690a (diff) | |
download | scintilla-mirror-a05c96f2412efbb37bc496563ad8e952842adbee.tar.gz |
Patch from Hiroshi-Saito to allow strings to use ' delimiters.
Diffstat (limited to 'src/LexSQL.cxx')
-rw-r--r-- | src/LexSQL.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx index 0520c00ed..ebeb33c4f 100644 --- a/src/LexSQL.cxx +++ b/src/LexSQL.cxx @@ -88,7 +88,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, } else if (ch == '-' && chNext == '-') { styler.ColourTo(i - 1, state); state = SCE_C_COMMENTLINE; - } else if (ch == '\'') { + } else if ((ch == '\'') || (ch == '"')) { styler.ColourTo(i - 1, state); state = SCE_C_STRING; } else if (isoperator(ch)) { @@ -103,7 +103,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, state = SCE_C_COMMENT; } else if (ch == '-' && chNext == '-') { state = SCE_C_COMMENTLINE; - } else if (ch == '\'') { + } else if ((ch == '\'') || (ch == '"')) { state = SCE_C_STRING; } else if (isoperator(ch)) { styler.ColourTo(i, SCE_C_OPERATOR); @@ -134,6 +134,16 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, } ch = chNext; chNext = styler.SafeGetCharAt(i + 1); + } else if (ch == '"') { + if (chNext == '"') { + i++; + } else { + styler.ColourTo(i, state); + state = SCE_C_DEFAULT; + i++; + } + ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); } } if (state == SCE_C_DEFAULT) { // One of the above succeeded @@ -141,7 +151,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, state = SCE_C_COMMENT; } else if (ch == '-' && chNext == '-') { state = SCE_C_COMMENTLINE; - } else if (ch == '\'') { + } else if ((ch == '\'') || (ch == '"')) { state = SCE_C_STRING; } else if (iswordstart(ch)) { state = SCE_C_WORD; |