diff options
author | nyamatongwe <devnull@localhost> | 2002-02-12 10:35:17 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2002-02-12 10:35:17 +0000 |
commit | a60206ecb6729cd1ee44a39aaf132cb60173b32d (patch) | |
tree | 3c82f9059fe7001e94745310b8eb4091a0d32bee /src | |
parent | 8fdc38b725ee9cc02900995e41fc9eb35305d611 (diff) | |
download | scintilla-mirror-a60206ecb6729cd1ee44a39aaf132cb60173b32d.tar.gz |
Minor fixes to lexers.
Diffstat (limited to 'src')
-rw-r--r-- | src/KeyWords.cxx | 2 | ||||
-rw-r--r-- | src/LexCrontab.cxx | 1 | ||||
-rw-r--r-- | src/LexOthers.cxx | 12 | ||||
-rw-r--r-- | src/LexPerl.cxx | 2 | ||||
-rw-r--r-- | src/LexRuby.cxx | 4 |
5 files changed, 11 insertions, 10 deletions
diff --git a/src/KeyWords.cxx b/src/KeyWords.cxx index 7aa56d5fe..288c64d21 100644 --- a/src/KeyWords.cxx +++ b/src/KeyWords.cxx @@ -63,7 +63,7 @@ const LexerModule *LexerModule::Find(const char *languageName) { void LexerModule::Lex(unsigned int startPos, int lengthDoc, int initStyle, WordList *keywordlists[], Accessor &styler) const { if (fnLexer) - fnLexer(startPos, lengthDoc, initStyle, keywordlists, styler); + fnLexer(startPos, lengthDoc-1, initStyle, keywordlists, styler); } void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle, diff --git a/src/LexCrontab.cxx b/src/LexCrontab.cxx index e0cfe8466..1296d367e 100644 --- a/src/LexCrontab.cxx +++ b/src/LexCrontab.cxx @@ -199,6 +199,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi break; } } + delete []buffer; } const LexerModule lmNncrontab(SCLEX_NNCRONTAB, ColouriseNncrontabDoc, "nncrontab"); diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index efc4dafd6..55a30d564 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -131,7 +131,7 @@ static void ColouriseBatchDoc( styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0, startLine = startPos; - for (unsigned int i = startPos; i <= startPos + length; i++) { + for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (styler[i] == '\r' || styler[i] == '\n' || (linePos >= sizeof(lineBuffer) - 1)) { @@ -229,7 +229,7 @@ static void ColourisePropsDoc(unsigned int startPos, int length, int, WordList * styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0, startLine = startPos; - for (unsigned int i = startPos; i <= startPos + length; i++) { + for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if ((styler[i] == '\r' && styler.SafeGetCharAt(i + 1) != '\n') || styler[i] == '\n' || @@ -296,9 +296,9 @@ static void ColouriseMakeLine( i++; } if (state == SCE_MAKE_IDENTIFIER) { - styler.ColourTo(endPos, SCE_MAKE_IDEOL); // Error, variable reference not ended + styler.ColourTo(endPos-1, SCE_MAKE_IDEOL); // Error, variable reference not ended } else { - styler.ColourTo(endPos, SCE_MAKE_DEFAULT); + styler.ColourTo(endPos-1, SCE_MAKE_DEFAULT); } } @@ -307,7 +307,7 @@ static void ColouriseMakeDoc(unsigned int startPos, int length, int, WordList *[ styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0, startLine = startPos; - for (unsigned int i = startPos; i <= startPos + length; i++) { + for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (styler[i] == '\r' || styler[i] == '\n' || (linePos >= sizeof(lineBuffer) - 1)) { lineBuffer[linePos] = '\0'; @@ -409,7 +409,7 @@ static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordLi styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; - for (unsigned int i = startPos; i <= startPos + length; i++) { + for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (styler[i] == '\r' || styler[i] == '\n' || (linePos >= sizeof(lineBuffer) - 1)) { ColouriseErrorListLine(lineBuffer, linePos, i, styler); diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx index 71942091b..c8d37f0ba 100644 --- a/src/LexPerl.cxx +++ b/src/LexPerl.cxx @@ -656,7 +656,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle, } chPrev = ch; } - styler.ColourTo(lengthDoc, state); + styler.ColourTo(lengthDoc - 1, state); } const LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl"); diff --git a/src/LexRuby.cxx b/src/LexRuby.cxx index 806a1991f..fe7497404 100644 --- a/src/LexRuby.cxx +++ b/src/LexRuby.cxx @@ -294,9 +294,9 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle, chPrev = ch; } if (state == SCE_P_WORD) { - ClassifyWordRb(styler.GetStartSegment(), lengthDoc, keywords, styler, prevWord); + ClassifyWordRb(styler.GetStartSegment(), lengthDoc-1, keywords, styler, prevWord); } else { - styler.ColourTo(lengthDoc, state); + styler.ColourTo(lengthDoc-1, state); } } |