aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-04-03 11:41:49 +1100
committerNeil <nyamatongwe@gmail.com>2014-04-03 11:41:49 +1100
commit0652c4660456371e9ad9ade8521591ba689ec4dc (patch)
treea638dd2dbd549e98aec0d3a95c3a87edb8b0b96f /lexers/LexCPP.cxx
parenta9e11e03eae995edf133f9527755ba602efe5bd8 (diff)
downloadscintilla-mirror-0652c4660456371e9ad9ade8521591ba689ec4dc.tar.gz
Feature [feature-requests:#1047]. Supports Go back quoted raw string literals with
lexer.cpp.backquoted.strings option. From Eric Promislow.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx9
1 files changed, 9 insertions, 0 deletions
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);