]> git.ipfire.org Git - thirdparty/jinja.git/commit
Added semantics for pairing blocks together
authorKevin <kevin@kevin-brown.com>
Wed, 13 May 2020 01:27:40 +0000 (21:27 -0400)
committerKevin <kevin@kevin-brown.com>
Wed, 13 May 2020 01:27:40 +0000 (21:27 -0400)
commit00e950e831290a6f0a5ea265184654b07bb5c5e7
tree72a0f77a14e40046595bb62ff7b359e7f915924d
parent9cf1c578d4477880449fbca52ba6dbb0ed1ac10f
Added semantics for pairing blocks together

This required us to modify how the parser works so that once it
detects a pair of blocks, it kicks it back to our specific function
which allows us to detect if the pair of blocks it detected were a
matching pair. This is required in order to allow single blocks to
be included within paired blocks, as otherwise it would always match
the last single block to the end block.

This required changing the grammar so the pair blocks had their own
named expression. This allows us to reject the parse as invalid with
incorrect semantics and allows it to try to just parse the first
block alone.
grammar.ebnf
test_tatsu.py