diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-06-04 13:35:22 (GMT) |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-06-04 13:35:22 (GMT) |
commit | 30971fa4ffaeb4c2a3a1267cca73311fb9834241 (patch) | |
tree | 0c92a4f4add811e6b0b9f1cf6f736400a17d9542 /src/declarative/qml/qmlscriptparser.cpp | |
parent | a800e1d5e7fa69a3bfa21d74c5db47f5a41ed65c (diff) | |
download | Qt-30971fa4ffaeb4c2a3a1267cca73311fb9834241.zip Qt-30971fa4ffaeb4c2a3a1267cca73311fb9834241.tar.gz Qt-30971fa4ffaeb4c2a3a1267cca73311fb9834241.tar.bz2 |
Added offsets of automatically inserted semicolons to the DOM and the
QML script parser.
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 31a20be..5207292 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -178,6 +178,8 @@ protected: virtual bool visit(AST::UiArrayBinding *node); virtual bool visit(AST::UiSourceElement *node); + virtual bool visit(AST::ExpressionStatement *node); + void accept(AST::Node *node); QString asString(AST::UiQualifiedId *node) const; @@ -638,6 +640,14 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) return true; } +bool ProcessAST::visit(AST::ExpressionStatement *node) +{ + if (!node->semicolonToken.isValid()) + _parser->addAutomaticSemicolonOffset(node->semicolonToken.offset); + + return true; +} + // UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; bool ProcessAST::visit(AST::UiArrayBinding *node) { @@ -825,6 +835,7 @@ void QmlScriptParser::clear() _nameSpacePaths.clear(); _typeNames.clear(); _errors.clear(); + _automaticSemicolonOffsets.clear(); if (data) { delete data; |