refactor: use the tag parser to streamline the tag handlers (#827)

This commit is contained in:
Juro Oravec 2024-12-13 09:00:03 +01:00 committed by GitHub
parent db4ca8b74f
commit 894dee3cad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 351 additions and 429 deletions

View file

@ -26,7 +26,7 @@ class ParserTest(BaseTestCase):
pos_or_keyword_args=["num", "var"],
keywordonly_args=True,
)
tag = _parse_tag(parser, parser.tokens[0], tag_spec=spec)
tag = _parse_tag(parser, parser.tokens[0], tag_spec=spec, tag_id="my-id")
ctx = {"myvar": {"a": "b"}, "val2": 1}
args = safe_resolve_list(ctx, tag.args)
@ -42,7 +42,7 @@ class ParserTest(BaseTestCase):
tokens = Lexer(template_str).tokenize()
parser = Parser(tokens=tokens)
spec = TagSpec(tag="component", keywordonly_args=True)
tag = _parse_tag(parser, parser.tokens[0], tag_spec=spec)
tag = _parse_tag(parser, parser.tokens[0], tag_spec=spec, tag_id="my-id")
ctx = Context({"date": 2024, "bzz": "fzz"})
args = safe_resolve_list(ctx, tag.args)