From e2d87ef5c151a25e9f15abe4309f3f2a2e6ec80f Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 21 Jul 2003 03:58:27 +0000 Subject: Patch from Hiroshi-Saito to allow strings to use ' delimiters. --- src/LexSQL.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/LexSQL.cxx') 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; -- cgit v1.2.3