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

Method enter_frame

src/jinja2/compiler.py:584–598  ·  view source on GitHub ↗
(self, frame: Frame)

Source from the content-addressed store, hash-verified

582 self.outdent()
583
584 def enter_frame(self, frame: Frame) -> None:
585 undefs = []
586 for target, (action, param) in frame.symbols.loads.items():
587 if action == VAR_LOAD_PARAMETER:
588 pass
589 elif action == VAR_LOAD_RESOLVE:
590 self.writeline(f"{target} = {self.get_resolve_func()}({param!r})")
591 elif action == VAR_LOAD_ALIAS:
592 self.writeline(f"{target} = {param}")
593 elif action == VAR_LOAD_UNDEFINED:
594 undefs.append(target)
595 else:
596 raise NotImplementedError("unknown load instruction")
597 if undefs:
598 self.writeline(f"{' = '.join(undefs)} = missing")
599
600 def leave_frame(self, frame: Frame, with_python_scope: bool = False) -> None:
601 if not with_python_scope:

Callers 8

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

Calls 3

writelineMethod · 0.95
get_resolve_funcMethod · 0.95
itemsMethod · 0.80

Tested by

no test coverage detected