jinja2.compiler

jinja2.compiler

Compiles nodes into python code.

copyright:
  1. 2010 by the Jinja Team.
license:

BSD, see LICENSE for more details.

Classes

CodeGenerator
DependencyFinderVisitor A visitor that collects filter and test calls.
Frame Holds compile time information for us.
FrameIdentifierVisitor A visitor for Frame.inspect.
Identifiers Tracks the status of identifiers in frames.
UndeclaredNameVisitor A visitor that checks if a name is accessed without being declared.

Exceptions

CompilerExit Raised if the compiler encountered a situation where it just doesn’t make sense to further process the code.
TemplateAssertionError(message, lineno[, ...]) Like a template syntax error, but covers cases where something in the template caused an error at compile time that wasn’t necessarily caused by a syntax error.
VisitorExit Exception used by the UndeclaredNameVisitor to signal a stop.

Functions

StringIO StringIO([s]) – Return a StringIO-like stream for reading or writing
concat S.join(iterable) -> unicode
find_undeclared(nodes, names) Check if the names passed are accessed undeclared.
generate(node, environment, name, filename) Generate the python source for a node tree.
has_safe_repr(value) Does the node have a safe representation?
is_python_keyword x.__contains__(y) <==> y in x.
next(iterator[, default]) Return the next item from the iterator.

Defined

  • EvalContext
  • Markup
  • NodeVisitor
  • chain
  • deepcopy
  • dict_item_iter
  • escape
  • have_condexpr
  • nodes
  • operators
  • unoptimize_before_dead_code

Table Of Contents

Previous topic

sha1

Next topic

CodeGenerator Class