add rules for each tag block, and renamed some rules

This commit is contained in:
danhanson committed 2026-09-12 18:14:14 -05:00
1 parent db3caa1672
commit f2d3a727f6
43 files changed
+18627 -25320

No files matched your search

+26 -14
View File
@@ -58,7 +58,7 @@ that place it:
count (at most N), or `false`. `kwargs`: `true` (`**kwargs`), `false`, or `{name: rule}` for a known 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. 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 - `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` and `include`; keyword arguments are guarded by the scanner order but never twice. Used by `translate_block` and `include_block`; keyword arguments are guarded by the scanner
instead. Grows as `Σ C(n,k)·k!` (65 for four names), which is instead. Grows as `Σ C(n,k)·k!` (65 for four names), which is
why it is only used for signatures that name their arguments. 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 - `wordAsValueRules(word)` / `wordAsValue($, word, continued)` — a tag's own keyword written where a value
@@ -102,10 +102,18 @@ opened it. A clause reduces anyway, so it survives error recovery and tooling ca
to find the enclosing tag. That is what makes completion of `{% elif %}`, `{% else %}`, `{% empty %}` and to find the enclosing tag. That is what makes completion of `{% elif %}`, `{% else %}`, `{% empty %}` and
the end tags possible. 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
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.
The names themselves need no hand-maintained list either: in the generated `src/node-types.json`, a group's 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 own `tag:` field holds the end tag, so the candidates for a group `children` are its clause types and its end block, and a clause's children include its opening block, so
are its `tag:` plus the `tag:` of each clause it can hold. For `if_group` that is `endif` from the group and the candidates for a group are its end block plus the opening block of each clause it can hold. For
`if`, `elif`, `else` from its three clauses. Going the other way — from a clause the cursor sits in to the `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 an unterminated tag needs, since groups that can hold it — is the same table read backwards, which is what an unterminated tag needs, since
the group node does not exist yet. the group node does not exist yet.
@@ -115,7 +123,10 @@ 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 `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 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 `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`. Their bodies are `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
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 clauses need no `conflicts` entry — the rule
below is about a body that can itself start with `{%`. below is about a body that can itself start with `{%`.
@@ -125,7 +136,8 @@ silently discarded the parse in which the body continues, so every tag inside a
Sharing the clauses also made the table markedly smaller — 7,200 states and a 515KB library became 5,150 Sharing the clauses 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 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. stops duplicating the body states in every group's inline context. Giving every `{% %}` its own `_block`
rule shrank it again, from 1,999 states to 1,818, by the same mechanism.
### Filter pipes differ by context ### Filter pipes differ by context
@@ -139,18 +151,18 @@ 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 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: arity, or whether a tag is a block tag. Two fallback rules accept them:
- `custom_tag` — `simpleTag($, $.identifier)`, i.e. what `simple_tag`/`inclusion_tag` accept, which is how - `custom_tag_block` — `simpleTag($, $.identifier)`, i.e. what `simple_tag`/`inclusion_tag` accept, which is how
a tag is registered unless it needs the parser itself. 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 - `_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 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` — see grammar extending this one can filter it out of `filter`'s `members` the way it can `custom_tag_block` — see
the extension section in `README.md`. the extension section in `README.md`.
**A name that only exists inside a tag group has to be reserved instead.** `endif`, `else`, `empty` and **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 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` takes them: `{% endif %}` on its own parsed as a tag from some library. They are identifier and `custom_tag_block` 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 listed in `NAMES_INSIDE_A_TAG_GROUP` and applied through the `tag_name` reserved context, which wraps
`custom_tag`'s name **and nothing else** — a reserved context replaces the global one inside whatever it `custom_tag_block`'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 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. with a new part or end tag means adding its name there too.
@@ -183,7 +195,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`, 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. `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`. A project that Modelling a library name makes it keyword-extracted, so it no longer reaches `custom_tag_block`. A project that
registers its own tag under one of these names and a different signature therefore gets a parse error. 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. is accepted: these names are common enough that shadowing them is the mistake.
@@ -245,7 +257,7 @@ matching.
`queries/highlights.scm` lists tag and filter names explicitly, so adding either to the grammar means `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 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 tag: (identifier))`). captured through its field instead (`(filter name: (identifier))`, `(custom_tag_block tag: (identifier))`).
`queries/libraries.scm` is not a query editors run themselves; it is data for a linter, and every tag or `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 filter added from a library belongs in it. `queries/locals.scm` relies on the `variable:` field to tell a
@@ -325,8 +337,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. - `{% 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 - 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 library registered. Cross-referencing names against `{% load %}` needs the project's Python, so it
belongs in a linter; the `load` rule already parses the library and `from` names for one to use. 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`s. Nesting them would mean guessing that - `{% mytag %}…{% endmytag %}` parses as two sibling `custom_tag_block`s. Nesting them would mean guessing that
an unknown tag is a block tag. 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 - 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. token and may parse anything, so `{% mytag <<>> %}` is rejected here and not by Django.
+17 -16
View File
@@ -110,7 +110,7 @@ them is treated as the mistake.
A library's tags and filters are registered in Python, so the grammar cannot know their names, their 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: 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`, with the shape `simple_tag` and - **Tags.** Any tag the grammar does not recognise parses as `custom_tag_block`, with the shape `simple_tag` and
`inclusion_tag` give: positional filter expressions, then `name=value` keyword arguments, then an `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:` field.
A keyword argument written twice is refused, as `parse_bits` refuses it. A keyword argument written twice is refused, as `parse_bits` refuses it.
@@ -122,13 +122,13 @@ grammar knows from one it is only tolerating.
What the fallbacks cannot do: What the fallbacks cannot do:
- **A block tag is not nested.** `{% mytag %}…{% endmytag %}` is two sibling `custom_tag`s; pairing them - **A block tag is not nested.** `{% mytag %}…{% endmytag %}` is two sibling `custom_tag_block`s; pairing them
would mean guessing that an unknown tag opens a body. 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 - **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. 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 - **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 registered. Cross-referencing names against `{% load %}` needs the project's Python, so it belongs in a
linter; `queries/libraries.scm` and the `load` rule supply what one needs. linter; `queries/libraries.scm` and the `load_block` rule supply what one needs.
- **Names that only exist inside a tag group are reserved**, so `{% endif %}` or `{% empty %}` standing on - **Names that only exist inside a tag group are reserved**, so `{% endif %}` or `{% empty %}` standing on
its own is an error rather than a call to a custom tag of that name. its own is an error rather than a call to a custom tag of that name.
@@ -136,7 +136,7 @@ What the fallbacks cannot do:
For a project whose custom tags deserve real rules rather than the fallbacks, use this grammar as a base 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 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 `template_block_groups`; a filter is an has receives it as `previous`. A tag is an alternative of `tag_block_group`; a filter is an
alternative of `filter`. alternative of `filter`.
```js ```js
@@ -149,8 +149,8 @@ export default grammar(django, {
rules: { rules: {
// {% map items over rows %} // {% map items over rows %}
template_block_groups: ($, previous) => choice(previous, $.map_tag), tag_block_group: ($, previous) => choice(previous, $.map_block),
map_tag: ($) => map_block: ($) =>
seq( seq(
"{%", "{%",
optional(SEP), optional(SEP),
@@ -183,12 +183,13 @@ Five things to know:
- **A new name wins over the fallback.** `shout` becomes a token of its own, so it commits to your - **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 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 name: (identifier))`.
- **A tag with a body needs a `conflicts` entry**, as every clause in the base grammar does: - **A tag with a body is split the way the base grammar's are**, so every `{% %}` is a node of its own:
`conflicts: ($, previous) => [...previous, [$.map_clause]]` for a `map_clause` holding the body. The a `map_block` for the opening tag, a `map_clause` of that block and the body, an `endmap_block`, and a
generator offers an associativity `map_group` of the clause and the end block. The clause needs a `conflicts` entry, as every clause in
instead; taking it silently discards the parse in which the body continues. the base grammar does: `conflicts: ($, previous) => [...previous, [$.map_clause]]`. The generator
- **End tags are not reserved**, a stray `{% endmap %}` parses as a `custom_tag` rather than an error — `reserved` takes no offers an associativity instead; taking it silently discards the parse in which the body continues.
`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. - **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.
- **The external scanner has to be re-exported under your grammar's name**, or block-name matching and the - **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 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: ones your generated `parser.c` calls, and includes it:
@@ -210,13 +211,13 @@ build step can hand the compiler an absolute path from `import.meta.resolve` whe
layout makes the relative one unreliable. layout makes the relative one unreliable.
**Turning the fallbacks off.** A grammar that models every tag and filter its project uses probably does **Turning the fallbacks off.** A grammar that models every tag and filter its project uses probably does
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: 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:
```js ```js
template_block_groups: ($, previous) => tag_block_group: ($, previous) =>
choice( choice(
...previous.members.filter((m) => m.name !== "custom_tag"), ...previous.members.filter((m) => m.name !== "custom_tag_block"),
$.map_tag, $.map_block,
), ),
filter: ($, previous) => filter: ($, previous) =>
+167 -150
View File
@@ -205,17 +205,20 @@ function simpleTag($, tag, args = true, kwargs = true) {
} }
/** /**
* @param {GrammarSymbols<string>} $ * The rules of one spelling of blocktranslate, which Django registers under
* both "blocktrans" and "blocktranslate" and closes with the matching end tag.
* Only the counted form takes a plural, so the clause has to know which
* opening block it saw: the two forms are separate hidden rules, each aliased
* to the one visible <tag>_block where the clause uses it.
*
* @param {string} tag * @param {string} tag
* @returns {ChoiceRule} * @returns {Record<string, RuleBuilder<string>>}
*/ */
function blocktrans_clause_rule($, tag) { function blocktransRules(tag) {
return choice( return {
seq( [`_${tag}_block`]: ($) =>
block(tag, $._tag_open, repeat($._translate_option)), block(tag, $._tag_open, repeat($._translate_option)),
optional($._translate_body), [`_${tag}_count_block`]: ($) =>
),
seq(
block( block(
tag, tag,
$._tag_open, $._tag_open,
@@ -223,10 +226,20 @@ function blocktrans_clause_rule($, tag) {
$._translate_count, $._translate_count,
repeat($._translate_option), repeat($._translate_option),
), ),
[`${tag}_clause`]: ($) =>
choice(
seq(
alias($[`_${tag}_block`], $[`${tag}_block`]),
optional($._translate_body),
),
seq(
alias($[`_${tag}_count_block`], $[`${tag}_block`]),
optional($._translate_body), optional($._translate_body),
$.plural_clause, $.plural_clause,
), ),
); ),
[`end${tag}_block`]: ($) => block(`end${tag}`),
};
} }
/** /**
@@ -325,7 +338,7 @@ const I18N_FILTERS_WITHOUT_ARGUMENT = [
/** /**
* The words that head an end tag or a part of a tag group. Each is a token * The words that head an end tag or a part of a tag group. Each is a token
* only inside the group it belongs to, so anywhere else the lexer reads it as * only inside the group it belongs to, so anywhere else the lexer reads it as
* an identifier and custom_tag accepts it: "{% endif %}" on its own parsed as * an identifier and custom_tag_block accepts it: "{% endif %}" on its own parsed as
* a tag some library registered. Reserving them where a tag is named makes * a tag some library registered. Reserving them where a tag is named makes
* them an error again, while leaving them usable as ordinary words elsewhere * them an error again, while leaving them usable as ordinary words elsewhere
* ("{{ endif }}" is a variable, and "{% mytag endif %}" an argument). * ("{{ endif }}" is a variable, and "{% mytag endif %}" an argument).
@@ -385,12 +398,12 @@ const django = grammar({
[$.with_clause], [$.with_clause],
[$.predicate], [$.predicate],
[$.binaryOperator], [$.binaryOperator],
[$.library, $.load], [$.library, $.load_block],
[$._translate_option], [$._translate_option],
[$._filtered_value_spaced], [$._filtered_value_spaced],
[$._filter_expression_spaced], [$._filter_expression_spaced],
], ],
supertypes: ($) => [$.template_tag, $.template_block_groups], supertypes: ($) => [$.template_node, $.tag_block_group],
externals: ($) => [ externals: ($) => [
$.matcher_error, $.matcher_error,
$.pop_block, $.pop_block,
@@ -410,10 +423,10 @@ const django = grammar({
tag_name: ($) => NAMES_INSIDE_A_TAG_GROUP, tag_name: ($) => NAMES_INSIDE_A_TAG_GROUP,
}, },
rules: { rules: {
template: ($) => repeat1(choice($.template_tag, $.content)), template: ($) => repeat1(choice($.template_node, $.content)),
content: ($) => /(?:[^\{]|\{[^\{#%}])+/, content: ($) => /(?:[^\{]|\{[^\{#%}])+/,
template_tag: ($) => template_node: ($) =>
choice($.template_block_groups, $.template_variable, $.template_comment), choice($.tag_block_group, $.template_variable, $.template_comment),
filtered_value: ($) => filtered_value: ($) =>
seq($.value, optional(seq("|", $.filter_expression))), seq($.value, optional(seq("|", $.filter_expression))),
filter_expression: ($) => seq($.filter, repeat(seq("|", $.filter))), filter_expression: ($) => seq($.filter, repeat(seq("|", $.filter))),
@@ -504,52 +517,52 @@ const django = grammar({
_filter_expression_spaced: ($) => _filter_expression_spaced: ($) =>
seq($.filter, repeat(seq(optional(SEP), "|", optional(SEP), $.filter))), seq($.filter, repeat(seq(optional(SEP), "|", optional(SEP), $.filter))),
template_comment: ($) => seq("{#", /(?:[^#]|#[^}])*/, "#}"), template_comment: ($) => seq("{#", /(?:[^#]|#[^}])*/, "#}"),
template_block_groups: ($) => tag_block_group: ($) =>
choice( choice(
$.autoescape_group, $.autoescape_group,
$.block_group, $.block_group,
$.blocktranslate_group, $.blocktranslate_group,
$.cache_group, $.cache_group,
$.comment_group, $.comment_group,
$.csp_nonce_attr, $.csp_nonce_attr_block,
$.csrf_token, $.csrf_token_block,
$.custom_tag, $.custom_tag_block,
$.cycle, $.cycle_block,
$.debug, $.debug_block,
$.extends, $.extends_block,
$.filter_group, $.filter_group,
$.firstof, $.firstof_block,
$.for_group, $.for_group,
$.get_available_languages, $.get_available_languages_block,
$.get_current_language, $.get_current_language_block,
$.get_current_language_bidi, $.get_current_language_bidi_block,
$.get_current_timezone, $.get_current_timezone_block,
$.get_language_info, $.get_language_info_block,
$.get_language_info_list, $.get_language_info_list_block,
$.get_media_prefix, $.get_media_prefix_block,
$.get_static_prefix, $.get_static_prefix_block,
$.if_group, $.if_group,
$.ifchanged_group, $.ifchanged_group,
$.include, $.include_block,
$.language_group, $.language_group,
$.load, $.load_block,
$.localize_group, $.localize_group,
$.localtime_group, $.localtime_group,
$.lorem, $.lorem_block,
$.now, $.now_block,
$.partial, $.partial_block,
$.partialdef_group, $.partialdef_group,
$.query_string, $.querystring_block,
$.regroup, $.regroup_block,
$.reset_cycle, $.resetcycle_block,
$.spaceless_group, $.spaceless_group,
$.static, $.static_block,
$.template_tag_block, $.templatetag_block,
$.timezone_group, $.timezone_group,
$.translate, $.translate_block,
$.url_block, $.url_block,
$.verbatim_group, $.verbatim_group,
$.width_ratio, $.widthratio_block,
$.with_group, $.with_group,
), ),
/** /**
@@ -587,28 +600,31 @@ const django = grammar({
* A filter a "load" brought in: its name is not known here, and so neither * A filter a "load" brought in: its name is not known here, and so neither
* is whether it takes an argument. Hidden, so the tree is the same as if * is whether it takes an argument. Hidden, so the tree is the same as if
* it were spelled inline, but named so that a grammar extending this one * it were spelled inline, but named so that a grammar extending this one
* can drop it from filter's alternatives the way it can drop custom_tag * can drop it from filter's alternatives the way it can drop custom_tag_block
* from template_block_groups. * from tag_block_group.
*/ */
_custom_filter: ($) => _custom_filter: ($) =>
seq( seq(
field("name", $.identifier), field("name", $.identifier),
optional(seq(":", field("argument", $.value))), optional(seq(":", field("argument", $.value))),
), ),
autoescape_clause: ($) => autoescape_block: ($) => block("autoescape", part(choice("on", "off"))),
seq(block("autoescape", part(choice("on", "off"))), optional($.template)), autoescape_clause: ($) => seq($.autoescape_block, optional($.template)),
autoescape_group: ($) => seq($.autoescape_clause, block("endautoescape")), endautoescape_block: ($) => block("endautoescape"),
autoescape_group: ($) => seq($.autoescape_clause, $.endautoescape_block),
// the scanner takes the whitespace before a name it has to match itself // the scanner takes the whitespace before a name it has to match itself
block_clause: ($) => block_block: ($) => block("block", field("name", $.push_block)),
seq(block("block", field("name", $.push_block)), optional($.template)), block_clause: ($) => seq($.block_block, optional($.template)),
block_group: ($) => seq($.block_clause, block("endblock", $.pop_block)), endblock_block: ($) => block("endblock", $.pop_block),
plural_clause: ($) => seq(block("plural"), optional($._translate_body)), block_group: ($) => seq($.block_clause, $.endblock_block),
blocktrans_clause: ($) => blocktrans_clause_rule($, "blocktrans"), plural_block: ($) => block("plural"),
blocktranslate_clause: ($) => blocktrans_clause_rule($, "blocktranslate"), plural_clause: ($) => seq($.plural_block, optional($._translate_body)),
...blocktransRules("blocktrans"),
...blocktransRules("blocktranslate"),
blocktranslate_group: ($) => blocktranslate_group: ($) =>
choice( choice(
seq($.blocktrans_clause, block("endblocktrans")), seq($.blocktrans_clause, $.endblocktrans_block),
seq($.blocktranslate_clause, block("endblocktranslate")), seq($.blocktranslate_clause, $.endblocktranslate_block),
), ),
/** /**
* The scanner reads the name of the option before the grammar does, so it * The scanner reads the name of the option before the grammar does, so it
@@ -654,8 +670,7 @@ const django = grammar({
), ),
), ),
), ),
cache_clause: ($) => cache_block: ($) =>
seq(
block( block(
"cache", "cache",
part($.filtered_value), part($.filtered_value),
@@ -663,26 +678,24 @@ const django = grammar({
repeat(part($.filtered_value)), repeat(part($.filtered_value)),
optional(part(seq("using=", $.filtered_value))), optional(part(seq("using=", $.filtered_value))),
), ),
optional($.template), cache_clause: ($) => seq($.cache_block, optional($.template)),
), endcache_block: ($) => block("endcache"),
cache_group: ($) => seq($.cache_clause, block("endcache")), cache_group: ($) => seq($.cache_clause, $.endcache_block),
comment_clause: ($) => comment_block: ($) => block("comment", optional(part($.string))),
seq( comment_clause: ($) => seq($.comment_block, optional($.comment_content)),
block("comment", optional(part($.string))), endcomment_block: ($) => block("endcomment"),
optional($.comment_content), comment_group: ($) => seq($.comment_clause, $.endcomment_block),
),
comment_group: ($) => seq($.comment_clause, block("endcomment")),
// csp_nonce_attr(context, media=None) // csp_nonce_attr(context, media=None)
csp_nonce_attr: ($) => csp_nonce_attr_block: ($) =>
simpleTag($, "csp_nonce_attr", 1, { media: $.filtered_value }), simpleTag($, "csp_nonce_attr", 1, { media: $.filtered_value }),
csrf_token: ($) => block("csrf_token"), csrf_token_block: ($) => block("csrf_token"),
/** /**
* A tag a "load" brought in. Its arguments cannot be known here, so what * A tag a "load" brought in. Its arguments cannot be known here, so what
* is accepted is what Library.simple_tag and Library.inclusion_tag take, * is accepted is what Library.simple_tag and Library.inclusion_tag take,
* which is how a tag is registered unless it needs the parser itself. * which is how a tag is registered unless it needs the parser itself.
*/ */
custom_tag: ($) => simpleTag($, reserved("tag_name", $.identifier)), custom_tag_block: ($) => simpleTag($, reserved("tag_name", $.identifier)),
cycle: ($) => cycle_block: ($) =>
block( block(
"cycle", "cycle",
repeat1(part($.filtered_value)), repeat1(part($.filtered_value)),
@@ -694,28 +707,26 @@ const django = grammar({
), ),
), ),
), ),
debug: ($) => block("debug"), debug_block: ($) => block("debug"),
extends: ($) => block("extends", part($.filtered_value)), extends_block: ($) => block("extends", part($.filtered_value)),
filter_clause: ($) => // the filter tag hands Django the rest of its text as one expression rather
seq( // than as split arguments, so pipes here take whitespace just as they do
// the filter tag hands Django the rest of its text as one expression // between "{{" and "}}"
// rather than as split arguments, so pipes here take whitespace just filter_block: ($) =>
// as they do between "{{" and "}}"
block( block(
"filter", "filter",
part(alias($._filter_expression_spaced, $.filter_expression)), part(alias($._filter_expression_spaced, $.filter_expression)),
), ),
optional($.template), filter_clause: ($) => seq($.filter_block, optional($.template)),
), endfilter_block: ($) => block("endfilter"),
filter_group: ($) => seq($.filter_clause, block("endfilter")), filter_group: ($) => seq($.filter_clause, $.endfilter_block),
firstof: ($) => firstof_block: ($) =>
block( block(
"firstof", "firstof",
repeat1(part($.filtered_value)), repeat1(part($.filtered_value)),
optional(asVariable($)), optional(asVariable($)),
), ),
for_clause: ($) => for_block: ($) =>
seq(
block( block(
"for", "for",
part(field("variable", $.identifier)), part(field("variable", $.identifier)),
@@ -742,23 +753,25 @@ const django = grammar({
seq(part(wordAsValue($, "reversed", false)), part("reversed")), seq(part(wordAsValue($, "reversed", false)), part("reversed")),
), ),
), ),
optional($.template), for_clause: ($) => seq($.for_block, optional($.template)),
), empty_block: ($) => block("empty"),
empty_clause: ($) => seq(block("empty"), optional($.template)), empty_clause: ($) => seq($.empty_block, optional($.template)),
endfor_block: ($) => block("endfor"),
for_group: ($) => for_group: ($) =>
seq($.for_clause, optional($.empty_clause), block("endfor")), seq($.for_clause, optional($.empty_clause), $.endfor_block),
/** /**
* django.templatetags.i18n. Each of these requires exactly "as <name>", * django.templatetags.i18n. Each of these requires exactly "as <name>",
* or "for <expression> as <name>", and rejects anything further. * or "for <expression> as <name>", and rejects anything further.
*/ */
get_available_languages: ($) => get_available_languages_block: ($) =>
block("get_available_languages", asVariable($)), block("get_available_languages", asVariable($)),
get_current_language: ($) => block("get_current_language", asVariable($)), get_current_language_block: ($) =>
get_current_language_bidi: ($) => block("get_current_language", asVariable($)),
get_current_language_bidi_block: ($) =>
block("get_current_language_bidi", asVariable($)), block("get_current_language_bidi", asVariable($)),
get_language_info: ($) => get_language_info_block: ($) =>
block("get_language_info", part("for", $.filtered_value), asVariable($)), block("get_language_info", part("for", $.filtered_value), asVariable($)),
get_language_info_list: ($) => get_language_info_list_block: ($) =>
block( block(
"get_language_info_list", "get_language_info_list",
part("for", $.filtered_value), part("for", $.filtered_value),
@@ -769,36 +782,39 @@ const django = grammar({
* "as <name>", so unlike get_static_prefix the clause is not optional and * "as <name>", so unlike get_static_prefix the clause is not optional and
* nothing may follow it. * nothing may follow it.
*/ */
get_current_timezone: ($) => block("get_current_timezone", asVariable($)), get_current_timezone_block: ($) =>
get_media_prefix: ($) => block("get_media_prefix", optional(asVariable($))), block("get_current_timezone", asVariable($)),
get_static_prefix: ($) => get_media_prefix_block: ($) =>
block("get_media_prefix", optional(asVariable($))),
get_static_prefix_block: ($) =>
block("get_static_prefix", optional(asVariable($))), block("get_static_prefix", optional(asVariable($))),
if_clause: ($) => seq(block("if", part($.predicate)), optional($.template)), if_block: ($) => block("if", part($.predicate)),
elif_clause: ($) => if_clause: ($) => seq($.if_block, optional($.template)),
seq(block("elif", part($.predicate)), optional($.template)), elif_block: ($) => block("elif", part($.predicate)),
elif_clause: ($) => seq($.elif_block, optional($.template)),
/** Shared by if_group and ifchanged_group, which spell it the same way. */ /** Shared by if_group and ifchanged_group, which spell it the same way. */
else_clause: ($) => seq(block("else"), optional($.template)), else_block: ($) => block("else"),
else_clause: ($) => seq($.else_block, optional($.template)),
endif_block: ($) => block("endif"),
if_group: ($) => if_group: ($) =>
seq( seq(
$.if_clause, $.if_clause,
repeat($.elif_clause), repeat($.elif_clause),
optional($.else_clause), optional($.else_clause),
block("endif"), $.endif_block,
),
ifchanged_clause: ($) =>
seq(
block("ifchanged", repeat(part($.filtered_value))),
optional($.template),
), ),
ifchanged_block: ($) => block("ifchanged", repeat(part($.filtered_value))),
ifchanged_clause: ($) => seq($.ifchanged_block, optional($.template)),
endifchanged_block: ($) => block("endifchanged"),
ifchanged_group: ($) => ifchanged_group: ($) =>
seq($.ifchanged_clause, optional($.else_clause), block("endifchanged")), seq($.ifchanged_clause, optional($.else_clause), $.endifchanged_block),
/** /**
* do_include takes "with" and "only" in either order and refuses one it has * do_include takes "with" and "only" in either order and refuses one it has
* already been given, and "with" needs at least one argument. It calls * already been given, and "with" needs at least one argument. It calls
* token_kwargs with support_legacy=False, so "{% include "t" with a as b %}" * token_kwargs with support_legacy=False, so "{% include "t" with a as b %}"
* is an error here as it is there, unlike the same clause in "{% with %}". * is an error here as it is there, unlike the same clause in "{% with %}".
*/ */
include: ($) => include_block: ($) =>
block( block(
"include", "include",
$._tag_open, $._tag_open,
@@ -808,11 +824,12 @@ const django = grammar({
), ),
), ),
/** django.templatetags.i18n. The language tag takes the one argument. */ /** django.templatetags.i18n. The language tag takes the one argument. */
language_clause: ($) => language_block: ($) => block("language", part($.filtered_value)),
seq(block("language", part($.filtered_value)), optional($.template)), language_clause: ($) => seq($.language_block, optional($.template)),
language_group: ($) => seq($.language_clause, block("endlanguage")), endlanguage_block: ($) => block("endlanguage"),
language_group: ($) => seq($.language_clause, $.endlanguage_block),
library: ($) => seq($.identifier, optional(seq(".", $.identifier))), library: ($) => seq($.identifier, optional(seq(".", $.identifier))),
load: ($) => load_block: ($) =>
block( block(
"load", "load",
choice( choice(
@@ -824,38 +841,34 @@ const django = grammar({
* django.templatetags.l10n. The argument is optional and localize_tag * django.templatetags.l10n. The argument is optional and localize_tag
* rejects anything but "on" or "off", including a second word. * rejects anything but "on" or "off", including a second word.
*/ */
localize_clause: ($) => localize_block: ($) =>
seq(
block("localize", optional(part(choice("on", "off")))), block("localize", optional(part(choice("on", "off")))),
optional($.template), localize_clause: ($) => seq($.localize_block, optional($.template)),
), endlocalize_block: ($) => block("endlocalize"),
localize_group: ($) => seq($.localize_clause, block("endlocalize")), localize_group: ($) => seq($.localize_clause, $.endlocalize_block),
/** django.templatetags.tz, taking "on" or "off" as localize does. */ /** django.templatetags.tz, taking "on" or "off" as localize does. */
localtime_clause: ($) => localtime_block: ($) =>
seq(
block("localtime", optional(part(choice("on", "off")))), block("localtime", optional(part(choice("on", "off")))),
optional($.template), localtime_clause: ($) => seq($.localtime_block, optional($.template)),
), endlocaltime_block: ($) => block("endlocaltime"),
localtime_group: ($) => seq($.localtime_clause, block("endlocaltime")), localtime_group: ($) => seq($.localtime_clause, $.endlocaltime_block),
lorem: ($) => lorem_block: ($) =>
block( block(
"lorem", "lorem",
part($.filtered_value), part($.filtered_value),
part(choice("w", "p", "b")), part(choice("w", "p", "b")),
optional(part("random")), optional(part("random")),
), ),
now: ($) => block("now", part($.string), optional(asVariable($))), now_block: ($) => block("now", part($.string), optional(asVariable($))),
partial: ($) => block("partial", part($.identifier)), partial_block: ($) => block("partial", part($.identifier)),
partialdef_clause: ($) => partialdef_block: ($) =>
seq(
block("partialdef", $.push_partial, optional(part("inline"))), block("partialdef", $.push_partial, optional(part("inline"))),
optional($.template), partialdef_clause: ($) => seq($.partialdef_block, optional($.template)),
), endpartialdef_block: ($) => block("endpartialdef", $.pop_partial),
partialdef_group: ($) => partialdef_group: ($) => seq($.partialdef_clause, $.endpartialdef_block),
seq($.partialdef_clause, block("endpartialdef", $.pop_partial)),
// querystring(context, *args, **kwargs) // querystring(context, *args, **kwargs)
query_string: ($) => simpleTag($, "querystring"), querystring_block: ($) => simpleTag($, "querystring"),
regroup: ($) => regroup_block: ($) =>
block( block(
"regroup", "regroup",
part($.filtered_value), part($.filtered_value),
@@ -863,12 +876,14 @@ const django = grammar({
part($.attribute), part($.attribute),
optional(asVariable($)), optional(asVariable($)),
), ),
reset_cycle: ($) => block("resetcycle", optional(part($.identifier))), resetcycle_block: ($) => block("resetcycle", optional(part($.identifier))),
spaceless_clause: ($) => seq(block("spaceless"), optional($.template)), spaceless_block: ($) => block("spaceless"),
spaceless_group: ($) => seq($.spaceless_clause, block("endspaceless")), spaceless_clause: ($) => seq($.spaceless_block, optional($.template)),
static: ($) => endspaceless_block: ($) => block("endspaceless"),
spaceless_group: ($) => seq($.spaceless_clause, $.endspaceless_block),
static_block: ($) =>
block("static", part($.filtered_value), optional(asVariable($))), block("static", part($.filtered_value), optional(asVariable($))),
template_tag_block: ($) => templatetag_block: ($) =>
block( block(
"templatetag", "templatetag",
part( part(
@@ -885,15 +900,16 @@ const django = grammar({
), ),
), ),
/** django.templatetags.tz. timezone_tag takes the one argument. */ /** django.templatetags.tz. timezone_tag takes the one argument. */
timezone_clause: ($) => timezone_block: ($) => block("timezone", part($.filtered_value)),
seq(block("timezone", part($.filtered_value)), optional($.template)), timezone_clause: ($) => seq($.timezone_block, optional($.template)),
timezone_group: ($) => seq($.timezone_clause, block("endtimezone")), endtimezone_block: ($) => block("endtimezone"),
timezone_group: ($) => seq($.timezone_clause, $.endtimezone_block),
/** /**
* django.templatetags.i18n, registered under both spellings. do_translate * django.templatetags.i18n, registered under both spellings. do_translate
* pops its options off one at a time and refuses one it has already seen, * pops its options off one at a time and refuses one it has already seen,
* so they may be written in any order but none of them twice. * so they may be written in any order but none of them twice.
*/ */
translate: ($) => translate_block: ($) =>
block( block(
choice("trans", "translate"), choice("trans", "translate"),
part($.filtered_value), part($.filtered_value),
@@ -922,11 +938,11 @@ const django = grammar({
), ),
optional(asVariable($)), optional(asVariable($)),
), ),
verbatim_clause: ($) => verbatim_block: ($) => block("verbatim", $.push_verbatim),
seq(block("verbatim", $.push_verbatim), optional($.verbatim_content)), verbatim_clause: ($) => seq($.verbatim_block, optional($.verbatim_content)),
verbatim_group: ($) => endverbatim_block: ($) => block("endverbatim", $.pop_verbatim),
seq($.verbatim_clause, block("endverbatim", $.pop_verbatim)), verbatim_group: ($) => seq($.verbatim_clause, $.endverbatim_block),
width_ratio: ($) => widthratio_block: ($) =>
block( block(
"widthratio", "widthratio",
part($.filtered_value), part($.filtered_value),
@@ -934,9 +950,10 @@ const django = grammar({
part($.filtered_value), part($.filtered_value),
optional(asVariable($)), optional(asVariable($)),
), ),
with_clause: ($) => with_block: ($) => block("with", $._tag_open, $._tag_kwargs),
seq(block("with", $._tag_open, $._tag_kwargs), optional($.template)), with_clause: ($) => seq($.with_block, optional($.template)),
with_group: ($) => seq($.with_clause, block("endwith")), endwith_block: ($) => block("endwith"),
with_group: ($) => seq($.with_clause, $.endwith_block),
}, },
}); });
+4 -2
View File
@@ -22,7 +22,9 @@
; rather than a narrower scope in locals.scm. ; rather than a narrower scope in locals.scm.
(blocktrans_clause (blocktrans_clause
asvar: (identifier) @export.name) @export.from (blocktrans_block
asvar: (identifier) @export.name)) @export.from
(blocktranslate_clause (blocktranslate_clause
asvar: (identifier) @export.name) @export.from (blocktranslate_block
asvar: (identifier) @export.name)) @export.from
+5 -5
View File
@@ -4,13 +4,13 @@
variable: (identifier) @variable.parameter variable: (identifier) @variable.parameter
(block_clause (block_block
(push_block) @type) (push_block) @type)
(partialdef_clause (partialdef_block
(push_partial) @type) (push_partial) @type)
(verbatim_clause (verbatim_block
(push_verbatim) @type) (push_verbatim) @type)
(comment_content) @comment (comment_content) @comment
@@ -192,8 +192,8 @@ tag: [
(filter (filter
name: (identifier) @function.call) name: (identifier) @function.call)
(custom_tag (custom_tag_block
tag: (identifier) @function.call) tag: (identifier) @function.call)
(load (load_block
(identifier) @function) (identifier) @function)
+19 -19
View File
@@ -15,42 +15,42 @@
; heads, so that the capture is both the name to look up and the range to ; 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. ; report. A paired tag names the opening tag only.
(static (static_block
tag: ("static") @library.static) tag: ("static") @library.static)
(get_static_prefix (get_static_prefix_block
tag: ("get_static_prefix") @library.static) tag: ("get_static_prefix") @library.static)
(get_media_prefix (get_media_prefix_block
tag: ("get_media_prefix") @library.static) tag: ("get_media_prefix") @library.static)
(blocktrans_clause (blocktrans_block
tag: ("blocktrans") @library.i18n) tag: ("blocktrans") @library.i18n)
(blocktranslate_clause (blocktranslate_block
tag: ("blocktranslate") @library.i18n) tag: ("blocktranslate") @library.i18n)
(translate (translate_block
tag: [ tag: [
("trans") ("trans")
("translate")] @library.i18n) ("translate")] @library.i18n)
(language_clause (language_block
tag: ("language") @library.i18n) tag: ("language") @library.i18n)
(get_available_languages (get_available_languages_block
tag: ("get_available_languages") @library.i18n) tag: ("get_available_languages") @library.i18n)
(get_current_language (get_current_language_block
tag: ("get_current_language") @library.i18n) tag: ("get_current_language") @library.i18n)
(get_current_language_bidi (get_current_language_bidi_block
tag: ("get_current_language_bidi") @library.i18n) tag: ("get_current_language_bidi") @library.i18n)
(get_language_info (get_language_info_block
tag: ("get_language_info") @library.i18n) tag: ("get_language_info") @library.i18n)
(get_language_info_list (get_language_info_list_block
tag: ("get_language_info_list") @library.i18n) tag: ("get_language_info_list") @library.i18n)
(filter (filter
@@ -60,10 +60,10 @@
("language_name_local") ("language_name_local")
("language_name_translated")] @library.i18n) ("language_name_translated")] @library.i18n)
(cache_clause (cache_block
tag: ("cache") @library.cache) tag: ("cache") @library.cache)
(localize_clause (localize_block
tag: ("localize") @library.l10n) tag: ("localize") @library.l10n)
(filter (filter
@@ -71,13 +71,13 @@
("localize") ("localize")
("unlocalize")] @library.l10n) ("unlocalize")] @library.l10n)
(localtime_clause (localtime_block
tag: ("localtime") @library.tz) tag: ("localtime") @library.tz)
(timezone_clause (timezone_block
tag: ("timezone") @library.tz) tag: ("timezone") @library.tz)
(get_current_timezone (get_current_timezone_block
tag: ("get_current_timezone") @library.tz) tag: ("get_current_timezone") @library.tz)
(filter (filter
@@ -88,8 +88,8 @@
; "{% load static %}" makes every name in the library available; "{% load ; "{% load static %}" makes every name in the library available; "{% load
; static from staticfiles %}" makes only the names listed available. ; static from staticfiles %}" makes only the names listed available.
(load (load_block
(library) @load.library) (library) @load.library)
(load (load_block
(identifier) @load.name) (identifier) @load.name)
+13 -10
View File
@@ -1,17 +1,20 @@
(load (load_block
(identifier) @name) @definition.function (identifier) @name) @definition.function
(partialdef_clause (push_partial) @name) @definition.method (partialdef_block (push_partial) @name) @definition.method
(partial (identifier) @name) @reference.call (partial_block (identifier) @name) @reference.call
; every tag that opens a group names itself in a clause of its own, and every ; a tag that opens no body names itself; a group is named by the first block of
; tag that does not is a group member directly ; its first clause, so neither its end block nor the blocks opening its later
(template_block_groups ; clauses are references of their own
[ (tag_block_group
tag: _ @name) @reference.call
(tag_block_group
.
(_ (_
tag: _ @name) .
(_ (_
(_ tag: _ @name))) @reference.call
tag: _ @name))] @reference.call)
(filter) @reference.call (filter) @reference.call
+786 -598
View File
File diff suppressed because it is too large. Load diff
+831 -362
View File
File diff suppressed because it is too large. Load diff
+16223 -23844
View File
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -18,6 +18,8 @@ Autoescape
(content) (content)
(autoescape_group (autoescape_group
(autoescape_clause (autoescape_clause
(autoescape_block)
(template (template
(content)))) (content)))
(endautoescape_block))
(content)) (content))
+32 -16
View File
@@ -18,10 +18,12 @@ Block
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content)) (content))
================== ==================
@@ -44,10 +46,12 @@ Block Matching End Tag
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content)) (content))
================== ==================
@@ -72,17 +76,21 @@ Nested Blocks
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content)) (content))
================== ==================
@@ -107,17 +115,21 @@ Nested Blocks End Tag
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content)) (content))
================== ==================
@@ -142,15 +154,19 @@ Nested Blocks Mixed Tags
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content))) (content)))
(pop_block)) (endblock_block
(pop_block)))
(content)) (content))
+65 -27
View File
@@ -10,7 +10,9 @@ Blocktrans
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(content))) (blocktrans_block)
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -25,7 +27,9 @@ Blocktranslate
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktranslate_clause (blocktranslate_clause
(content))) (blocktranslate_block)
(content))
(endblocktranslate_block))
(content)) (content))
================== ==================
@@ -39,7 +43,9 @@ Blocktrans Empty
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause)) (blocktrans_clause
(blocktrans_block))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -54,12 +60,14 @@ Blocktrans With A Placeholder
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block)
(content) (content)
(template_variable (template_variable
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))))) (identifier))))))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -74,7 +82,9 @@ Blocktrans Trimmed
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(content))) (blocktrans_block)
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -89,12 +99,14 @@ Blocktrans With
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(content))) (content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -109,6 +121,7 @@ Blocktrans With Several Bindings
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
@@ -118,8 +131,9 @@ Blocktrans With Several Bindings
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(content))) (content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -134,14 +148,16 @@ Blocktrans With A Filtered Binding
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))) (identifier)))
(filter_expression (filter_expression
(filter))) (filter))))
(content))) (content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -156,11 +172,13 @@ Blocktrans With Context
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block
(filtered_value (filtered_value
(value (value
(literal (literal
(string)))) (string)))))
(content))) (content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -175,8 +193,10 @@ Blocktrans With Asvar
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
asvar: (identifier) (blocktrans_block
(content))) asvar: (identifier))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -191,14 +211,17 @@ Blocktrans With Count And Plural
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(content) (content)
(plural_clause (plural_clause
(content)))) (plural_block)
(content)))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -213,13 +236,16 @@ Blocktrans With An Empty Singular
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(plural_clause (plural_clause
(content)))) (plural_block)
(content)))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -234,13 +260,16 @@ Blocktranslate With An Empty Plural
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktranslate_clause (blocktranslate_clause
(blocktranslate_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(content) (content)
(plural_clause))) (plural_clause
(plural_block)))
(endblocktranslate_block))
(content)) (content))
================== ==================
@@ -255,6 +284,7 @@ Blocktrans With Every Option
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(blocktrans_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
@@ -269,10 +299,12 @@ Blocktrans With Every Option
(value (value
(literal (literal
(string)))) (string))))
asvar: (identifier) asvar: (identifier))
(content) (content)
(plural_clause (plural_clause
(content)))) (plural_block)
(content)))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -287,8 +319,10 @@ Blocktrans With Its Options Reordered
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
asvar: (identifier) (blocktrans_block
(content))) asvar: (identifier))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -512,10 +546,14 @@ Blocktrans Repeating An Option Of The Tag Before It
(content) (content)
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(content))) (blocktrans_block)
(content))
(endblocktrans_block))
(blocktranslate_group (blocktranslate_group
(blocktrans_clause (blocktrans_clause
(content))) (blocktrans_block)
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
+32 -16
View File
@@ -10,13 +10,15 @@ Cache
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(literal (literal
(number)))) (number))))
(identifier) (identifier))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -31,13 +33,15 @@ Cache With A Variable Timeout
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier))))
(identifier) (identifier))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -52,6 +56,7 @@ Cache With A Filtered Timeout
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -61,9 +66,10 @@ Cache With A Filtered Timeout
argument: (value argument: (value
(literal (literal
(number)))))) (number))))))
(identifier) (identifier))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -78,13 +84,15 @@ Cache With A Quoted Fragment Name
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(literal (literal
(number)))) (number))))
(string) (string))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -99,6 +107,7 @@ Cache Varying On Arguments
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -111,9 +120,10 @@ Cache Varying On Arguments
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -128,6 +138,7 @@ Cache Varying On A Filtered Argument
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -138,9 +149,10 @@ Cache Varying On A Filtered Argument
(variable_attribute (variable_attribute
(identifier))) (identifier)))
(filter_expression (filter_expression
(filter))) (filter))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -155,6 +167,7 @@ Cache Using A Named Cache
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -163,9 +176,10 @@ Cache Using A Named Cache
(filtered_value (filtered_value
(value (value
(literal (literal
(string)))) (string)))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -180,6 +194,7 @@ Cache Using An Unquoted Cache Name
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(cache_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -188,9 +203,10 @@ Cache Using An Unquoted Cache Name
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
+13 -5
View File
@@ -12,7 +12,9 @@ This is ignored
(content) (content)
(comment_group (comment_group
(comment_clause (comment_clause
(comment_content))) (comment_block)
(comment_content))
(endcomment_block))
(content)) (content))
================== ==================
@@ -26,7 +28,9 @@ Comment Empty
(template (template
(content) (content)
(comment_group (comment_group
(comment_clause)) (comment_clause
(comment_block))
(endcomment_block))
(content)) (content))
================== ==================
@@ -43,8 +47,10 @@ This is ignored
(content) (content)
(comment_group (comment_group
(comment_clause (comment_clause
(string) (comment_block
(comment_content))) (string))
(comment_content))
(endcomment_block))
(content)) (content))
================== ==================
@@ -61,5 +67,7 @@ Contains {% if x %} tag-like text
(content) (content)
(comment_group (comment_group
(comment_clause (comment_clause
(comment_content))) (comment_block)
(comment_content))
(endcomment_block))
(content)) (content))
+3 -3
View File
@@ -8,7 +8,7 @@ Csp Nonce Attr
(template (template
(content) (content)
(csp_nonce_attr) (csp_nonce_attr_block)
(content)) (content))
================== ==================
@@ -21,7 +21,7 @@ Csp Nonce Attr With Argument And As
(template (template
(content) (content)
(csp_nonce_attr (csp_nonce_attr_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -39,7 +39,7 @@ Csp Nonce Attr With Media Keyword
(template (template
(content) (content)
(csp_nonce_attr (csp_nonce_attr_block
(filtered_value (filtered_value
(value (value
(literal (literal
+1 -1
View File
@@ -10,5 +10,5 @@ Csrf Token
(template (template
(content) (content)
(csrf_token) (csrf_token_block)
(content)) (content))
+12 -12
View File
@@ -8,7 +8,7 @@ Custom Tag
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier)) tag: (identifier))
(content)) (content))
@@ -22,7 +22,7 @@ Custom Tag With Arguments
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(filtered_value (filtered_value
(value (value
@@ -48,7 +48,7 @@ Custom Tag With Keyword Arguments
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(filtered_value (filtered_value
(value (value
@@ -71,7 +71,7 @@ Custom Tag With As
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(filtered_value (filtered_value
(value (value
@@ -90,7 +90,7 @@ Custom Tag With Filtered Argument
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(filtered_value (filtered_value
(value (value
@@ -110,10 +110,10 @@ Custom Tag Does Not Nest
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier)) tag: (identifier))
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier)) tag: (identifier))
(content)) (content))
@@ -201,7 +201,7 @@ Custom Filter In A Tag
(template (template
(content) (content)
(firstof (firstof_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -277,7 +277,7 @@ A Name Reserved For A Tag Is Still An Argument
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(filtered_value (filtered_value
(value (value
@@ -305,7 +305,7 @@ Custom Tag With Keyword Arguments And As
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(identifier) (identifier)
(filtered_value (filtered_value
@@ -330,14 +330,14 @@ Custom Tag Repeating A Keyword Of The Tag Before It
(template (template
(content) (content)
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(identifier) (identifier)
(filtered_value (filtered_value
(value (value
(literal (literal
(number))))) (number)))))
(custom_tag (custom_tag_block
tag: (identifier) tag: (identifier)
(identifier) (identifier)
(filtered_value (filtered_value
+5 -5
View File
@@ -11,7 +11,7 @@ Cycle Basic
(template (template
(content) (content)
(cycle (cycle_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -35,7 +35,7 @@ Cycle With As
(template (template
(content) (content)
(cycle (cycle_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -60,7 +60,7 @@ Cycle With As And Silent
(template (template
(content) (content)
(cycle (cycle_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -85,7 +85,7 @@ Cycle Referencing Existing Variable
(template (template
(content) (content)
(cycle (cycle_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -136,7 +136,7 @@ Cycle Spanning Lines
(template (template
(content) (content)
(cycle (cycle_block
(filtered_value (filtered_value
(value (value
(literal (literal
+1 -1
View File
@@ -10,5 +10,5 @@ Debug
(template (template
(content) (content)
(debug) (debug_block)
(content)) (content))
+2 -2
View File
@@ -9,7 +9,7 @@ Extends With String
(template (template
(content) (content)
(extends (extends_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -27,7 +27,7 @@ Extends With Variable
(template (template
(content) (content)
(extends (extends_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
+12 -6
View File
@@ -14,10 +14,12 @@ hello
(content) (content)
(filter_group (filter_group
(filter_clause (filter_clause
(filter_block
(filter_expression (filter_expression
(filter)) (filter)))
(template (template
(content)))) (content)))
(endfilter_block))
(content)) (content))
================== ==================
@@ -36,11 +38,13 @@ HELLO WORLD
(content) (content)
(filter_group (filter_group
(filter_clause (filter_clause
(filter_block
(filter_expression (filter_expression
(filter) (filter)
(filter)) (filter)))
(template (template
(content)))) (content)))
(endfilter_block))
(content)) (content))
================== ==================
@@ -60,9 +64,11 @@ HELLO WORLD
(content) (content)
(filter_group (filter_group
(filter_clause (filter_clause
(filter_block
(filter_expression (filter_expression
(filter) (filter)
(filter)) (filter)))
(template (template
(content)))) (content)))
(endfilter_block))
(content)) (content))
+2 -2
View File
@@ -8,7 +8,7 @@ Firstof Basic
(template (template
(content) (content)
(firstof (firstof_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -33,7 +33,7 @@ Firstof With As
(template (template
(content) (content)
(firstof (firstof_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
+127 -74
View File
@@ -14,11 +14,12 @@ For Basic
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content) (content)
(template_variable (template_variable
@@ -26,7 +27,8 @@ For Basic
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -45,12 +47,13 @@ For With Multiple Variables
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content) (content)
(template_variable (template_variable
@@ -58,7 +61,8 @@ For With Multiple Variables
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -79,11 +83,12 @@ For With Empty
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content) (content)
(template_variable (template_variable
@@ -93,8 +98,10 @@ For With Empty
(identifier))))) (identifier)))))
(content))) (content)))
(empty_clause (empty_clause
(empty_block)
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -111,23 +118,27 @@ For With A Tag In Its Body
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(content)
(if_group
(if_clause
(predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(template (template
(content)))) (content)
(content)))) (if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(endif_block))
(content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -144,23 +155,27 @@ For With A Nested For
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(content)))) (endfor_block))
(content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -179,36 +194,43 @@ For With Tags In Both Branches
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(content)
(if_group
(if_clause
(predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(template (template
(content)))) (content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(endif_block))
(content))) (content)))
(empty_clause (empty_clause
(empty_block)
(template (template
(content) (content)
(with_group (with_group
(with_clause (with_clause
(with_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(literal (literal
(number)))) (number)))))
(template (template
(content)))) (content)))
(content)))) (endwith_block))
(content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -225,20 +247,24 @@ For With A Named Block In Its Body
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content) (content)
(block_group (block_group
(block_clause (block_clause
name: (push_block) (block_block
name: (push_block))
(template (template
(content))) (content)))
(pop_block)) (endblock_block
(content)))) (pop_block)))
(content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -255,31 +281,37 @@ For Nested In A Tag
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(if_group
(if_clause
(predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(template (template
(content))))))) (if_group
(content)))) (if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(endif_block))))
(endfor_block))
(content)))
(endif_block))
(content)) (content))
================== ==================
@@ -294,11 +326,13 @@ For With An Empty Body
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))))) (identifier))))))
(endfor_block))
(content)) (content))
================== ==================
@@ -315,13 +349,15 @@ a
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -338,14 +374,16 @@ a
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -362,6 +400,7 @@ a
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
@@ -371,9 +410,10 @@ a
(filter (filter
argument: (value argument: (value
(literal (literal
(string)))))) (string)))))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -392,16 +432,19 @@ b
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content))) (content)))
(empty_clause (empty_clause
(empty_block)
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -418,23 +461,27 @@ For Reversed With A Tag In Its Body
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(content)
(if_group
(if_clause
(predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(template (template
(content)))) (content)
(content)))) (if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(endif_block))
(content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -468,13 +515,15 @@ For Over A Variable Named Reversed
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -489,14 +538,16 @@ For Over An Attribute Of A Variable Named Reversed
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier) (identifier)
(attribute)))) (attribute)))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -511,15 +562,17 @@ For Over A Filtered Variable Named Reversed
(content) (content)
(for_group (for_group
(for_clause (for_clause
(for_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))) (identifier)))
(filter_expression (filter_expression
(filter))) (filter))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
+25 -21
View File
@@ -8,7 +8,7 @@ Trans
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -25,7 +25,7 @@ Translate
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -42,7 +42,7 @@ Trans With A Variable
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -59,7 +59,7 @@ Trans With A Filtered Message
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -78,7 +78,7 @@ Trans Noop
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -95,7 +95,7 @@ Trans With As
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -113,7 +113,7 @@ Trans With Context
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -134,7 +134,7 @@ Trans With Every Option
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -156,7 +156,7 @@ Trans With Its Options Reordered
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -228,7 +228,7 @@ Get Available Languages
(template (template
(content) (content)
(get_available_languages (get_available_languages_block
variable: (identifier)) variable: (identifier))
(content)) (content))
@@ -252,7 +252,7 @@ Get Current Language
(template (template
(content) (content)
(get_current_language (get_current_language_block
variable: (identifier)) variable: (identifier))
(content)) (content))
@@ -266,7 +266,7 @@ Get Current Language Bidi
(template (template
(content) (content)
(get_current_language_bidi (get_current_language_bidi_block
variable: (identifier)) variable: (identifier))
(content)) (content))
@@ -280,7 +280,7 @@ Get Language Info
(template (template
(content) (content)
(get_language_info (get_language_info_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -298,7 +298,7 @@ Get Language Info For A Variable
(template (template
(content) (content)
(get_language_info (get_language_info_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -336,7 +336,7 @@ Get Language Info List
(template (template
(content) (content)
(get_language_info_list (get_language_info_list_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -356,12 +356,14 @@ Language
(content) (content)
(language_group (language_group
(language_clause (language_clause
(language_block
(filtered_value (filtered_value
(value (value
(literal (literal
(string)))) (string)))))
(template (template
(content)))) (content)))
(endlanguage_block))
(content)) (content))
================== ==================
@@ -376,12 +378,14 @@ Language With A Variable
(content) (content)
(language_group (language_group
(language_clause (language_clause
(language_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endlanguage_block))
(content)) (content))
================== ==================
@@ -509,7 +513,7 @@ Translate With A Context From An Attribute Of Noop
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -531,7 +535,7 @@ Translate With A Filtered Context Named After Noop
(template (template
(content) (content)
(translate (translate_block
(filtered_value (filtered_value
(value (value
(literal (literal
+47 -23
View File
@@ -12,14 +12,16 @@ Hi
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier) (identifier)
(attribute))))) (attribute))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -36,13 +38,15 @@ working
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -63,6 +67,7 @@ other
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -72,10 +77,11 @@ other
(filtered_value (filtered_value
(value (value
(literal (literal
(number))))) (number))))))
(template (template
(content))) (content)))
(elif_clause (elif_clause
(elif_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -85,12 +91,14 @@ other
(filtered_value (filtered_value
(value (value
(literal (literal
(number))))) (number))))))
(template (template
(content))) (content)))
(else_clause (else_clause
(else_block)
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -107,6 +115,7 @@ yes
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -143,9 +152,10 @@ yes
(filtered_value (filtered_value
(value (value
(literal (literal
(number))))) (number))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -169,6 +179,7 @@ If Is Not None
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -178,9 +189,10 @@ If Is Not None
(filtered_value (filtered_value
(value (value
(literal (literal
(none))))) (none))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -195,6 +207,7 @@ If Is
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -204,9 +217,10 @@ If Is
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -221,6 +235,7 @@ If Is Not
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -230,9 +245,10 @@ If Is Not
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -247,6 +263,7 @@ If Is Not Not
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -256,9 +273,10 @@ If Is Not Not
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -273,13 +291,15 @@ If With A Repeated Not
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -294,13 +314,15 @@ If Not Before A Name Beginning With In
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -315,6 +337,7 @@ If Is Before A Name Beginning With Not
(content) (content)
(if_group (if_group
(if_clause (if_clause
(if_block
(predicate (predicate
(filtered_value (filtered_value
(value (value
@@ -324,7 +347,8 @@ If Is Before A Name Beginning With Not
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
+28 -9
View File
@@ -12,8 +12,10 @@ content
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(ifchanged_block)
(template (template
(content)))) (content)))
(endifchanged_block))
(content)) (content))
================== ==================
@@ -30,6 +32,7 @@ content
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(ifchanged_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -37,9 +40,10 @@ content
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endifchanged_block))
(content)) (content))
================== ==================
@@ -58,11 +62,14 @@ unchanged
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(ifchanged_block)
(template (template
(content))) (content)))
(else_clause (else_clause
(else_block)
(template (template
(content)))) (content)))
(endifchanged_block))
(content)) (content))
================== ==================
@@ -81,6 +88,7 @@ unchanged
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(ifchanged_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -90,12 +98,14 @@ unchanged
(variable_attribute (variable_attribute
(identifier))) (identifier)))
(filter_expression (filter_expression
(filter))) (filter))))
(template (template
(content))) (content)))
(else_clause (else_clause
(else_block)
(template (template
(content)))) (content)))
(endifchanged_block))
(content)) (content))
================== ==================
@@ -112,9 +122,12 @@ content
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(ifchanged_block)
(template (template
(content))) (content)))
(else_clause)) (else_clause
(else_block))
(endifchanged_block))
(content)) (content))
================== ==================
@@ -137,19 +150,25 @@ c
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(ifchanged_block)
(template (template
(content))) (content)))
(else_clause (else_clause
(else_block)
(template (template
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(ifchanged_block)
(template (template
(content))) (content)))
(else_clause (else_clause
(else_block)
(template (template
(content)))) (content)))
(content)))) (endifchanged_block))
(content)))
(endifchanged_block))
(content)) (content))
================== ==================
+8 -8
View File
@@ -8,7 +8,7 @@ Include With String
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -25,7 +25,7 @@ Include With Variable
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -42,7 +42,7 @@ Include With A Filtered Name
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -61,7 +61,7 @@ Include Only
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -78,7 +78,7 @@ Include With Context
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -100,7 +100,7 @@ Include With Several Bindings
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -127,7 +127,7 @@ Include With Context And Only
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -149,7 +149,7 @@ Include With Only Before With
(template (template
(content) (content)
(include (include_block
(filtered_value (filtered_value
(value (value
(literal (literal
+17 -5
View File
@@ -10,8 +10,10 @@ Localize
(content) (content)
(localize_group (localize_group
(localize_clause (localize_clause
(localize_block)
(template (template
(content)))) (content)))
(endlocalize_block))
(content)) (content))
================== ==================
@@ -26,8 +28,10 @@ Localize On
(content) (content)
(localize_group (localize_group
(localize_clause (localize_clause
(localize_block)
(template (template
(content)))) (content)))
(endlocalize_block))
(content)) (content))
================== ==================
@@ -42,8 +46,10 @@ Localize Off
(content) (content)
(localize_group (localize_group
(localize_clause (localize_clause
(localize_block)
(template (template
(content)))) (content)))
(endlocalize_block))
(content)) (content))
================== ==================
@@ -58,8 +64,10 @@ Localize Hugging Its Delimiters
(content) (content)
(localize_group (localize_group
(localize_clause (localize_clause
(localize_block)
(template (template
(content)))) (content)))
(endlocalize_block))
(content)) (content))
================== ==================
@@ -74,11 +82,15 @@ Localize Nested
(content) (content)
(localize_group (localize_group
(localize_clause (localize_clause
(localize_block)
(template (template
(localize_group (localize_group
(localize_clause (localize_clause
(localize_block)
(template (template
(content))))))) (content)))
(endlocalize_block))))
(endlocalize_block))
(content)) (content))
================== ==================
+4 -4
View File
@@ -8,7 +8,7 @@ Load Single Library
(template (template
(content) (content)
(load (load_block
(library (library
(identifier))) (identifier)))
(content)) (content))
@@ -23,7 +23,7 @@ Load Multiple Libraries
(template (template
(content) (content)
(load (load_block
(library (library
(identifier)) (identifier))
(library (library
@@ -40,7 +40,7 @@ Load Dotted Library
(template (template
(content) (content)
(load (load_block
(library (library
(identifier) (identifier)
(identifier))) (identifier)))
@@ -56,7 +56,7 @@ Load Names From Library
(template (template
(content) (content)
(load (load_block
(identifier) (identifier)
(identifier) (identifier)
(library (library
+2 -2
View File
@@ -8,7 +8,7 @@ Lorem Words
(template (template
(content) (content)
(lorem (lorem_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -25,7 +25,7 @@ Lorem Paragraphs Random
(template (template
(content) (content)
(lorem (lorem_block
(filtered_value (filtered_value
(value (value
(literal (literal
+2 -2
View File
@@ -8,7 +8,7 @@ Now Basic
(template (template
(content) (content)
(now (now_block
(string)) (string))
(content)) (content))
@@ -22,7 +22,7 @@ Now With As
(template (template
(content) (content)
(now (now_block
(string) (string)
variable: (identifier)) variable: (identifier))
(content)) (content))
+1 -1
View File
@@ -8,6 +8,6 @@ Partial Basic
(template (template
(content) (content)
(partial (partial_block
(identifier)) (identifier))
(content)) (content))
+8 -4
View File
@@ -14,10 +14,12 @@ Partialdef Basic
(content) (content)
(partialdef_group (partialdef_group
(partialdef_clause (partialdef_clause
(push_partial) (partialdef_block
(push_partial))
(template (template
(content))) (content)))
(pop_partial)) (endpartialdef_block
(pop_partial)))
(content)) (content))
================== ==================
@@ -36,8 +38,10 @@ Partialdef Inline
(content) (content)
(partialdef_group (partialdef_group
(partialdef_clause (partialdef_clause
(push_partial) (partialdef_block
(push_partial))
(template (template
(content))) (content)))
(pop_partial)) (endpartialdef_block
(pop_partial)))
(content)) (content))
+5 -5
View File
@@ -8,7 +8,7 @@ Querystring Empty
(template (template
(content) (content)
(query_string) (querystring_block)
(content)) (content))
================== ==================
@@ -21,7 +21,7 @@ Querystring With Key Value
(template (template
(content) (content)
(query_string (querystring_block
(identifier) (identifier)
(filtered_value (filtered_value
(value (value
@@ -39,7 +39,7 @@ Querystring With Identifier And Key Value
(template (template
(content) (content)
(query_string (querystring_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -61,7 +61,7 @@ Querystring With Expression Argument And As
(template (template
(content) (content)
(query_string (querystring_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -85,7 +85,7 @@ Querystring With Two Keys
(template (template
(content) (content)
(query_string (querystring_block
(identifier) (identifier)
(filtered_value (filtered_value
(value (value
+1 -1
View File
@@ -8,7 +8,7 @@ Regroup Basic
(template (template
(content) (content)
(regroup (regroup_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
+2 -2
View File
@@ -8,7 +8,7 @@ Resetcycle Bare
(template (template
(content) (content)
(reset_cycle) (resetcycle_block)
(content)) (content))
================== ==================
@@ -21,6 +21,6 @@ Resetcycle With Name
(template (template
(content) (content)
(reset_cycle (resetcycle_block
(identifier)) (identifier))
(content)) (content))
+3 -1
View File
@@ -14,6 +14,8 @@ Spaceless Basic
(content) (content)
(spaceless_group (spaceless_group
(spaceless_clause (spaceless_clause
(spaceless_block)
(template (template
(content)))) (content)))
(endspaceless_block))
(content)) (content))
+9 -9
View File
@@ -8,7 +8,7 @@ Static
(template (template
(content) (content)
(static (static_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -25,7 +25,7 @@ Static With A Variable Path
(template (template
(content) (content)
(static (static_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
@@ -42,7 +42,7 @@ Static With A Filtered Path
(template (template
(content) (content)
(static (static_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -61,7 +61,7 @@ Static With As
(template (template
(content) (content)
(static (static_block
(filtered_value (filtered_value
(value (value
(literal (literal
@@ -109,7 +109,7 @@ Get Static Prefix
(template (template
(content) (content)
(get_static_prefix) (get_static_prefix_block)
(content)) (content))
================== ==================
@@ -122,7 +122,7 @@ Get Static Prefix With As
(template (template
(content) (content)
(get_static_prefix (get_static_prefix_block
variable: (identifier)) variable: (identifier))
(content)) (content))
@@ -136,7 +136,7 @@ Get Media Prefix With As
(template (template
(content) (content)
(get_media_prefix (get_media_prefix_block
variable: (identifier)) variable: (identifier))
(content)) (content))
@@ -170,10 +170,10 @@ Load Names The Library, Not The Tag
(template (template
(content) (content)
(load (load_block
(library (library
(identifier))) (identifier)))
(static (static_block
(filtered_value (filtered_value
(value (value
(literal (literal
+2 -2
View File
@@ -8,7 +8,7 @@ Templatetag Openblock
(template (template
(content) (content)
(template_tag_block) (templatetag_block)
(content)) (content))
================== ==================
@@ -21,5 +21,5 @@ Templatetag Closevariable
(template (template
(content) (content)
(template_tag_block) (templatetag_block)
(content)) (content))
+22 -10
View File
@@ -10,8 +10,10 @@ Localtime
(content) (content)
(localtime_group (localtime_group
(localtime_clause (localtime_clause
(localtime_block)
(template (template
(content)))) (content)))
(endlocaltime_block))
(content)) (content))
================== ==================
@@ -26,8 +28,10 @@ Localtime On
(content) (content)
(localtime_group (localtime_group
(localtime_clause (localtime_clause
(localtime_block)
(template (template
(content)))) (content)))
(endlocaltime_block))
(content)) (content))
================== ==================
@@ -42,8 +46,10 @@ Localtime Off
(content) (content)
(localtime_group (localtime_group
(localtime_clause (localtime_clause
(localtime_block)
(template (template
(content)))) (content)))
(endlocaltime_block))
(content)) (content))
================== ==================
@@ -78,12 +84,14 @@ Timezone
(content) (content)
(timezone_group (timezone_group
(timezone_clause (timezone_clause
(timezone_block
(filtered_value (filtered_value
(value (value
(literal (literal
(string)))) (string)))))
(template (template
(content)))) (content)))
(endtimezone_block))
(content)) (content))
================== ==================
@@ -98,12 +106,14 @@ Timezone With A Variable
(content) (content)
(timezone_group (timezone_group
(timezone_clause (timezone_clause
(timezone_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier)))) (identifier)))))
(template (template
(content)))) (content)))
(endtimezone_block))
(content)) (content))
================== ==================
@@ -118,14 +128,16 @@ Timezone With A Filtered Argument
(content) (content)
(timezone_group (timezone_group
(timezone_clause (timezone_clause
(timezone_block
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier))) (identifier)))
(filter_expression (filter_expression
(filter))) (filter))))
(template (template
(content)))) (content)))
(endtimezone_block))
(content)) (content))
================== ==================
@@ -158,7 +170,7 @@ Get Current Timezone
(template (template
(content) (content)
(get_current_timezone (get_current_timezone_block
variable: (identifier)) variable: (identifier))
(content)) (content))
+20 -10
View File
@@ -10,9 +10,11 @@ Verbatim Basic
(content) (content)
(verbatim_group (verbatim_group
(verbatim_clause (verbatim_clause
(push_verbatim) (verbatim_block
(push_verbatim))
(verbatim_content)) (verbatim_content))
(pop_verbatim)) (endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -27,8 +29,10 @@ Verbatim Empty
(content) (content)
(verbatim_group (verbatim_group
(verbatim_clause (verbatim_clause
(push_verbatim)) (verbatim_block
(pop_verbatim)) (push_verbatim)))
(endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -46,9 +50,11 @@ Verbatim Ignores Tags
(content) (content)
(verbatim_group (verbatim_group
(verbatim_clause (verbatim_clause
(push_verbatim) (verbatim_block
(push_verbatim))
(verbatim_content)) (verbatim_content))
(pop_verbatim)) (endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -63,9 +69,11 @@ Verbatim With Name
(content) (content)
(verbatim_group (verbatim_group
(verbatim_clause (verbatim_clause
(push_verbatim) (verbatim_block
(push_verbatim))
(verbatim_content)) (verbatim_content))
(pop_verbatim)) (endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -82,7 +90,9 @@ Avoid template rendering via the {% verbatim %}{% endverbatim %} block.
(content) (content)
(verbatim_group (verbatim_group
(verbatim_clause (verbatim_clause
(push_verbatim) (verbatim_block
(push_verbatim))
(verbatim_content)) (verbatim_content))
(pop_verbatim)) (endverbatim_block
(pop_verbatim)))
(content)) (content))
+20 -10
View File
@@ -12,12 +12,13 @@ With Basic
(content) (content)
(with_group (with_group
(with_clause (with_clause
(with_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(variable_attribute (variable_attribute
(identifier) (identifier)
(attribute)))) (attribute)))))
(template (template
(content) (content)
(template_variable (template_variable
@@ -25,7 +26,8 @@ With Basic
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(content)))) (content)))
(endwith_block))
(content)) (content))
================== ==================
@@ -42,6 +44,7 @@ With Multiple Variables
(content) (content)
(with_group (with_group
(with_clause (with_clause
(with_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
@@ -51,7 +54,7 @@ With Multiple Variables
(filtered_value (filtered_value
(value (value
(literal (literal
(number)))) (number)))))
(template (template
(content) (content)
(template_variable (template_variable
@@ -59,7 +62,8 @@ With Multiple Variables
(value (value
(variable_attribute (variable_attribute
(identifier))))) (identifier)))))
(content)))) (content)))
(endwith_block))
(content)) (content))
================== ==================
@@ -94,22 +98,26 @@ With Repeating A Binding Of The Tag Before It
(content) (content)
(with_group (with_group
(with_clause (with_clause
(with_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(literal (literal
(number)))) (number)))))
(template (template
(content)))) (content)))
(endwith_block))
(with_group (with_group
(with_clause (with_clause
(with_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(literal (literal
(number)))) (number)))))
(template (template
(content)))) (content)))
(endwith_block))
(content)) (content))
================== ==================
@@ -124,11 +132,13 @@ With A Binding Named After A Literal
(content) (content)
(with_group (with_group
(with_clause (with_clause
(with_block
variable: (identifier) variable: (identifier)
(filtered_value (filtered_value
(value (value
(literal (literal
(number)))) (number)))))
(template (template
(content)))) (content)))
(endwith_block))
(content)) (content))