aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--lexers/LexCPP.cxx9
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 866193753..49f2d26b0 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -468,6 +468,10 @@
<li>
C++ lexer can highlight task marker keywords in comments as SCE_C_TASKMARKER.
</li>
+ <li>
+ C++ lexer supports Go back quoted raw string literals with lexer.cpp.backquoted.strings option.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1047/">Feature #1047.</a>
+ </li>
<ul>
<h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite341.zip?download">Release 3.4.1</a>
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index a78e72e2b..99f598722 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -235,6 +235,7 @@ struct OptionsCPP {
bool updatePreprocessor;
bool triplequotedStrings;
bool hashquotedStrings;
+ bool backQuotedStrings;
bool fold;
bool foldSyntaxBased;
bool foldComment;
@@ -253,6 +254,7 @@ struct OptionsCPP {
updatePreprocessor = true;
triplequotedStrings = false;
hashquotedStrings = false;
+ backQuotedStrings = false;
fold = false;
foldSyntaxBased = true;
foldComment = false;
@@ -299,6 +301,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
DefineProperty("lexer.cpp.hashquoted.strings", &OptionsCPP::hashquotedStrings,
"Set to 1 to enable highlighting of hash-quoted strings.");
+ DefineProperty("lexer.cpp.backquoted.strings", &OptionsCPP::backQuotedStrings,
+ "Set to 1 to enable highlighting of back-quoted raw strings .");
+
DefineProperty("fold", &OptionsCPP::fold);
DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased,
@@ -942,6 +947,10 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
} else if (options.hashquotedStrings && sc.Match('#', '\"')) {
sc.SetState(SCE_C_HASHQUOTEDSTRING|activitySet);
sc.Forward();
+ } else if (options.backQuotedStrings && sc.Match('`')) {
+ sc.SetState(SCE_C_STRINGRAW|activitySet);
+ rawStringTerminator = "`";
+ sc.Forward();
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
if (lastWordWasUUID) {
sc.SetState(SCE_C_UUID|activitySet);