aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexSQL.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-03-12 13:00:10 +0000
committernyamatongwe <unknown>2005-03-12 13:00:10 +0000
commit10c0488f1643ae97a428682ae15d0482114b5497 (patch)
tree0b84f711b8b319d6ef11fb71316d76105bdb24a7 /src/LexSQL.cxx
parent5a3872b7db300f6b9f95233fbc8a364b4eb537f8 (diff)
downloadscintilla-mirror-10c0488f1643ae97a428682ae15d0482114b5497.tar.gz
Patch from Michael Owens to add a second set of keywords.
Diffstat (limited to 'src/LexSQL.cxx')
-rw-r--r--src/LexSQL.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx
index 8383eefb0..bb8f128da 100644
--- a/src/LexSQL.cxx
+++ b/src/LexSQL.cxx
@@ -19,19 +19,28 @@
#include "Scintilla.h"
#include "SciLexer.h"
-static void classifyWordSQL(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
+static void classifyWordSQL(unsigned int start, unsigned int end, WordList *keywordlists[], Accessor &styler) {
char s[100];
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.');
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {
s[i] = static_cast<char>(tolower(styler[start + i]));
s[i + 1] = '\0';
}
+
+ WordList &keywords1 = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+
char chAttr = SCE_C_IDENTIFIER;
if (wordIsNumber)
chAttr = SCE_C_NUMBER;
else {
- if (keywords.InList(s))
+ if (keywords1.InList(s)) {
chAttr = SCE_C_WORD;
+ }
+
+ if (keywords2.InList(s)) {
+ chAttr = SCE_C_WORD2;
+ }
}
styler.ColourTo(end, chAttr);
}
@@ -39,8 +48,6 @@ static void classifyWordSQL(unsigned int start, unsigned int end, WordList &keyw
static void ColouriseSQLDoc(unsigned int startPos, int length,
int initStyle, WordList *keywordlists[], Accessor &styler) {
- WordList &keywords = *keywordlists[0];
-
styler.StartAt(startPos);
bool fold = styler.GetPropertyInt("fold") != 0;
@@ -104,7 +111,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
}
} else if (state == SCE_C_WORD) {
if (!iswordchar(ch)) {
- classifyWordSQL(styler.GetStartSegment(), i - 1, keywords, styler);
+ classifyWordSQL(styler.GetStartSegment(), i - 1, keywordlists, styler);
state = SCE_C_DEFAULT;
if (ch == '/' && chNext == '*') {
state = SCE_C_COMMENT;
@@ -188,6 +195,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
static const char * const sqlWordListDesc[] = {
"Keywords",
+ "Database Objects",
0
};