Add function calls for variables

This allows for functions to be called, currently with a single
variable optionally passed.

This also adds a check to make sure that variable literals are
supported.
This commit is contained in:
Kevin Brown 2020-05-08 06:44:18 -04:00 committed by Kevin
parent 9f92f5c9e8
commit f12d76704d
2 changed files with 11 additions and 2 deletions

View File

@ -87,7 +87,7 @@ variable_identifier
variable_accessor
=
variable_accessor_brackets | variable_accessor_dot
variable_accessor_brackets | variable_accessor_call | variable_accessor_dot
;
variable_accessor_brackets
@ -95,6 +95,11 @@ variable_accessor_brackets
"[" variable_identifier "]"
;
variable_accessor_call
=
"(" [variable_identifier] ")"
;
variable_accessor_dot
=
"." variable_identifier

View File

@ -3,8 +3,12 @@
{%block single key=val param=value %}
test {{var}}
{%endblock%}
{% for item in dict_var.values() %}
<li>{% block loop_item %}{{ item }}{% endblock %}</li>
{% endfor %}
{# comment contents
across lines #}
{% raw %}
{% block %}fake content{{ fake vars }}
{% endraw %}
{% endraw %}
{{ '{{' }}