17#include <QtQml/private/qqmljsast_p.h>
18#include <QtQmlCompiler/private/qqmljsutils_p.h>
21#include <QtCore/QFileInfo>
22#include <QtCore/QScopeGuard>
23#include <QtCore/QLoggingCategory>
37#define Q_SCRIPTELEMENT_DISABLE() \
39 qDebug() << "Could not construct the JS DOM at" << __FILE__ << ":" << __LINE__ \
40 << ", skipping JS elements..."; \
41 disableScriptElements(); \
44#define Q_SCRIPTELEMENT_EXIT_IF(check) \
46 if (m_enableScriptExpressions && (check)) { \
47 Q_SCRIPTELEMENT_DISABLE(); \
58template<
typename K,
typename V>
64 auto end = mmap.end();
69 while (it2 !=
end && it2.key() ==
key) {
92 if (
iter != qualifiedId)
114 return combine(
s1,
s2);
127 left.visitConst([&
s1](
auto &&
el) {
s1 =
el->mainRegionLocation(); });
128 right.visitConst([&
s2](
auto &&
el) {
s2 =
el->mainRegionLocation(); });
130 auto result = std::make_shared<ScriptElements::BinaryExpression>(
s1,
s2);
142static ScriptElementVariant
147 for (
auto exp = qualifiedId; exp; exp = exp->
next) {
149 auto id = std::make_shared<ScriptElements::IdentifierExpression>(identifierLoc);
150 id->setName(exp->name);
163QQmlDomAstCreator::QmlStackElement &QQmlDomAstCreator::currentQmlObjectOrComponentEl(
int idx)
165 Q_ASSERT_X(idx < nodeStack.size() && idx >= 0,
"currentQmlObjectOrComponentEl",
166 "Stack does not contain enough elements!");
167 int i = nodeStack.size() - idx;
169 DomType k = nodeStack.at(
i).item.kind;
173 Q_ASSERT_X(
false,
"currentQmlObjectEl",
"No QmlObject or component in stack");
174 return nodeStack.last();
177QQmlDomAstCreator::QmlStackElement &QQmlDomAstCreator::currentNodeEl(
int i)
179 Q_ASSERT_X(
i < nodeStack.size() &&
i >= 0,
"currentNode",
"Stack does not contain element!");
180 return nodeStack[nodeStack.size() -
i - 1];
183QQmlDomAstCreator::ScriptStackElement &QQmlDomAstCreator::currentScriptNodeEl(
int i)
186 "Stack does not contain element!");
187 return scriptNodeStack[scriptNodeStack.
size() -
i - 1];
190QQmlDomAstCreator::DomValue &QQmlDomAstCreator::currentNode(
int i)
192 Q_ASSERT_X(
i < nodeStack.size() &&
i >= 0,
"currentNode",
193 "Stack does not contain element!");
194 return nodeStack[nodeStack.size() -
i - 1].item;
197void QQmlDomAstCreator::removeCurrentNode(std::optional<DomType> expectedType)
199 Q_ASSERT_X(!nodeStack.isEmpty(), className,
"popCurrentNode() without any node");
201 Q_ASSERT(nodeStack.last().item.kind == *expectedType);
202 nodeStack.removeLast();
205void QQmlDomAstCreator::removeCurrentScriptNode(std::optional<DomType> expectedType)
209 "popCurrentScriptNode() without any node");
227const ScriptElementVariant &
228QQmlDomAstCreator::finalizeScriptExpression(
const ScriptElementVariant &element,
const Path &pathFromOwner,
231 auto e = element.base();
234 qCDebug(creatorLog) <<
"Finalizing script expression with path:"
235 << ownerFileLocations->canonicalPathForTesting().append(
236 pathFromOwner.toString());
237 e->updatePathFromOwner(pathFromOwner);
238 e->createFileLocations(ownerFileLocations);
256 switch (currentNode().kind) {
268 base = currentNodeEl().fileLocations;
269 if (
p.length() > 2) {
270 Path
p2 =
p[
p.length() - 2];
271 if (
p2.headKind() == Path::Kind::Field
272 && (
p2.checkHeadName(Fields::children) ||
p2.checkHeadName(Fields::objects)
273 ||
p2.checkHeadName(Fields::value) ||
p2.checkHeadName(Fields::annotations)
274 ||
p2.checkHeadName(Fields::children)))
275 relative =
p.mid(
p.length() - 2, 2);
276 else if (
p.last().checkHeadName(Fields::value)
277 &&
p.last().headKind() == Path::Kind::Field)
280 qCWarning(domLog) <<
"unexpected path to QmlObject in createMap" <<
p;
284 qCWarning(domLog) <<
"unexpected path to QmlObject in createMap" <<
p;
290 base = currentNodeEl().fileLocations;
303 base = currentEl<QmlObject>().fileLocations;
305 relative =
p.mid(
p.length() - 3, 3);
315 return createMap(
base, relative,
n);
320 qmlFilePtr(qmlFile.ownerAs<
QmlFile>()),
321 rootMap(qmlFilePtr->fileLocationsTree())
328 QString componentName = fInfo.baseName();
333 Q_ASSERT_X(newC.item(), className,
"could not recover component added with addComponent");
340 const bool loadDependencies =
343 if (!fInfo.canonicalPath().isEmpty()) {
345 selfDirImport.implicit =
true;
346 qmlFilePtr->addImport(selfDirImport);
348 if (loadDependencies) {
352 envPtr, selfDirImport.uri.absoluteLocalPath(currentFileDir)),
359 qmlFilePtr->addImport(
i);
361 if (loadDependencies)
364 if (m_loadFileLazily && loadDependencies) {
365 envPtr->loadPendingDependencies();
376 for (
const Pragma &
p : qmlFilePtr->pragmas()) {
378 comp.setIsSingleton(
true);
379 comp.setIsCreatable(
false);
384 Q_ASSERT_X(nodeStack.isEmpty(), className,
"ui program did not finish node stack");
390 for (
auto t =
el->values;
t;
t =
t->next)
391 valueList <<
t->value.toString();
393 auto fileLocation = createMap(
397 if (
el->colonToken.isValid()) {
401 for (
auto t =
el->values;
t;
t =
t->next) {
402 auto subMap = createMap(fileLocation,
Path().field(Fields::values).
index(
i),
t);
413 if (
el->version &&
el->version->version.hasMajorVersion())
414 v.majorVersion =
el->version->version.majorVersion();
415 if (
el->version &&
el->version->version.hasMinorVersion())
416 v.minorVersion =
el->version->version.minorVersion();
419 const bool loadDependencies =
422 if (
el->importUri !=
nullptr) {
424 Import::fromUriString(toString(el->importUri), v, el->importId.toString());
427 if (loadDependencies) {
428 envPtr->loadModuleDependency(
import.uri.moduleUri(),
import.version,
434 Import::fromFileString(el->fileName.toString(), el->importId.toString());
437 if (loadDependencies) {
441 envPtr,
import.uri.absoluteLocalPath(currentFileDir)),
446 if (m_loadFileLazily && loadDependencies) {
447 envPtr->loadPendingDependencies();
451 if (
el->importToken.isValid())
454 if (
el->asToken.isValid())
457 if (
el->importIdToken.isValid())
474 m.isReadonly =
el->isReadonly();
480 pushEl(
p, *mPtr,
el);
482 el->propertyToken());
484 el->identifierToken);
492 mInfo.parameters.append(
param);
508 p.isReadonly =
el->isReadonly();
509 p.isDefaultMember =
el->isDefaultMember();
510 p.isRequired =
el->isRequired();
515 Path pPathFromOwner =
517 if (m_enableScriptExpressions) {
519 qmlObjectType->insertChild(Fields::typeName,
521 pPtr->setNameIdentifiers(finalizeScriptExpression(
523 pPathFromOwner.field(Fields::nameIdentifiers), rootMap));
526 m_skipBindingIdentifiers =
el->binding;
528 pushEl(pPathFromOwner, *pPtr,
el);
530 el->propertyToken());
532 el->identifierToken);
538 .
warning(
tr(
"id is a special attribute, that should not be "
539 "used as property name"))
540 .withPath(currentNodeEl().
path)));
541 if (
p.isDefaultMember) {
547 el->requiredToken());
551 el->readonlyToken());
558 auto script = std::make_shared<ScriptExpression>(
563 Path bPathFromOwner = current<QmlObject>().addBinding(
Binding(
p.name, script, bType),
572 nodeStack.append({ bPathFromOwner, *bPtr, bLoc });
583 Binding &
b = std::get<Binding>(lastEl.value);
584 if (m_enableScriptExpressions
585 && (scriptNodeStack.
size() != 1 || scriptNodeStack.
last().isList())) {
588 if (m_enableScriptExpressions) {
589 b.scriptExpressionValue()->setScriptElement(finalizeScriptExpression(
590 currentScriptNodeEl().takeVariant(),
Path().field(Fields::scriptElement),
592 Path().field(Fields::value))));
593 removeCurrentScriptNode({});
596 QmlObject &containingObject = current<QmlObject>();
600 removeCurrentNode({});
604 if ((
el->binding ||
el->statement)
607 if (!pDef.annotations.isEmpty()) {
611 auto it =
obj.m_bindings.
find(pDef.name);
614 ann.addAnnotation(duplicate);
615 it->addAnnotation(currentEl<QmlObject>()
616 .path.field(Fields::bindings)
618 .index(
obj.m_bindings.values(pDef.name).size() - 1),
625 QmlStackElement &sEl = nodeStack.last();
626 switch (sEl.item.kind) {
635 MethodInfo m = std::get<MethodInfo>(sEl.item.value);
643 removeCurrentNode({});
650 m.
name = fDef->name.toString();
661 QStringView preCode = code.
mid(methodLoc.begin(), bodyLoc.begin() - methodLoc.begin());
662 QStringView postCode = code.
mid(bodyLoc.end(), methodLoc.end() - bodyLoc.end());
663 m.body = std::make_shared<ScriptExpression>(
664 code.
mid(bodyLoc.offset, bodyLoc.length), qmlFilePtr->engine(), fDef->body,
668 if (fDef->typeAnnotation) {
670 m.returnType = std::make_shared<ScriptExpression>(
671 code.
mid(typeLoc.offset, typeLoc.length), qmlFilePtr->engine(),
672 fDef->typeAnnotation, qmlFilePtr->astComments(),
678 pushEl(mPathFromOwner, *mPtr,
681 if (fDef->identifierToken.isValid())
686 if (fDef->functionToken.isValid())
688 if (fDef->lparenToken.length != 0)
690 if (fDef->rparenToken.length != 0)
692 if (fDef->lbraceToken.length != 0)
694 if (fDef->rbraceToken.length != 0)
696 if (fDef->typeAnnotation)
707 if (
args->element->initializer) {
709 auto script = std::make_shared<ScriptExpression>(
711 args->element->initializer, qmlFilePtr->astComments(),
713 param.defaultValue = script;
716 param.isRestElement =
true;
718 param.value = std::make_shared<ScriptExpression>(
719 code.
mid(parameterLoc.offset, parameterLoc.length), qmlFilePtr->engine(),
720 args->element, qmlFilePtr->astComments(),
724 mInfo.parameters.append(
param);
729 if (
args->element->identifierToken.isValid())
731 if (
args->element->typeAnnotation)
740 if (!cast<FunctionDeclaration *>(
el->sourceElement)) {
750 if (
auto genericElement =
751 std::get_if<std::shared_ptr<ScriptElements::GenericScriptElement>>(&*
data)) {
764 if (!m_enableScriptExpressions)
769 if (currentScriptNodeEl().isList()) {
772 auto body = std::make_shared<ScriptElements::BlockStatement>(
774 body->setStatements(currentScriptNodeEl().takeList());
775 if (
auto semanticScope = body->statements().semanticScope())
776 body->setSemanticScope(semanticScope);
777 m.body->setScriptElement(finalizeScriptExpression(
780 m.body->setScriptElement(finalizeScriptExpression(
781 currentScriptNodeEl().takeVariant(), bodyPath, bodyTree));
783 removeCurrentScriptNode({});
786 auto body = std::make_shared<ScriptElements::BlockStatement>(
789 bodyPath, bodyTree));
792 if (fDef->typeAnnotation) {
794 Path().field(Fields::returnType),
796 const Path pathToReturnType =
Path().
field(Fields::scriptElement);
800 finalizeScriptExpression(
variant, pathToReturnType, argLoc);
801 m.returnType->setScriptElement(
variant);
802 removeCurrentScriptNode({});
804 std::vector<FormalParameterList *> reversedInitializerExpressions;
805 for (
auto it = fDef->formals;
it;
it =
it->next) {
806 reversedInitializerExpressions.push_back(
it);
808 const size_t size = reversedInitializerExpressions.size();
809 for (
size_t idx =
size - 1; idx <
size; --idx) {
811 nodeStack.last().fileLocations,
812 Path().field(Fields::parameters).
index(idx).field(Fields::value),
814 const Path pathToArgument =
Path().
field(Fields::scriptElement);
819 finalizeScriptExpression(
variant, pathToArgument, argLoc);
820 m.parameters[idx].value->setScriptElement(
variant);
821 removeCurrentScriptNode({});
825 if (m_enableScriptExpressions && !scriptNodeStack.
empty()) {
849 if (!arrayBindingLevels.isEmpty() && nodeStack.size() == arrayBindingLevels.last()) {
851 QList<QmlObject> *vals = std::get<Binding>(currentNode().
value).arrayValue();
853 int idx = vals->size();
855 sPathFromOwner = currentNodeEl().path.
field(Fields::value).
index(idx);
856 sPtr = &((*vals)[idx]);
857 sPtr->updatePathFromOwner(sPathFromOwner);
860 "expected an array binding with a valid QList<QmlScope> as value");
863 Q_ASSERT_X(
false, className,
"expected an array binding as last node on the stack");
866 DomValue &containingObject = currentQmlObjectOrComponentEl().item;
867 switch (containingObject.kind) {
869 sPathFromOwner = std::get<QmlComponent>(containingObject.value).addObject(scope, &sPtr);
872 sPathFromOwner = std::get<QmlObject>(containingObject.value).addChild(scope, &sPtr);
877 Path pathFromContainingObject = sPathFromOwner.
mid(currentNodeEl().
path.length());
882 el->qualifiedTypeNameId->identifierToken);
884 Q_ASSERT_X(sPtr, className,
"could not recover new scope");
886 if (m_enableScriptExpressions) {
888 qmlObjectType->insertChild(Fields::typeName,
890 sPtr->setNameIdentifiers(
892 sPathFromOwner.field(Fields::nameIdentifiers), rootMap));
894 pushEl(sPathFromOwner, *sPtr,
el);
896 if (m_enableScriptExpressions &&
el->initializer) {
898 el->initializer->lbraceToken);
900 el->initializer->rbraceToken);
909 int idx = currentIndex();
910 if (!arrayBindingLevels.isEmpty() && nodeStack.size() == arrayBindingLevels.last() + 1) {
913 QList<QmlObject> *vals =
b.arrayValue();
915 "expected an array binding with a valid QList<QmlScope> as value");
918 Q_ASSERT_X(
false, className,
"expected an array binding as last node on the stack");
921 DomValue &containingObject = currentNodeEl(1).item;
922 Path p = currentNodeEl().path;
923 switch (containingObject.kind) {
926 std::get<QmlComponent>(containingObject.value).m_objects[idx] =
obj;
932 std::get<QmlObject>(containingObject.value).m_children[idx] =
obj;
943void QQmlDomAstCreator::setBindingIdentifiers(
const Path &pathFromOwner,
946 const bool skipBindingIdentifiers = std::exchange(m_skipBindingIdentifiers,
false);
947 if (!m_enableScriptExpressions || skipBindingIdentifiers)
951 bindingPtr->setBindingIdentifiers(finalizeScriptExpression(
952 bindable, pathFromOwner.
field(Fields::bindingIdentifiers), rootMap));
961 Path bPathFromOwner = current<QmlObject>().addBinding(
963 if (bPtr->name() == u
"id")
965 .
warning(
tr(
"id attributes should only be a lower case letter "
966 "followed by letters, numbers or underscore, "
967 "assuming they refer to an id property"))
968 .withPath(bPathFromOwner)));
969 setBindingIdentifiers(bPathFromOwner,
el->qualifiedId, bPtr);
971 pushEl(bPathFromOwner, *bPtr,
el);
978 QmlObject *objValue = bPtr->objectValue();
979 Q_ASSERT_X(objValue, className,
"could not recover objectValue");
980 objValue->setName(
toString(
el->qualifiedTypeNameId));
982 if (m_enableScriptExpressions) {
984 qmlObjectType->insertChild(Fields::typeName,
986 objValue->setNameIdentifiers(finalizeScriptExpression(
988 bPathFromOwner.field(Fields::value).field(Fields::nameIdentifiers), rootMap));
992 pushEl(bPathFromOwner.field(Fields::value), *objValue,
el->initializer);
993 if (m_enableScriptExpressions &&
el->initializer) {
995 el->initializer->lbraceToken);
997 el->initializer->rbraceToken);
1004 QmlObject &objValue = current<QmlObject>();
1005 QmlObject &containingObj = current<QmlObject>(1);
1022 auto script = std::make_shared<ScriptExpression>(
1026 Binding *bindingPtr =
nullptr;
1027 Id *idPtr =
nullptr;
1029 if (bindingV.name() == u
"id") {
1030 Node *exp = script->ast();
1032 exp = eStat->expression;
1034 QmlStackElement &containingObjectEl = currentEl<QmlObject>();
1035 QmlObject &containingObject = std::get<QmlObject>(containingObjectEl.item.value);
1036 QString idName = iExp->name.toString();
1038 idVal.value = script;
1050 auto m = idRe.matchView(iExp->name);
1051 if (!
m.hasMatch()) {
1054 .
warning(
tr(
"id attributes should only be a lower case letter "
1055 "followed by letters, numbers or underscore, not %1")
1057 .withPath(pathFromOwner)));
1062 Q_ASSERT_X(bindingPtr, className,
"binding could not be retrieved");
1065 .
warning(
tr(
"id attributes should only be a lower case letter "
1066 "followed by letters, numbers or underscore, not %1 "
1067 "%2, assuming they refer to a property")
1068 .
arg(script->code(), script->astRelocatableDump()))
1069 .withPath(pathFromOwner)));
1074 QmlStackElement &containingObjectEl = currentEl<QmlObject>();
1076 Path pathFromContainingObject = pathFromOwner.
mid(containingObjectEl.path.length());
1077 auto bindingFileLocation =
1080 el->qualifiedId->identifierToken);
1083 setBindingIdentifiers(pathFromOwner,
el->qualifiedId, bindingPtr);
1085 Q_ASSERT_X(bindingPtr, className,
"binding could not be retrieved");
1088 pushEl(pathFromOwner, *bindingPtr,
el);
1090 pushEl(pathFromOwner, *idPtr,
el);
1099void QQmlDomAstCreator::setScriptExpression (
const std::shared_ptr<ScriptExpression>&
value)
1101 if (m_enableScriptExpressions
1102 && (scriptNodeStack.
size() != 1 || currentScriptNodeEl().isList()))
1104 if (m_enableScriptExpressions) {
1106 Path().field(Fields::value));
1107 value->setScriptElement(finalizeScriptExpression(currentScriptNodeEl().takeVariant(),
1108 Path().field(Fields::scriptElement),
1110 removeCurrentScriptNode({});
1116 DomValue &lastEl = currentNode();
1119 Binding &
b = std::get<Binding>(lastEl.value);
1121 setScriptExpression(
b.scriptExpressionValue());
1123 QmlObject &containingObject = current<QmlObject>();
1128 Id &
id = std::get<Id>(lastEl.value);
1130 setScriptExpression(
id.
value);
1140 if (m_enableScriptExpressions && !scriptNodeStack.
empty()) {
1143 removeCurrentNode({});
1148 QList<QmlObject>
value;
1151 Path bindingPathFromOwner =
1153 if (bindingV.name() == u
"id")
1156 .
error(
tr(
"id attributes should have only simple strings as values"))
1157 .withPath(bindingPathFromOwner)));
1159 setBindingIdentifiers(bindingPathFromOwner,
el->qualifiedId, bindingPtr);
1161 pushEl(bindingPathFromOwner, *bindingPtr,
el);
1165 createMap(currentNodeEl().fileLocations,
Path::Field(Fields::value),
nullptr);
1168 arrayBindingLevels.append(nodeStack.size());
1178 arrayBindingLevels.removeLast();
1184 if (!m_enableScriptExpressions)
1187 auto currentList = makeScriptList(
list);
1191 if (!m_enableScriptExpressions)
1194 if (scriptNodeStack.
empty() || scriptNodeStack.
last().isList()) {
1198 currentList.append(scriptNodeStack.
last().takeVariant());
1202 pushScriptElement(currentList);
1215 if (!m_enableScriptExpressions)
1218 auto currentList = makeScriptList(
list);
1223 if (scriptNodeStack.
empty() || !scriptNodeStack.
last().isList()) {
1227 currentList.append(scriptNodeStack.
last().takeList());
1232 if (scriptNodeStack.
empty() || scriptNodeStack.
last().isList()) {
1236 currentList.append(scriptNodeStack.
last().takeVariant());
1241 pushScriptElement(currentList);
1249 if (!m_enableScriptExpressions)
1252 auto currentList = makeScriptList(
list);
1257 if (!m_enableScriptExpressions)
1259 if (scriptNodeStack.
empty() || scriptNodeStack.
last().isList()) {
1263 currentList.append(scriptNodeStack.
last().takeVariant());
1268 pushScriptElement(currentList);
1282 auto id = std::make_shared<ScriptElements::IdentifierExpression>(
1284 id->setName(expression->
toString());
1291 if (!m_enableScriptExpressions)
1302 Path enumPathFromOwner =
1304 pushEl(enumPathFromOwner, *ePtr,
el);
1325 Path itPathFromDecl = eDecl.addValue(
it);
1328 if (
el->memberToken.isValid())
1330 if (
el->valueToken.isValid())
1348 if (m_enableScriptExpressions) {
1349 auto inlineComponentType =
1352 auto typeName = std::make_shared<ScriptElements::IdentifierExpression>(
el->identifierToken);
1354 inlineComponentType->insertChild(Fields::typeName,
1356 compPtr->setNameIdentifiers(
1358 p.field(Fields::nameIdentifiers), rootMap));
1361 pushEl(
p, *compPtr,
el);
1363 el->componentToken);
1384 pDef.isRequired =
true;
1386 Path pathFromOwner =
1397 DomValue &containingElement = currentNode();
1400 switch (containingElement.kind) {
1402 pathFromOwner = std::get<QmlObject>(containingElement.value).addAnnotation(
a, &aPtr);
1405 pathFromOwner = std::get<Binding>(containingElement.value)
1406 .addAnnotation(currentNodeEl().
path,
a, &aPtr);
1410 std::get<Id>(containingElement.value).addAnnotation(currentNodeEl().
path,
a, &aPtr);
1413 pathFromOwner = std::get<PropertyDefinition>(containingElement.value)
1414 .addAnnotation(currentNodeEl().
path,
a, &aPtr);
1417 pathFromOwner = std::get<MethodInfo>(containingElement.value)
1418 .addAnnotation(currentNodeEl().
path,
a, &aPtr);
1421 qCWarning(domLog) <<
"Unexpected container object for annotation:"
1425 pushEl(pathFromOwner, *aPtr,
el);
1431 DomValue &containingElement = currentNode(1);
1434 switch (containingElement.kind) {
1436 std::get<QmlObject>(containingElement.value).m_annotations[currentIndex()] =
a;
1439 std::get<Binding>(containingElement.value).m_annotations[currentIndex()] =
a;
1442 std::get<Id>(containingElement.value).annotations[currentIndex()] =
a;
1445 std::get<PropertyDefinition>(containingElement.value).annotations[currentIndex()] =
a;
1448 std::get<MethodInfo>(containingElement.value).annotations[currentIndex()] =
a;
1459 tr(
"Maximum statement or expression depth exceeded in QmlDomAstCreator")));
1464 if (!m_enableScriptExpressions)
1472 if (!m_enableScriptExpressions)
1475 auto current = makeScriptList(
list);
1479 current.append(scriptNodeStack.
takeLast().takeVariant());
1483 pushScriptElement(current);
1488 if (!m_enableScriptExpressions)
1496 if (!m_enableScriptExpressions)
1499 auto current = makeScriptElement<ScriptElements::BinaryExpression>(exp);
1502 current->setRight(currentScriptNodeEl().takeVariant());
1503 removeCurrentScriptNode({});
1505 current->setLeft(currentScriptNodeEl().takeVariant());
1506 removeCurrentScriptNode({});
1508 pushScriptElement(current);
1513 if (!m_enableScriptExpressions)
1521 if (!m_enableScriptExpressions)
1524 auto current = makeScriptElement<ScriptElements::BlockStatement>(block);
1528 current->setStatements(currentScriptNodeEl().takeList());
1532 pushScriptElement(current);
1537 if (!m_enableScriptExpressions)
1545 if (!m_enableScriptExpressions)
1548 auto current = makeScriptElement<ScriptElements::ForStatement>(forStatement);
1552 forStatement->firstSemicolonToken);
1554 forStatement->secondSemicolonToken);
1557 if (forStatement->statement) {
1559 current->setBody(currentScriptNodeEl().takeVariant());
1560 removeCurrentScriptNode(std::nullopt);
1563 if (forStatement->expression) {
1565 current->setExpression(currentScriptNodeEl().takeVariant());
1566 removeCurrentScriptNode(std::nullopt);
1569 if (forStatement->condition) {
1571 current->setCondition(currentScriptNodeEl().takeVariant());
1572 removeCurrentScriptNode(std::nullopt);
1575 if (forStatement->declarations) {
1577 auto variableDeclaration = makeGenericScriptElement(forStatement->declarations,
1583 variableDeclaration->insertChild(Fields::declarations, std::move(
list));
1584 removeCurrentScriptNode({});
1588 if (
auto pe = forStatement->declarations->declaration;
1589 pe && pe->declarationKindToken.isValid()) {
1591 pe->declarationKindToken);
1595 if (forStatement->initialiser) {
1597 current->setInitializer(currentScriptNodeEl().takeVariant());
1598 removeCurrentScriptNode(std::nullopt);
1600 pushScriptElement(current);
1605 if (!m_enableScriptExpressions)
1608 auto current = makeScriptElement<ScriptElements::IdentifierExpression>(expression);
1609 current->setName(expression->
name);
1610 pushScriptElement(current);
1616 if (!m_enableScriptExpressions)
1619 auto current = makeScriptElement<ScriptElements::Literal>(expression);
1620 current->setLiteralValue(expression->
value);
1621 pushScriptElement(current);
1627 if (!m_enableScriptExpressions)
1630 pushScriptElement(makeStringLiteral(expression->
value, expression));
1636 if (!m_enableScriptExpressions)
1639 auto current = makeScriptElement<ScriptElements::Literal>(expression);
1640 current->setLiteralValue(
nullptr);
1641 pushScriptElement(current);
1647 if (!m_enableScriptExpressions)
1650 auto current = makeScriptElement<ScriptElements::Literal>(expression);
1651 current->setLiteralValue(
true);
1652 pushScriptElement(current);
1658 if (!m_enableScriptExpressions)
1661 auto current = makeScriptElement<ScriptElements::Literal>(expression);
1662 current->setLiteralValue(
false);
1663 pushScriptElement(current);
1669 if (!m_enableScriptExpressions)
1672 auto current = makeScriptElement<ScriptElements::IdentifierExpression>(expression);
1673 current->setName(expression->
id);
1674 pushScriptElement(current);
1680 if (!m_enableScriptExpressions)
1683 pushScriptElement(makeStringLiteral(expression->
id, expression));
1689 if (!m_enableScriptExpressions)
1698 if (!m_enableScriptExpressions)
1701 auto current = makeScriptElement<ScriptElements::Literal>(expression);
1702 current->setLiteralValue(expression->
id);
1703 pushScriptElement(current);
1709 if (!m_enableScriptExpressions)
1718 if (!m_enableScriptExpressions)
1721 auto currentList = makeScriptList(
list);
1724 if (
it->declaration) {
1726 if (!m_enableScriptExpressions)
1728 if (scriptNodeStack.
empty() || scriptNodeStack.
last().isList()) {
1732 currentList.append(scriptNodeStack.
last().takeVariant());
1736 pushScriptElement(currentList);
1744 if (!m_enableScriptExpressions)
1747 auto currentList = makeScriptList(
list);
1753 pushScriptElement(currentList);
1761 if (!m_enableScriptExpressions)
1774 const std::shared_ptr<ScriptElements::GenericScriptElement> ¤t)
1776 if (pe->equalToken.isValid())
1779 if (pe->identifierToken.isValid() && !pe->bindingIdentifier.isEmpty()) {
1781 std::make_shared<ScriptElements::IdentifierExpression>(pe->identifierToken);
1782 identifier->setName(pe->bindingIdentifier);
1785 if (pe->initializer) {
1787 current->insertChild(Fields::initializer, scriptNodeStack.
last().takeVariant());
1790 if (pe->typeAnnotation) {
1792 current->insertChild(Fields::type, scriptNodeStack.
last().takeVariant());
1795 if (pe->bindingTarget) {
1797 current->insertChild(Fields::bindingElement, scriptNodeStack.
last().takeVariant());
1804 if (!m_enableScriptExpressions)
1810 if (!m_enableScriptExpressions)
1813 pushScriptElement(element);
1818 if (!m_enableScriptExpressions)
1826 if (!m_enableScriptExpressions)
1829 auto current = makeScriptElement<ScriptElements::IfStatement>(ifStatement);
1835 if (ifStatement->ko) {
1837 current->setAlternative(scriptNodeStack.
last().takeVariant());
1841 if (ifStatement->ok) {
1843 current->setConsequence(scriptNodeStack.
last().takeVariant());
1846 if (ifStatement->expression) {
1848 current->setCondition(scriptNodeStack.
last().takeVariant());
1852 pushScriptElement(current);
1857 if (!m_enableScriptExpressions)
1865 if (!m_enableScriptExpressions)
1868 auto current = makeScriptElement<ScriptElements::ReturnStatement>(returnStatement);
1871 if (returnStatement->expression) {
1873 current->setExpression(currentScriptNodeEl().takeVariant());
1874 removeCurrentScriptNode({});
1877 pushScriptElement(current);
1882 if (!m_enableScriptExpressions)
1890 if (!m_enableScriptExpressions)
1893 auto current = makeScriptElement<ScriptElements::BinaryExpression>(expression);
1897 if (expression->
base) {
1899 current->setLeft(currentScriptNodeEl().takeVariant());
1900 removeCurrentScriptNode({});
1903 auto scriptIdentifier =
1904 std::make_shared<ScriptElements::IdentifierExpression>(expression->
identifierToken);
1905 scriptIdentifier->setName(expression->
name);
1908 pushScriptElement(current);
1913 if (!m_enableScriptExpressions)
1921 if (!m_enableScriptExpressions)
1924 auto current = makeScriptElement<ScriptElements::BinaryExpression>(expression);
1932 current->setRight(currentScriptNodeEl().takeVariant());
1933 removeCurrentScriptNode({});
1936 if (expression->
base) {
1938 current->setLeft(currentScriptNodeEl().takeVariant());
1939 removeCurrentScriptNode({});
1942 pushScriptElement(current);
1947 if (!m_enableScriptExpressions)
1955 if (!m_enableScriptExpressions)
1962 if (exp->arguments) {
1964 current->insertChild(Fields::arguments, currentScriptNodeEl().takeList());
1965 removeCurrentScriptNode({});
1968 current->insertChild(Fields::arguments,
1974 current->insertChild(Fields::callee, currentScriptNodeEl().takeVariant());
1975 removeCurrentScriptNode({});
1978 pushScriptElement(current);
1983 if (!m_enableScriptExpressions)
1991 if (!m_enableScriptExpressions)
1996 if (exp->elements) {
2000 current->insertChild(Fields::elements, std::move(
list));
2002 removeCurrentScriptNode({});
2005 current->insertChild(Fields::elements,
2009 pushScriptElement(current);
2014 if (!m_enableScriptExpressions)
2022 if (!m_enableScriptExpressions)
2027 if (exp->properties) {
2029 current->insertChild(Fields::properties, currentScriptNodeEl().takeList());
2030 removeCurrentScriptNode({});
2033 current->insertChild(Fields::properties,
2037 pushScriptElement(current);
2042 if (!m_enableScriptExpressions)
2050 if (!m_enableScriptExpressions)
2059 if (!m_enableScriptExpressions)
2064 current->insertChild(Fields::name, currentScriptNodeEl().takeVariant());
2065 removeCurrentScriptNode({});
2068 pushScriptElement(current);
2073 if (!m_enableScriptExpressions)
2081 if (!m_enableScriptExpressions)
2093 current->insertChild(Fields::declarations, std::move(
list));
2095 removeCurrentScriptNode({});
2098 pushScriptElement(current);
2103 if (!m_enableScriptExpressions)
2111 if (!m_enableScriptExpressions)
2116 if (exp->typeArgument) {
2117 current->insertChild(Fields::typeArgumentName,
2127 pushScriptElement(current);
2132 if (!m_enableScriptExpressions)
2140 if (!m_enableScriptExpressions)
2147 if (exp->statements) {
2149 current->insertChild(Fields::statements, currentScriptNodeEl().takeList());
2150 removeCurrentScriptNode({});
2153 pushScriptElement(current);
2158 if (!m_enableScriptExpressions)
2166 if (!m_enableScriptExpressions)
2173 if (exp->statements) {
2175 current->insertChild(Fields::statements, currentScriptNodeEl().takeList());
2176 removeCurrentScriptNode({});
2179 if (exp->expression) {
2181 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2182 removeCurrentScriptNode({});
2185 pushScriptElement(current);
2190 if (!m_enableScriptExpressions)
2198 if (!m_enableScriptExpressions)
2201 auto current = makeScriptList(
list);
2205 current.append(scriptNodeStack.
takeLast().takeVariant());
2209 pushScriptElement(current);
2214 if (!m_enableScriptExpressions)
2222 if (!m_enableScriptExpressions)
2229 if (exp->moreClauses) {
2231 current->insertChild(Fields::moreCaseClauses, currentScriptNodeEl().takeList());
2232 removeCurrentScriptNode({});
2235 if (exp->defaultClause) {
2237 current->insertChild(Fields::defaultClause, currentScriptNodeEl().takeVariant());
2238 removeCurrentScriptNode({});
2243 current->insertChild(Fields::caseClauses, currentScriptNodeEl().takeList());
2244 removeCurrentScriptNode({});
2246 pushScriptElement(current);
2251 if (!m_enableScriptExpressions)
2259 if (!m_enableScriptExpressions)
2269 current->insertChild(Fields::caseBlock, currentScriptNodeEl().takeVariant());
2270 removeCurrentScriptNode({});
2272 if (exp->expression) {
2274 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2275 removeCurrentScriptNode({});
2278 pushScriptElement(current);
2283 if (!m_enableScriptExpressions)
2291 if (!m_enableScriptExpressions)
2299 if (exp->statement) {
2301 current->insertChild(Fields::body, currentScriptNodeEl().takeVariant());
2302 removeCurrentScriptNode({});
2305 if (exp->expression) {
2307 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2308 removeCurrentScriptNode({});
2311 pushScriptElement(current);
2316 if (!m_enableScriptExpressions)
2324 if (!m_enableScriptExpressions)
2333 if (exp->expression) {
2335 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2336 removeCurrentScriptNode({});
2339 if (exp->statement) {
2341 current->insertChild(Fields::body, currentScriptNodeEl().takeVariant());
2342 removeCurrentScriptNode({});
2345 pushScriptElement(current);
2350 if (!m_enableScriptExpressions)
2358 if (!m_enableScriptExpressions)
2367 if (exp->statement) {
2369 current->insertChild(Fields::body, currentScriptNodeEl().takeVariant());
2370 removeCurrentScriptNode({});
2372 if (exp->expression) {
2374 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2375 removeCurrentScriptNode({});
2380 current->insertChild(Fields::bindingElement, currentScriptNodeEl().takeVariant());
2381 removeCurrentScriptNode({});
2383 if (
auto pe = AST::cast<PatternElement *>(exp->lhs);
2384 pe && pe->declarationKindToken.isValid()) {
2386 pe->declarationKindToken);
2390 pushScriptElement(current);
2398 if (m_enableScriptExpressions)
2411 if (m_enableScriptExpressions)
2418 return m_enableScriptExpressions;
2423 if (!m_enableScriptExpressions)
2433 current->insertChild(Fields::finallyBlock, currentScriptNodeEl().takeVariant());
2434 removeCurrentScriptNode({});
2443 current->insertChild(Fields::catchBlock, currentScriptNodeEl().takeVariant());
2444 removeCurrentScriptNode({});
2446 current->insertChild(Fields::catchParameter, currentScriptNodeEl().takeVariant());
2447 removeCurrentScriptNode({});
2452 current->insertChild(Fields::block, currentScriptNodeEl().takeVariant());
2453 removeCurrentScriptNode({});
2456 pushScriptElement(current);
2462 return m_enableScriptExpressions;
2473 return m_enableScriptExpressions;
2483 return m_enableScriptExpressions;
2488 if (!m_enableScriptExpressions)
2496 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2497 removeCurrentScriptNode({});
2500 pushScriptElement(current);
2505 return m_enableScriptExpressions;
2510 if (!m_enableScriptExpressions)
2516 auto label = std::make_shared<ScriptElements::IdentifierExpression>(statement->
identifierToken);
2523 current->insertChild(Fields::statement, currentScriptNodeEl().takeVariant());
2524 removeCurrentScriptNode({});
2527 pushScriptElement(current);
2532 return m_enableScriptExpressions;
2537 if (!m_enableScriptExpressions)
2545 std::make_shared<ScriptElements::IdentifierExpression>(statement->
identifierToken);
2550 pushScriptElement(current);
2556 return m_enableScriptExpressions;
2562 if (!m_enableScriptExpressions)
2565 auto current = makeScriptElement<ScriptElements::BinaryExpression>(commaExpression);
2568 if (commaExpression->right) {
2570 current->setRight(currentScriptNodeEl().takeVariant());
2571 removeCurrentScriptNode({});
2574 if (commaExpression->left) {
2576 current->setLeft(currentScriptNodeEl().takeVariant());
2577 removeCurrentScriptNode({});
2580 pushScriptElement(current);
2585 return m_enableScriptExpressions;
2590 if (!m_enableScriptExpressions)
2597 if (expression->
ko) {
2599 current->insertChild(Fields::alternative, currentScriptNodeEl().takeVariant());
2600 removeCurrentScriptNode({});
2603 if (expression->
ok) {
2605 current->insertChild(Fields::consequence, currentScriptNodeEl().takeVariant());
2606 removeCurrentScriptNode({});
2611 current->insertChild(Fields::condition, currentScriptNodeEl().takeVariant());
2612 removeCurrentScriptNode({});
2615 pushScriptElement(current);
2620 return m_enableScriptExpressions;
2625 if (!m_enableScriptExpressions)
2633 std::make_shared<ScriptElements::IdentifierExpression>(statement->
identifierToken);
2638 pushScriptElement(current);
2646std::shared_ptr<ScriptElements::GenericScriptElement>
2648 bool hasExpression, UnaryExpressionKind kind)
2660 auto current = makeGenericScriptElement(expression,
type);
2663 if (hasExpression) {
2664 if (scriptNodeStack.
isEmpty() || scriptNodeStack.
last().isList()) {
2668 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2669 removeCurrentScriptNode({});
2677 return m_enableScriptExpressions;
2682 if (!m_enableScriptExpressions)
2690 pushScriptElement(current);
2695 return m_enableScriptExpressions;
2700 if (!m_enableScriptExpressions)
2708 pushScriptElement(current);
2713 return m_enableScriptExpressions;
2718 if (!m_enableScriptExpressions)
2726 pushScriptElement(current);
2731 return m_enableScriptExpressions;
2736 if (!m_enableScriptExpressions)
2744 pushScriptElement(current);
2749 return m_enableScriptExpressions;
2754 if (!m_enableScriptExpressions)
2762 pushScriptElement(current);
2767 return m_enableScriptExpressions;
2772 if (!m_enableScriptExpressions)
2780 pushScriptElement(current);
2785 return m_enableScriptExpressions;
2790 if (!m_enableScriptExpressions)
2798 pushScriptElement(current);
2803 return m_enableScriptExpressions;
2808 if (!m_enableScriptExpressions)
2816 pushScriptElement(current);
2821 return m_enableScriptExpressions;
2826 if (!m_enableScriptExpressions)
2834 pushScriptElement(current);
2839 return m_enableScriptExpressions;
2844 if (!m_enableScriptExpressions)
2852 pushScriptElement(current);
2857 return m_enableScriptExpressions;
2862 if (!m_enableScriptExpressions)
2867 pushScriptElement(current);
2872 return m_enableScriptExpressions;
2877 if (!m_enableScriptExpressions)
2886 current->insertChild(Fields::expression, currentScriptNodeEl().takeVariant());
2887 removeCurrentScriptNode({});
2890 pushScriptElement(current);
2895 return m_enableScriptExpressions;
2900 if (!m_enableScriptExpressions)
2908 pushScriptElement(current);
2913 auto top = qmlFile.
top();
2918 if (!domEnvironment) {
2921 return domEnvironment;
2927 return env->qmldirFiles();
2938 m_importer(importer),
2940 m_logger->
fileName(), m_importer->resourceFileMapper())),
2941 m_scopeCreator(m_root, m_importer, m_logger, m_implicitImportDirectory,
2943 m_domCreator(qmlFile)
2948 bool QQmlDomAstCreatorWithQQmlJSScope::visit(name *node) \
2950 return visitT(node); \
2952 void QQmlDomAstCreatorWithQQmlJSScope::endVisit(name *node) \
2959void QQmlDomAstCreatorWithQQmlJSScope::setScopeInDomAfterEndvisit()
2962 if (!m_domCreator.scriptNodeStack.
isEmpty()) {
2963 auto topOfStack = m_domCreator.currentScriptNodeEl();
2964 switch (topOfStack.kind) {
2971 m_domCreator.currentScriptNodeEl().setSemanticScope(scope);
2977 }
else if (!m_domCreator.nodeStack.isEmpty()) {
2979 [&scope](
auto &&e) {
2980 using U = std::remove_cv_t<std::remove_reference_t<
decltype(e)>>;
2982 if constexpr (std::is_same_v<U, QmlObject>) {
2983 e.setSemanticScope(scope);
2984 }
else if constexpr (std::is_same_v<U, QmlComponent>) {
2985 e.setSemanticScope(scope);
2986 }
else if constexpr (std::is_same_v<U, MethodInfo>) {
2988 if (
auto scriptElement = e.body->scriptElement()) {
2989 scriptElement.base()->setSemanticScope(scope);
2992 e.setSemanticScope(scope);
2995 m_domCreator.currentNodeEl().item.value);
2999void QQmlDomAstCreatorWithQQmlJSScope::setScopeInDomBeforeEndvisit()
3005 if (m_domCreator.nodeStack.size() > 1
3008 [&scope](
auto &&e) {
3009 using U = std::remove_cv_t<std::remove_reference_t<
decltype(e)>>;
3010 if constexpr (std::is_same_v<U, PropertyDefinition>) {
3023 m_domCreator.currentNodeEl(1).item.value);
3025 if (m_domCreator.nodeStack.size() > 0) {
3027 [&scope](
auto &&e) {
3028 using U = std::remove_cv_t<std::remove_reference_t<
decltype(e)>>;
3029 if constexpr (std::is_same_v<U, PropertyDefinition>) {
3030 e.setSemanticScope(scope);
3032 }
else if constexpr (std::is_same_v<U, MethodInfo>) {
3034 e.setSemanticScope(scope);
3038 m_domCreator.currentNodeEl().item.value);
3049#undef Q_SCRIPTELEMENT_DISABLE
3050#undef Q_SCRIPTELEMENT_EXIT_IF
QString canonicalPath() const
Returns the canonical path, i.e.
QDir dir() const
Returns a QDir object representing the path of the parent directory of the file system entry that thi...
qsizetype size() const noexcept
bool isEmpty() const noexcept
bool empty() const noexcept
void removeLast() noexcept
QQmlJSScope::Ptr m_currentScope
QQmlJSScope::Ptr parentScope()
ScopeType scopeType() const
SourceLocation lbracketToken
ExpressionNode * expression
StatementList * statements
SourceLocation identifierToken
SourceLocation breakToken
SourceLocation colonToken
SourceLocation questionToken
ExpressionNode * expression
SourceLocation identifierToken
SourceLocation continueToken
SourceLocation deleteToken
ExpressionNode * expression
SourceLocation semicolonToken
SourceLocation identifierToken
SourceLocation identifierToken
SourceLocation colonToken
SourceLocation rparenToken
SourceLocation lparenToken
ExpressionNode * expression
void accept(BaseVisitor *visitor)
ExpressionNode * expression
SourceLocation decrementToken
SourceLocation incrementToken
SourceLocation decrementToken
ExpressionNode * expression
ExpressionNode * expression
SourceLocation incrementToken
ExpressionNode * expression
SourceLocation throwToken
SourceLocation tildeToken
ExpressionNode * expression
Finally * finallyExpression
ExpressionNode * expression
SourceLocation typeofToken
SourceLocation firstSourceLocation() const override
SourceLocation lastSourceLocation() const override
ExpressionNode * expression
SourceLocation minusToken
ExpressionNode * expression
SourceLocation declarationKindToken
VariableDeclarationList * declarations
ExpressionNode * expression
Path pathFromOwner(const DomItem &self) const override
Represents a consistent set of types organized in modules, it is the top level of the DOM.
function< void(const Path &, const DomItem &, const DomItem &)> Callback
void setName(const QString &name)
Represents a set of tags grouping a set of related error messages.
static void addRegion(const Tree &fLoc, FileLocationRegion region, SourceLocation loc)
std::shared_ptr< AttachedInfoT< FileLocations > > Tree
static Tree ensure(const Tree &base, const Path &basePath, AttachedInfo::PathType pType=AttachedInfo::PathType::Relative)
static FileToLoad fromFileSystem(const std::weak_ptr< DomEnvironment > &environment, const QString &canonicalPath)
std::shared_ptr< T > ownerAs() const
MutableDomItem environment()
Path canonicalPath() const
QString canonicalFilePath() const
void addError(ErrorMessage &&msg)
MutableDomItem path(const Path &p)
index_type headIndex(index_type defaultValue=-1) const
Path field(const QString &name) const
Path path(const Path &toAdd, bool avoidToAddAsBase=false) const
Path mid(int offset, int length) const
static Path Field(QStringView s=u"")
Path index(index_type i) const
virtual QQmlJSASTClassListToVisit void throwRecursionDepthError() override
QQmlDomAstCreatorWithQQmlJSScope(const QQmlJSScope::Ptr ¤t, MutableDomItem &qmlFile, QQmlJSLogger *logger, QQmlJSImporter *importer)
void endVisit(AST::UiProgram *) override
void endVisitHelper(AST::PatternElement *pe, const std::shared_ptr< ScriptElements::GenericScriptElement > &element)
QQmlDomAstCreator(const MutableDomItem &qmlFile)
bool visit(AST::UiProgram *program) override
void throwRecursionDepthError() override
void loadAnnotations(AST::UiObjectMember *el)
A QmlFile, when loaded in a DomEnvironment that has the DomCreationOption::WithSemanticAnalysis,...
void setName(const QString &name)
void setIdStr(const QString &id)
Path addPrototypePath(const Path &prototypePath)
static QmlUri fromDirectoryString(const QString &importStr)
Use this to contain any script element.
static ScriptElementVariant fromElement(const T &element)
static constexpr qint32 Latest
\inmodule QtCore \reentrant
static QString anchoredPattern(const QString &expression)
iterator find(const T &value)
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
QString toString() const
Returns a deep copy of this string view's data as a QString.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString mid(qsizetype position, qsizetype n=-1) const &
void * data()
Returns a pointer to the contained object as a generic void* that can be written to.
QMap< QString, QString > map
[6]
QSet< QString >::iterator it
Path lookupTypePath(const QString &name)
static ScriptElementVariant fieldMemberExpressionForQualifiedId(const AST::UiQualifiedId *qualifiedId)
static ScriptElementVariant wrapIntoFieldMemberExpression(const ScriptElementVariant &left, const SourceLocation &dotToken, const ScriptElementVariant &right)
static const DomEnvironment * environmentFrom(MutableDomItem &qmlFile)
static ErrorGroups astParseErrors()
V * valueFromMultimap(QMultiMap< K, V > &mmap, const K &key, index_type idx)
QMLDOM_EXPORT QString domTypeToString(DomType k)
static QString toString(const UiQualifiedId *qualifiedId, QChar delimiter=QLatin1Char('.'))
@ FirstSemicolonTokenRegion
@ QuestionMarkTokenRegion
@ ScriptVariableDeclarationEntry
@ ScriptContinueStatement
@ ScriptLabelledStatement
@ ScriptParenthesizedExpression
@ ScriptConditionalExpression
@ ScriptTryCatchStatement
@ ScriptVariableDeclaration
static QStringList qmldirFilesFrom(MutableDomItem &qmlFile)
static void setFormalParameterKind(ScriptElementVariant &variant)
static QString typeToString(AST::Type *t)
SourceLocation combineLocations(SourceLocation s1, SourceLocation s2)
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLdouble GLdouble GLdouble GLdouble top
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * label
[43]
GLenum const GLint * param
GLsizei const GLchar *const * path
static qreal component(const QPointF &point, unsigned int i)
#define Q_SCRIPTELEMENT_EXIT_IF(check)
#define Q_SCRIPTELEMENT_DISABLE()
#define NewErrorGroup(name)
#define QQmlJSASTClassListToVisit
QDebug warning(QAnyStringView fileName, int lineNumber)
#define Q_ASSERT_X(cond, x, msg)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
\inmodule QtCore \reentrant