Clean up JS .import/.pragma directive scanning
authorSimon Hausmann <simon.hausmann@theqtcompany.com>
Fri, 5 Dec 2014 15:32:56 +0000 (16:32 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Thu, 8 Jan 2015 21:08:19 +0000 (22:08 +0100)
commit9d7b27f5bf44a46707e6d50ebf51ecf73f91dd1b
tree69ec84f34655b892c8bc855aa9a378a4bb2716fa
parentbede2a3ac794120be65fa50bfbc8ed04082c10e0
Clean up JS .import/.pragma directive scanning

There's a scanner in QQmlJS::Lexer::scanDirectives that can parse those, so
let's get rid of extra parser that operates on a string. Instead this way we
can do the scanning all in one shot, avoid detaching a copy of the source code
string and (most importantly) bring the parser closer to the copy in Qt
Creator, which uses the directives approach to extract imports and pragma.

Change-Id: Iff6eb8d91a45d8a70f383f953115692be48259de
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
14 files changed:
src/qml/compiler/qqmlirbuilder.cpp
src/qml/compiler/qqmlirbuilder_p.h
src/qml/jsruntime/qv4script.cpp
src/qml/jsruntime/qv4script_p.h
src/qml/parser/qqmljsengine_p.cpp
src/qml/parser/qqmljsengine_p.h
src/qml/parser/qqmljslexer.cpp
src/qml/parser/qqmljslexer_p.h
src/qml/parser/qqmljsparser.cpp
src/qml/qml/qqmltypeloader.cpp
tests/auto/qml/qmlmin/tst_qmlmin.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
tools/qmlimportscanner/main.cpp
tools/qmlmin/main.cpp