diff options
Diffstat (limited to 'lexers')
-rw-r--r-- | lexers/LexA68k.cxx | 178 | ||||
-rw-r--r-- | lexers/LexAVS.cxx | 2 | ||||
-rw-r--r-- | lexers/LexCPP.cxx | 6 | ||||
-rw-r--r-- | lexers/LexECL.cxx | 10 | ||||
-rw-r--r-- | lexers/LexKVIrc.cxx | 2 | ||||
-rw-r--r-- | lexers/LexLaTeX.cxx | 10 | ||||
-rw-r--r-- | lexers/LexMatlab.cxx | 10 | ||||
-rw-r--r-- | lexers/LexMySQL.cxx | 14 | ||||
-rw-r--r-- | lexers/LexOScript.cxx | 4 | ||||
-rw-r--r-- | lexers/LexPO.cxx | 32 | ||||
-rw-r--r-- | lexers/LexRust.cxx | 6 | ||||
-rw-r--r-- | lexers/LexSQL.cxx | 10 | ||||
-rw-r--r-- | lexers/LexTCMD.cxx | 4 | ||||
-rw-r--r-- | lexers/LexVisualProlog.cxx | 2 |
14 files changed, 145 insertions, 145 deletions
diff --git a/lexers/LexA68k.cxx b/lexers/LexA68k.cxx index e74c0b90a..b5f48987e 100644 --- a/lexers/LexA68k.cxx +++ b/lexers/LexA68k.cxx @@ -117,20 +117,20 @@ static inline bool IsDoxygenChar (const int ch) static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { - // Used to buffer a string, to be able to compare it using built-in functions - char Buffer[100]; - - - // Used to know the length of an operator - int OpType; - + // Used to buffer a string, to be able to compare it using built-in functions + char Buffer[100]; + + + // Used to know the length of an operator + int OpType; + // Get references to keywords lists WordList &cpuInstruction = *keywordlists[0]; WordList ®isters = *keywordlists[1]; WordList &directive = *keywordlists[2]; WordList &extInstruction = *keywordlists[3]; - WordList &alert = *keywordlists[4]; + WordList &alert = *keywordlists[4]; WordList &doxygenKeyword = *keywordlists[5]; @@ -140,109 +140,109 @@ static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int i /************************************************************ * - * Parse the source + * Parse the source * ************************************************************/ for ( ; sc.More(); sc.Forward()) { - /************************************************************ - * - * A style always terminates at the end of a line, even for - * comments (no multi-lines comments) - * - ************************************************************/ - if (sc.atLineStart) { + /************************************************************ + * + * A style always terminates at the end of a line, even for + * comments (no multi-lines comments) + * + ************************************************************/ + if (sc.atLineStart) { sc.SetState(SCE_A68K_DEFAULT); - } + } /************************************************************ * - * If we are not in "default style", check if the style continues - * In this case, we just have to loop + * If we are not in "default style", check if the style continues + * In this case, we just have to loop * ************************************************************/ if (sc.state != SCE_A68K_DEFAULT) { - if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number + if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number || ((sc.state == SCE_A68K_NUMBER_BIN) && IsBin(sc.ch)) // Binary number || ((sc.state == SCE_A68K_NUMBER_HEX) && isxdigit(sc.ch)) // Hexa number - || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument + || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument || ((sc.state == SCE_A68K_STRING1) && (sc.ch != '\'')) // String single-quoted || ((sc.state == SCE_A68K_STRING2) && (sc.ch != '\"')) // String double-quoted - || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point) - || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier - || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local) - || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword - || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert - || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment + || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point) + || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier + || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local) + || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword + || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert + || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment { continue; } - /************************************************************ - * - * Check if current state terminates - * - ************************************************************/ + /************************************************************ + * + * Check if current state terminates + * + ************************************************************/ - // Strings: include terminal ' or " in the current string by skipping it - if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) { - sc.Forward(); + // Strings: include terminal ' or " in the current string by skipping it + if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) { + sc.Forward(); } - - - // If a macro declaration was terminated with ':', it was a label - else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) { - sc.ChangeState(SCE_A68K_LABEL); + + + // If a macro declaration was terminated with ':', it was a label + else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) { + sc.ChangeState(SCE_A68K_LABEL); } - - // If it wasn't a Doxygen keyword, change it to normal comment - else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) { + + // If it wasn't a Doxygen keyword, change it to normal comment + else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) { sc.GetCurrent(Buffer, sizeof(Buffer)); - if (!doxygenKeyword.InList(Buffer)) { + if (!doxygenKeyword.InList(Buffer)) { sc.ChangeState(SCE_A68K_COMMENT); } sc.SetState(SCE_A68K_COMMENT); continue; } - - // If it wasn't an Alert, change it to normal comment - else if (sc.state == SCE_A68K_COMMENT_SPECIAL) { - sc.GetCurrent(Buffer, sizeof(Buffer)); - if (!alert.InList(Buffer)) { + + // If it wasn't an Alert, change it to normal comment + else if (sc.state == SCE_A68K_COMMENT_SPECIAL) { + sc.GetCurrent(Buffer, sizeof(Buffer)); + if (!alert.InList(Buffer)) { sc.ChangeState(SCE_A68K_COMMENT); } - // Reset style to normal comment, or to Doxygen keyword if it begins with '\' - if (sc.ch == '\\') { - sc.SetState(SCE_A68K_COMMENT_DOXYGEN); - } - else { + // Reset style to normal comment, or to Doxygen keyword if it begins with '\' + if (sc.ch == '\\') { + sc.SetState(SCE_A68K_COMMENT_DOXYGEN); + } + else { sc.SetState(SCE_A68K_COMMENT); - } + } continue; } - - // If we are in a comment, it's a Doxygen keyword or an Alert - else if (sc.state == SCE_A68K_COMMENT) { - if (sc.ch == '\\') { - sc.SetState(SCE_A68K_COMMENT_DOXYGEN); - } - else { - sc.SetState(SCE_A68K_COMMENT_SPECIAL); - } - continue; + + // If we are in a comment, it's a Doxygen keyword or an Alert + else if (sc.state == SCE_A68K_COMMENT) { + if (sc.ch == '\\') { + sc.SetState(SCE_A68K_COMMENT_DOXYGEN); + } + else { + sc.SetState(SCE_A68K_COMMENT_SPECIAL); + } + continue; } - + // Check if we are at the end of an identifier // In this case, colourise it if was a keyword. - else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) { + else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) { sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context if (cpuInstruction.InList(Buffer)) { // And check if it belongs to a keyword list sc.ChangeState(SCE_A68K_CPUINSTRUCTION); @@ -269,30 +269,30 @@ static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int i * ************************************************************/ - // Something which begins at the beginning of a line, and with - // - '\' + an identifier start char, or - // - '\\@' + an identifier start char - // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration - if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) { - sc.SetState(SCE_A68K_LABEL); - } - - if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) { - sc.Forward(2); - if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) { - sc.ChangeState(SCE_A68K_LABEL); - sc.SetState(SCE_A68K_LABEL); - } - } - + // Something which begins at the beginning of a line, and with + // - '\' + an identifier start char, or + // - '\\@' + an identifier start char + // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration + if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) { + sc.SetState(SCE_A68K_LABEL); + } + + if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) { + sc.Forward(2); + if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) { + sc.ChangeState(SCE_A68K_LABEL); + sc.SetState(SCE_A68K_LABEL); + } + } + // Label and macro identifiers start at the beginning of a line - // We set both as a macro id, but if it wasn't one (':' at the end), - // it will be changed as a label. + // We set both as a macro id, but if it wasn't one (':' at the end), + // it will be changed as a label. if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { - sc.SetState(SCE_A68K_MACRO_DECLARATION); + sc.SetState(SCE_A68K_MACRO_DECLARATION); } - else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match - sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment + else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match + sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment } else if ((sc.ch < 0x80) && isdigit(sc.ch)) { // Decimal numbers haven't prefix sc.SetState(SCE_A68K_NUMBER_DEC); @@ -309,7 +309,7 @@ static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int i else if ((sc.ch < 0x80) && (sc.ch == '\"')) { // String (double-quoted) sc.SetState(SCE_A68K_STRING2); } - else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\' + else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\' sc.SetState(SCE_A68K_MACRO_ARG); } else if ((sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { // An identifier: constant, label, etc... diff --git a/lexers/LexAVS.cxx b/lexers/LexAVS.cxx index 6e0980715..129c3563b 100644 --- a/lexers/LexAVS.cxx +++ b/lexers/LexAVS.cxx @@ -83,7 +83,7 @@ static void ColouriseAvsDoc( styler.SetLineState(currentLine, 0); } } - + // Determine if the current state should terminate. if (sc.state == SCE_AVS_OPERATOR) { sc.SetState(SCE_AVS_DEFAULT); diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 628672b9e..fc9b5b86b 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -374,7 +374,7 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> { DefineProperty("lexer.cpp.verbatim.strings.allow.escapes", &OptionsCPP::verbatimStringsAllowEscapes, "Set to 1 to allow verbatim strings to contain escape sequences."); - + DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings, "Set to 1 to enable highlighting of triple-quoted strings."); @@ -1467,7 +1467,7 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl } iMacro++; } - + // Insert results back into tokens tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end()); @@ -1481,7 +1481,7 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end()); } } else { - // Identifier not found + // Identifier not found tokens.erase(tokens.begin() + i); } } else { diff --git a/lexers/LexECL.cxx b/lexers/LexECL.cxx index 7c49be1be..2e5433e6e 100644 --- a/lexers/LexECL.cxx +++ b/lexers/LexECL.cxx @@ -175,7 +175,7 @@ static void ColouriseEclDoc(Sci_PositionU startPos, Sci_Position length, int ini } else if (keywords5.InList(s)) { sc.ChangeState(SCE_ECL_WORD5); } - else //Data types are of from KEYWORD## + else //Data types are of from KEYWORD## { int i = static_cast<int>(strlen(s)) - 1; while(i >= 0 && (isdigit(s[i]) || s[i] == '_')) @@ -186,7 +186,7 @@ static void ColouriseEclDoc(Sci_PositionU startPos, Sci_Position length, int ini s2[i + 1] = 0; if (keywords3.InList(s2)) { sc.ChangeState(SCE_ECL_WORD3); - } + } } sc.SetState(SCE_ECL_DEFAULT); } @@ -393,7 +393,7 @@ static bool MatchNoCase(Accessor & styler, Sci_PositionU & pos, const char *s) { for (; *s; i++) { char compare_char = tolower(*s); char styler_char = tolower(styler.SafeGetCharAt(pos+i)); - if (compare_char != styler_char) + if (compare_char != styler_char) return false; s++; } @@ -405,7 +405,7 @@ static bool MatchNoCase(Accessor & styler, Sci_PositionU & pos, const char *s) { // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". -static void FoldEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, +static void FoldEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = true; bool foldPreprocessor = true; @@ -473,7 +473,7 @@ static void FoldEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyl } } if (style == SCE_ECL_WORD2) { - if (MatchNoCase(styler, i, "record") || MatchNoCase(styler, i, "transform") || MatchNoCase(styler, i, "type") || MatchNoCase(styler, i, "function") || + if (MatchNoCase(styler, i, "record") || MatchNoCase(styler, i, "transform") || MatchNoCase(styler, i, "type") || MatchNoCase(styler, i, "function") || MatchNoCase(styler, i, "module") || MatchNoCase(styler, i, "service") || MatchNoCase(styler, i, "interface") || MatchNoCase(styler, i, "ifblock") || MatchNoCase(styler, i, "macro") || MatchNoCase(styler, i, "beginc++")) { levelNext++; diff --git a/lexers/LexKVIrc.cxx b/lexers/LexKVIrc.cxx index 76259db7e..75cb8331b 100644 --- a/lexers/LexKVIrc.cxx +++ b/lexers/LexKVIrc.cxx @@ -359,7 +359,7 @@ static void FoldKVIrcDoc(Sci_PositionU startPos, Sci_Position length, int /*init WordList *[], Accessor &styler) { /* Based on CMake's folder */ - + /* Exiting if folding isnt enabled */ if ( styler.GetPropertyInt("fold") == 0 ) return; diff --git a/lexers/LexLaTeX.cxx b/lexers/LexLaTeX.cxx index 7e03a9c4c..6dc0617e1 100644 --- a/lexers/LexLaTeX.cxx +++ b/lexers/LexLaTeX.cxx @@ -60,7 +60,7 @@ private: if (static_cast<Sci_Position>(modes.size()) > numLines * 2 + 256) modes.resize(numLines + 128); } - + vector<latexFoldSave> saves; void setSave(Sci_Position line, const latexFoldSave &save) { if (line >= static_cast<Sci_Position>(saves.size())) saves.resize(line + 1); @@ -192,7 +192,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int int state = initStyle; if (state == SCE_L_ERROR || state == SCE_L_SHORTCMD || state == SCE_L_SPECIAL) // should not happen latexStateReset(mode, state); - + char chNext = styler.SafeGetCharAt(startPos); char chVerbatimDelim = '\0'; styler.StartSegment(startPos); @@ -207,7 +207,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int chNext = styler.SafeGetCharAt(i + 1); continue; } - + if (ch == '\r' || ch == '\n') setMode(styler.GetLine(i), mode); @@ -256,7 +256,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int state = SCE_L_COMMENT; break; } - break; + break; // These 3 will never be reached. case SCE_L_ERROR: case SCE_L_SPECIAL: @@ -400,7 +400,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int chNext = styler.SafeGetCharAt(i + 1); mode = 0; state = SCE_L_DEFAULT; - } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation} + } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation} styler.ColourTo(i, SCE_L_SHORTCMD); } break; diff --git a/lexers/LexMatlab.cxx b/lexers/LexMatlab.cxx index 563b31b46..6b4b2a92a 100644 --- a/lexers/LexMatlab.cxx +++ b/lexers/LexMatlab.cxx @@ -67,7 +67,7 @@ static void ColouriseMatlabOctaveDoc( styler.StartAt(startPos); - // boolean for when the ' is allowed to be transpose vs the start/end + // boolean for when the ' is allowed to be transpose vs the start/end // of a string bool transpose = false; @@ -86,13 +86,13 @@ static void ColouriseMatlabOctaveDoc( for (; sc.More(); sc.Forward(), column++) { if(sc.atLineStart) { - // set the line state to the current commentDepth + // set the line state to the current commentDepth curLine = styler.GetLine(sc.currentPos); styler.SetLineState(curLine, commentDepth); // reset the column to 0, nonSpace to -1 (not set) column = 0; - nonSpaceColumn = -1; + nonSpaceColumn = -1; } // save the column position of first non space character in a line @@ -111,7 +111,7 @@ static void ColouriseMatlabOctaveDoc( sc.ForwardSetState(SCE_MATLAB_DEFAULT); transpose = true; } else if(sc.ch == '.' && sc.chNext == '.') { - // we werent an operator, but a '...' + // we werent an operator, but a '...' sc.ChangeState(SCE_MATLAB_COMMENT); transpose = false; } else { @@ -165,7 +165,7 @@ static void ColouriseMatlabOctaveDoc( // end or start of a nested a block comment? if( IsCommentChar(sc.ch) && sc.chNext == '}' && nonSpaceColumn == column) { if(commentDepth > 0) commentDepth --; - + curLine = styler.GetLine(sc.currentPos); styler.SetLineState(curLine, commentDepth); sc.Forward(); diff --git a/lexers/LexMySQL.cxx b/lexers/LexMySQL.cxx index 4609619f4..703b24daf 100644 --- a/lexers/LexMySQL.cxx +++ b/lexers/LexMySQL.cxx @@ -362,7 +362,7 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt int styleNext = styler.StyleAt(startPos); int style = initStyle; int activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE; - + bool endPending = false; bool whenPending = false; bool elseIfPending = false; @@ -375,11 +375,11 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt style = styleNext; styleNext = styler.StyleAt(i + 1); activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE; - + char currentChar = nextChar; nextChar = styler.SafeGetCharAt(i + 1); bool atEOL = (currentChar == '\r' && nextChar != '\n') || (currentChar == '\n'); - + switch (MASKACTIVE(style)) { case SCE_MYSQL_COMMENT: @@ -392,7 +392,7 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt break; case SCE_MYSQL_COMMENTLINE: if (foldComment) - { + { // Not really a standard, but we add support for single line comments // with special curly braces syntax as foldable comments too. // MySQL needs -- comments to be followed by space or control char @@ -500,12 +500,12 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt } } } - + // Keep the current end state for the next round. endPending = endFound; } break; - + default: if (!isspacechar(currentChar) && endPending) { @@ -547,7 +547,7 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); - + lineCurrent++; levelCurrent = levelNext; visibleChars = 0; diff --git a/lexers/LexOScript.cxx b/lexers/LexOScript.cxx index 8d4fe7950..ee2dddd6f 100644 --- a/lexers/LexOScript.cxx +++ b/lexers/LexOScript.cxx @@ -205,12 +205,12 @@ static void ColouriseOScriptDoc(Sci_PositionU startPos, Sci_Position length, bool isFirstToken = true; // It starts with true at the beginning of a line and changes to false as // soon as the first identifier on the line is passed by. - bool isFirstIdentifier = true; + bool isFirstIdentifier = true; // It becomes false when #ifdef DOC (the preprocessor directive often // used to start a documentation comment) is encountered and remain false // until the end of the documentation block is not detected. This is done // by checking for the complementary #endif preprocessor directive. - bool endDocComment = false; + bool endDocComment = false; for (; sc.More(); sc.Forward()) { diff --git a/lexers/LexPO.cxx b/lexers/LexPO.cxx index 61e601126..fcf886d6c 100644 --- a/lexers/LexPO.cxx +++ b/lexers/LexPO.cxx @@ -41,7 +41,7 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init Sci_Position curLine = styler.GetLine(startPos); // the line state holds the last state on or before the line that isn't the default style int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : SCE_PO_DEFAULT; - + for (; sc.More(); sc.Forward()) { // whether we should leave a state switch (sc.state) { @@ -57,19 +57,19 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init // on its own like a keyword rather than changing the whole flags style sc.ChangeState(SCE_PO_FUZZY); break; - + case SCE_PO_MSGCTXT: case SCE_PO_MSGID: case SCE_PO_MSGSTR: if (isspacechar(sc.ch)) sc.SetState(SCE_PO_DEFAULT); break; - + case SCE_PO_ERROR: if (sc.atLineEnd) sc.SetState(SCE_PO_DEFAULT); break; - + case SCE_PO_MSGCTXT_TEXT: case SCE_PO_MSGID_TEXT: case SCE_PO_MSGSTR_TEXT: @@ -92,7 +92,7 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init } break; } - + // whether we should enter a new state if (sc.state == SCE_PO_DEFAULT) { // forward to the first non-white character on the line @@ -103,11 +103,11 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init // and anyway the styling don't use line state for comments if (curLineState == SCE_PO_COMMENT) curLineState = SCE_PO_DEFAULT; - + while (sc.More() && ! sc.atLineEnd && isspacechar(sc.ch)) sc.Forward(); } - + if (atLineStart && sc.ch == '#') { if (sc.chNext == '.') sc.SetState(SCE_PO_PROGRAMMER_COMMENT); @@ -134,11 +134,11 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init sc.SetState(SCE_PO_ERROR); } else if (! isspacechar(sc.ch)) sc.SetState(SCE_PO_ERROR); - + if (sc.state != SCE_PO_DEFAULT) curLineState = sc.state; } - + if (sc.atLineEnd) { // Update the line state, so it can be seen by next line curLine = styler.GetLine(sc.currentPos); @@ -163,7 +163,7 @@ static void FoldPODoc(Sci_PositionU startPos, Sci_Position length, int, WordList return; bool foldCompact = styler.GetPropertyInt("fold.compact") != 0; bool foldComment = styler.GetPropertyInt("fold.comment") != 0; - + Sci_PositionU endPos = startPos + length; Sci_Position curLine = styler.GetLine(startPos); int lineState = styler.GetLineState(curLine); @@ -172,17 +172,17 @@ static void FoldPODoc(Sci_PositionU startPos, Sci_Position length, int, WordList int nextLevel; int visible = 0; int chNext = styler[startPos]; - + for (Sci_PositionU i = startPos; i < endPos; i++) { int ch = chNext; chNext = styler.SafeGetCharAt(i+1); - + if (! isspacechar(ch)) { visible++; } else if ((ch == '\r' && chNext != '\n') || ch == '\n' || i+1 >= endPos) { int lvl = level; Sci_Position nextLine = curLine + 1; - + nextLineState = styler.GetLineState(nextLine); if ((lineState != SCE_PO_COMMENT || foldComment) && nextLineState == lineState && @@ -190,14 +190,14 @@ static void FoldPODoc(Sci_PositionU startPos, Sci_Position length, int, WordList nextLevel = SC_FOLDLEVELBASE + 1; else nextLevel = SC_FOLDLEVELBASE; - + if (nextLevel > level) lvl |= SC_FOLDLEVELHEADERFLAG; if (visible == 0 && foldCompact) lvl |= SC_FOLDLEVELWHITEFLAG; - + styler.SetLevel(curLine, lvl); - + lineState = nextLineState; curLine = nextLine; level = nextLevel; diff --git a/lexers/LexRust.cxx b/lexers/LexRust.cxx index f98296bb3..ca5f3c7f1 100644 --- a/lexers/LexRust.cxx +++ b/lexers/LexRust.cxx @@ -287,7 +287,7 @@ static void ScanNumber(Accessor& styler, Sci_Position& pos) { } else if (!error) { /* If there's a period, it's a floating point literal unless it's * followed by an identifier (meaning this is a method call, e.g. - * `1.foo()`) or another period, in which case it's a range (e.g. 1..2) + * `1.foo()`) or another period, in which case it's a range (e.g. 1..2) */ n = styler.SafeGetCharAt(pos + 1, '\0'); if (c == '.' && !(IsIdentifierStart(n) || n == '.')) { @@ -308,7 +308,7 @@ static void ScanNumber(Accessor& styler, Sci_Position& pos) { /* It is invalid to have no digits in the exponent. */ error |= !ScanDigits(styler, pos, 10); } - + /* Scan the floating point suffix. */ c = styler.SafeGetCharAt(pos, '\0'); if (c == 'f') { @@ -620,7 +620,7 @@ static void ResumeRawString(Accessor &styler, Sci_Position& pos, Sci_Position ma } else if (pos >= max) { break; } else { - if (ascii_only && !IsASCII((char)c)) + if (ascii_only && !IsASCII((char)c)) break; pos++; } diff --git a/lexers/LexSQL.cxx b/lexers/LexSQL.cxx index 34b601fba..1d0091806 100644 --- a/lexers/LexSQL.cxx +++ b/lexers/LexSQL.cxx @@ -567,8 +567,8 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i break; } } - - char qComplement = 0x00; + + char qComplement = 0x00; if (qOperator == '<') { qComplement = '>'; @@ -580,8 +580,8 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i qComplement = ']'; } else { qComplement = qOperator; - } - + } + if (sc.Match(qComplement, '\'')) { sc.Forward(); sc.ForwardSetState(SCE_SQL_DEFAULT); @@ -592,7 +592,7 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i // Determine if a new state should be entered. if (sc.state == SCE_SQL_DEFAULT) { if (sc.Match('q', '\'') || sc.Match('Q', '\'')) { - sc.SetState(SCE_SQL_QOPERATOR); + sc.SetState(SCE_SQL_QOPERATOR); sc.Forward(); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)) || ((sc.ch == '-' || sc.ch == '+') && IsADigit(sc.chNext) && !IsADigit(sc.chPrev))) { diff --git a/lexers/LexTCMD.cxx b/lexers/LexTCMD.cxx index 150ceb32b..03895c56a 100644 --- a/lexers/LexTCMD.cxx +++ b/lexers/LexTCMD.cxx @@ -52,7 +52,7 @@ static unsigned int GetBatchVarLen( char *wordBuffer ) { int nLength = 0; if ( wordBuffer[0] == '%' ) { - + if ( wordBuffer[1] == '~' ) nLength = 2; else if (( wordBuffer[1] == '%' ) && ( wordBuffer[2] == '~' )) @@ -244,7 +244,7 @@ static void ColouriseTCMDLine( char *lineBuffer, Sci_PositionU lengthLine, Sci_P if ((CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) || - (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) || + (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "cd") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "path") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "prompt") == 0)) { diff --git a/lexers/LexVisualProlog.cxx b/lexers/LexVisualProlog.cxx index 5166ab2ae..d05413d7b 100644 --- a/lexers/LexVisualProlog.cxx +++ b/lexers/LexVisualProlog.cxx @@ -396,7 +396,7 @@ void SCI_METHOD LexerVisualProlog::Lex(Sci_PositionU startPos, Sci_Position leng if (sc.atLineEnd) { // Update the line state, so it can be seen by next line int lineState = 0; - if (SCE_VISUALPROLOG_STRING_VERBATIM_EOL == sc.state) { + if (SCE_VISUALPROLOG_STRING_VERBATIM_EOL == sc.state) { lineState = closingQuote; } else if (SCE_VISUALPROLOG_COMMENT_BLOCK == sc.state) { lineState = nestLevel; |