From 1ee64b2b5d2b0c3d62dfbc1e1f8ac6ced290a9b1 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 24 May 2014 08:49:35 +1000 Subject: Fix raw string recognition so that R"xxx(blah)xxx" is styled as SCE_C_STRINGRAW. --- doc/ScintillaHistory.html | 11 +++++++++++ lexers/LexCPP.cxx | 14 +++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 852503b86..f23191ff2 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -459,6 +459,17 @@ Icons Copyright(C) 1998 by Dean S. Jones
+

+ Release 3.4.3 +

+

Release 3.4.2

diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 7fe680991..e8b705b1f 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -821,10 +821,18 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, ((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) || ((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8')); if (valid) { - if (literalString) - sc.ChangeState((raw ? SCE_C_STRINGRAW : SCE_C_STRING)|activitySet); - else + if (literalString) { + if (raw) { + // Set the style of the string prefix to SCE_C_STRINGRAW but then change to + // SCE_C_DEFAULT as that allows the raw string start code to run. + sc.ChangeState(SCE_C_STRINGRAW|activitySet); + sc.SetState(SCE_C_DEFAULT|activitySet); + } else { + sc.ChangeState(SCE_C_STRING|activitySet); + } + } else { sc.ChangeState(SCE_C_CHARACTER|activitySet); + } } else { sc.SetState(SCE_C_DEFAULT | activitySet); } -- cgit v1.2.3