summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlscriptparser.cpp
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-04-20 15:54:26 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2009-04-24 07:52:38 (GMT)
commit411808e3020e4563e5c2e0bcf6ebf2a6b633a8c4 (patch)
treec71dc8e9478fa5f4ec853924930095a67d2b5cf7 /src/declarative/qml/qmlscriptparser.cpp
parentca1dde886a5613e7f298927d8c1cd61f7fd05b28 (diff)
downloadQt-411808e3020e4563e5c2e0bcf6ebf2a6b633a8c4.zip
Qt-411808e3020e4563e5c2e0bcf6ebf2a6b633a8c4.tar.gz
Qt-411808e3020e4563e5c2e0bcf6ebf2a6b633a8c4.tar.bz2
support comma for lists, better parser error output
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 8167c24..ddd473a 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -389,7 +389,9 @@ bool ProcessAST::visit(AST::UiScriptBinding *node)
primitive = getPrimitive(prop->name, stmt->expression);
} else {
+ out << '{';
pp(node->statement);
+ out << '}';
}
Value *v = new Value;
@@ -425,7 +427,7 @@ bool ProcessAST::visit(AST::UiArrayBinding *node)
QmlScriptParser::QmlScriptParser()
- : root(0)
+ : root(0), _errorLine(-1)
{
}
@@ -450,6 +452,7 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url)
if (! parser.parse(&driver)) {
_error = parser.errorMessage();
+ _errorLine = parser.errorLineNumber();
return false;
}
@@ -464,6 +467,11 @@ QString QmlScriptParser::errorDescription() const
return _error;
}
+int QmlScriptParser::errorLine() const
+{
+ return _errorLine;
+}
+
QMap<QString,QString> QmlScriptParser::nameSpacePaths() const
{
qWarning() << Q_FUNC_INFO << "not implemented";