From 6d4c3c7fe561d472b34bfed1ab9d3665cee1f659 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 6 May 2009 22:49:47 +1000 Subject: Add an (unused) locations field to compiled data --- src/declarative/qml/qmlcompiler.cpp | 16 ++++++++++++++++ src/declarative/qml/qmlcompiler_p.h | 11 +++++------ src/declarative/qml/qmlparser_p.h | 4 +--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 8eb5fa1..13fc332 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -136,6 +136,22 @@ int QmlCompiledData::indexForInt(int *data, int count) return idx; } +int QmlCompiledData::indexForLocation(const QmlParser::Location &l) +{ + // ### FIXME + int rv = locations.count(); + locations << l; + return rv; +} + +int QmlCompiledData::indexForLocation(const QmlParser::LocationSpan &l) +{ + // ### FIXME + int rv = locations.count(); + locations << l.start << l.end; + return rv; +} + QmlCompiler::QmlCompiler() : exceptionLine(-1), exceptionColumn(-1), output(0) { diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index e2b8388..b885e7b 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -48,6 +48,8 @@ #include #include #include +#include + class QStringList; QT_BEGIN_NAMESPACE @@ -56,12 +58,6 @@ class QmlComponent; class QmlCompiledComponent; class QmlContext; -namespace QmlParser { - class Object; - class Property; - class Value; -}; - class QmlCompiledData { public: @@ -98,6 +94,7 @@ public: QList customTypeData; QList datas; QList mos; + QList locations; QList bytecode; private: @@ -106,6 +103,8 @@ private: int indexForByteArray(const QByteArray &); int indexForFloat(float *, int); int indexForInt(int *, int); + int indexForLocation(const QmlParser::Location &); + int indexForLocation(const QmlParser::LocationSpan &); }; class Q_DECLARATIVE_EXPORT QmlCompiler diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 5910705..31f8702 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -45,10 +45,8 @@ #include #include #include -#include "qmlcomponent_p.h" #include -#include "qmlcompiledcomponent_p.h" - +#include QT_BEGIN_HEADER -- cgit v0.12