aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--lexers/LexCPP.cxx9
2 files changed, 12 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 81246f2fd..4fb730e62 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -498,6 +498,10 @@
Minimum version of Qt supported is now 4.8 due to the use of QElapsedTimer::nsecsElapsed.
</li>
<li>
+ C++ lexer adds lexer.cpp.verbatim.strings.allow.escapes option that allows verbatim (@") strings
+ to contain escape sequences. This should remain off (0) for C# and be turned on (1) for Objective C.
+ </li>
+ <li>
Rust lexer accepts new 'is'/'us' integer suffixes instead of 'i'/'u'.
<a href="http://sourceforge.net/p/scintilla/bugs/1098/">Bug #1098</a>.
</li>
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 {