aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexSQL.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-10-20 00:25:10 +0000
committernyamatongwe <unknown>2005-10-20 00:25:10 +0000
commite151a287e929563f631f1ea4f17048e82034458f (patch)
treec744d8cc489178009bd830ae0b606722d77bc50a /src/LexSQL.cxx
parent53701d6798ff9a237da65885cc7ac57de528828c (diff)
downloadscintilla-mirror-e151a287e929563f631f1ea4f17048e82034458f.tar.gz
Patch from Iago allows backtick quoted identifiers for MySQL.
Diffstat (limited to 'src/LexSQL.cxx')
-rw-r--r--src/LexSQL.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx
index dc4c7a804..6f2a703fb 100644
--- a/src/LexSQL.cxx
+++ b/src/LexSQL.cxx
@@ -109,6 +109,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
bool fold = styler.GetPropertyInt("fold") != 0;
bool sqlBackslashEscapes = styler.GetPropertyInt("sql.backslash.escapes", 0) != 0;
+ bool sqlBackticksString = styler.GetPropertyInt("sql.backticks.string", 0) != 0;
int lineCurrent = styler.GetLine(startPos);
int spaceFlags = 0;
@@ -169,7 +170,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
} else if (ch == '\'') {
styler.ColourTo(i - 1, state);
state = SCE_SQL_CHARACTER;
- } else if (ch == '"') {
+ } else if (ch == '"' || (sqlBackticksString && ch == 0x60)) {
styler.ColourTo(i - 1, state);
state = SCE_SQL_STRING;
} else if (isoperator(ch)) {
@@ -192,7 +193,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
state = SCE_SQL_COMMENTLINEDOC;
} else if (ch == '\'') {
state = SCE_SQL_CHARACTER;
- } else if (ch == '"') {
+ } else if (ch == '"' || (sqlBackticksString && ch == 0x60)) {
state = SCE_SQL_STRING;
} else if (isoperator(ch)) {
styler.ColourTo(i, SCE_SQL_OPERATOR);
@@ -261,7 +262,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (state == SCE_SQL_STRING) {
- if (ch == '"') {
+ if (ch == '"' || (sqlBackticksString && ch == 0x60)) {
if (chNext == '"') {
i++;
} else {
@@ -290,7 +291,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
state = SCE_SQL_SQLPLUS_PROMPT;
} else if (ch == '\'') {
state = SCE_SQL_CHARACTER;
- } else if (ch == '"') {
+ } else if (ch == '"' || (sqlBackticksString && ch == 0x60)) {
state = SCE_SQL_STRING;
} else if (iswordstart(ch)) {
state = SCE_SQL_WORD;