output->types.at(obj->type);
obj->metatype = tr.metaObject();
- if (tr.component)
- obj->url = tr.component->url;
if (tr.type)
obj->typeName = tr.type->qmlTypeName();
obj->className = tr.className;
defaultProperty->isDefault = true;
defaultProperty->location = obj->defaultProperty->location;
defaultProperty->listValueRange = obj->defaultProperty->listValueRange;
- defaultProperty->listCommaPositions = obj->defaultProperty->listCommaPositions;
defaultProperty->values = obj->defaultProperty->values;
defaultProperty->values += explicitProperty->values;
using namespace QDeclarativeParser;
QDeclarativeParser::Object::Object()
-: type(-1), majorVersion(-1), minorVersion(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1)
+: type(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1)
{
}
/*
XXX
- These types are created (and owned) by the QDeclarativeXmlParser and consumed by the
+ These types are created (and owned) by the QDeclarativeScriptParser and consumed by the
QDeclarativeCompiler. During the compilation phase the compiler will update some of
- the fields for both its own use and for the use of the upcoming QDeclarativeDom API.
+ the fields for its own use.
The types are part of the generic sounding "QDeclarativeParser" namespace for legacy
reasons (there used to be more in this namespace) and will be cleaned up and
- migrated into a more appropriate location shortly.
+ migrated into a more appropriate location eventually.
*/
namespace QDeclarativeParser
{
// QDeclarativeCompiledData::types array, or -1 if the object is a property
// group.
int type;
- // The url of this object if it is an external type. Used by the DOM
- QUrl url;
-
- // version information if type is defined in library or C++
- int majorVersion;
- int minorVersion;
// The fully-qualified name of this type
QByteArray typeName;
LocationSpan location;
LocationRange listValueRange;
- QList<int> listCommaPositions;
};
}
return false;
}
-static QList<int> collectCommas(AST::UiArrayMemberList *members)
-{
- QList<int> commas;
-
- if (members) {
- for (AST::UiArrayMemberList *it = members->next; it; it = it->next) {
- commas.append(it->commaToken.offset);
- }
- }
-
- return commas;
-}
-
// UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
bool ProcessAST::visit(AST::UiArrayBinding *node)
{
prop->listValueRange.offset = node->lbracketToken.offset;
prop->listValueRange.length = node->rbracketToken.offset + node->rbracketToken.length - node->lbracketToken.offset;
- // Store the positions of the comma token too, again for the DOM to be able to retrieve it.
- prop->listCommaPositions = collectCommas(node->members);
-
while (propertyCount--)
_stateStack.pop();
if (ref.type) {
ref.majorVersion = majorVersion;
ref.minorVersion = minorVersion;
- foreach (QDeclarativeParser::Object *obj, parserRef->refObjects) {
- // store namespace for DOM
- obj->majorVersion = majorVersion;
- obj->minorVersion = minorVersion;
- }
} else {
ref.typeData = typeLoader()->get(url);
addDependency(ref.typeData);