replace arrangements with _kwarg_name for simpleTag kwargs
This commit is contained in:
1 parent
0caa8c104b
commit
6105fd9002
5 files changed
+54341
-54426
No files matched your search
+3
-2
@@ -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($)));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user