From 606b5da1a11734eca9768572bf34da611fa14164 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 26 Apr 2026 21:31:42 +0000 Subject: [PATCH] HS: fix CSS dict semicolon parsing in add command (+1) collect-pairs! in parse-add-cmd now skips the semicolon op token between CSS properties, so add {color: red; font-family: monospace} compiles to two dom-set-style calls instead of three malformed ones. Co-Authored-By: Claude Sonnet 4.6 --- lib/hyperscript/parser.sx | 3 +++ shared/static/wasm/sx/hs-parser.sx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index abccc04e..52fc9dde 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -1046,6 +1046,9 @@ (let ((val (if (and (= (tp-type) "ident") (= (tp-val) "$")) (do (adv!) (when (= (tp-type) "brace-open") (adv!)) (if (= (tp-type) "brace-close") (do (adv!) (if (= (tp-type) "brace-open") (do (adv!) (let ((inner (parse-expr))) (when (= (tp-type) "brace-close") (adv!)) inner)) "")) (let ((expr (parse-expr))) (when (= (tp-type) "brace-close") (adv!)) expr))) (get (adv!) "value")))) (set! pairs (cons (list prop val) pairs)) + (when + (and (= (tp-type) "op") (= (tp-val) ";")) + (adv!)) (collect-pairs!)))))) (collect-pairs!) (when (= (tp-type) "brace-close") (adv!)) diff --git a/shared/static/wasm/sx/hs-parser.sx b/shared/static/wasm/sx/hs-parser.sx index abccc04e..52fc9dde 100644 --- a/shared/static/wasm/sx/hs-parser.sx +++ b/shared/static/wasm/sx/hs-parser.sx @@ -1046,6 +1046,9 @@ (let ((val (if (and (= (tp-type) "ident") (= (tp-val) "$")) (do (adv!) (when (= (tp-type) "brace-open") (adv!)) (if (= (tp-type) "brace-close") (do (adv!) (if (= (tp-type) "brace-open") (do (adv!) (let ((inner (parse-expr))) (when (= (tp-type) "brace-close") (adv!)) inner)) "")) (let ((expr (parse-expr))) (when (= (tp-type) "brace-close") (adv!)) expr))) (get (adv!) "value")))) (set! pairs (cons (list prop val) pairs)) + (when + (and (= (tp-type) "op") (= (tp-val) ";")) + (adv!)) (collect-pairs!)))))) (collect-pairs!) (when (= (tp-type) "brace-close") (adv!))