aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexSQL.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-03-22 20:26:07 +1100
committernyamatongwe <unknown>2011-03-22 20:26:07 +1100
commit08b14ea99ebf07fe82de6ad85288e7e37f619126 (patch)
tree7ffdff94b18d8e987d8f86d087942c5814811e06 /lexers/LexSQL.cxx
parent59a7e6a138648ceb391307ec531a5cda5893218c (diff)
downloadscintilla-mirror-08b14ea99ebf07fe82de6ad85288e7e37f619126.tar.gz
Ignore ';' in a comment. Bug #3196071.
From Jérôme LAFORGE.
Diffstat (limited to 'lexers/LexSQL.cxx')
-rw-r--r--lexers/LexSQL.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/lexers/LexSQL.cxx b/lexers/LexSQL.cxx
index ebcd72c0b..6b77d2961 100644
--- a/lexers/LexSQL.cxx
+++ b/lexers/LexSQL.cxx
@@ -283,6 +283,20 @@ private:
style == SCE_SQL_COMMENTDOCKEYWORDERROR;
}
+ bool IsCommentStyle (int style) {
+ switch (style) {
+ case SCE_SQL_COMMENT :
+ case SCE_SQL_COMMENTDOC :
+ case SCE_SQL_COMMENTLINE :
+ case SCE_SQL_COMMENTLINEDOC :
+ case SCE_SQL_COMMENTDOCKEYWORD :
+ case SCE_SQL_COMMENTDOCKEYWORDERROR :
+ return true;
+ default :
+ return false;
+ }
+ }
+
OptionsSQL options;
OptionSetSQL osSQL;
SQLStates sqlStates;
@@ -521,7 +535,7 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
- if (atEOL || (ch == ';')) {
+ if (atEOL || (!IsCommentStyle(style) && ch == ';')) {
if (endFound) {
//Maybe this is the end of "EXCEPTION" BLOCK (eg. "BEGIN ... EXCEPTION ... END;")
sqlStatesCurrentLine = sqlStates.IntoExceptionBlock(sqlStatesCurrentLine, false);
@@ -554,7 +568,7 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
if (ch == '(') {
if (levelCurrent > levelNext)
levelCurrent--;
- levelNext++;
+ levelNext++;
} else if (ch == ')') {
levelNext--;
} else if ((!options.foldOnlyBegin) && ch == ';') {