]> git.ipfire.org Git - thirdparty/jinja.git/commit
refactor visit_Output 1109/head
authorDavid Lord <davidism@gmail.com>
Wed, 20 Nov 2019 20:38:16 +0000 (12:38 -0800)
committerDavid Lord <davidism@gmail.com>
Wed, 20 Nov 2019 22:09:44 +0000 (14:09 -0800)
commit3487c8e087599962d09ed30e6e80782b95a43cbb
tree27ef51bb35b5d1f224f58be8e519c67f6a12f3fa
parent5d33f673ce261220b0a39b1c7a07e0f3bc6f8c64
refactor visit_Output

* `finalize` is generated once and cached for all nodes.
* Extract common behavior for native env.

Removed the compiler behavior where groups of nodes would generate a
format string. Instead, individual nodes are always yielded. This made
rendering 30% faster in the examples, and simplifies the code. It also
removes the issue where Python would report either the first or last
line of the multi-line format expression, messing up the traceback line
number mapping.
jinja2/compiler.py
jinja2/nativetypes.py
jinja2/runtime.py
tests/test_api.py
tests/test_async.py