diff options
author | mae <qt-info@nokia.com> | 2009-04-20 14:17:16 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-04-24 07:52:37 (GMT) |
commit | 624cd6b978b2dbd7e26702b2a8a8bb73fbd30267 (patch) | |
tree | 3080e29ad921b061c08ec7c80b8094ead84b8169 /src | |
parent | 44a82378d05bc54224f7ff0e276c084aeab6e548 (diff) | |
download | Qt-624cd6b978b2dbd7e26702b2a8a8bb73fbd30267.zip Qt-624cd6b978b2dbd7e26702b2a8a8bb73fbd30267.tar.gz Qt-624cd6b978b2dbd7e26702b2a8a8bb73fbd30267.tar.bz2 |
make arrays work, these visitors are ***** awesome
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index e7e54ef..01bdeac 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -254,6 +254,9 @@ bool ProcessAST::visit(AST::UiPublicMember *node) qWarning() << "bad public identifier" << type; // ### FIXME } + + // ### TODO drop initializer (unless some example needs differnet properties than name and type and value. + return false; } @@ -361,7 +364,18 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) // UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiObjectMemberList T_RBRACKET ; bool ProcessAST::visit(AST::UiArrayBinding *node) { - qWarning() << Q_FUNC_INFO << "not implemented"; + QString propertyName = asString(node->qualifiedId); + const QStringList str = propertyName.split(QLatin1Char('.'), QString::SkipEmptyParts); + for(int ii = 0; ii < str.count(); ++ii) { + const QString s = str.at(ii); + _stateStack.pushProperty(s, node->colonToken.startLine); + } + + accept(node->members); + + for(int ii = str.count() - 1; ii >= 0; --ii) + _stateStack.pop(); + return false; } |