From 297f0603e57214a38c49b8dd30550b184fde49e2 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 5 May 2026 13:34:22 +0000 Subject: [PATCH] =?UTF-8?q?HS:=20fix=20remove=20[@attr]=20=E2=80=94=20cons?= =?UTF-8?q?ume=20bracket-close=20instead=20of=20match-kw=20"]"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit match-kw only matches tokens of type "keyword", but ] tokenizes as bracket-close. This left the ] unconsumed after remove [@foo], causing the attribute to never be removed. Use (when (= (tp-type) "bracket-close") (adv!)) matching the same pattern parse-add-cmd uses for [attr=val]. Co-Authored-By: Claude Sonnet 4.6 --- lib/hyperscript/parser.sx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index bdfedb21..5be81c1f 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -1227,7 +1227,7 @@ (= (tp-type) "attr") (let ((attr-name (get (adv!) "value"))) - (match-kw "]") + (when (= (tp-type) "bracket-close") (adv!)) (let ((tgt (if (match-kw "from") (parse-expr) nil))) (list (quote remove-attr) attr-name tgt)))