diff options
author | Neil <nyamatongwe@gmail.com> | 2017-04-06 21:04:52 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-04-06 21:04:52 +1000 |
commit | 31b76af68badad3cb5d65b435b27760d65a9767a (patch) | |
tree | 2bd0a4ba12815acaa0c1f45b70f72bba66152dab /lexers/LexLua.cxx | |
parent | cda15af9657880e91ccf65603e109b202d9e78bf (diff) | |
download | scintilla-mirror-31b76af68badad3cb5d65b435b27760d65a9767a.tar.gz |
Added const to some lexers.
Diffstat (limited to 'lexers/LexLua.cxx')
-rw-r--r-- | lexers/LexLua.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lexers/LexLua.cxx b/lexers/LexLua.cxx index 1086b40e8..9e86b8a14 100644 --- a/lexers/LexLua.cxx +++ b/lexers/LexLua.cxx @@ -48,14 +48,14 @@ static void ColouriseLuaDoc( WordList *keywordlists[], Accessor &styler) { - WordList &keywords = *keywordlists[0]; - WordList &keywords2 = *keywordlists[1]; - WordList &keywords3 = *keywordlists[2]; - WordList &keywords4 = *keywordlists[3]; - WordList &keywords5 = *keywordlists[4]; - WordList &keywords6 = *keywordlists[5]; - WordList &keywords7 = *keywordlists[6]; - WordList &keywords8 = *keywordlists[7]; + const WordList &keywords = *keywordlists[0]; + const WordList &keywords2 = *keywordlists[1]; + const WordList &keywords3 = *keywordlists[2]; + const WordList &keywords4 = *keywordlists[3]; + const WordList &keywords5 = *keywordlists[4]; + const WordList &keywords6 = *keywordlists[5]; + const WordList &keywords7 = *keywordlists[6]; + const WordList &keywords8 = *keywordlists[7]; // Accepts accented characters CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); @@ -77,7 +77,7 @@ static void ColouriseLuaDoc( int stringWs = 0; if (initStyle == SCE_LUA_LITERALSTRING || initStyle == SCE_LUA_COMMENT || initStyle == SCE_LUA_STRING || initStyle == SCE_LUA_CHARACTER) { - int lineState = styler.GetLineState(currentLine - 1); + const int lineState = styler.GetLineState(currentLine - 1); nestLevel = lineState >> 9; sepCount = lineState & 0xFF; stringWs = lineState & 0x100; @@ -257,7 +257,7 @@ static void ColouriseLuaDoc( } } else if (sc.state == SCE_LUA_LITERALSTRING || sc.state == SCE_LUA_COMMENT) { if (sc.ch == '[') { - int sep = LongDelimCheck(sc); + const int sep = LongDelimCheck(sc); if (sep == 1 && sepCount == 1) { // [[-only allowed to nest nestLevel++; sc.Forward(); @@ -349,21 +349,21 @@ static void ColouriseLuaDoc( static void FoldLuaDoc(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, WordList *[], Accessor &styler) { - Sci_PositionU lengthDoc = startPos + length; + const Sci_PositionU lengthDoc = startPos + length; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; - bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; int styleNext = styler.StyleAt(startPos); for (Sci_PositionU i = startPos; i < lengthDoc; i++) { - char ch = chNext; + const char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); - int style = styleNext; + const int style = styleNext; styleNext = styler.StyleAt(i + 1); - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + const bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_LUA_WORD) { if (ch == 'i' || ch == 'd' || ch == 'f' || ch == 'e' || ch == 'r' || ch == 'u') { char s[10] = ""; |