summaryrefslogtreecommitdiff
path: root/src/core/parser/stack/Stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/parser/stack/Stack.cpp')
-rw-r--r--src/core/parser/stack/Stack.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/parser/stack/Stack.cpp b/src/core/parser/stack/Stack.cpp
index 41ced2a..d37f178 100644
--- a/src/core/parser/stack/Stack.cpp
+++ b/src/core/parser/stack/Stack.cpp
@@ -983,7 +983,7 @@ void StackImpl::handleToken(const Token &token)
std::vector<SyntaxDescriptor> pendingClose = pendingCloseTokens(token.id);
// Iterate until the stack can no longer be unwound
- while (true) {
+ while (!stack.empty()) {
LoggerFork loggerFork = logger().fork();
bool hadError = false;
@@ -1032,6 +1032,9 @@ void StackImpl::handleToken(const Token &token)
return;
}
}
+
+ // Issue an error, because the token was not handled
+ strayTokenError(token, descr, logger());
}
void StackImpl::handleFieldEnd(bool endRange)