From: Kevin Brown Date: Fri, 8 May 2020 11:13:52 +0000 (-0400) Subject: Support key-value block parameters X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=080489c63c6873b4e8cc29d2ec016de3c3083be5;p=thirdparty%2Fjinja.git Support key-value block parameters Block parameters should support all of the things that a function call parameter would normally support. This includes key-value paramters and in our test we include the transaltion example from the documentation. --- diff --git a/tatsu_grammar.txt b/tatsu_grammar.txt index 43a9d1e3..343059cc 100644 --- a/tatsu_grammar.txt +++ b/tatsu_grammar.txt @@ -58,12 +58,7 @@ block_close block_parameter = - {SP}+ @:(IDENTIFIER "=" block_parameter_value) - | {SP}+ @:block_parameter_value - ; -block_parameter_value - = - variable_identifier + variable_accessor_call_parameter ; variable_expression diff --git a/test_template.jinja b/test_template.jinja index df151ef1..0e23daf7 100644 --- a/test_template.jinja +++ b/test_template.jinja @@ -11,4 +11,5 @@ across lines #} {% raw %} {% block %}fake content{{ fake vars }} {% endraw %} -{{ '{{' }} \ No newline at end of file +{{ '{{' }} +{% trans user=user.username %}Hello, {{ user }}!{% endtrans %} \ No newline at end of file