diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-26 00:30:17 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-26 00:30:17 +0100 |
commit | e68c220586dfd1f14283def578c4c4ef109baed4 (patch) | |
tree | 8e197f3957c55cfc56f5b2319b042470bee9d28d | |
parent | 174bab2a00b890495f458a982ecec7342579ea56 (diff) |
Moving code for deferred Resolution and validation to "LINK" mode of Parser -> this causes these operations whenever the top-level scope instance is destroyed, which is the last possible point at which deferred resolution can take place. Validation must come after deferred resolution.
-rw-r--r-- | src/core/resource/ResourceManager.cpp | 8 | ||||
-rw-r--r-- | src/plugins/xml/XmlParser.cpp | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/core/resource/ResourceManager.cpp b/src/core/resource/ResourceManager.cpp index 11d01a7..c7a4104 100644 --- a/src/core/resource/ResourceManager.cpp +++ b/src/core/resource/ResourceManager.cpp @@ -103,6 +103,14 @@ Rooted<Node> ResourceManager::parse(Registry ®istry, ParserContext &ctx, ParserScope scope; // New empty parser scope instance ParserContext childCtx = ctx.clone(scope, sourceId); node = req.getParser()->parse(reader, childCtx); + + // Perform all deferred resolutions + scope.performDeferredResolution(ctx.getLogger()); + + // Validate the parsed node + if (node != nullptr) { + node->validate(ctx.getLogger()); + } break; } case ParseMode::INCLUDE: { diff --git a/src/plugins/xml/XmlParser.cpp b/src/plugins/xml/XmlParser.cpp index 5ab0c90..3831b3d 100644 --- a/src/plugins/xml/XmlParser.cpp +++ b/src/plugins/xml/XmlParser.cpp @@ -62,9 +62,6 @@ public: void end() override { - scope().performDeferredResolution(logger()); - // TODO: Automatically call validate in "pop"? - scope().getLeaf()->validate(logger()); scope().pop(); } |