From 2af0c5065620b5b7c87b060621ecb847f98811f8 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 31 Oct 2010 20:12:36 +1100 Subject: Feature request #3098071. Property to turn off '#' as comment start in SQL. --- lexers/LexSQL.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lexers/LexSQL.cxx') 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); -- cgit v1.2.3