diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2009-05-08 12:36:51 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2009-05-08 12:47:34 (GMT) |
commit | 7d67d5c24ce3e707c1bb9bc6f181765cccc4090d (patch) | |
tree | a289b9637975c91d74e5df1e85a5d896fe7b90f2 /src/declarative/qml/qmlscriptparser.cpp | |
parent | 79900981848fc4ba812243db83a7456d72ddda15 (diff) | |
download | Qt-7d67d5c24ce3e707c1bb9bc6f181765cccc4090d.zip Qt-7d67d5c24ce3e707c1bb9bc6f181765cccc4090d.tar.gz Qt-7d67d5c24ce3e707c1bb9bc6f181765cccc4090d.tar.bz2 |
Expose import statements in QmlDomDocument
Reviewed-by: erikv
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 4385601..8506933 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -362,6 +362,16 @@ bool ProcessAST::visit(AST::UiImport *node) { QString fileName = node->fileName->asString(); _parser->addNamespacePath(fileName); + + AST::SourceLocation startLoc = node->importToken; + AST::SourceLocation endLoc = node->semicolonToken; + + QmlScriptParser::Import import; + import.location = location(startLoc, endLoc); + import.uri = fileName; + + _parser->_imports << import; + return false; } @@ -686,6 +696,11 @@ Object *QmlScriptParser::tree() const return root; } +QList<QmlScriptParser::Import> QmlScriptParser::imports() const +{ + return _imports; +} + QList<QmlError> QmlScriptParser::errors() const { return _errors; |