Writes a common preamble that is used by root and block functions. Primarily this sets up common local helpers and enforces a generator through a dead branch.
(self)
| 718 | return f"{{{items_kv}}}" |
| 719 | |
| 720 | def write_commons(self) -> None: |
| 721 | """Writes a common preamble that is used by root and block functions. |
| 722 | Primarily this sets up common local helpers and enforces a generator |
| 723 | through a dead branch. |
| 724 | """ |
| 725 | self.writeline("resolve = context.resolve_or_missing") |
| 726 | self.writeline("undefined = environment.undefined") |
| 727 | self.writeline("concat = environment.concat") |
| 728 | # always use the standard Undefined class for the implicit else of |
| 729 | # conditional expressions |
| 730 | self.writeline("cond_expr_undefined = Undefined") |
| 731 | self.writeline("if 0: yield None") |
| 732 | |
| 733 | def push_parameter_definitions(self, frame: Frame) -> None: |
| 734 | """Pushes all parameter targets from the given frame into a local |
no test coverage detected