diff options
author | nyamatongwe <devnull@localhost> | 2013-03-18 20:42:55 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-03-18 20:42:55 +1100 |
commit | 71dfc4460f88f3f51de924ec9b313bf91d803991 (patch) | |
tree | f916d13cb841b4239e64d1953b03ebcdd9aa04a8 | |
parent | d2943f93973d17fa4e174c337555d8c32d13d342 (diff) | |
download | scintilla-mirror-71dfc4460f88f3f51de924ec9b313bf91d803991.tar.gz |
Bug: [#1454]. Reject raw strings when character after " is in " )\\\t\v\f\n".
See C++11 standard 2.14.5 String literals.
-rw-r--r-- | lexers/LexCPP.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 4f3b4f509..116ea7279 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -494,6 +494,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); + CharacterSet setInvalidRawFirst(CharacterSet::setNone, " )\\\t\v\f\n"); + if (options.identifiersAllowDollars) { setWordStart.Add('$'); } @@ -654,7 +656,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, const bool literalString = sc.ch == '\"'; if (literalString || sc.ch == '\'') { size_t lenS = strlen(s); - const bool raw = literalString && sc.chPrev == 'R'; + const bool raw = literalString && sc.chPrev == 'R' && !setInvalidRawFirst.Contains(sc.chNext); if (raw) s[lenS--] = '\0'; bool valid = |