aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-12-12 00:51:45 +0000
committernyamatongwe <unknown>2009-12-12 00:51:45 +0000
commit2b8af3312bbf658f606e80aead4414bb8c1260cc (patch)
tree4fac6d6098ce70dd2db7db2a4cceb567cbb99b40
parent2a9442b17f58b8ac9e1688067df87dfc50394c44 (diff)
downloadscintilla-mirror-2b8af3312bbf658f606e80aead4414bb8c1260cc.tar.gz
Bug #2901239 fix. VB: "Module" in last line problem
-rw-r--r--src/LexVB.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/LexVB.cxx b/src/LexVB.cxx
index a1f9ec7ae..c57a9ac49 100644
--- a/src/LexVB.cxx
+++ b/src/LexVB.cxx
@@ -214,6 +214,40 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,
visibleChars++;
}
}
+
+ if (sc.state == SCE_B_IDENTIFIER && !IsAWordChar(sc.ch)) {
+ // In Basic (except VBScript), a variable name or a function name
+ // can end with a special character indicating the type of the value
+ // held or returned.
+ bool skipType = false;
+ if (!vbScriptSyntax && IsTypeCharacter(sc.ch)) {
+ sc.Forward(); // Skip it
+ skipType = true;
+ }
+ if (sc.ch == ']') {
+ sc.Forward();
+ }
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (skipType) {
+ s[strlen(s) - 1] = '\0';
+ }
+ if (strcmp(s, "rem") == 0) {
+ sc.ChangeState(SCE_B_COMMENT);
+ } else {
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD4);
+ } // Else, it is really an identifier...
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ }
+
sc.Complete();
}