HS: parse-feat paren-open adds string-postfix check (+1 test)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s

parse-feat's paren-open handler stripped the grouping parens and
returned the inner feature, leaving any trailing ident (like `em`)
as a separate top-level feature. After consuming the closing paren,
now checks if the next token is a non-keyword ident or `%` op and
wraps as (string-postfix inner unit), making `(0 + 1) em` → "1em".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 19:19:54 +00:00
parent 42184797f1
commit fee62a20f0
2 changed files with 36 additions and 4 deletions

View File

@@ -987,7 +987,7 @@
(do
(when
(and
(number? left)
(or (number? left) (list? left))
(= (tp-type) "ident")
(not
(or
@@ -3113,7 +3113,23 @@
(let
((inner (parse-feat)))
(if (= (tp-type) "paren-close") (adv!) nil)
inner)))
(if
(and
inner
(or
(and
(= (tp-type) "ident")
(not
(or
(= (tp-val) "then")
(= (tp-val) "end")
(= (tp-val) "else")
(= (tp-val) "otherwise"))))
(and (= (tp-type) "op") (= (tp-val) "%"))))
(let
((unit (tp-val)))
(do (adv!) (list (quote string-postfix) inner unit)))
inner))))
((= val "on") (do (adv!) (parse-on-feat)))
((= val "init") (do (adv!) (parse-init-feat)))
((= val "def") (do (adv!) (parse-def-feat)))

View File

@@ -987,7 +987,7 @@
(do
(when
(and
(number? left)
(or (number? left) (list? left))
(= (tp-type) "ident")
(not
(or
@@ -3113,7 +3113,23 @@
(let
((inner (parse-feat)))
(if (= (tp-type) "paren-close") (adv!) nil)
inner)))
(if
(and
inner
(or
(and
(= (tp-type) "ident")
(not
(or
(= (tp-val) "then")
(= (tp-val) "end")
(= (tp-val) "else")
(= (tp-val) "otherwise"))))
(and (= (tp-type) "op") (= (tp-val) "%"))))
(let
((unit (tp-val)))
(do (adv!) (list (quote string-postfix) inner unit)))
inner))))
((= val "on") (do (adv!) (parse-on-feat)))
((= val "init") (do (adv!) (parse-init-feat)))
((= val "def") (do (adv!) (parse-def-feat)))