diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2023-12-20 08:36:59 +0100 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2023-12-29 09:48:23 +0100 |
commit | 6548c8cde7e975a640c6dda71f7f5c01dbd8d35b (patch) | |
tree | 91f97256a07584ffa23cf945d217c50f787fdc24 | |
parent | 2b008f242150017415bc427d87e84ac81b95e877 (diff) |
qqmljs.g: use canonical form for recovery options
Rename the properties to control recovery to use the canonical namings.
Change-Id: I7f05a3ad95baa54d7a374391ae2bfb1d48db4789
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/qml/parser/qqmljs.g | 24 | ||||
-rw-r--r-- | src/qmldom/qqmldomexternalitems.cpp | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g index bb27ccc96f..219f603e5f 100644 --- a/src/qml/parser/qqmljs.g +++ b/src/qml/parser/qqmljs.g @@ -302,17 +302,17 @@ public: inline int errorColumnNumber() const { return diagnosticMessage().loc.startColumn; } - inline bool identifierInsertion() const - { return m_enableIdentifierInsertion; } + inline bool identifierInsertionEnabled() const + { return m_identifierInsertionEnabled; } - inline void enableIdentifierInsertion() - { m_enableIdentifierInsertion = true; } + inline void setIdentifierInsertionEnabled(bool enable) + { m_identifierInsertionEnabled = enable; } - inline bool incompleteBindings() const - { return m_enableIncompleteBindings; } + inline bool incompleteBindingsEnabled() const + { return m_incompleteBindingsEnabled; } - inline void enableIncompleteBindings() - { m_enableIncompleteBindings = true; } + inline void setIncompleteBindingsEnabled(bool enable) + { m_incompleteBindingsEnabled = enable; } protected: bool parse(int startToken); @@ -404,8 +404,8 @@ protected: CoverExpressionType coverExpressionType = CE_Invalid; QList<DiagnosticMessage> diagnostic_messages; - bool m_enableIdentifierInsertion = false; - bool m_enableIncompleteBindings = false; + bool m_identifierInsertionEnabled = false; + bool m_incompleteBindingsEnabled = false; }; } // end of namespace QQmlJS @@ -1152,7 +1152,7 @@ case $rule_number: UiObjectMember: UiQualifiedId Semicolon; /. case $rule_number: { - if (!m_enableIncompleteBindings) { + if (!m_incompleteBindingsEnabled) { diagnostic_messages.append(compileError(loc(1), QLatin1String("Incomplete binding, expected token `:` or `{`"))); return false; } @@ -4827,7 +4827,7 @@ ExportSpecifier: IdentifierName T_AS IdentifierName; const int errorState = state_stack[tos]; // automatic insertion of missing identifiers after dots - if (yytoken != -1 && m_enableIdentifierInsertion && t_action(errorState, T_IDENTIFIER) && yyprevtoken == T_DOT) { + if (yytoken != -1 && m_identifierInsertionEnabled && t_action(errorState, T_IDENTIFIER) && yyprevtoken == T_DOT) { #ifdef PARSER_DEBUG qDebug() << "Inserting missing identifier between" << spell[yyprevtoken] << "and" << spell[yytoken]; diff --git a/src/qmldom/qqmldomexternalitems.cpp b/src/qmldom/qqmldomexternalitems.cpp index 1e90c8408b..434a0d74ee 100644 --- a/src/qmldom/qqmldomexternalitems.cpp +++ b/src/qmldom/qqmldomexternalitems.cpp @@ -446,8 +446,8 @@ QmlFile::QmlFile( lexer.setCode(code, /*lineno = */ 1, /*qmlMode=*/true); QQmlJS::Parser parser(m_engine.get()); if (option == EnableParserRecovery) { - parser.enableIdentifierInsertion(); - parser.enableIncompleteBindings(); + parser.setIdentifierInsertionEnabled(true); + parser.setIncompleteBindingsEnabled(true); } m_isValid = parser.parse(); const auto diagnostics = parser.diagnosticMessages(); |