]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Add line block pair checking
authorKevin Brown <kevin@kevin-brown.com>
Sat, 16 May 2020 02:17:46 +0000 (22:17 -0400)
committerKevin Brown <kevin@kevin-brown.com>
Sat, 16 May 2020 02:17:46 +0000 (22:17 -0400)
Similar to how it is done in regular Jinja blocks, line blocks will
now check to make sure that start and end blocks are properly paired
together. When they are not paired together, it will fall back to
parsing them separately like one would expect.

src/jinja2/new_parser.py

index 9d78921f377a035ba6e8c0370091fd4d406607e4..0a3dbeb89edace7299f027370f59de804517fd6f 100644 (file)
@@ -14,6 +14,9 @@ class JinjaSemantics(object):
 \r
         return ast\r
 \r
+    def line_block_expression_pair(self, ast):\r
+        return self.block_expression_pair(ast)\r
+\r
 \r
 def lineno_from_parseinfo(parseinfo):\r
     return parseinfo.line + 1\r