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:
@@ -1259,26 +1259,35 @@
|
|||||||
(fn
|
(fn
|
||||||
()
|
()
|
||||||
(let
|
(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
|
(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)))
|
((inner-tgt (if (match-kw "of") (parse-expr) nil)))
|
||||||
(expect-kw! "to")
|
|
||||||
(let
|
(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
|
(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
|
(let
|
||||||
((using-val (if (match-kw "using") (parse-expr) nil)))
|
((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))))
|
||||||
(if
|
(let
|
||||||
from-val
|
((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)))
|
||||||
(list
|
(let
|
||||||
(quote transition-from)
|
((using-val (if (match-kw "using") (parse-expr) nil)))
|
||||||
prop
|
(if
|
||||||
from-val
|
from-val
|
||||||
value
|
(list
|
||||||
dur
|
(quote transition-from)
|
||||||
tgt)
|
prop
|
||||||
(list (quote transition) prop value dur tgt)))))))))
|
from-val
|
||||||
|
value
|
||||||
|
dur
|
||||||
|
eff-tgt)
|
||||||
|
(list
|
||||||
|
(quote transition)
|
||||||
|
prop
|
||||||
|
value
|
||||||
|
dur
|
||||||
|
eff-tgt)))))))))))
|
||||||
(let
|
(let
|
||||||
((first-t (parse-one-transition)))
|
((first-t (parse-one-transition)))
|
||||||
(define
|
(define
|
||||||
|
|||||||
Reference in New Issue
Block a user