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
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:
@@ -987,7 +987,7 @@
|
|||||||
(do
|
(do
|
||||||
(when
|
(when
|
||||||
(and
|
(and
|
||||||
(number? left)
|
(or (number? left) (list? left))
|
||||||
(= (tp-type) "ident")
|
(= (tp-type) "ident")
|
||||||
(not
|
(not
|
||||||
(or
|
(or
|
||||||
@@ -3113,7 +3113,23 @@
|
|||||||
(let
|
(let
|
||||||
((inner (parse-feat)))
|
((inner (parse-feat)))
|
||||||
(if (= (tp-type) "paren-close") (adv!) nil)
|
(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 "on") (do (adv!) (parse-on-feat)))
|
||||||
((= val "init") (do (adv!) (parse-init-feat)))
|
((= val "init") (do (adv!) (parse-init-feat)))
|
||||||
((= val "def") (do (adv!) (parse-def-feat)))
|
((= val "def") (do (adv!) (parse-def-feat)))
|
||||||
|
|||||||
@@ -987,7 +987,7 @@
|
|||||||
(do
|
(do
|
||||||
(when
|
(when
|
||||||
(and
|
(and
|
||||||
(number? left)
|
(or (number? left) (list? left))
|
||||||
(= (tp-type) "ident")
|
(= (tp-type) "ident")
|
||||||
(not
|
(not
|
||||||
(or
|
(or
|
||||||
@@ -3113,7 +3113,23 @@
|
|||||||
(let
|
(let
|
||||||
((inner (parse-feat)))
|
((inner (parse-feat)))
|
||||||
(if (= (tp-type) "paren-close") (adv!) nil)
|
(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 "on") (do (adv!) (parse-on-feat)))
|
||||||
((= val "init") (do (adv!) (parse-init-feat)))
|
((= val "init") (do (adv!) (parse-init-feat)))
|
||||||
((= val "def") (do (adv!) (parse-def-feat)))
|
((= val "def") (do (adv!) (parse-def-feat)))
|
||||||
|
|||||||
Reference in New Issue
Block a user