diff options
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlcustomparser.cpp | 14 | ||||
-rw-r--r-- | src/qml/qml/qqmlcustomparser_p.h | 1 |
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; |