Fix C++ Library wizard when compiled with Qt < 5.12

Only Qt 5.12 got true ECMA Script capabilities, so arrow function
expressions are not supported before that.

To be able to use "regular" inline functions, we allow usage of } by escaping with backslash.
For variables that do not start with "JS:" we already supported backslash for escaping.

Fixes: QTCREATORBUG-22336
Change-Id: I9fc638e64d2757a21fffc16355635e2fcff87a36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2019-05-31 15:29:05 +02:00
parent d73c271259
commit 23c222f61b
5 changed files with 17 additions and 5 deletions

View File

@@ -143,7 +143,7 @@ bool AbstractMacroExpander::expandNestedMacros(const QString &str, int *pos, QSt
varName.reserve(strLen - i);
for (; i < strLen; prev = c) {
c = str.at(i++);
if (c == '\\' && i < strLen && validateVarName(varName)) {
if (c == '\\' && i < strLen) {
c = str.at(i++);
// For the replacement, do not skip the escape sequence when followed by a digit.
// This is needed for enabling convenient capture group replacement,