HS transition parser: handle *prop of target, possessive 's, inner targets

Parser:
- After parsing transition property, check for "of <expr>" inner target
- Handle possessive 's token before property name in parse-one-transition
- Inner target overrides outer target when present

Fixes 6 transition parse errors: *width of #foo, #foo's width,
query ref with of/possessive syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 21:44:42 +00:00
parent 00bf13a230
commit 7516d1e1f9

View File

@@ -1259,26 +1259,35 @@
(fn
()
(let
((prop (cond ((= (tp-type) "style") (get (adv!) "value")) ((= (tp-val) "my") (do (adv!) (if (= (tp-type) "style") (get (adv!) "value") (get (adv!) "value")))) (true (get (adv!) "value")))))
((prop (cond ((= (tp-type) "style") (get (adv!) "value")) ((= (tp-val) "my") (do (adv!) (if (= (tp-type) "style") (get (adv!) "value") (get (adv!) "value")))) ((= (tp-val) "'s") (do (adv!) (if (= (tp-type) "style") (get (adv!) "value") (get (adv!) "value")))) (true (get (adv!) "value")))))
(let
((from-val (if (match-kw "from") (let ((v (parse-atom))) (if (and v (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v)) nil)))
(expect-kw! "to")
((inner-tgt (if (match-kw "of") (parse-expr) nil)))
(let
((value (let ((v (parse-atom))) (if (and v (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v))))
((eff-tgt (if inner-tgt inner-tgt tgt)))
(let
((dur (if (match-kw "over") (let ((v (parse-atom))) (if (and (number? v) (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v)) nil)))
((from-val (if (match-kw "from") (let ((v (parse-atom))) (if (and v (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v)) nil)))
(expect-kw! "to")
(let
((using-val (if (match-kw "using") (parse-expr) nil)))
(if
from-val
(list
(quote transition-from)
prop
from-val
value
dur
tgt)
(list (quote transition) prop value dur tgt)))))))))
((value (let ((v (parse-atom))) (if (and v (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v))))
(let
((dur (if (match-kw "over") (let ((v (parse-atom))) (if (and (number? v) (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v)) nil)))
(let
((using-val (if (match-kw "using") (parse-expr) nil)))
(if
from-val
(list
(quote transition-from)
prop
from-val
value
dur
eff-tgt)
(list
(quote transition)
prop
value
dur
eff-tgt)))))))))))
(let
((first-t (parse-one-transition)))
(define