HS: wip — parser every-fix, integration boot, test tooling expansion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 18:51:32 +00:00
parent b0c135412a
commit c5d9a8b789
6 changed files with 442 additions and 64 deletions

View File

@@ -87,12 +87,11 @@
(not (dom-get-data script "hs-script-loaded"))
(let
((src (host-get script "innerHTML")))
(when
(and src (not (= src "")))
(guard
(_e (true nil))
(eval-expr-cek (hs-to-sx-from-source src)))
(dom-set-data script "hs-script-loaded" true)))))
(guard
(_e (true nil))
(let
((handler (eval-expr-cek (hs-to-sx-from-source src))))
(handler (dom-body)))))))
(hs-query-all "script[type=text/hyperscript]"))))
;; ── Boot: scan entire document ──────────────────────────────────
@@ -131,8 +130,13 @@
(dom-set-data el "hs-script" src)
(dom-set-data el "hs-active" true)
(dom-set-attr el "data-hyperscript-powered" "true")
(host-set! (host-global "window") "__hs_current_me" el)
(guard
(_e (true nil))
(_e
(true
(do
(dom-dispatch el "hyperscript:parse-error" {:errors (list _e)})
nil)))
(let
((handler (hs-handler src)))
(let
@@ -146,6 +150,7 @@
safe-handler
(hs-query-all (or comp-name "")))
(safe-handler el))))))
(host-set! (host-global "window") "__hs_current_me" nil)
(dom-dispatch el "hyperscript:after:init" nil)))))))
(define