From 84f0004cdf45f6fbad6461676897aa27f03cbb93 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 27 Jan 2015 01:39:19 +0100 Subject: Removed dependency between "Project" model class and parser/resources. This reduces coupling and was stupid beforehand. --- src/plugins/xml/XmlParser.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/plugins/xml/XmlParser.cpp') diff --git a/src/plugins/xml/XmlParser.cpp b/src/plugins/xml/XmlParser.cpp index 3831b3d..bb9d678 100644 --- a/src/plugins/xml/XmlParser.cpp +++ b/src/plugins/xml/XmlParser.cpp @@ -57,13 +57,13 @@ public: void start(Variant::mapType &args) override { - scope().push(project()->createTypesystem(args["name"].asString())); + Rooted typesystem = + project()->createTypesystem(args["name"].asString()); + typesystem->setLocation(location()); + scope().push(typesystem); } - void end() override - { - scope().pop(); - } + void end() override { scope().pop(); } static Handler *create(const HandlerData &handlerData) { @@ -84,6 +84,7 @@ public: // Fetch the current typesystem and create the struct node Rooted typesystem = scope().getLeaf().cast(); Rooted structType = typesystem->createStructType(name); + structType->setLocation(location()); // Try to resolve the parent type and set it as parent structure if (!parent.empty()) { @@ -128,6 +129,7 @@ public: Rooted structType = scope().getLeaf().cast(); Rooted attribute = structType->createAttribute(name, defaultValue, optional, logger()); + attribute->setLocation(location()); // Try to resolve the type scope().resolve( -- cgit v1.2.3