aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/jsoncheck.cpp
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2013-11-06 14:17:23 +0100
committerFawzi Mohamed <fawzi.mohamed@digia.com>2013-11-06 17:06:15 +0100
commite9c97aa1d1be46fffa8eecfa64bc4e3c4f1dd7b9 (patch)
tree085edbf2de55fce70b2a3d3474927b6f85315901 /src/libs/qmljs/jsoncheck.cpp
parent0374d83e8362811d0e9b2174d4baf2337d100d4a (diff)
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>
Diffstat (limited to 'src/libs/qmljs/jsoncheck.cpp')
-rw-r--r--src/libs/qmljs/jsoncheck.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libs/qmljs/jsoncheck.cpp b/src/libs/qmljs/jsoncheck.cpp
index c6c455a760..d712b843df 100644
--- a/src/libs/qmljs/jsoncheck.cpp
+++ b/src/libs/qmljs/jsoncheck.cpp
@@ -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));
}