diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2015-02-19 15:54:00 +1100 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2015-02-19 15:54:00 +1100 |
commit | 24bb413ee50e854d611df4a7a6d7a543975e90a0 (patch) | |
tree | a950b34cc872086bdd431adc5bbbad9a585157c8 /lexers/LexCPP.cxx | |
parent | 503cadb027ea9819421f3d8e361fed5407358996 (diff) | |
download | scintilla-mirror-24bb413ee50e854d611df4a7a6d7a543975e90a0.tar.gz |
Implement lexer.cpp.verbatim.strings.allow.escapes.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r-- | lexers/LexCPP.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index a78fcc003..ab982bb4b 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -306,6 +306,7 @@ struct OptionsCPP { bool identifiersAllowDollars; bool trackPreprocessor; bool updatePreprocessor; + bool verbatimStringsAllowEscapes; bool triplequotedStrings; bool hashquotedStrings; bool backQuotedStrings; @@ -326,6 +327,7 @@ struct OptionsCPP { identifiersAllowDollars = true; trackPreprocessor = true; updatePreprocessor = true; + verbatimStringsAllowEscapes = false; triplequotedStrings = false; hashquotedStrings = false; backQuotedStrings = false; @@ -370,6 +372,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> { DefineProperty("lexer.cpp.update.preprocessor", &OptionsCPP::updatePreprocessor, "Set to 1 to update preprocessor definitions when #define found."); + DefineProperty("lexer.cpp.verbatim.strings.allow.escapes", &OptionsCPP::verbatimStringsAllowEscapes, + "Set to 1 to allow verbatim strings to contain escape sequences."); + DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings, "Set to 1 to enable highlighting of triple-quoted strings."); @@ -1036,7 +1041,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, } break; case SCE_C_VERBATIM: - if (sc.ch == '\"') { + if (options.verbatimStringsAllowEscapes && (sc.ch == '\\')) { + sc.Forward(); // Skip all characters after the backslash + } else if (sc.ch == '\"') { if (sc.chNext == '\"') { sc.Forward(); } else { |