diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-27 01:39:19 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-27 01:39:19 +0100 |
commit | 84f0004cdf45f6fbad6461676897aa27f03cbb93 (patch) | |
tree | acb15536b40d7389c3c65df1567084bb57da416e /src/plugins/xml/XmlParser.cpp | |
parent | 495e2de57e587450e9532c7fe4ae0c2bfb196e6c (diff) |
Removed dependency between "Project" model class and parser/resources. This reduces coupling and was stupid beforehand.
Diffstat (limited to 'src/plugins/xml/XmlParser.cpp')
-rw-r--r-- | src/plugins/xml/XmlParser.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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> 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> typesystem = scope().getLeaf().cast<Typesystem>(); Rooted<StructType> 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> structType = scope().getLeaf().cast<StructType>(); Rooted<Attribute> attribute = structType->createAttribute(name, defaultValue, optional, logger()); + attribute->setLocation(location()); // Try to resolve the type scope().resolve<Type>( |