]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Switch blocks and variables to dictionaries
authorKevin Brown <kevin@kevin-brown.com>
Fri, 8 May 2020 12:14:38 +0000 (08:14 -0400)
committerKevin <kevin@kevin-brown.com>
Sun, 10 May 2020 01:50:06 +0000 (21:50 -0400)
This should make it easier to differentiate them based on their
type but also allow for the different pieces to have proper names.

tatsu_grammar.txt

index f214a9c56515bf5224c624b7280e097eadcd2dfb..9adc5299b6a09f580b3ad712c17d1061ed90070e 100644 (file)
@@ -39,12 +39,12 @@ block_expression
 \r
 block_start\r
     =\r
-    block_open !("end") IDENTIFIER {block_parameter}* block_close\r
+    block_open type:`blockstart` !("end") name:IDENTIFIER parameters:[{block_parameter}*] block_close\r
     ;\r
 \r
 block_end\r
     =\r
-    block_open "end" IDENTIFIER block_close\r
+    block_open type:`blockend` "end" name:IDENTIFIER block_close\r
     ;\r
 \r
 block_open\r
@@ -63,7 +63,7 @@ block_parameter
 \r
 variable_expression\r
     =\r
-    variable_open variable_identifier { !variable_close variable_filter }* variable_close\r
+    variable_open type:`variable` name:variable_identifier { !variable_close filters+:variable_filter }* variable_close\r
     ;\r
 variable_open\r
     =\r