diff options
Diffstat (limited to 'src/core/parser/stack/DomainHandler.cpp')
-rw-r--r-- | src/core/parser/stack/DomainHandler.cpp | 10 |
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; } |