added disclaimer to rwbench and fixed error reporting for one of the four Output...
authorArmin Ronacher <armin.ronacher@active-4.com>
Thu, 15 May 2008 22:22:40 +0000 (00:22 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Thu, 15 May 2008 22:22:40 +0000 (00:22 +0200)
--HG--
branch : trunk

examples/rwbench/rwbench.py
jinja2/compiler.py

index ccd144feba3294c43cfe42a9d269c6d36fee6f48..2406de2a257ba7df528fd6989e19e2f5739794f6 100644 (file)
@@ -3,7 +3,9 @@
     RealWorldish Benchmark
     ~~~~~~~~~~~~~~~~~~~~~~
 
-    A more real-world benchmark of Jinja2.
+    A more real-world benchmark of Jinja2.  Like the other benchmark in the
+    Jinja2 repository this has no real-world usefulnes (despite the name).
+    Just go away and ignore it.  NOW!
 
     :copyright: Copyright 2008 by Armin Ronacher.
     :license: BSD.
index 0b8ae964662a5e256cd0d847ae4f1e63ab775e18..9f99045bbac37756198b80918b75114cbc8573e7 100644 (file)
@@ -534,7 +534,7 @@ class CodeGenerator(NodeVisitor):
                                                  is nodes.Subscript)
             for node, count in static_subscribes:
                 ident = self.temporary_identifier()
-                self.writeline(ident + ' = ')
+                self.writeline(ident + ' = ', node)
                 self.visit(node, frame)
                 frame.overlays[node] = (ident, count)
 
@@ -556,9 +556,6 @@ class CodeGenerator(NodeVisitor):
         in the form name: alias and will write the required assignments
         into the current scope.  No indentation takes place.
         """
-        # make sure we "backup" overridden, local identifiers
-        # TODO: we should probably optimize this and check if the
-        # identifier is in use afterwards.
         aliases = {}
         for name in frame.identifiers.find_shadowed():
             aliases[name] = ident = self.temporary_identifier()
@@ -1190,7 +1187,9 @@ class CodeGenerator(NodeVisitor):
                 self.writeline('%s.append(' % frame.buffer)
             self.write(repr(concat(format)) + ' % (')
             idx = -1
+            self.indent()
             for argument in arguments:
+                self.newline()
                 close = 0
                 if self.environment.autoescape:
                     self.write('escape(')
@@ -1200,7 +1199,8 @@ class CodeGenerator(NodeVisitor):
                     close += 1
                 self.visit(argument, frame)
                 self.write(')' * close + ', ')
-            self.write(')')
+            self.outdent()
+            self.writeline(')')
             if frame.buffer is not None:
                 self.write(')')