From d0afc14f19509ba0d870c10d989151827c9bff57 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 15 Feb 2015 20:58:52 +0100 Subject: Domains an Typesystems can also be declared inline --- src/core/parser/stack/DomainHandler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/parser/stack/DomainHandler.cpp') 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 = 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 = scope().select(); + 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; } -- cgit v1.2.3