summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlscriptparser.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-07-09 07:25:16 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-07-09 07:25:16 (GMT)
commit8a6e5d5c95a8ae586c8fc2fa63be0228c4cefb53 (patch)
tree92326e96d070ac6c437f7b3cd8d6ac906b2b7656 /src/declarative/qml/qmlscriptparser.cpp
parent6c901f67fb2f2e73fa362e72d985a04fa57cdf48 (diff)
downloadQt-8a6e5d5c95a8ae586c8fc2fa63be0228c4cefb53.zip
Qt-8a6e5d5c95a8ae586c8fc2fa63be0228c4cefb53.tar.gz
Qt-8a6e5d5c95a8ae586c8fc2fa63be0228c4cefb53.tar.bz2
Expand input keyword to include "as" support
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 82f6a60..d1ad540 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -462,15 +462,26 @@ bool ProcessAST::visit(AST::UiProgram *node)
// UiImport: T_IMPORT T_STRING_LITERAL ;
bool ProcessAST::visit(AST::UiImport *node)
{
- QString fileName = node->fileName->asString();
- _parser->addNamespacePath(fileName);
+ QString uri;
+ QmlScriptParser::Import import;
+
+ if (node->fileName) {
+ import.type = QmlScriptParser::Import::File;
+ uri = node->fileName->asString();
+ _parser->addNamespacePath(uri);
+ } else {
+ import.type = QmlScriptParser::Import::Library;
+ uri = asString(node->importUri);
+ }
AST::SourceLocation startLoc = node->importToken;
AST::SourceLocation endLoc = node->semicolonToken;
- QmlScriptParser::Import import;
+ if (node->importId)
+ import.as = node->importId->asString();
+
import.location = location(startLoc, endLoc);
- import.uri = fileName;
+ import.uri = uri;
_parser->_imports << import;