Support named parameters to calls
This also switches the parameters in calls to be returned as a dictionary which should make it easier to differentiate between a value-only parameter and a key-value parameter.
This commit is contained in:
parent
611bdcfcc4
commit
3480d1fa0e
@ -102,8 +102,29 @@ variable_accessor_call
|
||||
|
||||
variable_accessor_call_parameters
|
||||
=
|
||||
{SP}* @+:variable_identifier {SP}*
|
||||
{ "," {SP}* @+:variable_identifier {SP}* }*
|
||||
@+:variable_accessor_call_parameter
|
||||
{ "," @+:variable_accessor_call_parameter }*
|
||||
;
|
||||
|
||||
variable_accessor_call_parameter
|
||||
=
|
||||
variable_accessor_call_parameter_key_value
|
||||
| variable_accessor_call_parameter_value_only
|
||||
;
|
||||
|
||||
variable_accessor_call_parameter_key_value
|
||||
=
|
||||
{SP}* key:IDENTIFIER {SP}* "=" value:variable_accessor_call_parameter_value {SP}*
|
||||
;
|
||||
|
||||
variable_accessor_call_parameter_value_only
|
||||
=
|
||||
value:variable_accessor_call_parameter_value
|
||||
;
|
||||
|
||||
variable_accessor_call_parameter_value
|
||||
=
|
||||
{SP}* @:variable_identifier {SP}*
|
||||
;
|
||||
|
||||
variable_accessor_dot
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{% with key=val.test %}
|
||||
{{ dict_var['single']["double"].dot |test(first ,second, third)|filter | lastFilter}}
|
||||
{{ dict_var['single']["double"].dot |test(first ,second, named=third)|filter | lastFilter}}
|
||||
{%block single key=val param=value %}
|
||||
test {{var}}
|
||||
{%endblock%}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user