summaryrefslogtreecommitdiff
path: root/src/core/parser/stack/DomainHandler.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-15 20:58:52 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-15 20:58:52 +0100
commitd0afc14f19509ba0d870c10d989151827c9bff57 (patch)
tree51020b0443afd4c813521a157ed59556a6fa8533 /src/core/parser/stack/DomainHandler.cpp
parentc298f00ef1633a663775fe9a715a249b9f4d255d (diff)
Domains an Typesystems can also be declared inline
Diffstat (limited to 'src/core/parser/stack/DomainHandler.cpp')
-rw-r--r--src/core/parser/stack/DomainHandler.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/parser/stack/DomainHandler.cpp b/src/core/parser/stack/DomainHandler.cpp
index 24a6f1a..a2c8eec 100644
--- a/src/core/parser/stack/DomainHandler.cpp
+++ b/src/core/parser/stack/DomainHandler.cpp
@@ -35,11 +35,21 @@ namespace parser_stack {
bool DomainHandler::start(Variant::mapType &args)
{
+ // Create the Domain node
Rooted<Domain> domain =
context().getProject()->createDomain(args["name"].asString());
domain->setLocation(location());
+ // If the domain is defined inside a document, add the reference to the
+ // document
+ Rooted<Document> document = scope().select<Document>();
+ if (document != nullptr) {
+ document->reference(domain);
+ }
+
+ // Push the typesystem onto the scope, set the POST_HEAD flag to true
scope().push(domain);
+ scope().setFlag(ParserFlag::POST_HEAD, false);
return true;
}