summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-04-12 17:39:31 +0200
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:24:16 +0200
commit84ab3caa172fc3f4ec7085135964173c8eed5f84 (patch)
tree32e16768c2d4a4f6771a45f06e3d3fc2b969805e
parent1c8e98853fc65023534cc19c5afdc20901b255f7 (diff)
Introduce HandlerInfo::hadData flag
-rw-r--r--src/core/parser/stack/Stack.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/parser/stack/Stack.cpp b/src/core/parser/stack/Stack.cpp
index c67f43c..ef503f7 100644
--- a/src/core/parser/stack/Stack.cpp
+++ b/src/core/parser/stack/Stack.cpp
@@ -117,6 +117,11 @@ public:
bool hadDefaultField : 1;
/**
+ * Set to true once data was passed to the handler.
+ */
+ bool hadData : 1;
+
+ /**
* Set to false, if the handler is not greedy (true is the default value).
* If false, the handler will only be passed one piece of "data" at most.
*/
@@ -194,6 +199,7 @@ HandlerInfo::HandlerInfo(std::shared_ptr<Handler> handler)
inImplicitDefaultField(false),
inValidField(false),
hadDefaultField(false),
+ hadData(false),
greedy(true)
{
}
@@ -211,6 +217,7 @@ HandlerInfo::HandlerInfo(bool implicit, bool inField, bool inDefaultField,
inImplicitDefaultField(inImplicitDefaultField),
inValidField(true),
hadDefaultField(false),
+ hadData(false),
greedy(true)
{
}
@@ -880,6 +887,9 @@ bool StackImpl::handleData()
loggerFork.log(ex);
}
+ // Update the "hadData" flag
+ info.hadData = info.hadData || valid;
+
// Reset the logger instance of the handler as soon as possible
info.handler->resetLogger();