HS: coll-feats error on unconsumed tokens (+1 test)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 38s

When parse-feat returns nil but the token stream is not at EOF,
coll-feats now throws a parse error ('Unexpected token X') instead
of silently returning the partial result. Fixes 'extra chars cause
error when evaling': eval-hs("1!") now correctly throws because '!'
is left over after parsing the number expression.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 17:46:06 +00:00
parent 20e23d233c
commit d5aa8a2e74
2 changed files with 26 additions and 2 deletions

View File

@@ -3133,7 +3133,19 @@
acc
(let
((feat (parse-feat)))
(if (nil? feat) acc (coll-feats (append acc (list feat))))))))
(if
(nil? feat)
(if
(at-end?)
acc
(error
(str
"Parse error: Unexpected token '"
(tp-val)
"' (line "
(get (nth tokens p) "line")
")")))
(coll-feats (append acc (list feat))))))))
(let
((features (coll-feats (list))))
(if

View File

@@ -3133,7 +3133,19 @@
acc
(let
((feat (parse-feat)))
(if (nil? feat) acc (coll-feats (append acc (list feat))))))))
(if
(nil? feat)
(if
(at-end?)
acc
(error
(str
"Parse error: Unexpected token '"
(tp-val)
"' (line "
(get (nth tokens p) "line")
")")))
(coll-feats (append acc (list feat))))))))
(let
((features (coll-feats (list))))
(if