From: Ben Darnell Date: Fri, 16 Dec 2011 07:27:30 +0000 (-0800) Subject: Merge remote-tracking branch 'alekstorm/template_comment' into merge X-Git-Tag: v2.2.0~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54b244d2b82a925f457b8607752744e2cb9e8c16;p=thirdparty%2Ftornado.git Merge remote-tracking branch 'alekstorm/template_comment' into merge --- 54b244d2b82a925f457b8607752744e2cb9e8c16 diff --cc tornado/template.py index 01927d60c,fea31c1f7..7883a44ce --- a/tornado/template.py +++ b/tornado/template.py @@@ -709,9 -665,18 +712,18 @@@ def _parse(reader, template, in_block=N # which also use double braces. if reader.remaining() and reader[0] == "!": reader.consume(1) - body.chunks.append(_Text(start_brace)) + body.chunks.append(_Text(start_brace, line)) continue + # Comment + if start_brace == "{#": + end = reader.find("#}") + if end == -1: + raise ParseError("Missing end expression #} on line %d" % line) + contents = reader.consume(end).strip() + reader.consume(2) + continue + # Expression if start_brace == "{{": end = reader.find("}}")