added more utility rules and updated example

This commit is contained in:
danhanson committed 2026-09-14 15:33:17 -05:00
1 parent 036928d628
commit cb8c9f9c0b
12 files changed
+34942 -32273

No files matched your search

+19 -22
View File
@@ -335,7 +335,6 @@ Blocktrans Closed By The Other Spelling
---
==================
Blocktranslate Closed By The Other Spelling
:error
@@ -346,7 +345,6 @@ Blocktranslate Closed By The Other Spelling
---
==================
Blocktrans With Count And No Plural
==================
@@ -370,8 +368,6 @@ Blocktrans With Count And No Plural
(endblocktrans_block))
(content))
==================
Blocktrans With Plural And No Count
:error
@@ -382,7 +378,6 @@ Blocktrans With Plural And No Count
---
==================
Blocktrans Counting Two Bindings
:error
@@ -393,7 +388,6 @@ Blocktrans Counting Two Bindings
---
==================
Blocktrans With Nothing To Bind
:error
@@ -404,7 +398,6 @@ Blocktrans With Nothing To Bind
---
==================
Blocktrans With An Unknown Option
:error
@@ -415,7 +408,6 @@ Blocktrans With An Unknown Option
---
==================
Blocktrans With Asvar And No Name
:error
@@ -426,7 +418,6 @@ Blocktrans With Asvar And No Name
---
==================
Blocktrans Holding A Tag
:error
@@ -437,7 +428,6 @@ Blocktrans Holding A Tag
---
==================
Blocktrans Holding A Comment
:error
@@ -448,7 +438,6 @@ Blocktrans Holding A Comment
---
==================
Blocktrans Holding Another Blocktrans
:error
@@ -459,17 +448,33 @@ Blocktrans Holding Another Blocktrans
---
==================
Blocktrans With Two Plurals
:error
==================
{% blocktrans count n=x %}one{% plural %}many{% plural %}x{% endblocktrans %}
---
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(plural_clause
(plural_block)
(content)))
(missing_endblocktrans_block))
(unexpected_block)
(content)
(unexpected_block)
(content))
==================
Blocktrans With An Argument On Plural
@@ -481,7 +486,6 @@ Blocktrans With An Argument On Plural
---
==================
Blocktrans With Trimmed Twice
:error
@@ -492,7 +496,6 @@ Blocktrans With Trimmed Twice
---
==================
Blocktrans With With Twice
:error
@@ -503,7 +506,6 @@ Blocktrans With With Twice
---
==================
Blocktrans With Context Twice
:error
@@ -514,7 +516,6 @@ Blocktrans With Context Twice
---
==================
Blocktrans With Asvar Twice
:error
@@ -525,7 +526,6 @@ Blocktrans With Asvar Twice
---
==================
Blocktrans With Count Twice
:error
@@ -536,7 +536,6 @@ Blocktrans With Count Twice
---
==================
Blocktranslate With Trimmed Twice
:error
@@ -547,7 +546,6 @@ Blocktranslate With Trimmed Twice
---
==================
Blocktrans Repeating An Option Of The Tag Before It
==================
@@ -579,4 +577,3 @@ Blocktrans With A Binding Twice
---
+9 -2
View File
@@ -230,25 +230,32 @@ Builtin Filter With An Argument It Does Not Take
---
==================
Custom Tag Does Not Cover An End Tag
:error
==================
{% endif %}
---
(template
(content)
(unexpected_block)
(content))
==================
Custom Tag Does Not Cover A Part Of A Tag Group
:error
==================
{% else %}
---
(template
(content)
(unexpected_block)
(content))
==================
A Name Reserved For A Tag Is Still A Variable
+27 -2
View File
@@ -173,7 +173,6 @@ c
==================
Ifchanged With Two Elses
:error
==================
{% ifchanged %}
@@ -186,10 +185,24 @@ c
---
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause
(else_block)
(template
(content)
(unexpected_block)
(content)))
(endifchanged_block))
(content))
==================
Ifchanged With An Argument On Else
:error
==================
{% ifchanged %}
@@ -199,3 +212,15 @@ b
{% endifchanged %}
---
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)
(unexpected_block)
(content)))
(endifchanged_block))
(content))
+497 -9
View File
@@ -164,7 +164,7 @@ Missing Endif Before An Outer End Tag
(content))
==================
Missing Endfor Before An Outer Else
Unseen Outer Else Is Not A Missing Tag
==================
{% if a %}{% for x in y %}{% else %}b{% endif %}
@@ -189,12 +189,11 @@ Missing Endfor Before An Outer Else
(filtered_value
(value
(variable_attribute
(identifier))))))
(identifier)))))
(template
(unexpected_block)
(content)))
(missing_endfor_block))))
(else_clause
(else_block)
(template
(content)))
(endif_block))
(content))
@@ -462,35 +461,524 @@ Missing Endif After A Custom End Tag
(content)))
(missing_endif_block)))
==================
Second Else After A Nested Else Is Unexpected
==================
{% if a %}{% if b %}x{% else %}y{% else %}z{% endif %}
---
(template
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(content)
(unexpected_block)
(content)))
(endif_block))
(content)))
(missing_endif_block)))
==================
Second Empty After A Nested Empty Is Unexpected
==================
{% for x in y %}{% for z in w %}a{% empty %}b{% empty %}c{% endfor %}
---
(template
(content)
(for_group
(for_clause
(for_block
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(for_group
(for_clause
(for_block
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(template
(content)
(unexpected_block)
(content)))
(endfor_block))
(content)))
(missing_endfor_block)))
==================
Else Of An If Nested In An Else
==================
{% if a %}x{% else %}{% if b %}y{% else %}z{% endif %}{% endif %}
---
(template
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(content)))
(endif_block))))
(endif_block))
(content))
==================
Elif Of An If Nested In An Elif
==================
{% if a %}x{% elif b %}{% if c %}y{% elif d %}z{% endif %}{% endif %}
---
(template
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(elif_clause
(elif_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(elif_clause
(elif_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(endif_block))))
(endif_block))
(content))
==================
Empty Of A For Nested In An Empty
==================
{% for x in y %}a{% empty %}{% for z in w %}b{% empty %}c{% endfor %}{% endfor %}
---
(template
(content)
(for_group
(for_clause
(for_block
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(template
(for_group
(for_clause
(for_block
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(template
(content)))
(endfor_block))))
(endfor_block))
(content))
==================
Else Of An Ifchanged Nested In An Else Of An If
==================
{% if a %}x{% else %}{% ifchanged %}y{% else %}z{% endifchanged %}{% endif %}
---
(template
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause
(else_block)
(template
(content)))
(endifchanged_block))))
(endif_block))
(content))
==================
Else Of An If Nested In An Else Of An Ifchanged
==================
{% ifchanged %}a{% else %}{% if b %}y{% else %}z{% endif %}{% endifchanged %}
---
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause
(else_block)
(template
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(content)))
(endif_block))))
(endifchanged_block))
(content))
==================
Third Else Is Unexpected Too
==================
{% if a %}w{% else %}x{% else %}y{% else %}z{% endif %}
---
(template
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(content)
(unexpected_block)
(content)
(unexpected_block)
(content)))
(endif_block))
(content))
==================
Second And Third Empty Are Unexpected
==================
{% for x in y %}a{% empty %}b{% empty %}c{% empty %}d{% endfor %}
---
(template
(content)
(for_group
(for_clause
(for_block
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(template
(content)
(unexpected_block)
(content)
(unexpected_block)
(content)))
(endfor_block))
(content))
==================
Second And Third Else Of An Ifchanged Are Unexpected
==================
{% ifchanged %}a{% else %}b{% else %}c{% else %}d{% endifchanged %}
---
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause
(else_block)
(template
(content)
(unexpected_block)
(content)
(unexpected_block)
(content)))
(endifchanged_block))
(content))
==================
Second Else Inside A Block Is Unexpected
==================
{% block a %}{% if b %}x{% else %}y{% else %}z{% endif %}{% endblock %}
---
(template
(content)
(block_group
(block_clause
(block_block
(push_block))
(template
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(content)
(unexpected_block)
(content)))
(endif_block))))
(endblock_block
(pop_block)))
(content))
==================
Second Else Of An If In A For Is Unexpected
==================
{% for x in y %}{% if a %}b{% else %}c{% else %}d{% endif %}{% endfor %}
---
(template
(content)
(for_group
(for_clause
(for_block
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(template
(content)
(unexpected_block)
(content)))
(endif_block))))
(endfor_block))
(content))
==================
Stray End Tag After A Missing One
:error
==================
{% if a %}{% endfor %}
---
(template
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(unexpected_block)
(content)))
(missing_endif_block)))
==================
Endblock Naming No Open Block
:error
==================
{% block a %}{% block b %}{% endblock c %}
---
(template
(content)
(block_group
(block_clause
(block_block
(push_block))
(template
(block_group
(block_clause
(block_block
(push_block))
(template
(unexpected_block)
(content)))
(missing_endblock_block))))
(missing_endblock_block)))
==================
Second Else Is Not A Missing Tag
:error
==================
{% if a %}{% else %}{% else %}{% endif %}
---
(template
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))))
(else_clause
(else_block)
(template
(unexpected_block)))
(endif_block))
(content))
==================
Plural Without Count Is Not A Missing Tag