HS runtime: empty/swap/compound events, host-set! fix — 403→423 (51%)
- Fix host-set → host-set! in emit-inc/emit-dec (increment/decrement properties) - Implement empty/clear command: parser dispatch, compiler, polymorphic runtime - Implement swap command: parser dispatch, compiler (let+do temp swap pattern) - Add parse-compound-event-name: joins dot/colon tokens (example.event, htmx:load) - Add hs-compile to source parser (was only in WASM deploy copy) - Add clear/swap to tokenizer keywords and cmd-kw? list - Generator: fix run() with extra args, String.raw support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -942,12 +942,40 @@
|
||||
(if (= (tp-type) "comma") (adv!) nil)
|
||||
(dd-collect (append acc (list key val))))))))
|
||||
(cons (quote dict) (dd-collect (list)))))
|
||||
(define
|
||||
parse-compound-event-name
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((result (get (adv!) "value")))
|
||||
(define
|
||||
collect!
|
||||
(fn
|
||||
()
|
||||
(when
|
||||
(not (at-end?))
|
||||
(cond
|
||||
((= (tp-type) "class")
|
||||
(let
|
||||
((part (tp-val)))
|
||||
(adv!)
|
||||
(set! result (str result "." part))
|
||||
(collect!)))
|
||||
((= (tp-type) "local")
|
||||
(let
|
||||
((part (tp-val)))
|
||||
(adv!)
|
||||
(set! result (str result ":" part))
|
||||
(collect!)))
|
||||
(true nil)))))
|
||||
(collect!)
|
||||
result)))
|
||||
(define
|
||||
parse-send-cmd
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((name (get (adv!) "value")))
|
||||
((name (parse-compound-event-name)))
|
||||
(let
|
||||
((dtl (if (= (tp-type) "paren-open") (parse-detail-dict) nil)))
|
||||
(let
|
||||
@@ -1602,7 +1630,7 @@
|
||||
(let
|
||||
((every? (match-kw "every")))
|
||||
(let
|
||||
((event-name (let ((v (tp-val))) (adv!) v)))
|
||||
((event-name (parse-compound-event-name)))
|
||||
(let
|
||||
((flt (if (= (tp-type) "bracket-open") (do (adv!) (let ((f (parse-expr))) (if (= (tp-type) "bracket-close") (adv!) nil) f)) nil)))
|
||||
(let
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user