module documentation

Compiles nodes from the parser into Python code.

Class CodeGenerator No class docstring; 0/1 property, 0/25 instance variable, 0/12 class variable, 35/91 methods, 1/1 static method, 0/1 class documented
Class CompilerExit Raised if the compiler encountered a situation where it just doesn't make sense to further process the code. Any block that raises such an exception is not further processed.
Class DependencyFinderVisitor A visitor that collects filter and test calls.
Class Frame Holds compile time information for us.
Class MacroRef Undocumented
Class UndeclaredNameVisitor A visitor that checks if a name is accessed without being declared. This is different from the frame visitor as it will not stop at closure frames.
Class VisitorExit Exception used by the `UndeclaredNameVisitor` to signal a stop.
Function find_undeclared Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found.
Function generate Generate the python source for a node tree.
Function has_safe_repr Does the node have a safe representation?
Function optimizeconst Undocumented
Constant F Undocumented
Variable operators Undocumented
Function _make_binop Undocumented
Function _make_unop Undocumented
def find_undeclared(nodes, names): (source)

Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found.

Parameters
nodes:t.Iterable[nodes.Node]Undocumented
names:t.Iterable[str]Undocumented
Returns
t.Set[str]Undocumented
def generate(node, environment, name, filename, stream=None, defer_init=False, optimized=True): (source)

Generate the python source for a node tree.

Parameters
node:nodes.TemplateUndocumented
environment:EnvironmentUndocumented
name:t.Optional[str]Undocumented
filename:t.Optional[str]Undocumented
stream:t.Optional[t.TextIO]Undocumented
defer_init:boolUndocumented
optimized:boolUndocumented
Returns
t.Optional[str]Undocumented
def has_safe_repr(value): (source)

Does the node have a safe representation?

Parameters
value:t.AnyUndocumented
Returns
boolUndocumented
def optimizeconst(f): (source)

Undocumented

Parameters
f:FUndocumented
Returns
FUndocumented

Undocumented

Value
t.TypeVar('F',
          bound=t.Callable[..., t.Any])
operators: dict[str, str] = (source)

Undocumented

def _make_binop(op): (source)

Undocumented

Parameters
op:strUndocumented
Returns
t.Callable[[CodeGenerator, nodes.BinExpr, Frame], None]Undocumented
def _make_unop(op): (source)

Undocumented

Parameters
op:strUndocumented
Returns
t.Callable[[CodeGenerator, nodes.UnaryExpr, Frame], None]Undocumented