aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lexers/LexSQL.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/lexers/LexSQL.cxx b/lexers/LexSQL.cxx
index 6567b817a..6a07c5231 100644
--- a/lexers/LexSQL.cxx
+++ b/lexers/LexSQL.cxx
@@ -38,8 +38,11 @@
using namespace Scintilla;
#endif
-static inline bool IsAWordChar(int ch) {
- return (ch < 0x80) && (isalnum(ch) || ch == '_');
+static inline bool IsAWordChar(int ch, bool sqlAllowDottedWord) {
+ if (!sqlAllowDottedWord)
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+ else
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch=='.');
}
static inline bool IsAWordStart(int ch) {
@@ -173,6 +176,7 @@ struct OptionsSQL {
bool sqlBackticksIdentifier;
bool sqlNumbersignComment;
bool sqlBackslashEscapes;
+ bool sqlAllowDottedWord;
OptionsSQL() {
fold = false;
foldAtElse = false;
@@ -183,6 +187,7 @@ struct OptionsSQL {
sqlBackticksIdentifier = false;
sqlNumbersignComment = false;
sqlBackslashEscapes = false;
+ sqlAllowDottedWord = false;
}
};
@@ -222,6 +227,10 @@ struct OptionSetSQL : public OptionSet<OptionsSQL> {
DefineProperty("sql.backslash.escapes", &OptionsSQL::sqlBackslashEscapes,
"Enables backslash as an escape character in SQL.");
+ DefineProperty("lexer.sql.allow.dotted.word", &OptionsSQL::sqlAllowDottedWord,
+ "Set to 1 to colourise recognized words with dots "
+ "(recommended for Oracle PL/SQL objects).");
+
DefineWordListSets(sqlWordListDesc);
}
};
@@ -351,7 +360,7 @@ void SCI_METHOD LexerSQL::Lex(unsigned int startPos, int length, int initStyle,
}
break;
case SCE_SQL_IDENTIFIER:
- if (!IsAWordChar(sc.ch)) {
+ if (!IsAWordChar(sc.ch, options.sqlAllowDottedWord)) {
int nextState = SCE_SQL_DEFAULT;
char s[1000];
sc.GetCurrentLowered(s, sizeof(s));