void -> do
--HG--
branch : trunk
diff --git a/jinja2/ext.py b/jinja2/ext.py
index 119fe4e..bd64cce 100644
--- a/jinja2/ext.py
+++ b/jinja2/ext.py
@@ -277,6 +277,18 @@
return nodes.Output([node])
+class ExprStmtExtension(Extension):
+ """Adds a `do` tag to Jinja2 that works like the print statement just
+ that it doesn't print the return value.
+ """
+ tags = set(['do'])
+
+ def parse(self, parser):
+ node = nodes.ExprStmt(lineno=parser.stream.next().lineno)
+ node.node = parser.parse_tuple()
+ return node
+
+
def extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS):
"""Extract localizable strings from the given template node.
@@ -360,3 +372,4 @@
#: nicer import names
i18n = InternationalizationExtension
+do = ExprStmtExtension