diff options
-rw-r--r-- | lexers/LexLua.cxx | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/lexers/LexLua.cxx b/lexers/LexLua.cxx index f0c3a5e57..62bb44dd1 100644 --- a/lexers/LexLua.cxx +++ b/lexers/LexLua.cxx @@ -132,39 +132,22 @@ 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 |