Coverage for phml\compiler\steps\wrapper.py: 100%
12 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-04-12 14:26 -0500
« prev ^ index » next coverage.py v6.5.0, created at 2023-04-12 14:26 -0500
1from phml.compiler.steps.base import scoped_step
2from phml.nodes import Element, Parent
5@scoped_step
6def step_replace_phml_wrapper(node: Parent, *_):
7 for child in list(node):
8 if isinstance(child, Element) and child.tag in ["", "Template"]:
9 idx = node.index(child)
10 for c in child:
11 if isinstance(c, Element):
12 c.context.update(child.context)
14 del node[idx]
15 node.insert(idx, child.children or [])