From cfd4a94559dad477cc11c7d33216970440402032 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 4 Sep 2023 15:28:11 +0000 Subject: [PATCH] basic: call executeFinal() when OnToken() fails Signed-off-by: Alejandro Mery --- basic/token.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/basic/token.go b/basic/token.go index 4f2103b..fc2862b 100644 --- a/basic/token.go +++ b/basic/token.go @@ -149,6 +149,8 @@ func (dec *decoder) OnToken(pos lexer.Position, typ parser.TokenType, value stri return nil default: // unacceptable - return newErrInvalidToken(t) + err := newErrInvalidToken(t) + dec.executeFinal() + return err } }