Commit 909c6124 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Allow 'var' property type.

It's new in Qt 5.

Change-Id: If3e670d42528ca6996ae280d96077ce744d281d9
Reviewed-on: http://codereview.qt-project.org/6121

Reviewed-by: default avatarRoberto Raggi <roberto.raggi@nokia.com>
parent 21f3a69d
......@@ -115,7 +115,8 @@ public:
validBuiltinPropertyNames.insert(QLatin1String("string"));
validBuiltinPropertyNames.insert(QLatin1String("time"));
validBuiltinPropertyNames.insert(QLatin1String("url"));
validBuiltinPropertyNames.insert(QLatin1String("variant"));
validBuiltinPropertyNames.insert(QLatin1String("var"));
validBuiltinPropertyNames.insert(QLatin1String("variant")); // obsolete in Qt 5
validBuiltinPropertyNames.insert(QLatin1String("vector3d"));
validBuiltinPropertyNames.insert(QLatin1String("alias"));
}
......
......@@ -1853,7 +1853,9 @@ bool ASTPropertyReference::getSourceLocation(QString *fileName, int *line, int *
const Value *ASTPropertyReference::value(ReferenceContext *referenceContext) const
{
if (_ast->statement
&& (_ast->memberType.isEmpty() || _ast->memberType == QLatin1String("variant")
&& (_ast->memberType.isEmpty()
|| _ast->memberType == QLatin1String("variant")
|| _ast->memberType == QLatin1String("var")
|| _ast->memberType == QLatin1String("alias"))) {
// Adjust the context for the current location - expensive!
......
......@@ -948,6 +948,6 @@ const Value *ValueOwner::defaultValueForBuiltinType(const QString &name) const
} else if (name == QLatin1String("date")) {
return datePrototype();
}
// ### variant
// ### variant or var
return undefinedValue();
}
......@@ -266,6 +266,8 @@ bool Highlighter::maybeQmlBuiltinType(const QStringRef &text) const
return true;
} else if (ch == QLatin1Char('v') && text == QLatin1String("variant")) {
return true;
} else if (ch == QLatin1Char('v') && text == QLatin1String("var")) {
return true;
} else if (ch == QLatin1Char('v') && text == QLatin1String("vector3d")) {
return true;
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment