aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmlirbuilder_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-18 18:21:18 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-19 08:32:33 +0100
commit89218c6d0eeec66025c62bb2e063ea067426445a (patch)
tree1a56c5da6120b9b9176e4d519440604c5336cbdb /src/qml/compiler/qqmlirbuilder_p.h
parentc33a79f0a0de8f01b3a43335778e246e1f02598e (diff)
Clean up script imports
Move the .pragma and .import script extraction out of qqmlscript and into qqmlirbuilder, where it can populate a QQmlIR::Document. Changed the script part of the type loader to use that, which also allowed eliminating the m_source member and m_metaData. Change-Id: Icc64d219fff5666679a02e6afda73f7edfca132b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder_p.h')
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index f40799436e..2f398eb008 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -305,6 +305,7 @@ struct Q_QML_EXPORT Document
Document(bool debugMode)
: jsModule(debugMode)
, jsGenerator(&jsModule, sizeof(QV4::CompiledData::QmlUnit))
+ , unitFlags(0)
{}
QString code;
QQmlJS::Engine jsParserEngine;
@@ -315,10 +316,14 @@ struct Q_QML_EXPORT Document
int indexOfRootObject;
QList<Object*> objects;
QV4::Compiler::JSUnitGenerator jsGenerator;
+ quint32 unitFlags;
QV4::CompiledData::TypeReferenceMap typeReferences;
+ int registerString(const QString &str) { return jsGenerator.registerString(str); }
QString stringAt(int index) const { return jsGenerator.strings.value(index); }
+
+ void extractScriptMetaData(QString &script, QQmlError *error);
};
struct Q_QML_EXPORT IRBuilder : public QQmlJS::AST::Visitor