- added :meth:`jinja2.environment.TemplateStream.dump`.
+- added support for implicit string literal concatenation.
+ ``{{ "foo" "bar" }}`` is equivalent to ``{{ "foobar" }}``
+
Version 2.0rc1
--------------
(no codename, released on July 9th 2008)
else:
node = nodes.Name(token.value, 'load', lineno=token.lineno)
self.stream.next()
- elif token.type in ('integer', 'float', 'string'):
+ elif token.type is 'string':
+ self.stream.next()
+ buf = [token.value]
+ lineno = token.lineno
+ while self.stream.current.type is 'string':
+ buf.append(self.stream.current.value)
+ self.stream.next()
+ node = nodes.Const(''.join(buf), lineno=lineno)
+ elif token.type in ('integer', 'float'):
self.stream.next()
node = nodes.Const(token.value, lineno=token.lineno)
elif token.type is 'lparen':
def test_test_chaining(env):
raises(TemplateSyntaxError, env.from_string, '{{ foo is string is sequence }}')
env.from_string('{{ 42 is string or 42 is number }}').render() == 'True'
+
+
+def test_string_concatenation(env):
+ tmpl = env.from_string('{{ "foo" "bar" "baz" }}')
+ assert tmpl.render() == 'foobarbaz'