module documentation

provides functionality for rendering a parsetree constructing into module source code.
Constant MAGIC​_NUMBER Undocumented
Constant RESERVED​_NAMES Undocumented
Constant TOPLEVEL​_DECLARED Undocumented
Class _​Compile​Context Undocumented
Class _​Generate​Render​Method A template visitor object which generates the full module source for a template.
Class _​Identifiers tracks the status of identifier names as template code is rendered.
Class ​Loop​Variable A node visitor which looks for the name 'loop' within undeclared identifiers.
Function compile Generate module source code given a parsetree node, uri, and optional source filename
Function mangle​_mako​_loop converts a for loop into a context manager wrapped around a for loop when access to the loop variable has been detected in the for loop body
Constant ​_FOR​_LOOP Undocumented
MAGIC_NUMBER: int =

Undocumented

Value
10
RESERVED_NAMES =

Undocumented

Value
set(['context', 'loop']).union(TOPLEVEL_DECLARED)
TOPLEVEL_DECLARED =

Undocumented

Value
set(['UNDEFINED', 'STOP_RENDERING'])
def compile(node, uri, filename=None, default_filters=None, buffer_filters=None, imports=None, future_imports=None, source_encoding=None, generate_magic_comment=True, disable_unicode=False, strict_undefined=False, enable_loop=True, reserved_names=frozenset()):
Generate module source code given a parsetree node, uri, and optional source filename
def mangle_mako_loop(node, printer):
converts a for loop into a context manager wrapped around a for loop when access to the loop variable has been detected in the for loop body
_FOR_LOOP =

Undocumented

Value
re.compile(r'^for\s+((?:\(?)\s*[A-Za-z_][A-Za-z_0-9]*(?:\s*,\s*(?:[A-Za-z_][A-Za
-z0-9_]*),??)*\s*(?:\)?))\s+in\s+(.*):')