HS: open/close commands for dialog/details — 428→435
- Parser: open/close commands with optional target (defaults to me) - Compiler: open-element → hs-open!, close-element → hs-close! - Runtime: hs-open! calls showModal() for dialogs, sets open=true for details - Runtime: hs-close! calls close() for dialogs, sets open=false for details - dialog: 1/10 → 8/10 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1495,6 +1495,20 @@
|
||||
((lhs (parse-expr)))
|
||||
(match-kw "with")
|
||||
(let ((rhs (parse-expr))) (list (quote swap!) lhs rhs)))))
|
||||
(define
|
||||
parse-open-cmd
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((target (cond ((at-end?) (list (quote me))) ((and (= (tp-type) "keyword") (or (= (tp-val) "then") (= (tp-val) "end"))) (list (quote me))) (true (parse-expr)))))
|
||||
(list (quote open-element) target))))
|
||||
(define
|
||||
parse-close-cmd
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((target (cond ((at-end?) (list (quote me))) ((and (= (tp-type) "keyword") (or (= (tp-val) "then") (= (tp-val) "end"))) (list (quote me))) (true (parse-expr)))))
|
||||
(list (quote close-element) target))))
|
||||
(define
|
||||
parse-cmd
|
||||
(fn
|
||||
@@ -1582,6 +1596,10 @@
|
||||
(do (adv!) (parse-empty-cmd)))
|
||||
((and (= typ "keyword") (= val "swap"))
|
||||
(do (adv!) (parse-swap-cmd)))
|
||||
((and (= typ "keyword") (= val "open"))
|
||||
(do (adv!) (parse-open-cmd)))
|
||||
((and (= typ "keyword") (= val "close"))
|
||||
(do (adv!) (parse-close-cmd)))
|
||||
(true (parse-expr))))))
|
||||
(define
|
||||
parse-cmd-list
|
||||
@@ -1630,7 +1648,9 @@
|
||||
(= v "focus")
|
||||
(= v "empty")
|
||||
(= v "clear")
|
||||
(= v "swap"))))
|
||||
(= v "swap")
|
||||
(= v "open")
|
||||
(= v "close"))))
|
||||
(define
|
||||
cl-collect
|
||||
(fn
|
||||
|
||||
Reference in New Issue
Block a user