Files
tree-sitter-django/test/corpus/with.txt
T

145 lines
2.4 KiB
Plaintext

==================
With Basic
==================
{% with total=business.employees.count %}
{{ total }}
{% endwith %}
---
(template
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)
(attribute)))))
(template
(content)
(template_variable
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)))
(endwith_block))
(content))
==================
With Multiple Variables
==================
{% with a=1 b=2 %}
{{ a }}
{% endwith %}
---
(template
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number))))
variable: (identifier)
(filtered_value
(value
(literal
(number)))))
(template
(content)
(template_variable
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)))
(endwith_block))
(content))
==================
With A Binding Twice
:error
==================
{% with a=1 a=2 %}x{% endwith %}
---
==================
With A Binding Repeated Later
:error
==================
{% with a=1 b=2 a=3 %}x{% endwith %}
---
==================
With Repeating A Binding Of The Tag Before It
==================
{% with a=1 %}x{% endwith %}{% with a=2 %}y{% endwith %}
---
(template
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number)))))
(template
(content)))
(endwith_block))
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number)))))
(template
(content)))
(endwith_block))
(content))
==================
With A Binding Named After A Literal
==================
{% with True=1 %}a{% endwith %}
---
(template
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number)))))
(template
(content)))
(endwith_block))
(content))