From 42d37d1fd71c1653c29715d3d3d886dfed1507aa Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Mon, 13 Jul 2026 16:49:16 -0400 Subject: [PATCH] Don't list all terminal statuses for weaseljson Also simplifies codegen slightly presumably. OK and AGAIN should be the only non-terminal statuses ever. --- src/parser3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser3.h b/src/parser3.h index fe3a3ef..fba123c 100644 --- a/src/parser3.h +++ b/src/parser3.h @@ -1085,7 +1085,7 @@ inline WeaselJsonStatus Parser3::parse(char *buf, int len) { // range. ContinuationStatus status = symbolTables.continuations[top()](this, buf, buf + len); - if (status == WeaselJson_REJECT || status == WeaselJson_OVERFLOW) { + if (status > WeaselJson_AGAIN) { this->terminalStatus = WeaselJsonStatus(status); } return WeaselJsonStatus(status); @@ -1095,7 +1095,7 @@ inline WeaselJsonStatus Parser3::parse(char *buf, int len) { while ((result = symbolTables.continuations[top()]( this, stashBufForTrampoline, buf + len)) == kBounce) ; - if (result == WeaselJson_REJECT || result == WeaselJson_OVERFLOW) { + if (result > WeaselJson_AGAIN) { this->terminalStatus = WeaselJsonStatus(result); } return WeaselJsonStatus(result);