Skip to content
Myr

fixed error reporting for filtered statements

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 83fbc0f · Browse files · 1 file+8 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−7 removed

  • other:+8 added−7 removed

1 file+8 added−7 removed

modified:jinja2/compiler.py+8 added-7 removed
1120 unmodified lines
1121 if len(body) == 1:1122 self.writeline('%s.append(' % frame.buffer)1123 else:1124 self.writeline('%s.extend((' % frame.buffer)1125 self.indent()1126 for item in body:1127 if isinstance(item, list):1128 val = repr(concat(item))1129 if frame.buffer is None:1130 self.writeline('yield ' + val)1131 else:1131 self.write(val + ', ')1132 self.writeline(val + ', ')1133 else:1134 if frame.buffer is None:1135 self.writeline('yield ')1136 else:1137 self.newline(item)1138 close = 11139 if self.environment.autoescape:1140 self.write('escape(')1141 else:
6 unmodified lines
1148 if frame.buffer is not None:1149 self.write(', ')1150 if frame.buffer is not None:1151 # close the open parentheses1152 self.outdent()1149 self.write(len(body) == 1 and ')' or '))')1153 self.writeline(len(body) == 1 and ')' or '))')11541155 # otherwise we create a format string as this is faster in that case1156 else:1157 format = []
9 unmodified lines
1167 else:1168 self.writeline('%s.append(' % frame.buffer)1169 self.write(repr(concat(format)) + ' % (')1170 idx = -11167 self.indent()1171 for argument in arguments:1169 self.newline(argument)1172 close = 01173 if self.environment.autoescape:1174 self.write('escape(')1175 close += 11176 if self.environment.finalize is not None:1177 self.write('environment.finalize(')1178 close += 11179 self.visit(argument, frame)1178 self.write(')' * close + ',')1179 self.outdent()1180 self.writeline(')')1180 self.write(')' * close + ', ')1181 self.write(')')1182 if frame.buffer is not None:1183 self.write(')')11841185 if outdent_later:
239 unmodified lines