aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-10 14:51:00 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-17 08:10:07 +0100
commit4005c0e29cea1bbcb35c480866418ba01f019756 (patch)
tree80dcf657f787f40bb60be56d7bc4cd90ef749c70 /src/qml
parent97c21311a1de5bca7b97a0a1ae81bb651afa41c8 (diff)
[new compiler] Initial support for QQuick state changes
This requires the use of the customer parser together with lazy binding compilation Change-Id: I45d8a206267d3e0c807771a79645168254be9c95 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4compileddata_p.h2
-rw-r--r--src/qml/qml/qqmlcustomparser.cpp14
-rw-r--r--src/qml/qml/qqmlcustomparser_p.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index c069111b91..3bffc5c8ef 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -264,7 +264,7 @@ struct Function
// Qml data structures
-struct Binding
+struct Q_QML_EXPORT Binding
{
quint32 propertyNameIndex;
diff --git a/src/qml/qml/qqmlcustomparser.cpp b/src/qml/qml/qqmlcustomparser.cpp
index 0cc62fb988..3f8fc967f4 100644
--- a/src/qml/qml/qqmlcustomparser.cpp
+++ b/src/qml/qml/qqmlcustomparser.cpp
@@ -298,6 +298,20 @@ void QQmlCustomParser::error(const QV4::CompiledData::Binding *binding, const QS
}
/*!
+ Reports an error in parsing \a object, with the given \a description.
+
+ An error is generated referring to the position of \a object in the source file.
+*/
+void QQmlCustomParser::error(const QV4::CompiledData::Object *object, const QString &description)
+{
+ QQmlError error;
+ error.setLine(object->location.line);
+ error.setColumn(object->location.column);
+ error.setDescription(description);
+ exceptions << error;
+}
+
+/*!
If \a script is a simple enumeration expression (eg. Text.AlignLeft),
returns the integer equivalent (eg. 1), and sets \a ok to true.
diff --git a/src/qml/qml/qqmlcustomparser_p.h b/src/qml/qml/qqmlcustomparser_p.h
index 3004b0f50c..39afa2a28e 100644
--- a/src/qml/qml/qqmlcustomparser_p.h
+++ b/src/qml/qml/qqmlcustomparser_p.h
@@ -136,6 +136,7 @@ protected:
void error(const QQmlCustomParserProperty&, const QString& description);
void error(const QQmlCustomParserNode&, const QString& description);
void error(const QV4::CompiledData::Binding *binding, const QString& description);
+ void error(const QV4::CompiledData::Object *object, const QString& description);
int evaluateEnum(const QByteArray&, bool *ok) const;