QmlJS: Replace QRegExp by QRegularExpression

Task-number: QTCREATORBUG-24098
Change-Id: I70157bcbee67cf493e28b5bad97248877a25e5c6
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-07-17 12:13:06 +02:00
parent 9dec1680cc
commit 6e29adaae7
7 changed files with 39 additions and 33 deletions

View File

@@ -79,11 +79,11 @@ using namespace QmlJS;
QmlJSIndenter::QmlJSIndenter()
: caseOrDefault(QRegExp(QLatin1String(
"\\s*(?:"
: caseOrDefault(QRegularExpression(QLatin1String(
"^\\s*(?:"
"case\\b[^:]+|"
"default)"
"\\s*:.*")))
"\\s*:.*$")))
{
@@ -534,7 +534,7 @@ int QmlJSIndenter::indentForStandaloneLine()
readLine();
int indentChange = - *yyBraceDepth;
if (caseOrDefault.exactMatch(*yyLine))
if (caseOrDefault.match(*yyLine).hasMatch())
++indentChange;
/*
@@ -598,7 +598,7 @@ int QmlJSIndenter::indentForBottomLine(QTextBlock begin, QTextBlock end, QChar t
*/
indent -= ppIndentSize;
} else if (okay(typedIn, QLatin1Char(':'))) {
if (caseOrDefault.exactMatch(bottomLine)) {
if (caseOrDefault.match(bottomLine).hasMatch()) {
/*
Move a case label (or the ':' in front of a
constructor initialization list) one level to the