}
/*!
- Reports an error in parsing \a binding, with the given \a description.
-
- An error is generated referring to the position of \a node in the source file.
-*/
-void QQmlCustomParser::error(const QV4::CompiledData::Binding *binding, const QString &description)
-{
- QQmlError error;
- error.setLine(binding->location.line);
- error.setColumn(binding->location.column);
- error.setDescription(description);
- exceptions << error;
-}
-
-/*!
- Reports an error in parsing \a object, with the given \a description.
+ Reports an error with the given \a description.
- An error is generated referring to the position of \a object in the source file.
+ An error is generated referring to the \a location in the source file.
*/
-void QQmlCustomParser::error(const QV4::CompiledData::Object *object, const QString &description)
+void QQmlCustomParser::error(const CompiledData::Location &location, const QString &description)
{
QQmlError error;
- error.setLine(object->location.line);
- error.setColumn(object->location.column);
+ error.setLine(location.line);
+ error.setColumn(location.column);
error.setDescription(description);
exceptions << error;
}
void error(const QString& description);
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);
+ void error(const QV4::CompiledData::Binding *binding, const QString& description)
+ { error(binding->location, description); }
+ void error(const QV4::CompiledData::Object *object, const QString& description)
+ { error(object->location, description); }
+ void error(const QV4::CompiledData::Location &location, const QString& description);
int evaluateEnum(const QByteArray&, bool *ok) const;
}
if (!qmlUnit->header.stringAt(target->idIndex).isEmpty()) {
- error(binding, QQmlListModel::tr("ListElement: cannot use reserved \"id\" property"));
+ error(target->locationOfIdProperty, QQmlListModel::tr("ListElement: cannot use reserved \"id\" property"));
return false;
}