diff options
Diffstat (limited to 'src/jinja2/optimizer.py')
-rw-r--r-- | src/jinja2/optimizer.py | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/jinja2/optimizer.py b/src/jinja2/optimizer.py index e262727..7bc78c4 100644 --- a/src/jinja2/optimizer.py +++ b/src/jinja2/optimizer.py @@ -1,20 +1,12 @@ # -*- coding: utf-8 -*- -""" - jinja2.optimizer - ~~~~~~~~~~~~~~~~ - - The jinja optimizer is currently trying to constant fold a few expressions - and modify the AST in place so that it should be easier to evaluate it. - - Because the AST does not contain all the scoping information and the - compiler has to find that out, we cannot do all the optimizations we - want. For example loop unrolling doesn't work because unrolled loops would - have a different scoping. - - The solution would be a second syntax tree that has the scoping rules stored. - - :copyright: (c) 2017 by the Jinja Team. - :license: BSD. +"""The optimizer tries to constant fold expressions and modify the AST +in place so that it should be faster to evaluate. + +Because the AST does not contain all the scoping information and the +compiler has to find that out, we cannot do all the optimizations we +want. For example, loop unrolling doesn't work because unrolled loops +would have a different scope. The solution would be a second syntax tree +that stored the scoping rules. """ from . import nodes from .visitor import NodeTransformer |