From be79585f0e81b27ce3dc6b94f1f502ff86dcef68 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 12 Apr 2015 17:34:09 +0200 Subject: Pass "isImplicit" flag to Handler::fieldStart --- src/core/parser/stack/DocumentHandler.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/core/parser/stack/DocumentHandler.cpp') diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp index e6af615..0912eb6 100644 --- a/src/core/parser/stack/DocumentHandler.cpp +++ b/src/core/parser/stack/DocumentHandler.cpp @@ -87,7 +87,9 @@ Rooted DocumentField::getDescriptor() /* DocumentChildHandler */ DocumentChildHandler::DocumentChildHandler(const HandlerData &handlerData) - : Handler(handlerData), isExplicitField(false) + : Handler(handlerData), + isExplicitField(false), + inImplicitDefaultField(false) { // Register all user defined tokens if this has not yet been done if (!scope().getFlag(ParserFlag::POST_USER_DEFINED_TOKEN_REGISTRATION)) { @@ -670,13 +672,15 @@ void DocumentChildHandler::end() } } -bool DocumentChildHandler::fieldStart(bool &isDefault, size_t fieldIdx) +bool DocumentChildHandler::fieldStart(bool &isDefault, bool isImplicit, + size_t fieldIdx) { if (isExplicitField) { // In case of explicit fields we do not want to create another field. isDefault = true; return fieldIdx == 0; } + inImplicitDefaultField = isImplicit; Rooted parentNode = scope().getLeaf(); assert(parentNode->isa(&RttiTypes::StructuredEntity) || @@ -717,6 +721,7 @@ void DocumentChildHandler::fieldEnd() popTokens(); rollbackPath(); } + inImplicitDefaultField = false; } bool DocumentChildHandler::convertData(Handle field, -- cgit v1.2.3