MCPcopy
hub / github.com/pallets/jinja / blockvisit

Method blockvisit

src/jinja2/compiler.py:442–451  ·  view source on GitHub ↗

Visit a list of nodes as block in a frame. If the current frame is no buffer a dummy ``if 0: yield None`` is written automatically.

(self, nodes: t.Iterable[nodes.Node], frame: Frame)

Source from the content-addressed store, hash-verified

440 self.end_write(frame)
441
442 def blockvisit(self, nodes: t.Iterable[nodes.Node], frame: Frame) -> None:
443 """Visit a list of nodes as block in a frame. If the current frame
444 is no buffer a dummy ``if 0: yield None`` is written automatically.
445 """
446 try:
447 self.writeline("pass")
448 for node in nodes:
449 self.visit(node, frame)
450 except CompilerExit:
451 pass
452
453 def write(self, x: str) -> None:
454 """Write a string into the output stream."""

Callers 9

macro_bodyMethod · 0.95
visit_TemplateMethod · 0.95
visit_ForMethod · 0.95
visit_IfMethod · 0.95
visit_FilterBlockMethod · 0.95
visit_WithMethod · 0.95
visit_AssignBlockMethod · 0.95
visit_ScopeMethod · 0.95
visit_OverlayScopeMethod · 0.95

Calls 2

writelineMethod · 0.95
visitMethod · 0.80

Tested by

no test coverage detected