QML DOM: Remove support for Qt < 6.5
And build standalone DOM against Qt 6.5 (beta) Change-Id: I9395b4932ecdedd28f10d1e791e2abe445516183 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
cc93479554
commit
9dae539949
|
@ -10,19 +10,19 @@ instructions:
|
|||
variableName: CONFIGURE_ENV_PREFIX
|
||||
variableValue: "{{.Env.ENV_PREFIX}}"
|
||||
- type: ExecuteCommand
|
||||
command: "curl -s http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtbase/qtbase-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z -o qtbase.7z"
|
||||
command: "curl -s https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtbase/qtbase-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z -o qtbase.7z"
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
download of http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtbase/qtbase-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z failed
|
||||
download of https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtbase/qtbase-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z failed
|
||||
- type: ExecuteCommand
|
||||
command: "curl -s http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtdeclarative/qtdeclarative-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z -o qtdeclarative.7z"
|
||||
command: "curl -s https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtdeclarative/qtdeclarative-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z -o qtdeclarative.7z"
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
Download of http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtdeclarative/qtdeclarative-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z failed
|
||||
Download of https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtdeclarative/qtdeclarative-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z failed
|
||||
- type: ExecuteCommand
|
||||
command: "7za x qtbase.7z"
|
||||
ignoreExitCode: false
|
||||
|
@ -43,21 +43,21 @@ instructions:
|
|||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
configuration of qmldom standalone on Qt 6.3 failed
|
||||
configuration of qmldom standalone on Qt 6.5 failed
|
||||
- type: ExecuteCommand
|
||||
command: "{{.Env.ENV_PREFIX}} cmake --build standalone63"
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 3600
|
||||
maxTimeBetweenOutput: 1800
|
||||
userMessageOnFailure: >
|
||||
Compilation of qmldom standalone on Qt 6.3 FAILED, see the log for details.
|
||||
Compilation of qmldom standalone on Qt 6.5 FAILED, see the log for details.
|
||||
- type: ExecuteCommand
|
||||
command: "./standalone63/qmldomloadeditwrite"
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
Run of qmldom standalone on Qt 6.3 FAILED
|
||||
Run of qmldom standalone on Qt 6.5 FAILED
|
||||
enable_if:
|
||||
condition: and
|
||||
conditions:
|
||||
|
|
|
@ -10,19 +10,19 @@ instructions:
|
|||
variableName: CONFIGURE_ENV_PREFIX
|
||||
variableValue: "{{.Env.ENV_PREFIX}}"
|
||||
- type: ExecuteCommand
|
||||
command: "curl -s http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtbase/qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z -o qtbase.7z"
|
||||
command: "curl -s https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtbase/qtbase-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64.7z -o qtbase.7z"
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
download of http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtbase/qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z failed
|
||||
download of https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtbase/qtbase-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64.7z failed
|
||||
- type: ExecuteCommand
|
||||
command: "curl -s http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtdeclarative/qtdeclarative-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z -o qtdeclarative.7z"
|
||||
command: "curl -s https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtdeclarative/qtdeclarative-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64.7z -o qtdeclarative.7z"
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
Download of http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.3/6.3.2-final-released/Qt/qtdeclarative/qtdeclarative-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z failed
|
||||
Download of https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.0-beta2-released/Qt/qtdeclarative/qtdeclarative-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64.7z failed
|
||||
- type: ExecuteCommand
|
||||
command: "7z.exe x qtbase.7z"
|
||||
ignoreExitCode: false
|
||||
|
@ -43,14 +43,14 @@ instructions:
|
|||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
configuration of qmldom standalone on Qt 6.3 failed
|
||||
configuration of qmldom standalone on Qt 6.5 failed
|
||||
- type: ExecuteCommand
|
||||
command: "{{.Env.ENV_PREFIX}} cmake --build standalone63"
|
||||
ignoreExitCode: false
|
||||
maxTimeInSeconds: 3600
|
||||
maxTimeBetweenOutput: 1800
|
||||
userMessageOnFailure: >
|
||||
Compilation of qmldom standalone on Qt 6.3 FAILED, see the log for details.
|
||||
Compilation of qmldom standalone on Qt 6.5 FAILED, see the log for details.
|
||||
- type: PrependToEnvironmentVariable
|
||||
variableName: PATH
|
||||
variableValue: "{{.BuildDir}}/qt63/bin;"
|
||||
|
@ -60,7 +60,7 @@ instructions:
|
|||
maxTimeInSeconds: 1800
|
||||
maxTimeBetweenOutput: 900
|
||||
userMessageOnFailure: >
|
||||
Run of qmldom standalone on Qt 6.3 FAILED
|
||||
Run of qmldom standalone on Qt 6.5 FAILED
|
||||
enable_if:
|
||||
condition: and
|
||||
conditions:
|
||||
|
|
|
@ -430,8 +430,7 @@ QString QQmlPluginImporter::resolvePlugin(const QString &qmldirPluginPath, const
|
|||
return absolutePath;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
# if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID)
|
||||
if (qmldirPath.size() > 25 && qmldirPath.at(0) == QLatin1Char(':')
|
||||
&& qmldirPath.at(1) == QLatin1Char('/')
|
||||
&& qmldirPath.startsWith(QStringLiteral(":/android_rcc_bundle/qml/"),
|
||||
|
@ -452,7 +451,6 @@ QString QQmlPluginImporter::resolvePlugin(const QString &qmldirPluginPath, const
|
|||
}
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -148,11 +148,9 @@ QQmlJSImporter::Import QQmlJSImporter::readQmldir(const QString &path)
|
|||
Import result;
|
||||
auto reader = createQmldirParserForFile(path + SlashQmldir);
|
||||
result.name = reader.typeNamespace();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
// #if required for standalone DOM build against Qt6.3
|
||||
|
||||
result.isStaticModule = reader.isStaticModule();
|
||||
result.isSystemModule = reader.isSystemModule();
|
||||
#endif
|
||||
result.imports.append(reader.imports());
|
||||
result.dependencies.append(reader.dependencies());
|
||||
|
||||
|
@ -291,11 +289,9 @@ void QQmlJSImporter::importDependencies(const QQmlJSImporter::Import &import,
|
|||
if (!m_useOptionalImports) {
|
||||
continue;
|
||||
}
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
||||
// #if required for standalone DOM build against Qt6.3
|
||||
|
||||
if (!(import.flags & QQmlDirParser::Import::OptionalDefault))
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
|
||||
importHelper(import.module, types, isDependency ? QString() : prefix,
|
||||
|
|
|
@ -1490,11 +1490,7 @@ bool QQmlJSImportVisitor::visit(UiPublicMember *publicMember)
|
|||
method.addParameter(
|
||||
QQmlJSMetaParameter(
|
||||
param->name.toString(),
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
param->type ? param->type->toString() : QString()
|
||||
#else
|
||||
buildName(param->type)
|
||||
#endif
|
||||
));
|
||||
param = param->next;
|
||||
}
|
||||
|
@ -1546,12 +1542,7 @@ bool QQmlJSImportVisitor::visit(UiPublicMember *publicMember)
|
|||
QQmlJSMetaProperty prop;
|
||||
prop.setPropertyName(publicMember->name.toString());
|
||||
prop.setIsList(publicMember->typeModifier == QLatin1String("list"));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
// #if required for standalone DOM compilation against Qt 6.2
|
||||
prop.setIsWritable(!publicMember->isReadonly());
|
||||
#else
|
||||
prop.setIsWritable(!publicMember->readonlyToken.isValid());
|
||||
#endif
|
||||
prop.setAliasExpression(aliasExpr);
|
||||
const auto type =
|
||||
isAlias ? QQmlJSScope::ConstPtr() : m_rootScopeImports.type(typeName).scope;
|
||||
|
@ -1565,21 +1556,11 @@ bool QQmlJSImportVisitor::visit(UiPublicMember *publicMember)
|
|||
prop.setTypeName(typeName);
|
||||
}
|
||||
prop.setAnnotations(parseAnnotations(publicMember->annotations));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
// #if required for standalone DOM compilation against Qt 6.2
|
||||
if (publicMember->isDefaultMember())
|
||||
#else
|
||||
if (publicMember->defaultToken.isValid())
|
||||
#endif
|
||||
m_currentScope->setOwnDefaultPropertyName(prop.propertyName());
|
||||
prop.setIndex(m_currentScope->ownProperties().size());
|
||||
m_currentScope->insertPropertyIdentifier(prop);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
// #if required for standalone DOM compilation against Qt 6.2
|
||||
if (publicMember->isRequired())
|
||||
#else
|
||||
if (publicMember->requiredToken.isValid())
|
||||
#endif
|
||||
m_currentScope->setPropertyLocallyRequired(prop.propertyName(), true);
|
||||
|
||||
BindingExpressionParseResult parseResult = BindingExpressionParseResult::Invalid;
|
||||
|
@ -1738,8 +1719,6 @@ void QQmlJSImportVisitor::endVisit(QQmlJS::AST::ClassExpression *)
|
|||
void handleTranslationBinding(QQmlJSMetaPropertyBinding &binding, QStringView base,
|
||||
QQmlJS::AST::ArgumentList *args)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
// #if required for standalone DOM compilation
|
||||
QStringView contextString;
|
||||
QStringView mainString;
|
||||
QStringView commentString;
|
||||
|
@ -1768,7 +1747,6 @@ void handleTranslationBinding(QQmlJSMetaPropertyBinding &binding, QStringView ba
|
|||
QmlIR::tryGeneratingTranslationBindingBase(
|
||||
base, args,
|
||||
registerMainString, registerCommentString, registerContextString, finalizeBinding);
|
||||
#endif
|
||||
}
|
||||
|
||||
QQmlJSImportVisitor::BindingExpressionParseResult
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
#include "qqmljsmetatypes_p.h"
|
||||
#include "qqmljstyperesolver_p.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
# include "QtQml/private/qqmltranslation_p.h"
|
||||
#endif
|
||||
#include "QtQml/private/qqmltranslation_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -64,8 +62,7 @@ QString QQmlJSMetaPropertyBinding::regExpValue() const
|
|||
return {};
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
/*!
|
||||
/*!
|
||||
* Extracts the information about translations from a binding.
|
||||
* An additional context string is needed for text based translation (e.g. with qsTr())
|
||||
* and can be obtained from the name of the qml file.
|
||||
|
@ -86,7 +83,6 @@ QQmlTranslation QQmlJSMetaPropertyBinding::translationDataValue(QString qmlFileN
|
|||
}
|
||||
return QQmlTranslation(data);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
|
||||
#include <QtQml/private/qqmljssourcelocation_p.h>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
# include <QtQml/private/qqmltranslation_p.h>
|
||||
#endif
|
||||
#include <QtQml/private/qqmltranslation_p.h>
|
||||
|
||||
#include "qqmljsannotation_p.h"
|
||||
|
||||
|
@ -730,9 +728,7 @@ public:
|
|||
|
||||
QString regExpValue() const;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
QQmlTranslation translationDataValue(QString qmlFileNameForContext = QStringLiteral("")) const;
|
||||
#endif
|
||||
|
||||
QSharedPointer<const QQmlJSScope> literalType(const QQmlJSTypeResolver *resolver) const;
|
||||
|
||||
|
|
|
@ -111,11 +111,9 @@ void QQmlJSTypeResolver::init(QQmlJSImportVisitor *visitor, QQmlJS::AST::Node *p
|
|||
QQmlJSScope::ConstPtr
|
||||
QQmlJSTypeResolver::scopeForLocation(const QV4::CompiledData::Location &location) const
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
// #if required for standalone DOM compilation against Qt 6.2
|
||||
qCDebug(lcTypeResolver()).nospace()
|
||||
<< "looking for object at " << location.line() << ':' << location.column();
|
||||
#endif
|
||||
return m_objectsByLocation[location];
|
||||
}
|
||||
|
||||
|
@ -128,15 +126,11 @@ QQmlJSScope::ConstPtr QQmlJSTypeResolver::scopeForId(
|
|||
QQmlJSScope::ConstPtr QQmlJSTypeResolver::typeFromAST(QQmlJS::AST::Type *type) const
|
||||
{
|
||||
const QString typeId = QmlIR::IRBuilder::asString(type->typeId);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
if (!type->typeArgument)
|
||||
return m_imports.type(typeId).scope;
|
||||
if (typeId == u"list"_s)
|
||||
return typeForName(type->typeArgument->toString())->listType();
|
||||
return QQmlJSScope::ConstPtr();
|
||||
#else
|
||||
return m_imports.type(typeId).scope;
|
||||
#endif
|
||||
}
|
||||
|
||||
QQmlJSScope::ConstPtr QQmlJSTypeResolver::typeForConst(QV4::ReturnedValue rv) const
|
||||
|
|
|
@ -72,24 +72,8 @@ static QString typeToString(AST::Type *t)
|
|||
Q_ASSERT(t);
|
||||
QString res = toString(t->typeId);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
if (UiQualifiedId *arg = t->typeArgument)
|
||||
res += u'<' + toString(arg) + u'>';
|
||||
#else
|
||||
if (!t->typeArguments)
|
||||
return res;
|
||||
res += u"<";
|
||||
bool first = true;
|
||||
for (TypeArgumentList *tt = static_cast<TypeArgumentList *>(t->typeArguments);
|
||||
tt; tt = tt->next) {
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
res += u",";
|
||||
res += typeToString(tt->typeId);
|
||||
}
|
||||
res += u">";
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -355,32 +339,20 @@ public:
|
|||
MethodInfo m;
|
||||
m.name = el->name.toString();
|
||||
m.typeName = toString(el->memberType);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
m.isReadonly = el->isReadonly();
|
||||
#else
|
||||
m.isReadonly = el->readonlyToken.isValid();
|
||||
#endif
|
||||
m.access = MethodInfo::Public;
|
||||
m.methodType = MethodInfo::Signal;
|
||||
m.isList = el->typeModifier == QLatin1String("list");
|
||||
MethodInfo *mPtr;
|
||||
Path p = current<QmlObject>().addMethod(m, AddOption::KeepExisting, &mPtr);
|
||||
pushEl(p, *mPtr, el);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"signal", el->propertyToken());
|
||||
#else
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"signal", el->propertyToken);
|
||||
#endif
|
||||
MethodInfo &mInfo = std::get<MethodInfo>(currentNode().value);
|
||||
AST::UiParameterList *args = el->parameters;
|
||||
while (args) {
|
||||
MethodParameter param;
|
||||
param.name = args->name.toString();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
param.typeName = args->type ? args->type->toString() : QString();
|
||||
#else
|
||||
param.typeName = toString(args->type);
|
||||
#endif
|
||||
index_type idx = index_type(mInfo.parameters.size());
|
||||
mInfo.parameters.append(param);
|
||||
auto argLocs = FileLocations::ensure(nodeStack.last().fileLocations,
|
||||
|
@ -395,15 +367,9 @@ public:
|
|||
PropertyDefinition p;
|
||||
p.name = el->name.toString();
|
||||
p.typeName = toString(el->memberType);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
p.isReadonly = el->isReadonly();
|
||||
p.isDefaultMember = el->isDefaultMember();
|
||||
p.isRequired = el->isRequired();
|
||||
#else
|
||||
p.isReadonly = el->readonlyToken.isValid();
|
||||
p.isDefaultMember = el->defaultToken.isValid();
|
||||
p.isRequired = el->requiredToken.isValid();
|
||||
#endif
|
||||
p.isList = el->typeModifier == QLatin1String("list");
|
||||
if (!el->typeModifier.isEmpty())
|
||||
p.typeName = el->typeModifier.toString() + QChar(u'<') + p.typeName + QChar(u'>');
|
||||
|
@ -411,34 +377,20 @@ public:
|
|||
Path pPathFromOwner =
|
||||
current<QmlObject>().addPropertyDef(p, AddOption::KeepExisting, &pPtr);
|
||||
pushEl(pPathFromOwner, *pPtr, el);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"property",
|
||||
el->propertyToken());
|
||||
#else
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"property",
|
||||
el->propertyToken);
|
||||
#endif
|
||||
if (p.name == u"id")
|
||||
qmlFile.addError(
|
||||
myParseErrors()
|
||||
.warning(tr("id is a special attribute, that should not be "
|
||||
"used as property name"))
|
||||
.withPath(currentNodeEl().path));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
if (p.isDefaultMember)
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"default",
|
||||
el->defaultToken());
|
||||
if (p.isRequired)
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"required",
|
||||
el->requiredToken());
|
||||
#else
|
||||
if (p.isDefaultMember)
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"default",
|
||||
el->defaultToken);
|
||||
if (p.isRequired)
|
||||
FileLocations::addRegion(nodeStack.last().fileLocations, u"required",
|
||||
el->requiredToken);
|
||||
#endif
|
||||
if (el->statement) {
|
||||
BindingType bType = BindingType::Normal;
|
||||
SourceLocation loc = combineLocations(el->statement);
|
||||
|
@ -745,11 +697,7 @@ public:
|
|||
pathFromOwner = comp.addId(idVal, AddOption::KeepExisting, &idPtr);
|
||||
QRegularExpression idRe(QRegularExpression::anchoredPattern(
|
||||
QStringLiteral(uR"([[:lower:]][[:lower:][:upper:]0-9_]*)")));
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
auto m = idRe.match(iExp->name);
|
||||
#else
|
||||
auto m = idRe.matchView(iExp->name);
|
||||
#endif
|
||||
if (!m.hasMatch()) {
|
||||
qmlFile.addError(
|
||||
myParseErrors()
|
||||
|
@ -846,11 +794,7 @@ public:
|
|||
{ // currently not used...
|
||||
MethodParameter p {
|
||||
el->name.toString(),
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
el->type ? el->type->toString() : QString(),
|
||||
#else
|
||||
toString(el->type),
|
||||
#endif
|
||||
false, false, false, {}, {}, {}
|
||||
};
|
||||
return true;
|
||||
|
|
|
@ -162,19 +162,11 @@ public:
|
|||
"typeModifierToken=%11 typeToken=%12 "
|
||||
"identifierToken=%13 colonToken=%14%15")
|
||||
.arg(quotedString(typeStr), quotedString(el->typeModifier),
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
quotedString(el->name), boolStr(el->isDefaultMember()),
|
||||
boolStr(el->isReadonly()), boolStr(el->isRequired()),
|
||||
loc(el->defaultToken()), loc(el->readonlyToken()),
|
||||
loc(el->propertyToken()), loc(el->requiredToken()),
|
||||
loc(el->typeModifierToken), loc(el->typeToken),
|
||||
#else
|
||||
quotedString(el->name), boolStr(el->defaultToken.isValid()),
|
||||
boolStr(el->readonlyToken.isValid()),
|
||||
boolStr(el->requiredToken.isValid()), loc(el->defaultToken),
|
||||
loc(el->readonlyToken), loc(el->propertyToken), loc(el->requiredToken),
|
||||
loc(el->typeModifierToken), loc(el->typeToken),
|
||||
#endif
|
||||
loc(el->identifierToken), loc(el->colonToken),
|
||||
semicolonToken(el->semicolonToken)));
|
||||
if (!noAnnotations()) // put annotations inside the node they refer to
|
||||
|
@ -990,19 +982,11 @@ public:
|
|||
}
|
||||
void endVisit(AST::Type *) override { stop(u"Type"); }
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
bool visit(AST::TypeArgument *) override {
|
||||
start(u"TypeArgument");
|
||||
return true;
|
||||
}
|
||||
void endVisit(AST::TypeArgument *) override { stop(u"TypeArgument"); }
|
||||
#else
|
||||
bool visit(AST::TypeArgumentList *) override {
|
||||
start(u"TypeArgumentList");
|
||||
return true;
|
||||
}
|
||||
void endVisit(AST::TypeArgumentList *) override { stop(u"TypeArgumentList"); }
|
||||
#endif
|
||||
|
||||
bool visit(AST::TypeAnnotation *el) override {
|
||||
start(QLatin1String("TypeAnnotation colonToken=%1")
|
||||
|
|
|
@ -1038,7 +1038,7 @@ void FormatPartialStatus::handleTokens()
|
|||
}
|
||||
// multi-line comment start?
|
||||
if (topState != StateType::MultilineCommentStart && topState != StateType::MultilineCommentCont
|
||||
&& currentStatus.lexerState.state.tokenKind == T_PARTIAL_COMMENT) {
|
||||
&& currentStatus.lexerState.state.tokenKind == QQmlJSGrammar::T_PARTIAL_COMMENT) {
|
||||
enterState(StateType::MultilineCommentStart);
|
||||
}
|
||||
currentStatus.finalIndent = currentIndent;
|
||||
|
@ -1060,10 +1060,10 @@ int indentForLineStartingWithToken(const FormatTextStatus &oldStatus, const Form
|
|||
return -1;
|
||||
}
|
||||
// don't touch multi-line strings at all
|
||||
if (oldStatus.lexerState.state.tokenKind == T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL
|
||||
|| oldStatus.lexerState.state.tokenKind == T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL
|
||||
|| oldStatus.lexerState.state.tokenKind == T_PARTIAL_TEMPLATE_HEAD
|
||||
|| oldStatus.lexerState.state.tokenKind == T_PARTIAL_TEMPLATE_MIDDLE) {
|
||||
if (oldStatus.lexerState.state.tokenKind == QQmlJSGrammar::T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL
|
||||
|| oldStatus.lexerState.state.tokenKind == QQmlJSGrammar::T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL
|
||||
|| oldStatus.lexerState.state.tokenKind == QQmlJSGrammar::T_PARTIAL_TEMPLATE_HEAD
|
||||
|| oldStatus.lexerState.state.tokenKind == QQmlJSGrammar::T_PARTIAL_TEMPLATE_MIDDLE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1159,7 +1159,7 @@ int indentForLineStartingWithToken(const FormatTextStatus &oldStatus, const Form
|
|||
int FormatPartialStatus::indentLine()
|
||||
{
|
||||
Q_ASSERT(currentStatus.size() >= 1);
|
||||
int firstToken = (lineTokens.isEmpty() ? T_NONE : tokenAt(0).lexKind);
|
||||
int firstToken = (lineTokens.isEmpty() ? QQmlJSGrammar::T_NONE : tokenAt(0).lexKind);
|
||||
int indent = indentForLineStartingWithToken(initialStatus, options, firstToken);
|
||||
recalculateWithIndent(indent);
|
||||
return indent;
|
||||
|
@ -1168,7 +1168,7 @@ int FormatPartialStatus::indentLine()
|
|||
int FormatPartialStatus::indentForNewLineAfter() const
|
||||
{
|
||||
// should be just currentIndent?
|
||||
int indent = indentForLineStartingWithToken(currentStatus, options, T_NONE);
|
||||
int indent = indentForLineStartingWithToken(currentStatus, options, QQmlJSGrammar::T_NONE);
|
||||
if (indent < 0)
|
||||
return currentIndent;
|
||||
return indent;
|
||||
|
|
|
@ -419,11 +419,7 @@ const QSet<int> AstRangesVisitor::kindsToSkip()
|
|||
AST::Node::Kind_ClassElementList,
|
||||
AST::Node::Kind_PatternElementList,
|
||||
AST::Node::Kind_PatternPropertyList,
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
AST::Node::Kind_TypeArgument,
|
||||
#else
|
||||
AST::Node::Kind_TypeArgumentList,
|
||||
#endif
|
||||
})
|
||||
.unite(VisitAll::uiKinds());
|
||||
return res;
|
||||
|
|
|
@ -203,11 +203,7 @@ Version Version::fromString(QStringView v)
|
|||
return Version(Latest, Latest);
|
||||
QRegularExpression r(
|
||||
QRegularExpression::anchoredPattern(QStringLiteral(uR"(([0-9]*)(?:\.([0-9]*))?)")));
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
auto m = r.match(v);
|
||||
#else
|
||||
auto m = r.matchView(v);
|
||||
#endif
|
||||
if (m.hasMatch()) {
|
||||
bool ok;
|
||||
int majorV = m.capturedView(1).toInt(&ok);
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
constexpr static DomType kindValue = DomType::QmlDirectory;
|
||||
DomType kind() const override { return kindValue; }
|
||||
QmlDirectory(QString filePath = QString(), QStringList dirList = QStringList(),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0);
|
||||
QmlDirectory(const QmlDirectory &o) = default;
|
||||
|
||||
|
@ -152,7 +152,7 @@ public:
|
|||
static ErrorGroups myParsingErrors();
|
||||
|
||||
QmldirFile(QString filePath = QString(), QString code = QString(),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0)
|
||||
: ExternalOwningItem(filePath, lastDataUpdateAt, Paths::qmldirFilePath(filePath),
|
||||
derivedFrom, code)
|
||||
|
@ -217,7 +217,7 @@ public:
|
|||
constexpr static DomType kindValue = DomType::JsFile;
|
||||
DomType kind() const override { return kindValue; }
|
||||
JsFile(QString filePath = QString(),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
Path pathFromTop = Path(), int derivedFrom = 0)
|
||||
: ExternalOwningItem(filePath, lastDataUpdateAt, pathFromTop, derivedFrom)
|
||||
{
|
||||
|
@ -248,7 +248,7 @@ public:
|
|||
|
||||
QmlFile(const QmlFile &o);
|
||||
QmlFile(QString filePath = QString(), QString code = QString(),
|
||||
QDateTime lastDataUpdate = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime lastDataUpdate = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0);
|
||||
static ErrorGroups myParsingErrors();
|
||||
bool iterateDirectSubpaths(DomItem &self, DirectVisitor)
|
||||
|
@ -349,7 +349,7 @@ public:
|
|||
DomType kind() const override { return kindValue; }
|
||||
|
||||
QmltypesFile(QString filePath = QString(), QString code = QString(),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0)
|
||||
: ExternalOwningItem(filePath, lastDataUpdateAt, Paths::qmltypesFilePath(filePath),
|
||||
derivedFrom, code)
|
||||
|
@ -417,7 +417,7 @@ public:
|
|||
DomType kind() const override { return kindValue; }
|
||||
|
||||
GlobalScope(QString filePath = QString(),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0)
|
||||
: ExternalOwningItem(filePath, lastDataUpdateAt, Paths::globalScopePath(filePath),
|
||||
derivedFrom)
|
||||
|
|
|
@ -102,12 +102,7 @@ bool FieldFilter::addFilter(QString fFields)
|
|||
QRegularExpression fieldRe(QRegularExpression::anchoredPattern(QStringLiteral(
|
||||
uR"((?<op>[-+])?(?:(?<type>[a-zA-Z0-9_]*):)?(?<field>[a-zA-Z0-9_]*))")));
|
||||
for (const QString &fField : fFields.split(QLatin1Char(','))) {
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
QRegularExpressionMatch m = fieldRe.match(fField);
|
||||
#else
|
||||
QRegularExpressionMatch m = fieldRe.matchView(fField);
|
||||
#endif
|
||||
if (m.hasMatch()) {
|
||||
if (m.capturedView(u"op") == u"+") {
|
||||
m_fieldFilterRemove.remove(m.captured(u"type"), m.captured(u"field"));
|
||||
|
|
|
@ -53,7 +53,7 @@ indentAgain:
|
|||
trailingSpace = m_options.stringTrailingSpace;
|
||||
} else {
|
||||
const int kind =
|
||||
(fStatus().lineTokens.isEmpty() ? T_EOL
|
||||
(fStatus().lineTokens.isEmpty() ? Lexer::T_EOL
|
||||
: fStatus().lineTokens.last().lexKind);
|
||||
if (Token::lexKindIsComment(kind)) {
|
||||
// a // comment...
|
||||
|
|
|
@ -31,16 +31,7 @@
|
|||
#include <QtCore/QRegularExpression>
|
||||
#include <QtCore/QScopeGuard>
|
||||
#include <QtCore/QtGlobal>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
namespace {
|
||||
static constexpr auto UTC = Qt::UTC;
|
||||
}
|
||||
#else
|
||||
#include <QtCore/QTimeZone>
|
||||
namespace {
|
||||
static constexpr auto UTC = QTimeZone::UTC;
|
||||
}
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -1695,11 +1686,7 @@ public:
|
|||
QRegularExpression reTarget = QRegularExpression(QRegularExpression::anchoredPattern(
|
||||
uR"(QList<(?<list>[a-zA-Z_0-9:]+) *(?<listPtr>\*?)>|QMap< *(?<mapKey>[a-zA-Z_0-9:]+) *, *(?<mapValue>[a-zA-Z_0-9:]+) *(?<mapPtr>\*?)>|(?<baseType>[a-zA-Z_0-9:]+) *(?<ptr>\*?))"));
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
QRegularExpressionMatch m = reTarget.match(target);
|
||||
#else
|
||||
QRegularExpressionMatch m = reTarget.matchView(target);
|
||||
#endif
|
||||
if (!m.hasMatch()) {
|
||||
DomItem::myResolveErrors()
|
||||
.error(tr("Unexpected complex CppType %1").arg(target))
|
||||
|
@ -2232,7 +2219,7 @@ QDateTime DomItem::createdAt()
|
|||
if (m_owner)
|
||||
return std::visit([](auto &&ow) { return ow->createdAt(); }, *m_owner);
|
||||
else
|
||||
return QDateTime::fromMSecsSinceEpoch(0, UTC);
|
||||
return QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC);
|
||||
}
|
||||
|
||||
QDateTime DomItem::frozenAt()
|
||||
|
@ -2240,7 +2227,7 @@ QDateTime DomItem::frozenAt()
|
|||
if (m_owner)
|
||||
return std::visit([](auto &&ow) { return ow->frozenAt(); }, *m_owner);
|
||||
else
|
||||
return QDateTime::fromMSecsSinceEpoch(0, UTC);
|
||||
return QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC);
|
||||
}
|
||||
|
||||
QDateTime DomItem::lastDataUpdateAt()
|
||||
|
@ -2248,7 +2235,7 @@ QDateTime DomItem::lastDataUpdateAt()
|
|||
if (m_owner)
|
||||
return std::visit([](auto &&ow) { return ow->lastDataUpdateAt(); }, *m_owner);
|
||||
else
|
||||
return QDateTime::fromMSecsSinceEpoch(0, UTC);
|
||||
return QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC);
|
||||
}
|
||||
|
||||
void DomItem::addError(ErrorMessage msg)
|
||||
|
@ -2968,7 +2955,7 @@ OwningItem::OwningItem(int derivedFrom)
|
|||
m_revision(nextRevision()),
|
||||
m_createdAt(QDateTime::currentDateTimeUtc()),
|
||||
m_lastDataUpdateAt(m_createdAt),
|
||||
m_frozenAt(QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
m_frozenAt(QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
{}
|
||||
|
||||
OwningItem::OwningItem(int derivedFrom, QDateTime lastDataUpdateAt)
|
||||
|
@ -2976,7 +2963,7 @@ OwningItem::OwningItem(int derivedFrom, QDateTime lastDataUpdateAt)
|
|||
m_revision(nextRevision()),
|
||||
m_createdAt(QDateTime::currentDateTimeUtc()),
|
||||
m_lastDataUpdateAt(lastDataUpdateAt),
|
||||
m_frozenAt(QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
m_frozenAt(QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
{}
|
||||
|
||||
OwningItem::OwningItem(const OwningItem &o)
|
||||
|
@ -2984,7 +2971,7 @@ OwningItem::OwningItem(const OwningItem &o)
|
|||
m_revision(nextRevision()),
|
||||
m_createdAt(QDateTime::currentDateTimeUtc()),
|
||||
m_lastDataUpdateAt(o.lastDataUpdateAt()),
|
||||
m_frozenAt(QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
m_frozenAt(QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
{
|
||||
QMultiMap<Path, ErrorMessage> my_errors;
|
||||
{
|
||||
|
|
|
@ -34,9 +34,7 @@
|
|||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QCborValue>
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
#include <QtCore/QTimeZone>
|
||||
#endif
|
||||
#include <QtQml/private/qqmljssourcelocation_p.h>
|
||||
|
||||
#include <memory>
|
||||
|
@ -1262,12 +1260,6 @@ class QMLDOM_EXPORT OwningItem: public DomBase {
|
|||
protected:
|
||||
virtual std::shared_ptr<OwningItem> doCopy(DomItem &self) const = 0;
|
||||
|
||||
// Temporary alias until QMLDom supports nothing older than 6.5:
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
static constexpr auto UTC = Qt::UTC;
|
||||
#else
|
||||
static constexpr auto UTC = QTimeZone::UTC;
|
||||
#endif
|
||||
public:
|
||||
OwningItem(const OwningItem &o);
|
||||
OwningItem(int derivedFrom=0);
|
||||
|
|
|
@ -140,11 +140,7 @@ QString LineWriter::eolToWrite() const
|
|||
template<typename String, typename ...Args>
|
||||
static QRegularExpressionMatch matchHelper(QRegularExpression &re, String &&s, Args &&...args)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
return re.match(s, args...);
|
||||
#else
|
||||
return re.matchView(s, args...);
|
||||
#endif
|
||||
}
|
||||
|
||||
LineWriter &LineWriter::write(QStringView v, TextAddType tAdd)
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
DomType kind() const override { return kindValue; }
|
||||
|
||||
ModuleIndex(QString uri, int majorVersion, int derivedFrom = 0,
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
: OwningItem(derivedFrom, lastDataUpdateAt), m_uri(uri), m_majorVersion(majorVersion)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -982,7 +982,7 @@ protected:
|
|||
bool visit(YieldExpression *) override { return true; }
|
||||
bool visit(ClassExpression *) override { return true; }
|
||||
|
||||
// Return false because we want to omit default function calls in accept0 implementation.
|
||||
// Return false because we want to omit default function calls in accept0 implementation.
|
||||
bool visit(ClassDeclaration *ast) override
|
||||
{
|
||||
preVisit(ast);
|
||||
|
@ -1052,11 +1052,7 @@ protected:
|
|||
bool visit(ESModule *) override { return true; }
|
||||
bool visit(DebuggerStatement *) override { return true; }
|
||||
bool visit(Type *) override { return true; }
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
bool visit(TypeArgument *) override { return true; }
|
||||
#else
|
||||
bool visit(TypeArgumentList *) override { return true; }
|
||||
#endif
|
||||
bool visit(TypeAnnotation *) override { return true; }
|
||||
|
||||
// overridden to use BasicVisitor (and ensure warnings about new added AST)
|
||||
|
@ -1173,11 +1169,7 @@ protected:
|
|||
void endVisit(ESModule *) override { }
|
||||
void endVisit(DebuggerStatement *) override { }
|
||||
void endVisit(Type *) override { }
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
void endVisit(TypeArgument *) override { }
|
||||
#else
|
||||
void endVisit(TypeArgumentList *) override { }
|
||||
#endif
|
||||
void endVisit(TypeAnnotation *) override { }
|
||||
|
||||
void throwRecursionDepthError() override
|
||||
|
|
|
@ -129,7 +129,7 @@ static void addLexToken(QList<Token> &tokens, int tokenKind, QQmlJS::Lexer &lexe
|
|||
tokens.append(Token(lexer.tokenStartColumn() - 1, 1, QQmlJSGrammar::T_PLUS));
|
||||
tokens.append(Token(lexer.tokenStartColumn(), lexer.tokenLength() - 1, tokenKind));
|
||||
return;
|
||||
case T_PARTIAL_TEMPLATE_MIDDLE:
|
||||
case QQmlJSGrammar::T_PARTIAL_TEMPLATE_MIDDLE:
|
||||
regexpMayFollow = true;
|
||||
tokens.append(Token(lexer.tokenStartColumn() - 1, 1, QQmlJSGrammar::T_PLUS));
|
||||
tokens.append(Token(lexer.tokenStartColumn(), lexer.tokenLength() - 1, tokenKind));
|
||||
|
@ -137,15 +137,14 @@ static void addLexToken(QList<Token> &tokens, int tokenKind, QQmlJS::Lexer &lexe
|
|||
case QQmlJSGrammar::T_MULTILINE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_NO_SUBSTITUTION_TEMPLATE:
|
||||
case QQmlJSGrammar::T_STRING_LITERAL:
|
||||
case T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL:
|
||||
case T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL:
|
||||
case T_PARTIAL_TEMPLATE_HEAD:
|
||||
case QQmlJSGrammar::T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_PARTIAL_TEMPLATE_HEAD:
|
||||
regexpMayFollow = (tokenKind == QQmlJSGrammar::T_TEMPLATE_MIDDLE
|
||||
|| tokenKind == QQmlJSGrammar::T_TEMPLATE_HEAD);
|
||||
break;
|
||||
|
||||
case QQmlJSGrammar::T_VERSION_NUMBER:
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
if (lexer.state().currentChar == u'.') {
|
||||
int offset = lexer.tokenStartColumn() - 1;
|
||||
int length = lexer.tokenLength();
|
||||
|
@ -157,7 +156,6 @@ static void addLexToken(QList<Token> &tokens, int tokenKind, QQmlJS::Lexer &lexe
|
|||
tokens.append(Token(offset, length, QQmlJSGrammar::T_NUMERIC_LITERAL));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -251,7 +249,7 @@ bool Token::lexKindIsComment(int kind)
|
|||
{
|
||||
switch (kind) {
|
||||
case QQmlJSGrammar::T_COMMENT:
|
||||
case T_PARTIAL_COMMENT:
|
||||
case QQmlJSGrammar::T_PARTIAL_COMMENT:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
@ -339,13 +337,13 @@ bool Token::lexKindIsIdentifier(int kind)
|
|||
bool Token::lexKindIsStringType(int kind)
|
||||
{
|
||||
switch (kind) {
|
||||
case T_PARTIAL_TEMPLATE_MIDDLE:
|
||||
case QQmlJSGrammar::T_PARTIAL_TEMPLATE_MIDDLE:
|
||||
case QQmlJSGrammar::T_MULTILINE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_NO_SUBSTITUTION_TEMPLATE:
|
||||
case QQmlJSGrammar::T_STRING_LITERAL:
|
||||
case T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL:
|
||||
case T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL:
|
||||
case T_PARTIAL_TEMPLATE_HEAD:
|
||||
case QQmlJSGrammar::T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_PARTIAL_TEMPLATE_HEAD:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
@ -356,8 +354,8 @@ bool Token::lexKindIsStringType(int kind)
|
|||
bool Token::lexKindIsInvalid(int kind)
|
||||
{
|
||||
switch (kind) {
|
||||
case T_NONE:
|
||||
case T_EOL:
|
||||
case QQmlJSGrammar::T_NONE:
|
||||
case QQmlJSGrammar::T_EOL:
|
||||
case QQmlJSGrammar::EOF_SYMBOL:
|
||||
case QQmlJSGrammar::T_ERROR:
|
||||
case QQmlJSGrammar::T_FEED_JS_EXPRESSION:
|
||||
|
@ -398,11 +396,6 @@ QList<Token> Scanner::operator()(QStringView text, const Scanner::State &startSt
|
|||
_state = startState;
|
||||
QList<Token> tokens;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
Q_ASSERT_X(false, "qmldomscanner",
|
||||
"line by line (progressive lexing supported only when building against Qt6.5 or "
|
||||
"higher)");
|
||||
#else
|
||||
{
|
||||
QQmlJS::Lexer lexer(nullptr, QQmlJS::Lexer::LexMode::LineByLine);
|
||||
lexer.setState(startState.state);
|
||||
|
@ -412,13 +405,12 @@ QList<Token> Scanner::operator()(QStringView text, const Scanner::State &startSt
|
|||
lexer.setCode(line, -1, _qmlMode, QQmlJS::Lexer::CodeContinuation::Continue);
|
||||
while (true) {
|
||||
int tokenKind = lexer.lex();
|
||||
if (tokenKind == T_EOL || tokenKind == QQmlJSGrammar::EOF_SYMBOL)
|
||||
if (tokenKind == QQmlJSGrammar::T_EOL || tokenKind == QQmlJSGrammar::EOF_SYMBOL)
|
||||
break;
|
||||
addLexToken(tokens, tokenKind, lexer, _state.regexpMightFollow);
|
||||
}
|
||||
_state.state = lexer.state();
|
||||
}
|
||||
#endif
|
||||
return tokens;
|
||||
}
|
||||
|
||||
|
@ -430,11 +422,11 @@ Scanner::State Scanner::state() const
|
|||
bool Scanner::State::isMultiline() const
|
||||
{
|
||||
switch (state.tokenKind) {
|
||||
case T_PARTIAL_COMMENT:
|
||||
case T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL:
|
||||
case T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL:
|
||||
case T_PARTIAL_TEMPLATE_HEAD:
|
||||
case T_PARTIAL_TEMPLATE_MIDDLE:
|
||||
case QQmlJSGrammar::T_PARTIAL_COMMENT:
|
||||
case QQmlJSGrammar::T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL:
|
||||
case QQmlJSGrammar::T_PARTIAL_TEMPLATE_HEAD:
|
||||
case QQmlJSGrammar::T_PARTIAL_TEMPLATE_MIDDLE:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
@ -445,7 +437,7 @@ bool Scanner::State::isMultiline() const
|
|||
bool Scanner::State::isMultilineComment() const
|
||||
{
|
||||
switch (state.tokenKind) {
|
||||
case T_PARTIAL_COMMENT:
|
||||
case QQmlJSGrammar::T_PARTIAL_COMMENT:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -28,28 +28,6 @@ QT_BEGIN_NAMESPACE
|
|||
namespace QQmlJS {
|
||||
namespace Dom {
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
enum {
|
||||
T_EOL = 2000,
|
||||
T_PARTIAL_COMMENT = 2001,
|
||||
T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL = 2002,
|
||||
T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL = 2003,
|
||||
T_PARTIAL_TEMPLATE_HEAD = 2004,
|
||||
T_PARTIAL_TEMPLATE_MIDDLE = 2005,
|
||||
T_NONE = 2006
|
||||
};
|
||||
#else
|
||||
constexpr auto T_NONE = QQmlJSGrammar::T_NONE;
|
||||
constexpr auto T_EOL = QQmlJSGrammar::T_EOL;
|
||||
constexpr auto T_PARTIAL_COMMENT = QQmlJSGrammar::T_PARTIAL_COMMENT;
|
||||
constexpr auto T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL =
|
||||
QQmlJSGrammar::T_PARTIAL_DOUBLE_QUOTE_STRING_LITERAL;
|
||||
constexpr auto T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL =
|
||||
QQmlJSGrammar::T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL;
|
||||
constexpr auto T_PARTIAL_TEMPLATE_HEAD = QQmlJSGrammar::T_PARTIAL_TEMPLATE_HEAD;
|
||||
constexpr auto T_PARTIAL_TEMPLATE_MIDDLE = QQmlJSGrammar::T_PARTIAL_TEMPLATE_MIDDLE;
|
||||
#endif
|
||||
|
||||
class QMLDOM_EXPORT Token
|
||||
{
|
||||
Q_GADGET
|
||||
|
@ -83,7 +61,7 @@ public:
|
|||
|
||||
int offset = 0;
|
||||
int length = 0;
|
||||
int lexKind = T_NONE;
|
||||
int lexKind = QQmlJSGrammar::T_NONE;
|
||||
};
|
||||
|
||||
inline int operator==(const Token &t1, const Token &t2)
|
||||
|
@ -100,18 +78,7 @@ class QMLDOM_EXPORT Scanner
|
|||
public:
|
||||
struct QMLDOM_EXPORT State
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
Lexer::State state {};
|
||||
#else
|
||||
struct LState
|
||||
{
|
||||
int tokenKind = {};
|
||||
friend QDebug operator<<(QDebug dbg, const LState &s)
|
||||
{
|
||||
return dbg << "tokenKind:" << s.tokenKind;
|
||||
}
|
||||
} state;
|
||||
#endif
|
||||
bool regexpMightFollow = true;
|
||||
bool isMultiline() const;
|
||||
bool isMultilineComment() const;
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
#define Q_CONSTINIT
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace QQmlJS {
|
||||
|
@ -226,7 +222,7 @@ std::shared_ptr<OwningItem> DomUniverse::doCopy(DomItem &) const
|
|||
void DomUniverse::loadFile(DomItem &self, QString filePath, QString logicalPath, Callback callback,
|
||||
LoadOptions loadOptions, std::optional<DomType> fileType)
|
||||
{
|
||||
loadFile(self, filePath, logicalPath, QString(), QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
loadFile(self, filePath, logicalPath, QString(), QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
callback, loadOptions, fileType);
|
||||
}
|
||||
|
||||
|
@ -1176,7 +1172,7 @@ void DomEnvironment::loadFile(DomItem &self, QString filePath, QString logicalPa
|
|||
DomTop::Callback endCallback, LoadOptions loadOptions,
|
||||
std::optional<DomType> fileType, ErrorHandler h)
|
||||
{
|
||||
loadFile(self, filePath, logicalPath, QString(), QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
loadFile(self, filePath, logicalPath, QString(), QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
loadCallback, directDepsCallback, endCallback, loadOptions, fileType, h);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,10 +64,10 @@ class QMLDOM_EXPORT ExternalItemPairBase: public OwningItem { // all access shou
|
|||
public:
|
||||
constexpr static DomType kindValue = DomType::ExternalItemPair;
|
||||
DomType kind() const final override { return kindValue; }
|
||||
ExternalItemPairBase(QDateTime validExposedAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
ExternalItemPairBase(QDateTime validExposedAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0,
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
: OwningItem(derivedFrom, lastDataUpdateAt),
|
||||
validExposedAt(validExposedAt),
|
||||
currentExposedAt(currentExposedAt)
|
||||
|
@ -128,10 +128,10 @@ public:
|
|||
constexpr static DomType kindValue = DomType::ExternalItemPair;
|
||||
friend class DomUniverse;
|
||||
ExternalItemPair(std::shared_ptr<T> valid = {}, std::shared_ptr<T> current = {},
|
||||
QDateTime validExposedAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime validExposedAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0,
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
: ExternalItemPairBase(validExposedAt, currentExposedAt, derivedFrom, lastDataUpdateAt),
|
||||
valid(valid),
|
||||
current(current)
|
||||
|
@ -369,9 +369,9 @@ public:
|
|||
constexpr static DomType kindValue = DomType::ExternalItemInfo;
|
||||
DomType kind() const final override { return kindValue; }
|
||||
ExternalItemInfoBase(Path canonicalPath,
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0,
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
: OwningItem(derivedFrom, lastDataUpdateAt),
|
||||
m_canonicalPath(canonicalPath),
|
||||
m_currentExposedAt(currentExposedAt)
|
||||
|
@ -454,9 +454,9 @@ protected:
|
|||
public:
|
||||
constexpr static DomType kindValue = DomType::ExternalItemInfo;
|
||||
ExternalItemInfo(std::shared_ptr<T> current = std::shared_ptr<T>(),
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, UTC),
|
||||
QDateTime currentExposedAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC),
|
||||
int derivedFrom = 0,
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
: ExternalItemInfoBase(current->canonicalPath().dropTail(), currentExposedAt, derivedFrom,
|
||||
lastDataUpdateAt),
|
||||
current(current)
|
||||
|
@ -515,7 +515,7 @@ public:
|
|||
|
||||
LoadInfo(Path elPath = Path(), Status status = Status::NotStarted, int nLoaded = 0,
|
||||
int derivedFrom = 0,
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, UTC))
|
||||
QDateTime lastDataUpdateAt = QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC))
|
||||
: OwningItem(derivedFrom, lastDataUpdateAt),
|
||||
m_elementCanonicalPath(elPath),
|
||||
m_status(status),
|
||||
|
|
|
@ -16,36 +16,5 @@
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
|
||||
#include <QtCore/qstring.h>
|
||||
namespace Qt {
|
||||
inline namespace Literals {
|
||||
inline namespace StringLiterals {
|
||||
|
||||
constexpr inline QLatin1String operator"" _L1(const char *str, size_t size) noexcept
|
||||
{
|
||||
return QLatin1String { str, qsizetype(size) };
|
||||
}
|
||||
|
||||
inline QString operator"" _s(const char16_t *str, size_t size) noexcept
|
||||
{
|
||||
return QString(QStringPrivate(nullptr, const_cast<char16_t *>(str), qsizetype(size)));
|
||||
}
|
||||
|
||||
} // StringLiterals
|
||||
} // Literals
|
||||
} // Qt
|
||||
|
||||
#ifdef Q_QMLCOMPILER_PRIVATE_EXPORT // clashing declaration fixed in ce53e48504f
|
||||
#undef Q_QMLCOMPILER_PRIVATE_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // 6.4.0
|
||||
|
||||
#ifndef Q_UNREACHABLE_RETURN // new in QT_VERSION_CHECK(6, 5, 0)
|
||||
# define Q_UNREACHABLE_RETURN(...) do { Q_UNREACHABLE(); return __VA_ARGS__; } while (0)
|
||||
#endif
|
||||
|
||||
#define Q_QMLCOMPILER_PRIVATE_EXPORT QMLDOM_EXPORT
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue