diff options
Diffstat (limited to 'scintilla/lexers/LexLua.cxx')
-rw-r--r-- | scintilla/lexers/LexLua.cxx | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/scintilla/lexers/LexLua.cxx b/scintilla/lexers/LexLua.cxx index de9c41b..a571320 100644 --- a/scintilla/lexers/LexLua.cxx +++ b/scintilla/lexers/LexLua.cxx @@ -132,55 +132,38 @@ static void ColouriseLuaDoc( if (sc.state == SCE_LUA_OPERATOR) {
if (sc.ch == ':' && sc.chPrev == ':') { // :: <label> :: forward scan
sc.Forward();
- int ln = 0, maxln = startPos + length - sc.currentPos;
- int c;
- while (ln < maxln) { // determine line extent
- c = sc.GetRelative(ln);
- if (c == '\r' || c == '\n')
- break;
- ln++;
- }
- maxln = ln; ln = 0;
- while (ln < maxln) { // skip over spaces/tabs
- if (!IsASpaceOrTab(sc.GetRelative(ln)))
- break;
+ int ln = 0;
+ while (IsASpaceOrTab(sc.GetRelative(ln))) // skip over spaces/tabs
ln++;
- }
int ws1 = ln;
if (setWordStart.Contains(sc.GetRelative(ln))) {
- int i = 0;
+ int c, i = 0;
char s[100];
- while (ln < maxln) { // get potential label
- c = sc.GetRelative(ln);
- if (!setWord.Contains(c))
- break;
+ while (setWord.Contains(c = sc.GetRelative(ln))) { // get potential label
if (i < 90)
s[i++] = c;
ln++;
}
s[i] = '\0'; int lbl = ln;
if (!keywords.InList(s)) {
- while (ln < maxln) { // skip over spaces/tabs
- if (!IsASpaceOrTab(sc.GetRelative(ln)))
- break;
+ while (IsASpaceOrTab(sc.GetRelative(ln))) // skip over spaces/tabs
ln++;
- }
int ws2 = ln - lbl;
if (sc.GetRelative(ln) == ':' && sc.GetRelative(ln + 1) == ':') {
// final :: found, complete valid label construct
sc.ChangeState(SCE_LUA_LABEL);
if (ws1) {
sc.SetState(SCE_LUA_DEFAULT);
- sc.Forward(ws1);
+ sc.ForwardBytes(ws1);
}
sc.SetState(SCE_LUA_LABEL);
- sc.Forward(lbl - ws1);
+ sc.ForwardBytes(lbl - ws1);
if (ws2) {
sc.SetState(SCE_LUA_DEFAULT);
- sc.Forward(ws2);
+ sc.ForwardBytes(ws2);
}
sc.SetState(SCE_LUA_LABEL);
- sc.Forward(2);
+ sc.ForwardBytes(2);
}
}
}
|