aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcustomparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlcustomparser.cpp')
-rw-r--r--src/qml/qml/qqmlcustomparser.cpp14
1 files changed, 14 insertions, 0 deletions
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.