HS: viewTransition command (+9 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s
Add 'start view transition [using EXPR] [then] BODY end' syntax. - tokenizer: add 'view' as a keyword - parser: add 'start' to cmd-kw? and dispatch to view-transition! AST node - compiler: emit hs-view-transition! call from view-transition! node Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1832,6 +1832,9 @@
|
|||||||
(hs-to-sx (nth ast 2))))
|
(hs-to-sx (nth ast 2))))
|
||||||
((= head (quote set-el!))
|
((= head (quote set-el!))
|
||||||
(list (quote hs-set-element!) (hs-to-sx (nth ast 1)) (hs-to-sx (nth ast 2))))
|
(list (quote hs-set-element!) (hs-to-sx (nth ast 1)) (hs-to-sx (nth ast 2))))
|
||||||
|
((= head (quote view-transition!))
|
||||||
|
(let ((body (nth ast 2)))
|
||||||
|
(list (quote hs-view-transition!) (hs-to-sx (nth ast 1)) (if (nil? body) (quote nil) (hs-to-sx body)))))
|
||||||
((= head (quote put!))
|
((= head (quote put!))
|
||||||
(let
|
(let
|
||||||
((val (hs-to-sx (nth ast 1)))
|
((val (hs-to-sx (nth ast 1)))
|
||||||
|
|||||||
@@ -2711,6 +2711,16 @@
|
|||||||
(do (adv!) (list (quote exit))))
|
(do (adv!) (list (quote exit))))
|
||||||
((and (= typ "keyword") (= val "js"))
|
((and (= typ "keyword") (= val "js"))
|
||||||
(do (adv!) (parse-js-block)))
|
(do (adv!) (parse-js-block)))
|
||||||
|
((and (= typ "keyword") (= val "start"))
|
||||||
|
(do
|
||||||
|
(adv!)
|
||||||
|
(expect-kw! "view")
|
||||||
|
(expect-kw! "transition")
|
||||||
|
(let ((using (if (match-kw "using") (parse-expr) nil)))
|
||||||
|
(match-kw "then")
|
||||||
|
(let ((body (parse-cmd-list)))
|
||||||
|
(match-kw "end")
|
||||||
|
(list (quote view-transition!) using body)))))
|
||||||
(true (parse-expr))))))
|
(true (parse-expr))))))
|
||||||
(define
|
(define
|
||||||
parse-cmd-list
|
parse-cmd-list
|
||||||
@@ -2767,7 +2777,8 @@
|
|||||||
(= v "pick")
|
(= v "pick")
|
||||||
(= v "ask")
|
(= v "ask")
|
||||||
(= v "answer")
|
(= v "answer")
|
||||||
(= v "js"))))
|
(= v "js")
|
||||||
|
(= v "start"))))
|
||||||
(define
|
(define
|
||||||
cl-collect
|
cl-collect
|
||||||
(fn
|
(fn
|
||||||
|
|||||||
@@ -131,6 +131,7 @@
|
|||||||
"append"
|
"append"
|
||||||
"settle"
|
"settle"
|
||||||
"transition"
|
"transition"
|
||||||
|
"view"
|
||||||
"over"
|
"over"
|
||||||
"closest"
|
"closest"
|
||||||
"next"
|
"next"
|
||||||
|
|||||||
@@ -1832,6 +1832,9 @@
|
|||||||
(hs-to-sx (nth ast 2))))
|
(hs-to-sx (nth ast 2))))
|
||||||
((= head (quote set-el!))
|
((= head (quote set-el!))
|
||||||
(list (quote hs-set-element!) (hs-to-sx (nth ast 1)) (hs-to-sx (nth ast 2))))
|
(list (quote hs-set-element!) (hs-to-sx (nth ast 1)) (hs-to-sx (nth ast 2))))
|
||||||
|
((= head (quote view-transition!))
|
||||||
|
(let ((body (nth ast 2)))
|
||||||
|
(list (quote hs-view-transition!) (hs-to-sx (nth ast 1)) (if (nil? body) (quote nil) (hs-to-sx body)))))
|
||||||
((= head (quote put!))
|
((= head (quote put!))
|
||||||
(let
|
(let
|
||||||
((val (hs-to-sx (nth ast 1)))
|
((val (hs-to-sx (nth ast 1)))
|
||||||
|
|||||||
@@ -2711,6 +2711,16 @@
|
|||||||
(do (adv!) (list (quote exit))))
|
(do (adv!) (list (quote exit))))
|
||||||
((and (= typ "keyword") (= val "js"))
|
((and (= typ "keyword") (= val "js"))
|
||||||
(do (adv!) (parse-js-block)))
|
(do (adv!) (parse-js-block)))
|
||||||
|
((and (= typ "keyword") (= val "start"))
|
||||||
|
(do
|
||||||
|
(adv!)
|
||||||
|
(expect-kw! "view")
|
||||||
|
(expect-kw! "transition")
|
||||||
|
(let ((using (if (match-kw "using") (parse-expr) nil)))
|
||||||
|
(match-kw "then")
|
||||||
|
(let ((body (parse-cmd-list)))
|
||||||
|
(match-kw "end")
|
||||||
|
(list (quote view-transition!) using body)))))
|
||||||
(true (parse-expr))))))
|
(true (parse-expr))))))
|
||||||
(define
|
(define
|
||||||
parse-cmd-list
|
parse-cmd-list
|
||||||
@@ -2767,7 +2777,8 @@
|
|||||||
(= v "pick")
|
(= v "pick")
|
||||||
(= v "ask")
|
(= v "ask")
|
||||||
(= v "answer")
|
(= v "answer")
|
||||||
(= v "js"))))
|
(= v "js")
|
||||||
|
(= v "start"))))
|
||||||
(define
|
(define
|
||||||
cl-collect
|
cl-collect
|
||||||
(fn
|
(fn
|
||||||
|
|||||||
@@ -131,6 +131,7 @@
|
|||||||
"append"
|
"append"
|
||||||
"settle"
|
"settle"
|
||||||
"transition"
|
"transition"
|
||||||
|
"view"
|
||||||
"over"
|
"over"
|
||||||
"closest"
|
"closest"
|
||||||
"next"
|
"next"
|
||||||
|
|||||||
Reference in New Issue
Block a user