OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """ | 2 """ |
3 jinja2.optimizer | 3 jinja2.optimizer |
4 ~~~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~~~ |
5 | 5 |
6 The jinja optimizer is currently trying to constant fold a few expressions | 6 The jinja optimizer is currently trying to constant fold a few expressions |
7 and modify the AST in place so that it should be easier to evaluate it. | 7 and modify the AST in place so that it should be easier to evaluate it. |
8 | 8 |
9 Because the AST does not contain all the scoping information and the | 9 Because the AST does not contain all the scoping information and the |
10 compiler has to find that out, we cannot do all the optimizations we | 10 compiler has to find that out, we cannot do all the optimizations we |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 lineno=node.lineno, | 59 lineno=node.lineno, |
60 environment=self.environment) | 60 environment=self.environment) |
61 except nodes.Impossible: | 61 except nodes.Impossible: |
62 return node | 62 return node |
63 | 63 |
64 visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \ | 64 visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \ |
65 visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \ | 65 visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \ |
66 visit_Not = visit_Compare = visit_Getitem = visit_Getattr = visit_Call = \ | 66 visit_Not = visit_Compare = visit_Getitem = visit_Getattr = visit_Call = \ |
67 visit_Filter = visit_Test = visit_CondExpr = fold | 67 visit_Filter = visit_Test = visit_CondExpr = fold |
68 del fold | 68 del fold |
OLD | NEW |