diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2016-09-06 19:21:50 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-08-24 14:27:50 +0000 |
commit | 515b9051505d61af6be0eba87616c7281ee4ce62 (patch) | |
tree | 69bea4769022c2003f6ddf1cd1c8e1699e4b7f9e /src/plugins | |
parent | 797530c3f81b6c5fb8e25e431105fdcd22d8775a (diff) |
Adapt qmake's raw-string parser to avoid confusion by macros
A macro name ending in R might expand to a string; if this precedes a
string constant, we're juxtaposing the strings. My first parser for
raw strings would mistake it for a raw string instead, ignoring the
part of the identifier before R. Re-worked the exploration of what
came before the string to catch these cases, too.
The backwards parsing would also allow any messy jumble of [RLUu8]* as
prefix for the string; but in fact R must (if present) be last in the
prefix and *it* can have at most one prefix, [LUu] or u8. Anything
else is an identifier that happens to precede the string. Reworked
the parsing to allow only one prefix and not treat R specially unless
it's immediately (modulo BSNL) before the string's open-quotes.
Add link to the cppreference page about string literals, on which the
grammar now parsed is based.
Added a test for the issue this addresses.
Verified that this fails on 5.6, dev and 5.9 without the fix.
Expanded the existing test to cover R-with-prefix cases.
Task-number: QTBUG-55633
Change-Id: I541486c2ec909cfb42050907c84bee83ead4a2f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/plugins')
0 files changed, 0 insertions, 0 deletions