summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/parser
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2009-07-27 14:11:40 (GMT)
committerErik Verbruggen <erik.verbruggen@nokia.com>2009-07-27 14:11:40 (GMT)
commitee3c71df7b0a091b078b9b6cbdf60d8f79d95913 (patch)
treeaed0428348c47548c7cd2bdc6019fab82fd5f33e /src/declarative/qml/parser
parent10c75fb244f57b7caaf72cd570883e8c8bb5da7d (diff)
downloadQt-ee3c71df7b0a091b078b9b6cbdf60d8f79d95913.zip
Qt-ee3c71df7b0a091b078b9b6cbdf60d8f79d95913.tar.gz
Qt-ee3c71df7b0a091b078b9b6cbdf60d8f79d95913.tar.bz2
Added utility methods firstSourceLocation/lastSourceLocation methods to
UiImport and UiImportList.
Diffstat (limited to 'src/declarative/qml/parser')
-rw-r--r--src/declarative/qml/parser/qmljsast_p.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/declarative/qml/parser/qmljsast_p.h b/src/declarative/qml/parser/qmljsast_p.h
index 9745153..ee2f472 100644
--- a/src/declarative/qml/parser/qmljsast_p.h
+++ b/src/declarative/qml/parser/qmljsast_p.h
@@ -2291,6 +2291,12 @@ public:
: fileName(0), importUri(uri), importId(0)
{ kind = K; }
+ virtual SourceLocation firstSourceLocation() const
+ { return importToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
virtual void accept0(Visitor *visitor);
// attributes
@@ -2323,6 +2329,21 @@ public:
previous->next = this;
}
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (import) return import->firstSourceLocation();
+ else return SourceLocation();
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ for (const UiImportList *it = this; it; it = it->next)
+ if (!it->next && it->import)
+ return it->import->lastSourceLocation();
+
+ return SourceLocation();
+ }
+
UiImportList *finish()
{
UiImportList *head = next;