qmljs: use new qml parser

adds support for singleton and getter/setter properties

Change-Id: Ia6691ac7799a46885db0df44617617dcc3c13189
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Fawzi Mohamed
2013-11-06 14:17:23 +01:00
parent 0374d83e83
commit e9c97aa1d1
35 changed files with 2420 additions and 1675 deletions

View File

@@ -100,8 +100,9 @@ bool JsonCheck::visit(ObjectLiteral *ast)
return false;
QSet<QString> propertiesFound;
for (PropertyNameAndValueList *it = ast->properties; it; it = it->next) {
StringLiteralPropertyName *literalName = cast<StringLiteralPropertyName *>(it->name);
for (PropertyAssignmentList *it = ast->properties; it; it = it->next) {
PropertyNameAndValue *assignment = AST::cast<AST::PropertyNameAndValue *>(it->assignment);
StringLiteralPropertyName *literalName = cast<StringLiteralPropertyName *>(assignment->name);
if (literalName) {
const QString &propertyName = literalName->id.toString();
if (m_schema->hasPropertySchema(propertyName)) {
@@ -109,7 +110,7 @@ bool JsonCheck::visit(ObjectLiteral *ast)
propertiesFound.insert(propertyName);
// Sec. 5.2: "... each property definition's value MUST be a schema..."
m_schema->enterNestedPropertySchema(propertyName);
processSchema(it->value);
processSchema(assignment->value);
m_schema->leaveNestedSchema();
} else {
analysis()->m_messages.append(Message(ErrInvalidPropertyName,
@@ -119,7 +120,7 @@ bool JsonCheck::visit(ObjectLiteral *ast)
}
} else {
analysis()->m_messages.append(Message(ErrStringValueExpected,
it->name->firstSourceLocation(),
assignment->name->firstSourceLocation(),
QString(), QString(),
false));
}