From 3ad6d09b82f9b3c4118b3264b1a013384c81e3c2 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Thu, 9 Apr 2015 11:33:34 +0200 Subject: added test for empty explicit fields, which currently fails. --- src/core/parser/ParserScope.cpp | 4 ++-- src/core/parser/stack/DocumentHandler.cpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/parser/ParserScope.cpp b/src/core/parser/ParserScope.cpp index c46dc51..e5bf6f6 100644 --- a/src/core/parser/ParserScope.cpp +++ b/src/core/parser/ParserScope.cpp @@ -174,12 +174,12 @@ ParserScope::ParserScope() : topLevelDepth(0) {} bool ParserScope::checkUnwound(Logger &logger) const { - if (nodes.size() != topLevelDepth) { + if (nodes.size() > topLevelDepth) { logger.error("Not all open elements have been closed!", SourceLocation{}, MessageMode::NO_CONTEXT); logger.note("Still open elements are: ", SourceLocation{}, MessageMode::NO_CONTEXT); - for (size_t i = topLevelDepth + 1; i < nodes.size(); i++) { + for (size_t i = topLevelDepth; i < nodes.size(); i++) { logger.note(std::string("Element of interal type ") + nodes[i]->type()->name + std::string(" defined here:"), diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp index 3e85f72..ce6267f 100644 --- a/src/core/parser/stack/DocumentHandler.cpp +++ b/src/core/parser/stack/DocumentHandler.cpp @@ -334,7 +334,6 @@ bool DocumentChildHandler::startCommand(Variant::mapType &args) } // Otherwise create a new StructuredEntity - // TODO: Consider Anchors and AnnotationEntities Rooted strct = scope().resolve( Utils::split(name(), ':'), logger()); if (strct == nullptr) { -- cgit v1.2.3