aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexSQL.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-10-31 20:12:36 +1100
committernyamatongwe <unknown>2010-10-31 20:12:36 +1100
commit2af0c5065620b5b7c87b060621ecb847f98811f8 (patch)
tree84b84b894d4c74bbc99524007306acc569c29169 /lexers/LexSQL.cxx
parent9886a2cabd22524c90091ec39f1ddb4c250b46ac (diff)
downloadscintilla-mirror-2af0c5065620b5b7c87b060621ecb847f98811f8.tar.gz
Feature request #3098071. Property to turn off '#' as comment start in SQL.
Diffstat (limited to 'lexers/LexSQL.cxx')
-rw-r--r--lexers/LexSQL.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/lexers/LexSQL.cxx b/lexers/LexSQL.cxx
index 6ec32d04d..1375af5cb 100644
--- a/lexers/LexSQL.cxx
+++ b/lexers/LexSQL.cxx
@@ -70,6 +70,11 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, Wo
bool sqlBackslashEscapes = styler.GetPropertyInt("sql.backslash.escapes", 0) != 0;
bool sqlBackticksIdentifier = styler.GetPropertyInt("lexer.sql.backticks.identifier", 0) != 0;
+
+ // property lexer.sql.numbersign.comment
+ // If "lexer.sql.numbersign.comment" property is set to 0 a line beginning with '#' will not be a comment.
+ bool sqlNumbersignComment = styler.GetPropertyInt("lexer.sql.numbersign.comment", 1) != 0;
+
int styleBeforeDCKeyword = SCE_SQL_DEFAULT;
for (; sc.More(); sc.Forward()) {
// Determine if the current state should terminate.
@@ -206,7 +211,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, Wo
// Perhaps we should enforce that with proper property:
//~ } else if (sc.Match("-- ")) {
sc.SetState(SCE_SQL_COMMENTLINE);
- } else if (sc.ch == '#') {
+ } else if (sc.ch == '#' && sqlNumbersignComment) {
sc.SetState(SCE_SQL_COMMENTLINEDOC);
} else if (sc.ch == '\'') {
sc.SetState(SCE_SQL_CHARACTER);