massive rename

This commit is contained in:
danhanson committed 2026-09-14 15:59:53 -05:00
1 parent cb8c9f9c0b
commit 9f2fdaf746
49 files changed
+6378 -6403

No files matched your search

+65 -65
View File
@@ -50,16 +50,16 @@ that place it:
`$._sep`. Newlines included: Django matches tags with `re.DOTALL`, so tags may span lines.
- `part(...)` — one tag part, taking the whitespace that separates it from the part before.
- `joined(first, ...rest)` — parts separated from _each other_, with no leading separator (`not in`).
- `block(tag, ...args)` — `{%`, optional separator, tag name, args, optional separator, `%}`; tags may
- `tag(name, ...args)` — `{%`, optional separator, tag name, args, optional separator, `%}`; tags may
hug their delimiters (`{%cycle 1%}`).
- `asVariable($)` — the `as name` clause. Every tag that takes one names the target `field("variable", …)`;
do not invent a second name for it.
- `simpleTag($, tag, args, kwargs)` — a tag registered with Django's `simple_tag`, which always accepts
- `simpleTag($, name, args, kwargs)` — a tag registered with Django's `simple_tag`, which always accepts
positional filter expressions, then `name=value` keywords, then `as name`. `args`: `true` (`*args`), a
count (at most N), or `false`. `kwargs`: `true` (`**kwargs`), `false`, or `{name: rule}` for a known
signature. Put the Python signature in a comment above the call site.
- `arrangements(items)` — every ordered subset of `items`, so that a tag's options may be written in any
order but never twice. Used by `translate_block` and `include_block`; keyword arguments are guarded by the scanner
order but never twice. Used by `translate_tag` and `include_tag`; keyword arguments are guarded by the scanner
instead. Grows as `Σ C(n,k)·k!` (65 for four names), which is
why it is only used for signatures that name their arguments.
- `wordAsValueRules(word)` / `wordAsValue($, word, continued)` — a tag's own keyword written where a value
@@ -86,82 +86,82 @@ Consequences worth knowing before editing a rule:
table is built and discards the other parse outright, which is how a bare `{% if x is y %}` came to be
an error.
### A tag group is a sequence of clauses
### A tag group is a sequence of blocks
Every group is split so that each tag that opens a body owns a node of its own:
```js
if_block: ($) => startBlock("if", part($.predicate)),
if_clause: ($) => seq($.if_block, optional($.template)),
endif_block: ($) => endBlock("endif"),
if_tag: ($) => startTag("if", part($.predicate)),
if_block: ($) => seq($.if_tag, optional($.template)),
endif_tag: ($) => endTag("endif"),
if_group: ($) =>
seq(
$.if_clause,
repeat($.elif_clause),
optional($.else_clause),
choice($.endif_block, alias($._missing_block, $.missing_endif_block)),
$.if_block,
repeat($.elif_block),
optional($.else_block),
choice($.endif_tag, alias($._missing_tag, $.missing_endif_tag)),
),
```
**A clause is complete without the closing tag, and that is the point.** While a template is being edited
**A block is complete without the closing tag, and that is the point.** While a template is being edited
the closer usually is not there yet, and a group rule cannot be reduced without it — so `{% if a %}{% x %}`
used to produce a top-level `ERROR` with the body's `template` parented to nothing that says which tag
opened it. A clause reduces anyway, so it survives error recovery and tooling can walk up from the cursor
opened it. A block reduces anyway, so it survives error recovery and tooling can walk up from the cursor
to find the enclosing tag. That is what makes completion of `{% elif %}`, `{% else %}`, `{% empty %}` and
the end tags possible.
**Every `{% %}` is a node of its own, named `<tag>_block`** after the tag as Django spells it: `if_block`,
`elif_block`, `endif_block`, `block_block`, `templatetag_block`, `custom_tag_block`. A clause is its
opening block and a body; a group is its clauses and its end block. A block ends at `%}` and nothing can
**Every `{% %}` is a node of its own, named `<name>_tag`** after the tag's name as Django spells it: `if_tag`,
`elif_tag`, `endif_tag`, `block_tag`, `templatetag_tag`, `custom_tag`. A block is its
opening tag and a body; a group is its blocks and its end tag. A tag ends at `%}` and nothing can
extend it, so it reduces on whatever token follows — the end of input included — and a half-written
template still holds the last `{% for … %}` or `{% endif %}` typed as a whole node, not as loose tokens.
Stripping `_block` gives the name; a new tag, or a tag group's new part, follows the same scheme.
Stripping `_tag` gives the tag name; a new tag, or a tag group's new part, follows the same scheme.
A group's last child is its end block or, where the end tag is missing, a zero-width marker named for it
(`missing_endif_block`; see the scanner section). So an unterminated group still reduces to a group node,
and a group's tag written where no open group can hold it is an `unexpected_block` (see the load section
(`missing_endif_tag`; see the scanner section). So an unterminated group still reduces to a group node,
and a group's tag written where no open group can hold it is an `unexpected_tag` (see the load section
below), so only a body the grammar cannot read produces an `ERROR`.
Every tag is built from ten inline utility rules — `simpleBlockOpen`/`simpleBlockClose`,
`startBlockOpen`/`startBlockClose`,
`followBlockOpen`/`followBlockClose`, `repeatBlockOpen`/`repeatBlockClose`, `endBlockOpen`/`endBlockClose` —
through the helpers `block` (a tag outside any group, from `simpleBlockOpen`/`simpleBlockClose`), `startBlock`, `followBlock` (a middle tag a group
holds at most once: `else`, `empty`, `plural`), `repeatBlock` (one it may repeat: `elif`) and `endBlock`.
Every tag is built from ten inline utility rules — `simpleTagOpen`/`simpleTagClose`,
`startTagOpen`/`startTagClose`,
`followTagOpen`/`followTagClose`, `repeatTagOpen`/`repeatTagClose`, `endTagOpen`/`endTagClose` —
through the helpers `tag` (a tag outside any group, from `simpleTagOpen`/`simpleTagClose`), `startTag`, `followTag` (a middle tag a group
holds at most once: `else`, `empty`, `plural`), `repeatTag` (one it may repeat: `elif`) and `endTag`.
They are inline rules rather than JS helpers so that a grammar extending this one can use them. **Every
tag must begin with one of the opens**, one an extending grammar adds included: the token they read the
tag's name with is valid wherever a tag's name is and the scanner always returns it, so a tag written from a bare `"{%"` never matches: its name is read as a `custom_tag_block` instead,
with no error to show for it. Choose `followBlock` or `repeatBlock` by what the grammar allows, because the
scanner trusts it: a tag marked once-only that can in fact repeat is an `unexpected_block` from its
tag's name with is valid wherever a tag's name is and the scanner always returns it, so a tag written from a bare `"{%"` never matches: its name is read as a `custom_tag` instead,
with no error to show for it. Choose `followTag` or `repeatTag` by what the grammar allows, because the
scanner trusts it: a tag marked once-only that can in fact repeat is an `unexpected_tag` from its
second use on, and one marked repeatable that cannot is never flagged when repeated.
The names themselves need no hand-maintained list either: in the generated `src/node-types.json`, a group's
`children` are its clause types and its end block, and a clause's children include its opening block, so
the candidates for a group are its end block plus the opening block of each clause it can hold. For
`if_group` that is `endif_block` from the group and `if_block`, `elif_block`, `else_block` from its three
clauses. Going the other way — from a clause the cursor sits in to the
groups that can hold it — is the same table read backwards, which is what a clause needs when error
`children` are its block types and its end tag, and a block's children include its opening tag, so
the candidates for a group are its end tag plus the opening tag of each block it can hold. For
`if_group` that is `endif_tag` from the group and `if_tag`, `elif_tag`, `else_tag` from its three
blocks. Going the other way — from a block the cursor sits in to the
groups that can hold it — is the same table read backwards, which is what a block needs when error
recovery has left it without its group.
Do not reach for lookahead to solve that instead: `ts_language_next_state` follows only the shift on `{%`,
which lands in the "a tag starts here" state no matter how the tree is shaped.
`else_clause` is shared by `if_group` and `ifchanged_group`. `comment_clause` and `verbatim_clause` hold raw
scanner text that admits no tags. `blocktranslate_group` has one clause per spelling, `blocktrans_clause` and
`blocktranslate_clause`, because each must be closed by its own end tag; the counted form nests a
`plural_clause` inside it, since `{% plural %}` is only valid after `count`. The clause has to know which
form its opening block was, so `blocktransRules` builds each as a hidden rule (`_blocktrans_block`,
`_blocktrans_count_block`) and aliases both to the one visible `blocktrans_block` where the clause uses
`else_block` is shared by `if_group` and `ifchanged_group`. `comment_block` and `verbatim_block` hold raw
scanner text that admits no tags. `blocktranslate_group` has one block per spelling, `blocktrans_block` and
`blocktranslate_block`, because each must be closed by its own end tag; the counted form nests a
`plural_block` inside it, since `{% plural %}` is only valid after `count`. The block has to know which
form its opening tag was, so `blocktransRules` builds each as a hidden rule (`_blocktrans_tag`,
`_blocktrans_count_tag`) and aliases both to the one visible `blocktrans_tag` where the block uses
it. Their bodies are
`_translate_body`, not `template`, which is why these four clauses need no `conflicts` entry — the rule
`_translate_body`, not `template`, which is why these four blocks need no `conflicts` entry — the rule
below is about a body that can itself start with `{%`.
**Every clause needs a `conflicts` entry.** The generator offers a left associativity instead; taking it is
**Every block needs a `conflicts` entry.** The generator offers a left associativity instead; taking it is
what broke `{% for %}` in `06aa870`, where `prec.left` resolved the shift/reduce on `{%` statically and
silently discarded the parse in which the body continues, so every tag inside a loop became an `ERROR`.
Sharing the clauses also made the table markedly smaller — 7,200 states and a 515KB library became 5,150
Sharing the blocks also made the table markedly smaller — 7,200 states and a 515KB library became 5,150
and 383KB — for the same reason hoisting `blocktranslate`'s pieces into hidden rules did: the automaton
stops duplicating the body states in every group's inline context. Giving every `{% %}` its own `_block`
stops duplicating the body states in every group's inline context. Giving every `{% %}` its own `_tag`
rule shrank it again, from 1,999 states to 1,818, by the same mechanism. The group stack's tokens (see the
scanner section) cost 247, to 3,304.
@@ -177,34 +177,34 @@ whitespace first, so a pipe there must be tight. Hence `_filtered_value_spaced`
A library's tags and filters are registered in Python, so the grammar cannot know their names, their
arity, or whether a tag is a block tag. Two fallback rules accept them:
- `custom_tag_block` — `simpleTag($, $.identifier)`, i.e. what `simple_tag`/`inclusion_tag` accept, which is how
- `custom_tag` — `simpleTag($, $.identifier)`, i.e. what `simple_tag`/`inclusion_tag` accept, which is how
a tag is registered unless it needs the parser itself.
- `_custom_filter`, the last alternative of `filter`, whose name is `$.identifier` rather than one of the
builtin literals. Hidden, so the tree is what an inline alternative would give, but named so that a
grammar extending this one can filter it out of `filter`'s `members` the way it can `custom_tag_block` — see
grammar extending this one can filter it out of `filter`'s `members` the way it can `custom_tag` — see
the extension section in `README.md`.
**A name that only exists inside a tag group has to be reserved instead.** `endif`, `else`, `empty` and
the rest are tokens only in the state their group opens, so where a tag is named the lexer reads them as an
identifier and `custom_tag_block` takes them: `{% endif %}` on its own parsed as a tag from some library. They are
identifier and `custom_tag` takes them: `{% endif %}` on its own parsed as a tag from some library. They are
listed in `NAMES_INSIDE_A_TAG_GROUP` and applied through the `tag_name` reserved context, which wraps
`custom_tag_block`'s name **and nothing else** — a reserved context replaces the global one inside whatever it
`custom_tag`'s name **and nothing else** — a reserved context replaces the global one inside whatever it
wraps, so wrapping the whole rule would un-reserve `as` and reject `{% mytag endif %}`. Adding a tag group
with a new part or end tag means adding its name there too.
**The same names are what `unexpected_block` accepts.** Once reserved, a group's tag written where no open
**The same names are what `unexpected_tag` accepts.** Once reserved, a group's tag written where no open
group can hold it — `{% endif %}` with nothing open, `{% else %}` in a `{% for %}` — used to be an `ERROR`,
and error recovery placed it badly: every tag starts with `{%` and the read token, which the parser has
already accepted when the name turns out to be wrong, so recovery rewinds to just after them and folds the
stray tag into whichever tag comes next, which then holds the `ERROR`. `unexpected_block` takes any of
stray tag into whichever tag comes next, which then holds the `ERROR`. `unexpected_tag` takes any of
`NAMES_INSIDE_A_TAG_GROUP` with loose arguments, so there is nothing to recover; `prec.dynamic(-1)` keeps it
from displacing a tag the group does take, and `queries/errors.scm` reports it as
`@error.unexpected_block`. It added 31 states and no `conflicts` entry.
`@error.unexpected_tag`. It added 31 states and no `conflicts` entry.
Where several tags share a name the group holds only once — `{% if %}{% else %}{% else %}{% else %}` — reading
any of them as the stray parses, so the ties are broken by dynamic precedence: `unexpected_block` is -1 when
any of them as the stray parses, so the ties are broken by dynamic precedence: `unexpected_tag` is -1 when
`_group_held` confirms the innermost group already holds the name and -2 otherwise, so each tag flagged
before its time costs one more, and the first stays the clause however many follow.
before its time costs one more, and the first still opens the block however many follow.
**Builtin names must stay keyword-extractable, or the fallbacks swallow them.** `word: $.identifier` turns
each builtin's name into its own token, which the lexer prefers wherever it is valid, so a builtin commits
@@ -235,7 +235,7 @@ no ordering predicate to express it. What such a tool needs to know about Django
A library's filters go in their own arity tables (`L10N_FILTERS_WITHOUT_ARGUMENT`,
`TZ_FILTERS_WITH_ARGUMENT`, …) rather than into the builtin ones, so that the builtin parity check still has an exact list to compare against.
Modelling a library name makes it keyword-extracted, so it no longer reaches `custom_tag_block`. A project that
Modelling a library name makes it keyword-extracted, so it no longer reaches `custom_tag`. A project that
registers its own tag under one of these names and a different signature therefore gets a parse error. That
is accepted: these names are common enough that shadowing them is the mistake.
@@ -273,7 +273,7 @@ Eighteen external tokens, for the constraints a context-free grammar cannot expr
reads the tag's name into `read_word`. The other four sit right before `%}` and check that it follows:
push opens a group expecting `"end"` + `read_word` (every Django end tag is spelled that way), follow
records a middle tag the innermost group may hold only once, repeat records nothing, and close pops the
innermost group once `read_word` is what it expects. `_group_held` belongs to `unexpected_block` (see the load section) and returns only when
innermost group once `read_word` is what it expects. `_group_held` belongs to `unexpected_tag` (see the load section) and returns only when
the innermost group already holds a tag named `read_word`. Reading `count` (`_bt_option`) marks the group about
to be pushed as waiting for `plural`, which its follow clears. An entry is
`{expected, name, middles, awaits_plural}`, serialized as `expected:name:middles:flag` and a newline per
@@ -281,12 +281,12 @@ Eighteen external tokens, for the constraints a context-free grammar cannot expr
the error state rather than overrun it. Push and follow before `%}` cost 247 states over the table-driven
scanner (3,057 to 3,304), because argument-final states stop being shared with tags where the token is not
valid; after `%}`, where each tag's states are its own, saved only 15.
- `_missing_block` — the marker where a group's required tag block is missing, aliased at each use to
`missing_endX_block` or `missing_plural_block` (`MISSING_BLOCKS`). It is placed only at the end of input;
- `_missing_tag` — the marker where a group's required tag block is missing, aliased at each use to
`missing_endX_tag` or `missing_plural_tag` (`MISSING_TAGS`). It is placed only at the end of input;
before the end tag of a group enclosing the innermost one; before an `endblock`/`endpartialdef` naming a
block further out; or before a second `plural`, since a blocktranslate body holds no tag that could take it.
Any other tag is taken to be the innermost group's, as Django's parser takes it — a middle tag it has not
held yet, and a second of one it holds only once, which is an `unexpected_block` inside it. Marking the
held yet, and a second of one it holds only once, which is an `unexpected_tag` inside it. Marking the
group closed before a second `else` was tried and dropped: inside `{% block %}`, where most template code
sits, there is always an enclosing group to hand the `else` to, so the inner group's own end tag became a
stray instead. A counted blocktranslate is missing its
@@ -330,7 +330,7 @@ Zero-width guards carry one hazard: `recover_with_missing` can supply one withou
during tree-sitter's mark-everything-valid recovery pass, so new guards go **below** it — and above the
whitespace loop, which skips the separator the grammar still has to match. A guard must also never be valid
where `content` is: a zero-width token at a content boundary preempts the internal lexer and `content` stops
matching. `_missing_block` is the one exception, and is safe only because it returns a token solely at the end
matching. `_missing_tag` is the one exception, and is safe only because it returns a token solely at the end
of input or at `{%`, where `content` cannot match. It is scanned above the raw-text scanners, which find
nothing at the end of an empty body.
@@ -343,13 +343,13 @@ got the right markers. Junk inside an end tag does leave the whole file an `ERRO
`queries/highlights.scm` lists tag and filter names explicitly, so adding either to the grammar means
adding it there too; filter names appear there without their colon. A name the grammar does not know is
captured through its field instead (`(filter name: (identifier))`, `(custom_tag_block tag: (identifier))`).
captured through its field instead (`(filter filter_name: (identifier))`, `(custom_tag tag_name: (identifier))`).
`queries/libraries.scm` is not a query editors run themselves; it is data for a linter, and every tag or
filter added from a library belongs in it. `queries/locals.scm` relies on the `variable:` field to tell a
binding from a reference — another reason to keep `asVariable` uniform. `{% blocktranslate %}`'s `asvar`
target carries an `asvar:` field instead, because it is written inside the tag but assigned outside it:
the scope on `blocktrans_clause` / `blocktranslate_clause` confines the `with` and `count` bindings, and would swallow `asvar`
the scope on `blocktrans_block` / `blocktranslate_block` confines the `with` and `count` bindings, and would swallow `asvar`
too if it were spelled the same way. `queries/exports.scm` names it for a tool to
bind in the scope around the block, which a locals query cannot do: it places a definition in the innermost
scope containing it and offers no way out again.
@@ -359,16 +359,16 @@ scope containing it and offers no way out again.
`{% if a %}{% now "Y" as n %}{% endif %}{{ n }}` may reach `{{ n }}` with nothing bound. A locals query
cannot: it matches a reference to the definition whose scope contains it and has no notion of a path not
taken. A group is exhaustive iff it has a `@conditional.default`, so each pattern captures the group
alongside one of its parts and a tool needs no list of which clause belongs to which group. Adding a tag
alongside one of its parts and a tool needs no list of which block belongs to which group. Adding a tag
group whose body may be skipped means adding it there — `{% cache %}` is the non-obvious one, since a
cache hit skips the body outright and `CacheNode` pushes no context.
A branch that is also a `@local.scope` confines its bindings whichever way the branch goes, which is why
`{% for %}` is inert for that check: `ForNode` renders `nodelist_empty` **inside** the same
`context.push()` as the loop body, so `empty_clause` is a scope alongside `for_clause`.
`context.push()` as the loop body, so `empty_block` is a scope alongside `for_block`.
`queries/errors.scm` collects what an editor should report: `(ERROR)` as `@error.syntax`, `(MISSING)` as
`@error.missing`, and every missing-tag marker as `@error.missing_block`. A tree holding only markers has
`@error.missing`, and every missing-tag marker as `@error.missing_tag`. A tree holding only markers has
no `has_error`, so a tool that checks that flag alone misses them. Adding a tag group means adding its
marker there, since no supertype matches them all.
@@ -428,8 +428,8 @@ unavoidable limitation, or a case where this grammar is the more permissive one
- `{% csp_nonce_attr "a" media="b" %}` is accepted, matching Django, which only rejects it at render time.
- A misspelled tag or filter cannot be caught: `{{ x|lenght }}` is indistinguishable from a filter some
library registered. Cross-referencing names against `{% load %}` needs the project's Python, so it
belongs in a linter; the `load_block` rule already parses the library and `from` names for one to use.
- `{% mytag %}…{% endmytag %}` parses as two sibling `custom_tag_block`s. Nesting them would mean guessing that
belongs in a linter; the `load_tag` rule already parses the library and `from` names for one to use.
- `{% mytag %}…{% endmytag %}` parses as two sibling `custom_tag`s. Nesting them would mean guessing that
an unknown tag is a block tag.
- A custom tag's contents are only assumed to be the `simple_tag` shape. `@register.tag` receives the raw
token and may parse anything, so `{% mytag <<>> %}` is rejected here and not by Django.
@@ -447,6 +447,6 @@ unavoidable limitation, or a case where this grammar is the more permissive one
- `partial`/`partialdef` are Django builtins as of Django 6; `elif`/`else`/`empty` are modelled as parts of
their enclosing tag rather than as separate tags.
- An unterminated group parses here and raises `TemplateSyntaxError` in Django: `{% if a %}x`, or a
`{% for %}` closed while an `{% if %}` inside it is still open, holds a `missing_endif_block` marker
`{% for %}` closed while an `{% if %}` inside it is still open, holds a `missing_endif_tag` marker
where the end tag belongs. The marker is the error, reported through `queries/errors.scm`; a check
for `ERROR` nodes alone accepts the tree.
+44 -48
View File
@@ -53,7 +53,7 @@ Five of the files in `queries/` are query files an editor loads:
- **`highlights.scm`** — syntax highlighting. Tag and filter names are listed one by one, so a name the
grammar knows is captured as `@function` and a name it is only tolerating as `@function.call`.
- **`locals.scm`** — scopes, definitions and references, so an editor can resolve a variable to the tag
that bound it. A definition is a `variable:` field; the scopes are the clauses whose bindings do not
that bound it. A definition is a `variable:` field; the scopes are the blocks whose bindings do not
outlive them (`{% with %}`, `{% for %}`, `{% empty %}`, `{% block %}`, `{% partialdef %}`,
`{% blocktranslate %}`).
- **`tags.scm`** — the symbol index behind `tree-sitter tag`. A `{% partialdef %}` and the names a
@@ -62,14 +62,14 @@ Five of the files in `queries/` are query files an editor loads:
the HTML around the tags can be parsed by its own grammar. It names no language, leaving the editor to
supply one.
- **`errors.scm`** — what to report as a problem: `(ERROR)` as `@error.syntax`, tree-sitter's own
`(MISSING)` as `@error.missing`, and `@error.missing_block` for the marker placed where a group's required
`(MISSING)` as `@error.missing`, and `@error.missing_tag` for the marker placed where a group's required
tag is missing. An unterminated `{% if a %}x` parses as an `if_group` ending in a zero-width
`missing_endif_block` rather than as an `ERROR`, so completion and the scope queries keep working while
`missing_endif_tag` rather than as an `ERROR`, so completion and the scope queries keep working while
a template is being written — and the tree reports no error of its own, so this query is how to find
it. A marker is placed only where the scanner can tell: at the end of input, before an end tag that
belongs to an enclosing group, or before an `{% endblock %}` naming a block further out.
A group's tag written where no open group can hold it, such as `{% else %}` inside a `{% for %}`, is an
`unexpected_block`, captured as `@error.unexpected_block`.
`unexpected_tag`, captured as `@error.unexpected_tag`.
The other three are data for a tool rather than queries an editor runs. Each captures the two halves of a
relation a tree-sitter query cannot express, and the tool does the join:
@@ -119,11 +119,11 @@ them is treated as the mistake.
A library's tags and filters are registered in Python, so the grammar cannot know their names, their
arity, or whether a tag opens a body. Two fallback rules accept them:
- **Tags.** Any tag the grammar does not recognise parses as `custom_tag_block`, with the shape `simple_tag` and
- **Tags.** Any tag the grammar does not recognise parses as `custom_tag`, with the shape `simple_tag` and
`inclusion_tag` give: positional filter expressions, then `name=value` keyword arguments, then an
optional `as name`. So `{% mytag a b|upper "s" k=1 as out %}` parses, with the name on the `tag:` field.
optional `as name`. So `{% mytag a b|upper "s" k=1 as out %}` parses, with the name on the `tag_name:` field.
A keyword argument written twice is refused, as `parse_bits` refuses it.
- **Filters.** An unknown filter parses as `(filter name: (identifier))` with at most one `:argument`,
- **Filters.** An unknown filter parses as `(filter filter_name: (identifier))` with at most one `:argument`,
which is all Django's expression regex allows. No arity check is possible.
Both are captured as `@function.call` rather than `@function`, so an editor can distinguish a name the
@@ -131,21 +131,21 @@ grammar knows from one it is only tolerating.
What the fallbacks cannot do:
- **A block tag is not nested.** `{% mytag %}…{% endmytag %}` is two sibling `custom_tag_block`s; pairing them
- **A block tag is not nested.** `{% mytag %}…{% endmytag %}` is two sibling `custom_tag`s; pairing them
would mean guessing that an unknown tag opens a body.
- **A tag registered with `@register.tag` may parse anything**, since it receives the raw token, so one
whose arguments are not the `simple_tag` shape — `{% mytag <<>> %}` — is an error here and not in Django.
- **A misspelled name cannot be caught.** `{{ x|lenght }}` is indistinguishable from a filter some library
registered. Cross-referencing names against `{% load %}` needs the project's Python, so it belongs in a
linter; `queries/libraries.scm` and the `load_block` rule supply what one needs.
linter; `queries/libraries.scm` and the `load_tag` rule supply what one needs.
- **Names that only exist inside a tag group are reserved**, so `{% endif %}` or `{% empty %}` standing on
its own is an `unexpected_block`, reported by `errors.scm`, rather than a call to a custom tag of that name.
its own is an `unexpected_tag`, reported by `errors.scm`, rather than a call to a custom tag of that name.
### Adding rules for your own tags and filters
For a project whose custom tags deserve real rules rather than the fallbacks, use this grammar as a base
grammar. `grammar(base, {...})` merges your rules into it, and a rule that redefines one the base already
has receives it as `previous`. A tag is an alternative of `tag_block_group`; a filter is an
has receives it as `previous`. A tag is an alternative of `template_tag`; a filter is an
alternative of `filter`.
```js
@@ -154,16 +154,15 @@ import django from "tree-sitter-django/grammar";
export default grammar(django, {
name: "djangox",
conflicts: ($, previous) => [...previous, [$.loop_clause]],
conflicts: ($, previous) => [...previous, [$.loop_block]],
rules: {
tag_block_group: ($, previous) =>
choice(previous, $.map_block, $.loop_group),
template_tag: ($, previous) => choice(previous, $.map_tag, $.loop_group),
// {% map items over rows %}
map_block: ($) =>
map_tag: ($) =>
seq(
$.simpleBlockOpen,
$.simpleTagOpen,
field("tag", "map"),
$._sep,
$.filtered_value,
@@ -171,28 +170,25 @@ export default grammar(django, {
"over",
$._sep,
$.filtered_value,
$.simpleBlockClose,
$.simpleTagClose,
),
// {% loop x %}…{% endloop %}
loop_block: ($) =>
loop_tag: ($) =>
seq(
$.startBlockOpen,
$.startTagOpen,
field("tag", "loop"),
$._sep,
$.identifier,
$.startBlockClose,
$.startTagClose,
),
loop_clause: ($) => seq($.loop_block, optional($.template)),
endloop_block: ($) =>
seq($.endBlockOpen, field("tag", "endloop"), $.endBlockClose),
loop_block: ($) => seq($.loop_tag, optional($.template)),
endloop_tag: ($) =>
seq($.endTagOpen, field("tag", "endloop"), $.endTagClose),
loop_group: ($) =>
seq(
$.loop_clause,
choice(
$.endloop_block,
alias($._missing_block, $.missing_endloop_block),
),
$.loop_block,
choice($.endloop_tag, alias($._missing_tag, $.missing_endloop_tag)),
),
// {{ value|shout:"!" }}
@@ -208,31 +204,31 @@ export default grammar(django, {
Seven things to know:
- **Whitespace is explicit.** `extras` is empty, because Django splits a tag's contents before parsing any
argument, so every separator has to be written out. The `part`/`block`/`simpleTag` helpers the base
argument, so every separator has to be written out. The `part`/`tag`/`simpleTag` helpers the base
grammar is built from are private to it, but the separator is the hidden rule `$._sep`, and it and the
tag utilities (`simpleBlockOpen` and the rest) are rules, so an extending grammar uses them as they are.
- **Every tag begins with one of the opens**: `$.simpleBlockOpen`, with `$.simpleBlockClose` at its end, for a
tag outside any group such as `map_block`, and `startBlockOpen`, `followBlockOpen`, `repeatBlockOpen` or
`endBlockOpen` for the tags of a group. Its
tag utilities (`simpleTagOpen` and the rest) are rules, so an extending grammar uses them as they are.
- **Every tag begins with one of the opens**: `$.simpleTagOpen`, with `$.simpleTagClose` at its end, for a
tag outside any group such as `map_tag`, and `startTagOpen`, `followTagOpen`, `repeatTagOpen` or
`endTagOpen` for the tags of a group. Its
zero-width token hands the tag's name to the scanner and is taken wherever a tag can start, so a tag
written from a bare `"{%"` never matches: `{% map items over rows %}` would quietly parse as a
`custom_tag_block` instead.
`custom_tag` instead.
- **A new name wins over the fallback.** `shout` becomes a token of its own, so it commits to your
alternative and your arity applies — `{{ x|shout }}` is now an error, while names you have not modelled
still fall through to `(filter name: (identifier))`.
still fall through to `(filter filter_name: (identifier))`.
- **A tag with a body is split the way the base grammar's are**, so every `{% %}` is a node of its own:
a `loop_block` ending in `$.startBlockClose`, a `loop_clause` of that block and the body, an
`endloop_block` built from `$.endBlockOpen` and `$.endBlockClose`, and a `loop_group` of the clause and the
end block. A middle tag uses `followBlockOpen`/`followBlockClose` if the group holds it at most once, and
`repeatBlockOpen`/`repeatBlockClose` if it may repeat; the scanner trusts that choice. The clause needs a
`conflicts` entry, as every clause in the base grammar does. The generator offers an associativity
a `loop_tag` ending in `$.startTagClose`, a `loop_block` of that tag and the body, an
`endloop_tag` built from `$.endTagOpen` and `$.endTagClose`, and a `loop_group` of the block and the
end tag. A middle tag uses `followTagOpen`/`followTagClose` if the group holds it at most once, and
`repeatTagOpen`/`repeatTagClose` if it may repeat; the scanner trusts that choice. The block needs a
`conflicts` entry, as every block in the base grammar does. The generator offers an associativity
instead; taking it silently discards the parse in which the body continues.
- **End tags are not reserved**, a stray `{% endmap %}` parses as a `custom_tag_block` rather than an error — `reserved` takes no
`previous`, so the `tag_name` list cannot be added to a name at a time. Instead you may drop the `custom_tag_block` rule to avoid parsing end tags as custom tags.
- **End tags are not reserved**, a stray `{% endmap %}` parses as a `custom_tag` rather than an error — `reserved` takes no
`previous`, so the `tag_name` list cannot be added to a name at a time. Instead you may drop the `custom_tag` rule to avoid parsing end tags as custom tags.
- **Your groups get missing-tag markers.** The scanner knows no group by name — a group is closed by `end`
followed by its opening tag's name — so the `alias($._missing_block, $.missing_endloop_block)` choice
followed by its opening tag's name — so the `alias($._missing_tag, $.missing_endloop_tag)` choice
above is all it takes: an unclosed `{% loop x %}`, or one left open inside an `{% if %}` that
`{% endif %}` closes, holds a `missing_endloop_block`. Add the name to your copy of `errors.scm`.
`{% endif %}` closes, holds a `missing_endloop_tag`. Add the name to your copy of `errors.scm`.
- **The external scanner has to be re-exported under your grammar's name**, or block-name matching and the
repeated-argument guards will not link. Give your grammar a `src/scanner.c` that renames the base's five entry points to the
ones your generated `parser.c` calls, and includes it:
@@ -254,13 +250,13 @@ build step can hand the compiler an absolute path from `import.meta.resolve` whe
layout makes the relative one unreliable.
**Turning the fallbacks off.** A grammar that models every tag and filter its project uses probably does
not want `custom_tag_block` and `_custom_filter` accepting unrecognized names as they allow typos to parse. `previous` is the base rule whose `members` are filterable. We can filter out these rules to make the grammar more strict:
not want `custom_tag` and `_custom_filter` accepting unrecognized names as they allow typos to parse. `previous` is the base rule whose `members` are filterable. We can filter out these rules to make the grammar more strict:
```js
tag_block_group: ($, previous) =>
template_tag: ($, previous) =>
choice(
...previous.members.filter((m) => m.name !== "custom_tag_block"),
$.map_block,
...previous.members.filter((m) => m.name !== "custom_tag"),
$.map_tag,
),
filter: ($, previous) =>
+315 -338
View File
File diff suppressed because it is too large. Load diff
+10 -10
View File
@@ -22,7 +22,7 @@
; If it is not, some pass through it binds nothing, so every definition inside
; is conditional. If it is, a definition escapes only when every branch makes
; it. Each capture names both halves of the pair, so no ancestor walk is needed
; and no clause has to be attributed to a group by name.
; and no block has to be attributed to a group by name.
;
; Branches nest, so the same test applies again to a group inside a branch.
;
@@ -34,20 +34,20 @@
; of the three pushes a context, so this is the case the check exists for.
(if_group
[
(if_clause)
(elif_clause)
(if_block)
(elif_block)
] @conditional.branch) @conditional.group
(if_group
(else_clause) @conditional.default) @conditional.group
(else_block) @conditional.default) @conditional.group
; ifchanged renders its body only when the watched value differs from the
; previous pass, and its else otherwise. It pushes no context either.
(ifchanged_group
(ifchanged_clause) @conditional.branch) @conditional.group
(ifchanged_block) @conditional.branch) @conditional.group
(ifchanged_group
(else_clause) @conditional.default) @conditional.group
(else_block) @conditional.default) @conditional.group
; The loop body runs once per item and empty runs when there are none, so the
; two partition every render. Both are inside ForNode's context.push() — the
@@ -55,21 +55,21 @@
; nothing escapes either way. Named here because the construct does branch, and
; because a tool reading only this file should not have to infer that it does.
(for_group
(for_clause) @conditional.branch) @conditional.group
(for_block) @conditional.branch) @conditional.group
(for_group
(empty_clause) @conditional.default) @conditional.group
(empty_block) @conditional.default) @conditional.group
; A cache body is skipped entirely on a cache hit, and CacheNode pushes no
; context, so a binding made inside it reaches the rest of the template on the
; first render and is gone on the next. One branch and no default: never
; exhaustive, which is the right answer.
(cache_group
(cache_clause) @conditional.branch) @conditional.group
(cache_block) @conditional.branch) @conditional.group
; Not here, deliberately: block and partialdef bodies may also fail to render —
; a child template overrides the block, and a partial renders only where
; {% partial %} names it — but both clauses are @local.scope in locals.scm, so
; {% partial %} names it — but both blocks are @local.scope in locals.scm, so
; nothing they bind escapes to be checked. Bodies that always render once
; (with, filter, autoescape, spaceless, language, localize, localtime,
; timezone) are not conditional at all, and comment, verbatim and
+23 -23
View File
@@ -1,16 +1,16 @@
; Everything in a template that an editor should report as a problem.
;
; A group whose required tag is missing parses without an ERROR: the scanner
; supplies a zero-width marker where the tag belongs, so the group, its clauses
; supplies a zero-width marker where the tag belongs, so the group, its blocks
; and the scopes they open stay intact for completion and the other queries.
; Such a tree has no error of its own (ts_node_has_error is false), so a tool
; has to run this query to find them.
;
; @error.syntax input the grammar could not parse
; @error.missing a token that tree-sitter's error recovery inserted
; @error.missing_block expected tag block is missing
; @error.missing_tag expected tag block is missing
;
; The markers are listed one by one, as MISSING_BLOCKS in grammar.js: the
; The markers are listed one by one, as MISSING_TAGS in grammar.js: the
; generator drops a supertype whose members are aliases, so there is no single
; node type to match them all. A new tag group, or a new kind of marker, is
; added here.
@@ -20,24 +20,24 @@
(MISSING) @error.missing
[
(missing_endautoescape_block)
(missing_endblock_block)
(missing_endblocktrans_block)
(missing_endblocktranslate_block)
(missing_endcache_block)
(missing_endcomment_block)
(missing_endfilter_block)
(missing_endfor_block)
(missing_endif_block)
(missing_endifchanged_block)
(missing_endlanguage_block)
(missing_endlocalize_block)
(missing_endlocaltime_block)
(missing_endpartialdef_block)
(missing_endspaceless_block)
(missing_endtimezone_block)
(missing_endverbatim_block)
(missing_endwith_block)
(missing_plural_block)] @error.missing_block
(missing_endautoescape_tag)
(missing_endblock_tag)
(missing_endblocktrans_tag)
(missing_endblocktranslate_tag)
(missing_endcache_tag)
(missing_endcomment_tag)
(missing_endfilter_tag)
(missing_endfor_tag)
(missing_endif_tag)
(missing_endifchanged_tag)
(missing_endlanguage_tag)
(missing_endlocalize_tag)
(missing_endlocaltime_tag)
(missing_endpartialdef_tag)
(missing_endspaceless_tag)
(missing_endtimezone_tag)
(missing_endverbatim_tag)
(missing_endwith_tag)
(missing_plural_tag)] @error.missing_tag
(unexpected_block) @error.unexpected_block
(unexpected_tag) @error.unexpected_tag
+4 -4
View File
@@ -21,10 +21,10 @@
; scope span could have separated them; that is why this is a separate file
; rather than a narrower scope in locals.scm.
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
asvar: (identifier) @export.name)) @export.from
(blocktranslate_clause
(blocktranslate_block
(blocktranslate_block
(blocktranslate_tag
asvar: (identifier) @export.name)) @export.from
+9 -9
View File
@@ -4,13 +4,13 @@
variable: (identifier) @variable.parameter
(block_block
(block_tag
(push_block) @type)
(partialdef_block
(partialdef_tag
(push_partial) @type)
(verbatim_block
(verbatim_tag
(push_verbatim) @type)
(comment_content) @comment
@@ -47,7 +47,7 @@ variable: (identifier) @variable.parameter
(library
(identifier) @module)
tag: [
tag_name: [
("autoescape")
("endautoescape")
("block")
@@ -120,7 +120,7 @@ tag: [
("endwith")] @function
(filter
name: [
filter_name: [
("add")
("addslashes")
("capfirst")
@@ -190,10 +190,10 @@ tag: [
; a filter or tag a "load" brought in, whose name the grammar does not know
(filter
name: (identifier) @function.call)
filter_name: (identifier) @function.call)
(custom_tag_block
tag: (identifier) @function.call)
(custom_tag
tag_name: (identifier) @function.call)
(load_block
(load_tag
(identifier) @function)
+39 -39
View File
@@ -15,81 +15,81 @@
; heads, so that the capture is both the name to look up and the range to
; report. A paired tag names the opening tag only.
(static_block
tag: ("static") @library.static)
(static_tag
tag_name: ("static") @library.static)
(get_static_prefix_block
tag: ("get_static_prefix") @library.static)
(get_static_prefix_tag
tag_name: ("get_static_prefix") @library.static)
(get_media_prefix_block
tag: ("get_media_prefix") @library.static)
(get_media_prefix_tag
tag_name: ("get_media_prefix") @library.static)
(blocktrans_block
tag: ("blocktrans") @library.i18n)
(blocktrans_tag
tag_name: ("blocktrans") @library.i18n)
(blocktranslate_block
tag: ("blocktranslate") @library.i18n)
(blocktranslate_tag
tag_name: ("blocktranslate") @library.i18n)
(translate_block
tag: [
(translate_tag
tag_name: [
("trans")
("translate")] @library.i18n)
(language_block
tag: ("language") @library.i18n)
(language_tag
tag_name: ("language") @library.i18n)
(get_available_languages_block
tag: ("get_available_languages") @library.i18n)
(get_available_languages_tag
tag_name: ("get_available_languages") @library.i18n)
(get_current_language_block
tag: ("get_current_language") @library.i18n)
(get_current_language_tag
tag_name: ("get_current_language") @library.i18n)
(get_current_language_bidi_block
tag: ("get_current_language_bidi") @library.i18n)
(get_current_language_bidi_tag
tag_name: ("get_current_language_bidi") @library.i18n)
(get_language_info_block
tag: ("get_language_info") @library.i18n)
(get_language_info_tag
tag_name: ("get_language_info") @library.i18n)
(get_language_info_list_block
tag: ("get_language_info_list") @library.i18n)
(get_language_info_list_tag
tag_name: ("get_language_info_list") @library.i18n)
(filter
name: [
filter_name: [
("language_bidi")
("language_name")
("language_name_local")
("language_name_translated")] @library.i18n)
(cache_block
tag: ("cache") @library.cache)
(cache_tag
tag_name: ("cache") @library.cache)
(localize_block
tag: ("localize") @library.l10n)
(localize_tag
tag_name: ("localize") @library.l10n)
(filter
name: [
filter_name: [
("localize")
("unlocalize")] @library.l10n)
(localtime_block
tag: ("localtime") @library.tz)
(localtime_tag
tag_name: ("localtime") @library.tz)
(timezone_block
tag: ("timezone") @library.tz)
(timezone_tag
tag_name: ("timezone") @library.tz)
(get_current_timezone_block
tag: ("get_current_timezone") @library.tz)
(get_current_timezone_tag
tag_name: ("get_current_timezone") @library.tz)
(filter
name: [
filter_name: [
("localtime")
("timezone")
("utc")] @library.tz)
; "{% load static %}" makes every name in the library available; "{% load
; static from staticfiles %}" makes only the names listed available.
(load_block
(load_tag
(library) @load.library)
(load_block
(load_tag
(identifier) @load.name)
+9 -9
View File
@@ -6,22 +6,22 @@ variable: (identifier) @local.definition
; The tags whose Node pushes a context, so that what they bind is not visible
; after them. Verified by rendering: "{% block b %}{% now "Y" as n %}{% endblock %}{{ n }}"
; is empty, while the same around an "{% if %}" is not, because if does not push.
(with_clause) @local.scope
(for_clause) @local.scope
(block_clause) @local.scope
(partialdef_clause) @local.scope
(with_block) @local.scope
(for_block) @local.scope
(block_block) @local.scope
(partialdef_block) @local.scope
; ForNode renders nodelist_empty inside the same context.push() as the loop
; body, so "{% empty %}" is part of the loop's scope even though it is a
; separate clause: "{% for x in ys %}a{% empty %}{% now "Y" as n %}{% endfor %}{{ n }}"
; is empty. queries/conditionals.scm names both clauses as branches of the
; separate block: "{% for x in ys %}a{% empty %}{% now "Y" as n %}{% endfor %}{{ n }}"
; is empty. queries/conditionals.scm names both blocks as branches of the
; same group and relies on this.
(empty_clause) @local.scope
(empty_block) @local.scope
; blocktranslate pushes a context for its "with" and "count" bindings. Its
; asvar target is not one of them: it is written in the same tag but assigned
; outside it, and carries an "asvar" field rather than "variable" so that this
; scope does not swallow it. A tool that wants it must define it in the scope
; around the block, which a locals query has no way to say.
(blocktrans_clause) @local.scope
(blocktranslate_clause) @local.scope
(blocktrans_block) @local.scope
(blocktranslate_block) @local.scope
+10 -10
View File
@@ -1,20 +1,20 @@
(load_block
(load_tag
(identifier) @name) @definition.function
(partialdef_block (push_partial) @name) @definition.method
(partial_block (identifier) @name) @reference.call
(partialdef_tag (push_partial) @name) @definition.method
(partial_tag (identifier) @name) @reference.call
; a tag that opens no body names itself; a group is named by the first block of
; its first clause, so neither its end block nor the blocks opening its later
; clauses are references of their own
(tag_block_group
tag: _ @name) @reference.call
; a tag that opens no body names itself; a group is named by the first tag of
; its first block, so neither its end tag nor the tags opening its later blocks
; are references of their own
(template_tag
tag_name: _ @name) @reference.call
(tag_block_group
(template_tag
.
(_
.
(_
tag: _ @name))) @reference.call
tag_name: _ @name))) @reference.call
(filter) @reference.call
+616 -616
View File
File diff suppressed because it is too large. Load diff
+838 -838
View File
File diff suppressed because it is too large. Load diff
+3681 -3679
View File
File diff suppressed because it is too large. Load diff
+16 -16
View File
@@ -39,8 +39,8 @@ enum TokenType {
* and fail if the tag has already been given one by that name */
KwargName,
/* zero width, where a tag group's required tag is missing; see
* scan_missing_block */
MissingBlock,
* scan_missing_tag */
MissingTag,
/* zero width, after "{%": read the tag's name */
GroupOpenTagRead,
/* zero width, before the "%}" of a tag that opens a group: push the group */
@@ -53,7 +53,7 @@ enum TokenType {
GroupRepeat,
/* zero width, before the "%}" of a tag that closes a group: pop the group */
GroupClose,
/* zero width, before the "%}" of an unexpected_block: returned only when
/* zero width, before the "%}" of an unexpected_tag: returned only when
* the innermost group already holds a tag by that name, which makes this the
* likelier stray of the two */
GroupHeld,
@@ -469,7 +469,7 @@ static unsigned check_name(TSLexer *const lexer, const Name *const name) {
return name->size;
}
static bool check_close_block(TSLexer *const lexer) {
static bool check_close_tag(TSLexer *const lexer) {
while (check_space(lexer->lookahead)) {
lexer->advance(lexer, false);
}
@@ -481,9 +481,9 @@ static bool check_close_block(TSLexer *const lexer) {
}
/* Marks the name just read as the token, then checks that only "%}" follows. */
static bool check_close_block_from(TSLexer *const lexer) {
static bool check_close_tag_from(TSLexer *const lexer) {
lexer->mark_end(lexer);
return check_close_block(lexer);
return check_close_tag(lexer);
}
const char inline_chars[] = "inline";
@@ -495,7 +495,7 @@ static bool check_inline(TSLexer *const lexer) {
}
lexer->advance(lexer, false);
}
return check_close_block(lexer);
return check_close_tag(lexer);
}
static void skip_whitespace(TSLexer *const lexer) {
@@ -715,7 +715,7 @@ static bool scan_group_tag_end(
} else {
OpenGroup *const group = array_back(&scanner->stack);
if (name_in_list(&scanner->read_word, &group->middles)) {
// a second one of these parses as an unexpected_block, which has no follow
// a second one of these parses as an unexpected_tag, which has no follow
lexer->log(lexer, "refused %s: the parser gives it to the innermost group, which already holds one",
log_name(&scanner->read_word, buffer));
return false;
@@ -785,11 +785,11 @@ typedef enum {
* block further out; and before a second plural, since a blocktranslate body
* holds no tag that could take it. Any other tag is taken to be the innermost
* group's, as Django takes it: a second of a tag the group holds only once, such
* as a second "else", is an unexpected_block inside the group rather than a sign
* as a second "else", is an unexpected_tag inside the group rather than a sign
* that it has ended. A counted blocktranslate still waiting for its plural is
* missing it before anything but "plural". The marker closes the group as the
* missing tag would have, or for a plural records it, leaving the group open. */
static MissingResult scan_missing_block(
static MissingResult scan_missing_tag(
struct Scanner *const scanner,
TSLexer *const lexer,
const bool *const valid_symbols
@@ -838,7 +838,7 @@ static MissingResult scan_missing_block(
array_delete(&name);
}
} else if (name_in_list(&word, &innermost->middles)) {
// a second of a tag the group holds only once is an unexpected_block in it
// a second of a tag the group holds only once is an unexpected_tag in it
missing = name_is(&word, "plural");
} else {
missing = outer_group_expects(scanner, &word);
@@ -853,7 +853,7 @@ static MissingResult scan_missing_block(
} else {
pop_group(scanner);
}
lexer->result_symbol = MissingBlock;
lexer->result_symbol = MissingTag;
return Missing;
}
@@ -947,8 +947,8 @@ bool tree_sitter_django_external_scanner_scan(
* down, which skips the separator the grammar still has to match, and below
* the MatcherError check, which keeps them from being scanned during error
* recovery. */
if (valid_symbols[MissingBlock]) {
switch (scan_missing_block(scanner, lexer, valid_symbols)) {
if (valid_symbols[MissingTag]) {
switch (scan_missing_tag(scanner, lexer, valid_symbols)) {
case Missing:
return true;
case NotMissingAfterReading:
@@ -1038,7 +1038,7 @@ bool tree_sitter_django_external_scanner_scan(
}
const unsigned match_amt = check_name(lexer, &group->name);
const bool has_next_char = group->name.size ? check_name_char(lexer->lookahead) : check_name_start_char(lexer->lookahead);
if (match_amt == group->name.size && !has_next_char && check_close_block_from(lexer)) {
if (match_amt == group->name.size && !has_next_char && check_close_tag_from(lexer)) {
lexer->result_symbol = token;
return true;
}
@@ -1061,7 +1061,7 @@ bool tree_sitter_django_external_scanner_scan(
if (read_name(lexer, &name)) {
// validate tokens after name
lexer->mark_end(lexer);
if (check_close_block(lexer) || token == PushPartial && check_inline(lexer)) {
if (check_close_tag(lexer) || token == PushPartial && check_inline(lexer)) {
array_delete(&scanner->pending_name);
scanner->pending_name = name;
lexer->result_symbol = token;
+3 -3
View File
@@ -17,9 +17,9 @@ Autoescape
(template
(content)
(autoescape_group
(autoescape_clause
(autoescape_block)
(autoescape_block
(autoescape_tag)
(template
(content)))
(endautoescape_block))
(endautoescape_tag))
(content))
+24 -24
View File
@@ -17,12 +17,12 @@ Block
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content))
@@ -45,12 +45,12 @@ Block Matching End Tag
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content))
@@ -75,21 +75,21 @@ Nested Blocks
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content))
@@ -114,21 +114,21 @@ Nested Blocks End Tag
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content))
@@ -153,20 +153,20 @@ Nested Blocks Mixed Tags
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content))
+70 -70
View File
@@ -9,10 +9,10 @@ Blocktrans
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(blocktrans_block
(blocktrans_tag)
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -26,10 +26,10 @@ Blocktranslate
(template
(content)
(blocktranslate_group
(blocktranslate_clause
(blocktranslate_block)
(blocktranslate_block
(blocktranslate_tag)
(content))
(endblocktranslate_block))
(endblocktranslate_tag))
(content))
==================
@@ -43,9 +43,9 @@ Blocktrans Empty
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block))
(endblocktrans_block))
(blocktrans_block
(blocktrans_tag))
(endblocktrans_tag))
(content))
==================
@@ -59,15 +59,15 @@ Blocktrans With A Placeholder
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(blocktrans_block
(blocktrans_tag)
(content)
(template_variable
(filtered_value
(value
(variable_attribute
(identifier))))))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -81,10 +81,10 @@ Blocktrans Trimmed
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(blocktrans_block
(blocktrans_tag)
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -98,15 +98,15 @@ Blocktrans With
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -120,8 +120,8 @@ Blocktrans With Several Bindings
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
variable: (identifier)
(filtered_value
(value
@@ -133,7 +133,7 @@ Blocktrans With Several Bindings
(variable_attribute
(identifier)))))
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -147,8 +147,8 @@ Blocktrans With A Filtered Binding
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
variable: (identifier)
(filtered_value
(value
@@ -157,7 +157,7 @@ Blocktrans With A Filtered Binding
(filter_expression
(filter))))
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -171,14 +171,14 @@ Blocktrans With Context
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
(filtered_value
(value
(literal
(string)))))
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -192,11 +192,11 @@ Blocktrans With Asvar
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
asvar: (identifier))
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -210,18 +210,18 @@ Blocktrans With Count And Plural
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(plural_clause
(plural_block)
(plural_block
(plural_tag)
(content)))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -235,17 +235,17 @@ Blocktrans With An Empty Singular
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(plural_clause
(plural_block)
(plural_block
(plural_tag)
(content)))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -259,17 +259,17 @@ Blocktranslate With An Empty Plural
(template
(content)
(blocktranslate_group
(blocktranslate_clause
(blocktranslate_block
(blocktranslate_block
(blocktranslate_tag
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(plural_clause
(plural_block)))
(endblocktranslate_block))
(plural_block
(plural_tag)))
(endblocktranslate_tag))
(content))
==================
@@ -283,8 +283,8 @@ Blocktrans With Every Option
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
variable: (identifier)
(filtered_value
(value
@@ -301,10 +301,10 @@ Blocktrans With Every Option
(string))))
asvar: (identifier))
(content)
(plural_clause
(plural_block)
(plural_block
(plural_tag)
(content)))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -318,11 +318,11 @@ Blocktrans With Its Options Reordered
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
asvar: (identifier))
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
@@ -356,16 +356,16 @@ Blocktrans With Count And No Plural
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(missing_plural_block))
(endblocktrans_block))
(missing_plural_tag))
(endblocktrans_tag))
(content))
==================
@@ -459,21 +459,21 @@ Blocktrans With Two Plurals
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(plural_clause
(plural_block)
(plural_block
(plural_tag)
(content)))
(missing_endblocktrans_block))
(unexpected_block)
(missing_endblocktrans_tag))
(unexpected_tag)
(content)
(unexpected_block)
(unexpected_tag)
(content))
==================
@@ -557,15 +557,15 @@ Blocktrans Repeating An Option Of The Tag Before It
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(blocktrans_block
(blocktrans_tag)
(content))
(endblocktrans_block))
(endblocktrans_tag))
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(blocktrans_block
(blocktrans_tag)
(content))
(endblocktrans_block))
(endblocktrans_tag))
(content))
==================
+24 -24
View File
@@ -9,8 +9,8 @@ Cache
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(literal
@@ -18,7 +18,7 @@ Cache
(identifier))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
@@ -32,8 +32,8 @@ Cache With A Variable Timeout
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(variable_attribute
@@ -41,7 +41,7 @@ Cache With A Variable Timeout
(identifier))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
@@ -55,8 +55,8 @@ Cache With A Filtered Timeout
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(literal
@@ -69,7 +69,7 @@ Cache With A Filtered Timeout
(identifier))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
@@ -83,8 +83,8 @@ Cache With A Quoted Fragment Name
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(literal
@@ -92,7 +92,7 @@ Cache With A Quoted Fragment Name
(string))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
@@ -106,8 +106,8 @@ Cache Varying On Arguments
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(literal
@@ -123,7 +123,7 @@ Cache Varying On Arguments
(identifier)))))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
@@ -137,8 +137,8 @@ Cache Varying On A Filtered Argument
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(literal
@@ -152,7 +152,7 @@ Cache Varying On A Filtered Argument
(filter))))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
@@ -166,8 +166,8 @@ Cache Using A Named Cache
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(literal
@@ -179,7 +179,7 @@ Cache Using A Named Cache
(string)))))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
@@ -193,8 +193,8 @@ Cache Using An Unquoted Cache Name
(template
(content)
(cache_group
(cache_clause
(cache_block
(cache_block
(cache_tag
(filtered_value
(value
(literal
@@ -206,7 +206,7 @@ Cache Using An Unquoted Cache Name
(identifier)))))
(template
(content)))
(endcache_block))
(endcache_tag))
(content))
==================
+12 -12
View File
@@ -11,10 +11,10 @@ This is ignored
(template
(content)
(comment_group
(comment_clause
(comment_block)
(comment_block
(comment_tag)
(comment_content))
(endcomment_block))
(endcomment_tag))
(content))
==================
@@ -28,9 +28,9 @@ Comment Empty
(template
(content)
(comment_group
(comment_clause
(comment_block))
(endcomment_block))
(comment_block
(comment_tag))
(endcomment_tag))
(content))
==================
@@ -46,11 +46,11 @@ This is ignored
(template
(content)
(comment_group
(comment_clause
(comment_block
(comment_block
(comment_tag
(string))
(comment_content))
(endcomment_block))
(endcomment_tag))
(content))
==================
@@ -66,8 +66,8 @@ Contains {% if x %} tag-like text
(template
(content)
(comment_group
(comment_clause
(comment_block)
(comment_block
(comment_tag)
(comment_content))
(endcomment_block))
(endcomment_tag))
(content))
+3 -3
View File
@@ -8,7 +8,7 @@ Csp Nonce Attr
(template
(content)
(csp_nonce_attr_block)
(csp_nonce_attr_tag)
(content))
==================
@@ -21,7 +21,7 @@ Csp Nonce Attr With Argument And As
(template
(content)
(csp_nonce_attr_block
(csp_nonce_attr_tag
(filtered_value
(value
(literal
@@ -39,7 +39,7 @@ Csp Nonce Attr With Media Keyword
(template
(content)
(csp_nonce_attr_block
(csp_nonce_attr_tag
(filtered_value
(value
(literal
+1 -1
View File
@@ -10,5 +10,5 @@ Csrf Token
(template
(content)
(csrf_token_block)
(csrf_token_tag)
(content))
+29 -29
View File
@@ -8,8 +8,8 @@ Custom Tag
(template
(content)
(custom_tag_block
tag: (identifier))
(custom_tag
tag_name: (identifier))
(content))
==================
@@ -22,8 +22,8 @@ Custom Tag With Arguments
(template
(content)
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(filtered_value
(value
(variable_attribute
@@ -48,8 +48,8 @@ Custom Tag With Keyword Arguments
(template
(content)
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(filtered_value
(value
(variable_attribute
@@ -71,8 +71,8 @@ Custom Tag With As
(template
(content)
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(filtered_value
(value
(variable_attribute
@@ -90,8 +90,8 @@ Custom Tag With Filtered Argument
(template
(content)
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(filtered_value
(value
(variable_attribute
@@ -110,11 +110,11 @@ Custom Tag Does Not Nest
(template
(content)
(custom_tag_block
tag: (identifier))
(custom_tag
tag_name: (identifier))
(content)
(custom_tag_block
tag: (identifier))
(custom_tag
tag_name: (identifier))
(content))
==================
@@ -144,7 +144,7 @@ Custom Filter
(identifier)))
(filter_expression
(filter
name: (identifier)))))
filter_name: (identifier)))))
(content))
==================
@@ -164,7 +164,7 @@ Custom Filter With Argument
(identifier)))
(filter_expression
(filter
name: (identifier)
filter_name: (identifier)
argument: (value
(literal
(string)))))))
@@ -187,7 +187,7 @@ Custom Filter In A Chain With A Builtin
(identifier)))
(filter_expression
(filter
name: (identifier))
filter_name: (identifier))
(filter))))
(content))
@@ -201,14 +201,14 @@ Custom Filter In A Tag
(template
(content)
(firstof_block
(firstof_tag
(filtered_value
(value
(variable_attribute
(identifier)))
(filter_expression
(filter
name: (identifier)))))
filter_name: (identifier)))))
(content))
==================
@@ -241,7 +241,7 @@ Custom Tag Does Not Cover An End Tag
(template
(content)
(unexpected_block)
(unexpected_tag)
(content))
==================
@@ -254,7 +254,7 @@ Custom Tag Does Not Cover A Part Of A Tag Group
(template
(content)
(unexpected_block)
(unexpected_tag)
(content))
==================
@@ -284,8 +284,8 @@ A Name Reserved For A Tag Is Still An Argument
(template
(content)
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(filtered_value
(value
(variable_attribute
@@ -312,8 +312,8 @@ Custom Tag With Keyword Arguments And As
(template
(content)
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(identifier)
(filtered_value
(value
@@ -337,15 +337,15 @@ Custom Tag Repeating A Keyword Of The Tag Before It
(template
(content)
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(identifier)
(filtered_value
(value
(literal
(number)))))
(custom_tag_block
tag: (identifier)
(custom_tag
tag_name: (identifier)
(identifier)
(filtered_value
(value
+5 -5
View File
@@ -11,7 +11,7 @@ Cycle Basic
(template
(content)
(cycle_block
(cycle_tag
(filtered_value
(value
(literal
@@ -35,7 +35,7 @@ Cycle With As
(template
(content)
(cycle_block
(cycle_tag
(filtered_value
(value
(literal
@@ -60,7 +60,7 @@ Cycle With As And Silent
(template
(content)
(cycle_block
(cycle_tag
(filtered_value
(value
(literal
@@ -85,7 +85,7 @@ Cycle Referencing Existing Variable
(template
(content)
(cycle_block
(cycle_tag
(filtered_value
(value
(variable_attribute
@@ -136,7 +136,7 @@ Cycle Spanning Lines
(template
(content)
(cycle_block
(cycle_tag
(filtered_value
(value
(literal
+1 -1
View File
@@ -10,5 +10,5 @@ Debug
(template
(content)
(debug_block)
(debug_tag)
(content))
+2 -2
View File
@@ -9,7 +9,7 @@ Extends With String
(template
(content)
(extends_block
(extends_tag
(filtered_value
(value
(literal
@@ -27,7 +27,7 @@ Extends With Variable
(template
(content)
(extends_block
(extends_tag
(filtered_value
(value
(variable_attribute
+9 -9
View File
@@ -13,13 +13,13 @@ hello
(template
(content)
(filter_group
(filter_clause
(filter_block
(filter_block
(filter_tag
(filter_expression
(filter)))
(template
(content)))
(endfilter_block))
(endfilter_tag))
(content))
==================
@@ -37,14 +37,14 @@ HELLO WORLD
(template
(content)
(filter_group
(filter_clause
(filter_block
(filter_block
(filter_tag
(filter_expression
(filter)
(filter)))
(template
(content)))
(endfilter_block))
(endfilter_tag))
(content))
==================
@@ -63,12 +63,12 @@ HELLO WORLD
(template
(content)
(filter_group
(filter_clause
(filter_block
(filter_block
(filter_tag
(filter_expression
(filter)
(filter)))
(template
(content)))
(endfilter_block))
(endfilter_tag))
(content))
+2 -2
View File
@@ -8,7 +8,7 @@ Firstof Basic
(template
(content)
(firstof_block
(firstof_tag
(filtered_value
(value
(variable_attribute
@@ -33,7 +33,7 @@ Firstof With As
(template
(content)
(firstof_block
(firstof_tag
(filtered_value
(value
(variable_attribute
+81 -81
View File
@@ -13,8 +13,8 @@ For Basic
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -28,7 +28,7 @@ For Basic
(variable_attribute
(identifier)))))
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -46,8 +46,8 @@ For With Multiple Variables
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
variable: (identifier)
(filtered_value
@@ -62,7 +62,7 @@ For With Multiple Variables
(variable_attribute
(identifier)))))
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -82,8 +82,8 @@ For With Empty
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -97,11 +97,11 @@ For With Empty
(variable_attribute
(identifier)))))
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -117,8 +117,8 @@ For With A Tag In Its Body
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -127,8 +127,8 @@ For With A Tag In Its Body
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -136,9 +136,9 @@ For With A Tag In Its Body
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -154,8 +154,8 @@ For With A Nested For
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -164,8 +164,8 @@ For With A Nested For
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -173,9 +173,9 @@ For With A Nested For
(identifier)))))
(template
(content)))
(endfor_block))
(endfor_tag))
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -193,8 +193,8 @@ For With Tags In Both Branches
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -203,8 +203,8 @@ For With Tags In Both Branches
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -212,15 +212,15 @@ For With Tags In Both Branches
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(content)
(with_group
(with_clause
(with_block
(with_block
(with_tag
variable: (identifier)
(filtered_value
(value
@@ -228,9 +228,9 @@ For With Tags In Both Branches
(number)))))
(template
(content)))
(endwith_block))
(endwith_tag))
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -246,8 +246,8 @@ For With A Named Block In Its Body
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -256,15 +256,15 @@ For With A Named Block In Its Body
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
name: (push_block))
(template
(content)))
(endblock_block
(endblock_tag
(pop_block)))
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -280,8 +280,8 @@ For Nested In A Tag
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -290,8 +290,8 @@ For Nested In A Tag
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -299,8 +299,8 @@ For Nested In A Tag
(identifier)))))
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -308,10 +308,10 @@ For Nested In A Tag
(identifier))))))
(template
(content)))
(endif_block))))
(endfor_block))
(endif_tag))))
(endfor_tag))
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -325,14 +325,14 @@ For With An Empty Body
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -348,8 +348,8 @@ a
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -357,7 +357,7 @@ a
(identifier)))))
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -373,8 +373,8 @@ a
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
variable: (identifier)
(filtered_value
@@ -383,7 +383,7 @@ a
(identifier)))))
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -399,8 +399,8 @@ a
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -413,7 +413,7 @@ a
(string)))))))
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -431,8 +431,8 @@ b
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -440,11 +440,11 @@ b
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -460,8 +460,8 @@ For Reversed With A Tag In Its Body
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -470,8 +470,8 @@ For Reversed With A Tag In Its Body
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -479,9 +479,9 @@ For Reversed With A Tag In Its Body
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -514,8 +514,8 @@ For Over A Variable Named Reversed
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -523,7 +523,7 @@ For Over A Variable Named Reversed
(identifier)))))
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -537,8 +537,8 @@ For Over An Attribute Of A Variable Named Reversed
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -547,7 +547,7 @@ For Over An Attribute Of A Variable Named Reversed
(attribute)))))
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -561,8 +561,8 @@ For Over A Filtered Variable Named Reversed
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
variable: (identifier)
(filtered_value
(value
@@ -572,7 +572,7 @@ For Over A Filtered Variable Named Reversed
(filter))))
(template
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
+23 -23
View File
@@ -8,7 +8,7 @@ Trans
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Translate
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -42,7 +42,7 @@ Trans With A Variable
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(variable_attribute
@@ -59,7 +59,7 @@ Trans With A Filtered Message
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -78,7 +78,7 @@ Trans Noop
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -95,7 +95,7 @@ Trans With As
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -113,7 +113,7 @@ Trans With Context
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -134,7 +134,7 @@ Trans With Every Option
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -156,7 +156,7 @@ Trans With Its Options Reordered
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -228,7 +228,7 @@ Get Available Languages
(template
(content)
(get_available_languages_block
(get_available_languages_tag
variable: (identifier))
(content))
@@ -252,7 +252,7 @@ Get Current Language
(template
(content)
(get_current_language_block
(get_current_language_tag
variable: (identifier))
(content))
@@ -266,7 +266,7 @@ Get Current Language Bidi
(template
(content)
(get_current_language_bidi_block
(get_current_language_bidi_tag
variable: (identifier))
(content))
@@ -280,7 +280,7 @@ Get Language Info
(template
(content)
(get_language_info_block
(get_language_info_tag
(filtered_value
(value
(literal
@@ -298,7 +298,7 @@ Get Language Info For A Variable
(template
(content)
(get_language_info_block
(get_language_info_tag
(filtered_value
(value
(variable_attribute
@@ -336,7 +336,7 @@ Get Language Info List
(template
(content)
(get_language_info_list_block
(get_language_info_list_tag
(filtered_value
(value
(variable_attribute
@@ -355,15 +355,15 @@ Language
(template
(content)
(language_group
(language_clause
(language_block
(language_block
(language_tag
(filtered_value
(value
(literal
(string)))))
(template
(content)))
(endlanguage_block))
(endlanguage_tag))
(content))
==================
@@ -377,15 +377,15 @@ Language With A Variable
(template
(content)
(language_group
(language_clause
(language_block
(language_block
(language_tag
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content)))
(endlanguage_block))
(endlanguage_tag))
(content))
==================
@@ -513,7 +513,7 @@ Translate With A Context From An Attribute Of Noop
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
@@ -535,7 +535,7 @@ Translate With A Filtered Context Named After Noop
(template
(content)
(translate_block
(translate_tag
(filtered_value
(value
(literal
+37 -37
View File
@@ -11,8 +11,8 @@ Hi
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -21,7 +21,7 @@ Hi
(attribute))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -37,8 +37,8 @@ working
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -46,7 +46,7 @@ working
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -66,8 +66,8 @@ other
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -80,8 +80,8 @@ other
(number))))))
(template
(content)))
(elif_clause
(elif_block
(elif_block
(elif_tag
(predicate
(filtered_value
(value
@@ -94,11 +94,11 @@ other
(number))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -114,8 +114,8 @@ yes
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -155,7 +155,7 @@ yes
(number))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -178,8 +178,8 @@ If Is Not None
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -192,7 +192,7 @@ If Is Not None
(none))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -206,8 +206,8 @@ If Is
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -220,7 +220,7 @@ If Is
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -234,8 +234,8 @@ If Is Not
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -248,7 +248,7 @@ If Is Not
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -262,8 +262,8 @@ If Is Not Not
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -276,7 +276,7 @@ If Is Not Not
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -290,8 +290,8 @@ If With A Repeated Not
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -299,7 +299,7 @@ If With A Repeated Not
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -313,8 +313,8 @@ If Not Before A Name Beginning With In
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -322,7 +322,7 @@ If Not Before A Name Beginning With In
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -336,8 +336,8 @@ If Is Before A Name Beginning With Not
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -350,5 +350,5 @@ If Is Before A Name Beginning With Not
(identifier))))))
(template
(content)))
(endif_block))
(endif_tag))
(content))
+41 -41
View File
@@ -11,11 +11,11 @@ content
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
==================
@@ -31,8 +31,8 @@ content
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block
(ifchanged_block
(ifchanged_tag
(filtered_value
(value
(variable_attribute
@@ -43,7 +43,7 @@ content
(identifier)))))
(template
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
==================
@@ -61,15 +61,15 @@ unchanged
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
==================
@@ -87,8 +87,8 @@ unchanged
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block
(ifchanged_block
(ifchanged_tag
(filtered_value
(value
(variable_attribute
@@ -101,11 +101,11 @@ unchanged
(filter))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
==================
@@ -121,13 +121,13 @@ content
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block))
(endifchanged_block))
(else_block
(else_tag))
(endifchanged_tag))
(content))
==================
@@ -149,26 +149,26 @@ c
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)))
(endifchanged_block))
(endifchanged_tag))
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
==================
@@ -188,17 +188,17 @@ c
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
==================
@@ -216,11 +216,11 @@ b
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
+8 -8
View File
@@ -8,7 +8,7 @@ Include With String
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Include With Variable
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(variable_attribute
@@ -42,7 +42,7 @@ Include With A Filtered Name
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(literal
@@ -61,7 +61,7 @@ Include Only
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(literal
@@ -78,7 +78,7 @@ Include With Context
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(literal
@@ -100,7 +100,7 @@ Include With Several Bindings
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(literal
@@ -127,7 +127,7 @@ Include With Context And Only
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(literal
@@ -149,7 +149,7 @@ Include With Only Before With
(template
(content)
(include_block
(include_tag
(filtered_value
(value
(literal
+21 -21
View File
@@ -9,11 +9,11 @@ Localize
(template
(content)
(localize_group
(localize_clause
(localize_block)
(localize_block
(localize_tag)
(template
(content)))
(endlocalize_block))
(endlocalize_tag))
(content))
==================
@@ -27,11 +27,11 @@ Localize On
(template
(content)
(localize_group
(localize_clause
(localize_block)
(localize_block
(localize_tag)
(template
(content)))
(endlocalize_block))
(endlocalize_tag))
(content))
==================
@@ -45,11 +45,11 @@ Localize Off
(template
(content)
(localize_group
(localize_clause
(localize_block)
(localize_block
(localize_tag)
(template
(content)))
(endlocalize_block))
(endlocalize_tag))
(content))
==================
@@ -63,11 +63,11 @@ Localize Hugging Its Delimiters
(template
(content)
(localize_group
(localize_clause
(localize_block)
(localize_block
(localize_tag)
(template
(content)))
(endlocalize_block))
(endlocalize_tag))
(content))
==================
@@ -81,16 +81,16 @@ Localize Nested
(template
(content)
(localize_group
(localize_clause
(localize_block)
(localize_block
(localize_tag)
(template
(localize_group
(localize_clause
(localize_block)
(localize_block
(localize_tag)
(template
(content)))
(endlocalize_block))))
(endlocalize_block))
(endlocalize_tag))))
(endlocalize_tag))
(content))
==================
@@ -124,11 +124,11 @@ Localize Unclosed
(template
(content)
(localize_group
(localize_clause
(localize_block)
(localize_block
(localize_tag)
(template
(content)))
(missing_endlocalize_block)))
(missing_endlocalize_tag)))
==================
+4 -4
View File
@@ -8,7 +8,7 @@ Load Single Library
(template
(content)
(load_block
(load_tag
(library
(identifier)))
(content))
@@ -23,7 +23,7 @@ Load Multiple Libraries
(template
(content)
(load_block
(load_tag
(library
(identifier))
(library
@@ -40,7 +40,7 @@ Load Dotted Library
(template
(content)
(load_block
(load_tag
(library
(identifier)
(identifier)))
@@ -56,7 +56,7 @@ Load Names From Library
(template
(content)
(load_block
(load_tag
(identifier)
(identifier)
(library
+2 -2
View File
@@ -8,7 +8,7 @@ Lorem Words
(template
(content)
(lorem_block
(lorem_tag
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Lorem Paragraphs Random
(template
(content)
(lorem_block
(lorem_tag
(filtered_value
(value
(literal
+213 -213
View File
@@ -9,8 +9,8 @@ Missing Endif At End Of Input
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -18,7 +18,7 @@ Missing Endif At End Of Input
(identifier))))))
(template
(content)))
(missing_endif_block)))
(missing_endif_tag)))
==================
Missing Endfor After Empty
@@ -31,8 +31,8 @@ Missing Endfor After Empty
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -40,11 +40,11 @@ Missing Endfor After Empty
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(content)))
(missing_endfor_block)))
(missing_endfor_tag)))
==================
Missing Endblock At End Of Input
@@ -57,12 +57,12 @@ Missing Endblock At End Of Input
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
(push_block))
(template
(content)))
(missing_endblock_block)))
(missing_endblock_tag)))
==================
Missing Endpartialdef At End Of Input
@@ -75,12 +75,12 @@ Missing Endpartialdef At End Of Input
(template
(content)
(partialdef_group
(partialdef_clause
(partialdef_block
(partialdef_block
(partialdef_tag
(push_partial))
(template
(content)))
(missing_endpartialdef_block)))
(missing_endpartialdef_tag)))
==================
Missing Endverbatim With An Empty Body
@@ -93,11 +93,11 @@ Missing Endverbatim With An Empty Body
(template
(content)
(verbatim_group
(verbatim_clause
(verbatim_block
(verbatim_block
(verbatim_tag
(push_verbatim))
(verbatim_content))
(missing_endverbatim_block)))
(missing_endverbatim_tag)))
==================
Missing Endverbatim After A Tag In Its Text
@@ -110,11 +110,11 @@ Missing Endverbatim After A Tag In Its Text
(template
(content)
(verbatim_group
(verbatim_clause
(verbatim_block
(verbatim_block
(verbatim_tag
(push_verbatim))
(verbatim_content))
(missing_endverbatim_block)))
(missing_endverbatim_tag)))
==================
Missing Endcomment At End Of Input
@@ -127,10 +127,10 @@ Missing Endcomment At End Of Input
(template
(content)
(comment_group
(comment_clause
(comment_block)
(comment_block
(comment_tag)
(comment_content))
(missing_endcomment_block)))
(missing_endcomment_tag)))
==================
Missing Endif Before An Outer End Tag
@@ -143,8 +143,8 @@ Missing Endif Before An Outer End Tag
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -152,15 +152,15 @@ Missing Endif Before An Outer End Tag
(identifier)))))
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))))
(missing_endif_block))))
(endfor_block))
(missing_endif_tag))))
(endfor_tag))
(content))
==================
@@ -174,8 +174,8 @@ Unseen Outer Else Is Not A Missing Tag
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -183,18 +183,18 @@ Unseen Outer Else Is Not A Missing Tag
(identifier))))))
(template
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(unexpected_block)
(unexpected_tag)
(content)))
(missing_endfor_block))))
(endif_block))
(missing_endfor_tag))))
(endif_tag))
(content))
==================
@@ -208,20 +208,20 @@ Missing Endwith Before An Outer Endblock
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
(push_block))
(template
(with_group
(with_clause
(with_block
(with_block
(with_tag
(identifier)
(filtered_value
(value
(literal
(number))))))
(missing_endwith_block))))
(endblock_block
(missing_endwith_tag))))
(endblock_tag
(pop_block)))
(content))
@@ -236,8 +236,8 @@ Missing Two End Tags At End Of Input
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -245,8 +245,8 @@ Missing Two End Tags At End Of Input
(identifier)))))
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -254,8 +254,8 @@ Missing Two End Tags At End Of Input
(identifier))))))
(template
(content)))
(missing_endif_block))))
(missing_endfor_block)))
(missing_endif_tag))))
(missing_endfor_tag)))
==================
Missing Endblock Before An Outer Name
@@ -268,16 +268,16 @@ Missing Endblock Before An Outer Name
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
(push_block))
(template
(block_group
(block_clause
(block_block
(block_block
(block_tag
(push_block)))
(missing_endblock_block))))
(endblock_block
(missing_endblock_tag))))
(endblock_tag
(pop_block)))
(content))
@@ -292,16 +292,16 @@ Missing Endpartialdef Before An Outer Name
(template
(content)
(partialdef_group
(partialdef_clause
(partialdef_block
(partialdef_block
(partialdef_tag
(push_partial))
(template
(partialdef_group
(partialdef_clause
(partialdef_block
(partialdef_block
(partialdef_tag
(push_partial)))
(missing_endpartialdef_block))))
(endpartialdef_block
(missing_endpartialdef_tag))))
(endpartialdef_tag
(pop_partial)))
(content))
@@ -316,16 +316,16 @@ Missing Plural At End Of Input
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(missing_plural_block))
(missing_endblocktrans_block)))
(missing_plural_tag))
(missing_endblocktrans_tag)))
==================
Missing Plural Before Endblocktranslate
@@ -338,16 +338,16 @@ Missing Plural Before Endblocktranslate
(template
(content)
(blocktranslate_group
(blocktranslate_clause
(blocktranslate_block
(blocktranslate_block
(blocktranslate_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(missing_plural_block))
(endblocktranslate_block))
(missing_plural_tag))
(endblocktranslate_tag))
(content))
==================
@@ -361,18 +361,18 @@ Missing Endblocktrans After Plural
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(blocktrans_block
(blocktrans_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(plural_clause
(plural_block)
(plural_block
(plural_tag)
(content)))
(missing_endblocktrans_block)))
(missing_endblocktrans_tag)))
==================
Missing Endfor Before A Tag Without Spaces
@@ -385,8 +385,8 @@ Missing Endfor Before A Tag Without Spaces
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -394,15 +394,15 @@ Missing Endfor Before A Tag Without Spaces
(identifier))))))
(template
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier))))))
(missing_endfor_block))))
(endif_block))
(missing_endfor_tag))))
(endif_tag))
(content))
==================
@@ -417,8 +417,8 @@ endif %}
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -426,15 +426,15 @@ endif %}
(identifier))))))
(template
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
(variable_attribute
(identifier))))))
(missing_endfor_block))))
(endif_block))
(missing_endfor_tag))))
(endif_tag))
(content))
==================
@@ -448,18 +448,18 @@ Missing Endif After A Custom End Tag
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(custom_tag_block
(custom_tag
(identifier))
(content)))
(missing_endif_block)))
(missing_endif_tag)))
==================
Second Else After A Nested Else Is Unexpected
@@ -472,8 +472,8 @@ Second Else After A Nested Else Is Unexpected
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -481,8 +481,8 @@ Second Else After A Nested Else Is Unexpected
(identifier))))))
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -490,15 +490,15 @@ Second Else After A Nested Else Is Unexpected
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endif_block))
(endif_tag))
(content)))
(missing_endif_block)))
(missing_endif_tag)))
==================
Second Empty After A Nested Empty Is Unexpected
@@ -511,8 +511,8 @@ Second Empty After A Nested Empty Is Unexpected
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -520,8 +520,8 @@ Second Empty After A Nested Empty Is Unexpected
(identifier)))))
(template
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -529,15 +529,15 @@ Second Empty After A Nested Empty Is Unexpected
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endfor_block))
(endfor_tag))
(content)))
(missing_endfor_block)))
(missing_endfor_tag)))
==================
Else Of An If Nested In An Else
@@ -550,8 +550,8 @@ Else Of An If Nested In An Else
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -559,12 +559,12 @@ Else Of An If Nested In An Else
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -572,12 +572,12 @@ Else Of An If Nested In An Else
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)))
(endif_block))))
(endif_block))
(endif_tag))))
(endif_tag))
(content))
==================
@@ -591,8 +591,8 @@ Elif Of An If Nested In An Elif
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -600,8 +600,8 @@ Elif Of An If Nested In An Elif
(identifier))))))
(template
(content)))
(elif_clause
(elif_block
(elif_block
(elif_tag
(predicate
(filtered_value
(value
@@ -609,8 +609,8 @@ Elif Of An If Nested In An Elif
(identifier))))))
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -618,8 +618,8 @@ Elif Of An If Nested In An Elif
(identifier))))))
(template
(content)))
(elif_clause
(elif_block
(elif_block
(elif_tag
(predicate
(filtered_value
(value
@@ -627,8 +627,8 @@ Elif Of An If Nested In An Elif
(identifier))))))
(template
(content)))
(endif_block))))
(endif_block))
(endif_tag))))
(endif_tag))
(content))
==================
@@ -642,8 +642,8 @@ Empty Of A For Nested In An Empty
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -651,12 +651,12 @@ Empty Of A For Nested In An Empty
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -664,12 +664,12 @@ Empty Of A For Nested In An Empty
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(content)))
(endfor_block))))
(endfor_block))
(endfor_tag))))
(endfor_tag))
(content))
==================
@@ -683,8 +683,8 @@ Else Of An Ifchanged Nested In An Else Of An If
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -692,20 +692,20 @@ Else Of An Ifchanged Nested In An Else Of An If
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)))
(endifchanged_block))))
(endif_block))
(endifchanged_tag))))
(endif_tag))
(content))
==================
@@ -719,16 +719,16 @@ Else Of An If Nested In An Else Of An Ifchanged
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -736,12 +736,12 @@ Else Of An If Nested In An Else Of An Ifchanged
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)))
(endif_block))))
(endifchanged_block))
(endif_tag))))
(endifchanged_tag))
(content))
==================
@@ -755,8 +755,8 @@ Third Else Is Unexpected Too
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -764,15 +764,15 @@ Third Else Is Unexpected Too
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endif_block))
(endif_tag))
(content))
==================
@@ -786,8 +786,8 @@ Second And Third Empty Are Unexpected
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -795,15 +795,15 @@ Second And Third Empty Are Unexpected
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(empty_block
(empty_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endfor_block))
(endfor_tag))
(content))
==================
@@ -817,19 +817,19 @@ Second And Third Else Of An Ifchanged Are Unexpected
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(ifchanged_block
(ifchanged_tag)
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endifchanged_block))
(endifchanged_tag))
(content))
==================
@@ -843,13 +843,13 @@ Second Else Inside A Block Is Unexpected
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
(push_block))
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -857,14 +857,14 @@ Second Else Inside A Block Is Unexpected
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endif_block))))
(endblock_block
(endif_tag))))
(endblock_tag
(pop_block)))
(content))
@@ -879,8 +879,8 @@ Second Else Of An If In A For Is Unexpected
(template
(content)
(for_group
(for_clause
(for_block
(for_block
(for_tag
(identifier)
(filtered_value
(value
@@ -888,8 +888,8 @@ Second Else Of An If In A For Is Unexpected
(identifier)))))
(template
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
@@ -897,14 +897,14 @@ Second Else Of An If In A For Is Unexpected
(identifier))))))
(template
(content)))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(content)
(unexpected_block)
(unexpected_tag)
(content)))
(endif_block))))
(endfor_block))
(endif_tag))))
(endfor_tag))
(content))
==================
@@ -918,17 +918,17 @@ Stray End Tag After A Missing One
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(unexpected_block)
(unexpected_tag)
(content)))
(missing_endif_block)))
(missing_endif_tag)))
==================
Endblock Naming No Open Block
@@ -941,19 +941,19 @@ Endblock Naming No Open Block
(template
(content)
(block_group
(block_clause
(block_block
(block_block
(block_tag
(push_block))
(template
(block_group
(block_clause
(block_block
(block_block
(block_tag
(push_block))
(template
(unexpected_block)
(unexpected_tag)
(content)))
(missing_endblock_block))))
(missing_endblock_block)))
(missing_endblock_tag))))
(missing_endblock_tag)))
==================
Second Else Is Not A Missing Tag
@@ -966,18 +966,18 @@ Second Else Is Not A Missing Tag
(template
(content)
(if_group
(if_clause
(if_block
(if_block
(if_tag
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))))
(else_clause
(else_block)
(else_block
(else_tag)
(template
(unexpected_block)))
(endif_block))
(unexpected_tag)))
(endif_tag))
(content))
==================
+2 -2
View File
@@ -8,7 +8,7 @@ Now Basic
(template
(content)
(now_block
(now_tag
(string))
(content))
@@ -22,7 +22,7 @@ Now With As
(template
(content)
(now_block
(now_tag
(string)
variable: (identifier))
(content))
+1 -1
View File
@@ -8,6 +8,6 @@ Partial Basic
(template
(content)
(partial_block
(partial_tag
(identifier))
(content))
+6 -6
View File
@@ -13,12 +13,12 @@ Partialdef Basic
(template
(content)
(partialdef_group
(partialdef_clause
(partialdef_block
(partialdef_block
(partialdef_tag
(push_partial))
(template
(content)))
(endpartialdef_block
(endpartialdef_tag
(pop_partial)))
(content))
@@ -37,11 +37,11 @@ Partialdef Inline
(template
(content)
(partialdef_group
(partialdef_clause
(partialdef_block
(partialdef_block
(partialdef_tag
(push_partial))
(template
(content)))
(endpartialdef_block
(endpartialdef_tag
(pop_partial)))
(content))
+5 -5
View File
@@ -8,7 +8,7 @@ Querystring Empty
(template
(content)
(querystring_block)
(querystring_tag)
(content))
==================
@@ -21,7 +21,7 @@ Querystring With Key Value
(template
(content)
(querystring_block
(querystring_tag
(identifier)
(filtered_value
(value
@@ -39,7 +39,7 @@ Querystring With Identifier And Key Value
(template
(content)
(querystring_block
(querystring_tag
(filtered_value
(value
(variable_attribute
@@ -61,7 +61,7 @@ Querystring With Expression Argument And As
(template
(content)
(querystring_block
(querystring_tag
(filtered_value
(value
(variable_attribute
@@ -85,7 +85,7 @@ Querystring With Two Keys
(template
(content)
(querystring_block
(querystring_tag
(identifier)
(filtered_value
(value
+1 -1
View File
@@ -8,7 +8,7 @@ Regroup Basic
(template
(content)
(regroup_block
(regroup_tag
(filtered_value
(value
(variable_attribute
+2 -2
View File
@@ -8,7 +8,7 @@ Resetcycle Bare
(template
(content)
(resetcycle_block)
(resetcycle_tag)
(content))
==================
@@ -21,6 +21,6 @@ Resetcycle With Name
(template
(content)
(resetcycle_block
(resetcycle_tag
(identifier))
(content))
+3 -3
View File
@@ -13,9 +13,9 @@ Spaceless Basic
(template
(content)
(spaceless_group
(spaceless_clause
(spaceless_block)
(spaceless_block
(spaceless_tag)
(template
(content)))
(endspaceless_block))
(endspaceless_tag))
(content))
+9 -9
View File
@@ -8,7 +8,7 @@ Static
(template
(content)
(static_block
(static_tag
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Static With A Variable Path
(template
(content)
(static_block
(static_tag
(filtered_value
(value
(variable_attribute
@@ -42,7 +42,7 @@ Static With A Filtered Path
(template
(content)
(static_block
(static_tag
(filtered_value
(value
(literal
@@ -61,7 +61,7 @@ Static With As
(template
(content)
(static_block
(static_tag
(filtered_value
(value
(literal
@@ -109,7 +109,7 @@ Get Static Prefix
(template
(content)
(get_static_prefix_block)
(get_static_prefix_tag)
(content))
==================
@@ -122,7 +122,7 @@ Get Static Prefix With As
(template
(content)
(get_static_prefix_block
(get_static_prefix_tag
variable: (identifier))
(content))
@@ -136,7 +136,7 @@ Get Media Prefix With As
(template
(content)
(get_media_prefix_block
(get_media_prefix_tag
variable: (identifier))
(content))
@@ -170,10 +170,10 @@ Load Names The Library, Not The Tag
(template
(content)
(load_block
(load_tag
(library
(identifier)))
(static_block
(static_tag
(filtered_value
(value
(literal
+2 -2
View File
@@ -8,7 +8,7 @@ Templatetag Openblock
(template
(content)
(templatetag_block)
(templatetag_tag)
(content))
==================
@@ -21,5 +21,5 @@ Templatetag Closevariable
(template
(content)
(templatetag_block)
(templatetag_tag)
(content))
+19 -19
View File
@@ -9,11 +9,11 @@ Localtime
(template
(content)
(localtime_group
(localtime_clause
(localtime_block)
(localtime_block
(localtime_tag)
(template
(content)))
(endlocaltime_block))
(endlocaltime_tag))
(content))
==================
@@ -27,11 +27,11 @@ Localtime On
(template
(content)
(localtime_group
(localtime_clause
(localtime_block)
(localtime_block
(localtime_tag)
(template
(content)))
(endlocaltime_block))
(endlocaltime_tag))
(content))
==================
@@ -45,11 +45,11 @@ Localtime Off
(template
(content)
(localtime_group
(localtime_clause
(localtime_block)
(localtime_block
(localtime_tag)
(template
(content)))
(endlocaltime_block))
(endlocaltime_tag))
(content))
==================
@@ -83,15 +83,15 @@ Timezone
(template
(content)
(timezone_group
(timezone_clause
(timezone_block
(timezone_block
(timezone_tag
(filtered_value
(value
(literal
(string)))))
(template
(content)))
(endtimezone_block))
(endtimezone_tag))
(content))
==================
@@ -105,15 +105,15 @@ Timezone With A Variable
(template
(content)
(timezone_group
(timezone_clause
(timezone_block
(timezone_block
(timezone_tag
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content)))
(endtimezone_block))
(endtimezone_tag))
(content))
==================
@@ -127,8 +127,8 @@ Timezone With A Filtered Argument
(template
(content)
(timezone_group
(timezone_clause
(timezone_block
(timezone_block
(timezone_tag
(filtered_value
(value
(variable_attribute
@@ -137,7 +137,7 @@ Timezone With A Filtered Argument
(filter))))
(template
(content)))
(endtimezone_block))
(endtimezone_tag))
(content))
==================
@@ -170,7 +170,7 @@ Get Current Timezone
(template
(content)
(get_current_timezone_block
(get_current_timezone_tag
variable: (identifier))
(content))
+4 -4
View File
@@ -8,7 +8,7 @@ Url Basic
(template
(content)
(url_block
(url_tag
(string))
(content))
@@ -22,7 +22,7 @@ Url With Positional Args
(template
(content)
(url_block
(url_tag
(string)
(filtered_value
(value
@@ -44,7 +44,7 @@ Url With Keyword Args
(template
(content)
(url_block
(url_tag
(string)
(identifier)
(filtered_value
@@ -63,7 +63,7 @@ Url With As
(template
(content)
(url_block
(url_tag
(string)
variable: (identifier))
(content))
+15 -15
View File
@@ -9,11 +9,11 @@ Verbatim Basic
(template
(content)
(verbatim_group
(verbatim_clause
(verbatim_block
(verbatim_block
(verbatim_tag
(push_verbatim))
(verbatim_content))
(endverbatim_block
(endverbatim_tag
(pop_verbatim)))
(content))
@@ -28,10 +28,10 @@ Verbatim Empty
(template
(content)
(verbatim_group
(verbatim_clause
(verbatim_block
(verbatim_block
(verbatim_tag
(push_verbatim)))
(endverbatim_block
(endverbatim_tag
(pop_verbatim)))
(content))
@@ -49,11 +49,11 @@ Verbatim Ignores Tags
(template
(content)
(verbatim_group
(verbatim_clause
(verbatim_block
(verbatim_block
(verbatim_tag
(push_verbatim))
(verbatim_content))
(endverbatim_block
(endverbatim_tag
(pop_verbatim)))
(content))
@@ -68,11 +68,11 @@ Verbatim With Name
(template
(content)
(verbatim_group
(verbatim_clause
(verbatim_block
(verbatim_block
(verbatim_tag
(push_verbatim))
(verbatim_content))
(endverbatim_block
(endverbatim_tag
(pop_verbatim)))
(content))
@@ -89,10 +89,10 @@ Avoid template rendering via the {% verbatim %}{% endverbatim %} block.
(template
(content)
(verbatim_group
(verbatim_clause
(verbatim_block
(verbatim_block
(verbatim_tag
(push_verbatim))
(verbatim_content))
(endverbatim_block
(endverbatim_tag
(pop_verbatim)))
(content))
+15 -15
View File
@@ -11,8 +11,8 @@ With Basic
(template
(content)
(with_group
(with_clause
(with_block
(with_block
(with_tag
variable: (identifier)
(filtered_value
(value
@@ -27,7 +27,7 @@ With Basic
(variable_attribute
(identifier)))))
(content)))
(endwith_block))
(endwith_tag))
(content))
==================
@@ -43,8 +43,8 @@ With Multiple Variables
(template
(content)
(with_group
(with_clause
(with_block
(with_block
(with_tag
variable: (identifier)
(filtered_value
(value
@@ -63,7 +63,7 @@ With Multiple Variables
(variable_attribute
(identifier)))))
(content)))
(endwith_block))
(endwith_tag))
(content))
==================
@@ -97,8 +97,8 @@ With Repeating A Binding Of The Tag Before It
(template
(content)
(with_group
(with_clause
(with_block
(with_block
(with_tag
variable: (identifier)
(filtered_value
(value
@@ -106,10 +106,10 @@ With Repeating A Binding Of The Tag Before It
(number)))))
(template
(content)))
(endwith_block))
(endwith_tag))
(with_group
(with_clause
(with_block
(with_block
(with_tag
variable: (identifier)
(filtered_value
(value
@@ -117,7 +117,7 @@ With Repeating A Binding Of The Tag Before It
(number)))))
(template
(content)))
(endwith_block))
(endwith_tag))
(content))
==================
@@ -131,8 +131,8 @@ With A Binding Named After A Literal
(template
(content)
(with_group
(with_clause
(with_block
(with_block
(with_tag
variable: (identifier)
(filtered_value
(value
@@ -140,5 +140,5 @@ With A Binding Named After A Literal
(number)))))
(template
(content)))
(endwith_block))
(endwith_tag))
(content))