replace arrangements with _kwarg_name for simpleTag kwargs

This commit is contained in:
danhanson committed 2026-09-07 20:01:51 -05:00
1 parent 0caa8c104b
commit 6105fd9002
5 files changed
+54341 -54426

No files matched your search

+3 -2
View File
@@ -144,11 +144,12 @@ function simpleTag($, tag, args = true, kwargs = true) {
repeat(part(seq($._kwarg_name, $.identifier, "=", $.filtered_value))),
);
} else if (kwargs) {
parts.unshift($._tag_open);
// a known signature: any of the names it accepts, in any order, none twice
const named = Object.entries(kwargs).map(([name, value]) =>
part(seq(name, "=", value)),
part(seq($._kwarg_name, name, "=", value)),
);
parts.push(optional(arrangements(named)));
parts.push(repeat(choice(...named)));
}
return block(tag, ...parts, optional(asVariable($)));
}