summaryrefslogtreecommitdiff
path: root/test/core/parser/stack/StackTest.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-04-11 16:51:38 +0200
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:24:14 +0200
commitd369ff33faa4bf5654db3f1eb105141fccf2270d (patch)
treedd09b8f9a628d055b36b96b3fca9b4b407c1413d /test/core/parser/stack/StackTest.cpp
parent994615f76b86a65f11829863be96c63135eef977 (diff)
Reimplement closeToken handling
Idea: Only start unrolling anything on the parser stack if an element that matches the given close token is found. This requires the endToken method in DocumentChildHandler to search for the given descriptor that might be ended. While performing this search, only a specified number of "explicit" structures/fields opened by the Stack class may be skipped (those with implicit default fields). Added an integration test ("python_code") which requires this new (hopefully sane) behaviour.
Diffstat (limited to 'test/core/parser/stack/StackTest.cpp')
-rw-r--r--test/core/parser/stack/StackTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/core/parser/stack/StackTest.cpp b/test/core/parser/stack/StackTest.cpp
index af2b8e8..e23cde7 100644
--- a/test/core/parser/stack/StackTest.cpp
+++ b/test/core/parser/stack/StackTest.cpp
@@ -66,7 +66,7 @@ struct Tracker {
bool startCommandResult;
bool startAnnotationResult;
bool startTokenResult;
- Handler::EndTokenResult endTokenResult;
+ EndTokenResult endTokenResult;
bool fieldStartResult;
bool dataResult;
@@ -96,7 +96,7 @@ struct Tracker {
startCommandResult = true;
startAnnotationResult = true;
startTokenResult = true;
- endTokenResult = Handler::EndTokenResult::ENDED_THIS;
+ endTokenResult = EndTokenResult();
fieldStartResult = true;
dataResult = true;
@@ -157,7 +157,7 @@ public:
return tracker.startTokenResult;
}
- EndTokenResult endToken(const Token &token, Handle<Node> node) override
+ EndTokenResult endToken(Handle<Node> node, size_t maxStackDepth) override
{
tracker.endTokenCount++;
return tracker.endTokenResult;