Compare commits

...
2 Commits
44 changed files with 19572 additions and 57200 deletions

No files matched your search

+32 -17
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
signature. Put the Python signature in a comment above the call site.
- `arrangements(items)` — every ordered subset of `items`, so that a tag's options may be written in any
order but never twice. Used by `translate` 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
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
@@ -102,19 +102,33 @@ 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
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
`children` are its clause types and its own `tag:` field holds the end tag, so the candidates for a group
are its `tag:` plus the `tag:` of each clause it can hold. For `if_group` that is `endif` from the group and
`if`, `elif`, `else` from its three clauses. Going the other way — from a clause the cursor sits in to the
`children` are its clause types and its end block, and a clause's children include its opening block, so
the candidates for a group are its end block plus the opening block of each clause it can hold. For
`if_group` that is `endif_block` from the group and `if_block`, `elif_block`, `else_block` from its three
clauses. Going the other way — from a clause the cursor sits in to the
groups that can hold it — is the same table read backwards, which is what an unterminated tag needs, since
the group node does not exist yet.
Do not reach for lookahead to solve that instead: `ts_language_next_state` follows only the shift on `{%`,
which lands in the "a tag starts here" state no matter how the tree is shaped.
`else_clause` is shared by `if_group` and `ifchanged_group`. `comment_group` and `verbatim_group` have no
clause — their bodies are raw scanner text that admits no tags — and neither does `blocktranslate_group`,
whose body is `_translate_body`.
`else_clause` is shared by `if_group` and `ifchanged_group`. `comment_clause` and `verbatim_clause` hold raw
scanner text that admits no tags. `blocktranslate_group` has one clause per spelling, `blocktrans_clause` and
`blocktranslate_clause`, because each must be closed by its own end tag; the counted form nests a
`plural_clause` inside it, since `{% plural %}` is only valid after `count`. The clause has to know which
form its opening block was, so `blocktransRules` builds each as a hidden rule (`_blocktrans_block`,
`_blocktrans_count_block`) and aliases both to the one visible `blocktrans_block` where the clause uses
it. Their bodies are
`_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 `{%`.
**Every clause needs a `conflicts` entry.** The generator offers a left associativity instead; taking it is
what broke `{% for %}` in `06aa870`, where `prec.left` resolved the shift/reduce on `{%` statically and
@@ -122,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
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
@@ -136,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
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.
- `_custom_filter`, the last alternative of `filter`, whose name is `$.identifier` rather than one of the
builtin literals. Hidden, so the tree is what an inline alternative would give, but named so that a
grammar extending this one can filter it out of `filter`'s `members` the way it can `custom_tag` — 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`.
**A name that only exists inside a tag group has to be reserved instead.** `endif`, `else`, `empty` and
the rest are tokens only in the state their group opens, so where a tag is named the lexer reads them as an
identifier and `custom_tag` 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
`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
with a new part or end tag means adding its name there too.
@@ -180,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`,
`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
is accepted: these names are common enough that shadowing them is the mistake.
@@ -242,13 +257,13 @@ matching.
`queries/highlights.scm` lists tag and filter names explicitly, so adding either to the grammar means
adding it there too; filter names appear there without their colon. A name the grammar does not know is
captured through its field instead (`(filter name: (identifier))`, `(custom_tag 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
filter added from a library belongs in it. `queries/locals.scm` relies on the `variable:` field to tell a
binding from a reference — another reason to keep `asVariable` uniform. `{% blocktranslate %}`'s `asvar`
target carries an `asvar:` field instead, because it is written inside the tag but assigned outside it:
the scope on `blocktranslate_group` confines the `with` and `count` bindings, and would swallow `asvar`
the scope on `blocktrans_clause` / `blocktranslate_clause` confines the `with` and `count` bindings, and would swallow `asvar`
too if it were spelled the same way. `queries/exports.scm` names it for a tool to
bind in the scope around the block, which a locals query cannot do: it places a definition in the innermost
scope containing it and offers no way out again.
@@ -322,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.
- A misspelled tag or filter cannot be caught: `{{ x|lenght }}` is indistinguishable from a filter some
library registered. Cross-referencing names against `{% load %}` needs the project's Python, so it
belongs in a linter; the `load` 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
belongs in a linter; the `load_block` rule already parses the library and `from` names for one to use.
- `{% mytag %}…{% endmytag %}` parses as two sibling `custom_tag_block`s. Nesting them would mean guessing that
an unknown tag is a block tag.
- A custom tag's contents are only assumed to be the `simple_tag` shape. `@register.tag` receives the raw
token and may parse anything, so `{% mytag <<>> %}` is rejected here and not by Django.
+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
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
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.
@@ -122,13 +122,13 @@ grammar knows from one it is only tolerating.
What the fallbacks cannot do:
- **A block tag is not nested.** `{% mytag %}…{% endmytag %}` is two sibling `custom_tag`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.
- **A tag registered with `@register.tag` may parse anything**, since it receives the raw token, so one
whose arguments are not the `simple_tag` shape — `{% mytag <<>> %}` — is an error here and not in Django.
- **A misspelled name cannot be caught.** `{{ x|lenght }}` is indistinguishable from a filter some library
registered. Cross-referencing names against `{% load %}` needs the project's Python, so it belongs in a
linter; `queries/libraries.scm` and the `load` 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
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
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`.
```js
@@ -149,8 +149,8 @@ export default grammar(django, {
rules: {
// {% map items over rows %}
template_block_groups: ($, previous) => choice(previous, $.map_tag),
map_tag: ($) =>
tag_block_group: ($, previous) => choice(previous, $.map_block),
map_block: ($) =>
seq(
"{%",
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
alternative and your arity applies — `{{ x|shout }}` is now an error, while names you have not modelled
still fall through to `(filter name: (identifier))`.
- **A tag with a body needs a `conflicts` entry**, as every clause in the base grammar does:
`conflicts: ($, previous) => [...previous, [$.map_clause]]` for a `map_clause` holding the body. The
generator offers an associativity
instead; taking it silently discards the parse in which the body continues.
- **End tags are not reserved**, a stray `{% endmap %}` parses as a `custom_tag` rather than an error — `reserved` takes no
`previous`, so the `tag_name` list cannot be added to a name at a time. Instead you may drop the `custom_tag` rule to avoid parsing end tags as custom tags.
- **A tag with a body is split the way the base grammar's are**, so every `{% %}` is a node of its own:
a `map_block` for the opening tag, a `map_clause` of that block and the body, an `endmap_block`, and a
`map_group` of the clause and the end block. The clause needs a `conflicts` entry, as every clause in
the base grammar does: `conflicts: ($, previous) => [...previous, [$.map_clause]]`. The generator
offers an associativity instead; taking it silently discards the parse in which the body continues.
- **End tags are not reserved**, a stray `{% endmap %}` parses as a `custom_tag_block` rather than an error — `reserved` takes no
`previous`, so the `tag_name` list cannot be added to a name at a time. Instead you may drop the `custom_tag_block` rule to avoid parsing end tags as custom tags.
- **The external scanner has to be re-exported under your grammar's name**, or block-name matching and the
repeated-argument guards will not link. Give your grammar a `src/scanner.c` that renames the base's five entry points to the
ones your generated `parser.c` calls, and includes it:
@@ -210,13 +211,13 @@ build step can hand the compiler an absolute path from `import.meta.resolve` whe
layout makes the relative one unreliable.
**Turning the fallbacks off.** A grammar that models every tag and filter its project uses probably does
not want `custom_tag` 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
template_block_groups: ($, previous) =>
tag_block_group: ($, previous) =>
choice(
...previous.members.filter((m) => m.name !== "custom_tag"),
$.map_tag,
...previous.members.filter((m) => m.name !== "custom_tag_block"),
$.map_block,
),
filter: ($, previous) =>
+183 -160
View File
@@ -204,6 +204,44 @@ function simpleTag($, tag, args = true, kwargs = true) {
return block(tag, ...parts, optional(asVariable($)));
}
/**
* 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
* @returns {Record<string, RuleBuilder<string>>}
*/
function blocktransRules(tag) {
return {
[`_${tag}_block`]: ($) =>
block(tag, $._tag_open, repeat($._translate_option)),
[`_${tag}_count_block`]: ($) =>
block(
tag,
$._tag_open,
repeat($._translate_option),
$._translate_count,
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),
$.plural_clause,
),
),
[`end${tag}_block`]: ($) => block(`end${tag}`),
};
}
/**
* Django checks a filter's argument count against the registered function
* while it parses the template, so the arity of a builtin is syntax here:
@@ -300,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
* 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
* them an error again, while leaving them usable as ordinary words elsewhere
* ("{{ endif }}" is a variable, and "{% mytag endif %}" an argument).
@@ -360,12 +398,12 @@ const django = grammar({
[$.with_clause],
[$.predicate],
[$.binaryOperator],
[$.library, $.load],
[$.library, $.load_block],
[$._translate_option],
[$._filtered_value_spaced],
[$._filter_expression_spaced],
],
supertypes: ($) => [$.template_tag, $.template_block_groups],
supertypes: ($) => [$.template_node, $.tag_block_group],
externals: ($) => [
$.matcher_error,
$.pop_block,
@@ -385,10 +423,10 @@ const django = grammar({
tag_name: ($) => NAMES_INSIDE_A_TAG_GROUP,
},
rules: {
template: ($) => repeat1(choice($.template_tag, $.content)),
template: ($) => repeat1(choice($.template_node, $.content)),
content: ($) => /(?:[^\{]|\{[^\{#%}])+/,
template_tag: ($) =>
choice($.template_block_groups, $.template_variable, $.template_comment),
template_node: ($) =>
choice($.tag_block_group, $.template_variable, $.template_comment),
filtered_value: ($) =>
seq($.value, optional(seq("|", $.filter_expression))),
filter_expression: ($) => seq($.filter, repeat(seq("|", $.filter))),
@@ -479,52 +517,52 @@ const django = grammar({
_filter_expression_spaced: ($) =>
seq($.filter, repeat(seq(optional(SEP), "|", optional(SEP), $.filter))),
template_comment: ($) => seq("{#", /(?:[^#]|#[^}])*/, "#}"),
template_block_groups: ($) =>
tag_block_group: ($) =>
choice(
$.autoescape_group,
$.block_group,
$.blocktranslate_group,
$.cache_group,
$.comment_group,
$.csp_nonce_attr,
$.csrf_token,
$.custom_tag,
$.cycle,
$.debug,
$.extends,
$.csp_nonce_attr_block,
$.csrf_token_block,
$.custom_tag_block,
$.cycle_block,
$.debug_block,
$.extends_block,
$.filter_group,
$.firstof,
$.firstof_block,
$.for_group,
$.get_available_languages,
$.get_current_language,
$.get_current_language_bidi,
$.get_current_timezone,
$.get_language_info,
$.get_language_info_list,
$.get_media_prefix,
$.get_static_prefix,
$.get_available_languages_block,
$.get_current_language_block,
$.get_current_language_bidi_block,
$.get_current_timezone_block,
$.get_language_info_block,
$.get_language_info_list_block,
$.get_media_prefix_block,
$.get_static_prefix_block,
$.if_group,
$.ifchanged_group,
$.include,
$.include_block,
$.language_group,
$.load,
$.load_block,
$.localize_group,
$.localtime_group,
$.lorem,
$.now,
$.partial,
$.lorem_block,
$.now_block,
$.partial_block,
$.partialdef_group,
$.query_string,
$.regroup,
$.reset_cycle,
$.querystring_block,
$.regroup_block,
$.resetcycle_block,
$.spaceless_group,
$.static,
$.template_tag_block,
$.static_block,
$.templatetag_block,
$.timezone_group,
$.translate,
$.translate_block,
$.url_block,
$.verbatim_group,
$.width_ratio,
$.widthratio_block,
$.with_group,
),
/**
@@ -562,45 +600,31 @@ const django = grammar({
* 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
* 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
* from template_block_groups.
* can drop it from filter's alternatives the way it can drop custom_tag_block
* from tag_block_group.
*/
_custom_filter: ($) =>
seq(
field("name", $.identifier),
optional(seq(":", field("argument", $.value))),
),
autoescape_clause: ($) =>
seq(block("autoescape", part(choice("on", "off"))), optional($.template)),
autoescape_group: ($) => seq($.autoescape_clause, block("endautoescape")),
autoescape_block: ($) => block("autoescape", part(choice("on", "off"))),
autoescape_clause: ($) => seq($.autoescape_block, optional($.template)),
endautoescape_block: ($) => block("endautoescape"),
autoescape_group: ($) => seq($.autoescape_clause, $.endautoescape_block),
// the scanner takes the whitespace before a name it has to match itself
block_clause: ($) =>
seq(block("block", field("name", $.push_block)), optional($.template)),
block_group: ($) => seq($.block_clause, block("endblock", $.pop_block)),
block_block: ($) => block("block", field("name", $.push_block)),
block_clause: ($) => seq($.block_block, optional($.template)),
endblock_block: ($) => block("endblock", $.pop_block),
block_group: ($) => seq($.block_clause, $.endblock_block),
plural_block: ($) => block("plural"),
plural_clause: ($) => seq($.plural_block, optional($._translate_body)),
...blocktransRules("blocktrans"),
...blocktransRules("blocktranslate"),
blocktranslate_group: ($) =>
choice(
...["blocktrans", "blocktranslate"].map((name) =>
choice(
seq(
block(name, $._tag_open, repeat($._translate_option)),
optional($._translate_body),
block("end" + name),
),
seq(
block(
name,
$._tag_open,
repeat($._translate_option),
$._translate_count,
repeat($._translate_option),
),
$._translate_body,
block("plural"),
optional($._translate_body),
block("end" + name),
),
),
),
seq($.blocktrans_clause, $.endblocktrans_block),
seq($.blocktranslate_clause, $.endblocktranslate_block),
),
/**
* The scanner reads the name of the option before the grammar does, so it
@@ -646,8 +670,7 @@ const django = grammar({
),
),
),
cache_clause: ($) =>
seq(
cache_block: ($) =>
block(
"cache",
part($.filtered_value),
@@ -655,26 +678,24 @@ const django = grammar({
repeat(part($.filtered_value)),
optional(part(seq("using=", $.filtered_value))),
),
optional($.template),
),
cache_group: ($) => seq($.cache_clause, block("endcache")),
comment_group: ($) =>
seq(
block("comment", optional(part($.string))),
optional($.comment_content),
block("endcomment"),
),
cache_clause: ($) => seq($.cache_block, optional($.template)),
endcache_block: ($) => block("endcache"),
cache_group: ($) => seq($.cache_clause, $.endcache_block),
comment_block: ($) => block("comment", optional(part($.string))),
comment_clause: ($) => seq($.comment_block, optional($.comment_content)),
endcomment_block: ($) => block("endcomment"),
comment_group: ($) => seq($.comment_clause, $.endcomment_block),
// csp_nonce_attr(context, media=None)
csp_nonce_attr: ($) =>
csp_nonce_attr_block: ($) =>
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
* 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.
*/
custom_tag: ($) => simpleTag($, reserved("tag_name", $.identifier)),
cycle: ($) =>
custom_tag_block: ($) => simpleTag($, reserved("tag_name", $.identifier)),
cycle_block: ($) =>
block(
"cycle",
repeat1(part($.filtered_value)),
@@ -686,28 +707,26 @@ const django = grammar({
),
),
),
debug: ($) => block("debug"),
extends: ($) => block("extends", part($.filtered_value)),
filter_clause: ($) =>
seq(
// the filter tag hands Django the rest of its text as one expression
// rather than as split arguments, so pipes here take whitespace just
// as they do between "{{" and "}}"
debug_block: ($) => block("debug"),
extends_block: ($) => block("extends", part($.filtered_value)),
// the filter tag hands Django the rest of its text as one expression rather
// than as split arguments, so pipes here take whitespace just as they do
// between "{{" and "}}"
filter_block: ($) =>
block(
"filter",
part(alias($._filter_expression_spaced, $.filter_expression)),
),
optional($.template),
),
filter_group: ($) => seq($.filter_clause, block("endfilter")),
firstof: ($) =>
filter_clause: ($) => seq($.filter_block, optional($.template)),
endfilter_block: ($) => block("endfilter"),
filter_group: ($) => seq($.filter_clause, $.endfilter_block),
firstof_block: ($) =>
block(
"firstof",
repeat1(part($.filtered_value)),
optional(asVariable($)),
),
for_clause: ($) =>
seq(
for_block: ($) =>
block(
"for",
part(field("variable", $.identifier)),
@@ -734,23 +753,25 @@ const django = grammar({
seq(part(wordAsValue($, "reversed", false)), part("reversed")),
),
),
optional($.template),
),
empty_clause: ($) => seq(block("empty"), optional($.template)),
for_clause: ($) => seq($.for_block, optional($.template)),
empty_block: ($) => block("empty"),
empty_clause: ($) => seq($.empty_block, optional($.template)),
endfor_block: ($) => block("endfor"),
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>",
* or "for <expression> as <name>", and rejects anything further.
*/
get_available_languages: ($) =>
get_available_languages_block: ($) =>
block("get_available_languages", asVariable($)),
get_current_language: ($) => block("get_current_language", asVariable($)),
get_current_language_bidi: ($) =>
get_current_language_block: ($) =>
block("get_current_language", asVariable($)),
get_current_language_bidi_block: ($) =>
block("get_current_language_bidi", asVariable($)),
get_language_info: ($) =>
get_language_info_block: ($) =>
block("get_language_info", part("for", $.filtered_value), asVariable($)),
get_language_info_list: ($) =>
get_language_info_list_block: ($) =>
block(
"get_language_info_list",
part("for", $.filtered_value),
@@ -761,36 +782,39 @@ const django = grammar({
* "as <name>", so unlike get_static_prefix the clause is not optional and
* nothing may follow it.
*/
get_current_timezone: ($) => block("get_current_timezone", asVariable($)),
get_media_prefix: ($) => block("get_media_prefix", optional(asVariable($))),
get_static_prefix: ($) =>
get_current_timezone_block: ($) =>
block("get_current_timezone", asVariable($)),
get_media_prefix_block: ($) =>
block("get_media_prefix", optional(asVariable($))),
get_static_prefix_block: ($) =>
block("get_static_prefix", optional(asVariable($))),
if_clause: ($) => seq(block("if", part($.predicate)), optional($.template)),
elif_clause: ($) =>
seq(block("elif", part($.predicate)), optional($.template)),
if_block: ($) => block("if", part($.predicate)),
if_clause: ($) => seq($.if_block, 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. */
else_clause: ($) => seq(block("else"), optional($.template)),
else_block: ($) => block("else"),
else_clause: ($) => seq($.else_block, optional($.template)),
endif_block: ($) => block("endif"),
if_group: ($) =>
seq(
$.if_clause,
repeat($.elif_clause),
optional($.else_clause),
block("endif"),
),
ifchanged_clause: ($) =>
seq(
block("ifchanged", repeat(part($.filtered_value))),
optional($.template),
$.endif_block,
),
ifchanged_block: ($) => block("ifchanged", repeat(part($.filtered_value))),
ifchanged_clause: ($) => seq($.ifchanged_block, optional($.template)),
endifchanged_block: ($) => block("endifchanged"),
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
* 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 %}"
* is an error here as it is there, unlike the same clause in "{% with %}".
*/
include: ($) =>
include_block: ($) =>
block(
"include",
$._tag_open,
@@ -800,11 +824,12 @@ const django = grammar({
),
),
/** django.templatetags.i18n. The language tag takes the one argument. */
language_clause: ($) =>
seq(block("language", part($.filtered_value)), optional($.template)),
language_group: ($) => seq($.language_clause, block("endlanguage")),
language_block: ($) => block("language", part($.filtered_value)),
language_clause: ($) => seq($.language_block, optional($.template)),
endlanguage_block: ($) => block("endlanguage"),
language_group: ($) => seq($.language_clause, $.endlanguage_block),
library: ($) => seq($.identifier, optional(seq(".", $.identifier))),
load: ($) =>
load_block: ($) =>
block(
"load",
choice(
@@ -816,38 +841,34 @@ const django = grammar({
* django.templatetags.l10n. The argument is optional and localize_tag
* rejects anything but "on" or "off", including a second word.
*/
localize_clause: ($) =>
seq(
localize_block: ($) =>
block("localize", optional(part(choice("on", "off")))),
optional($.template),
),
localize_group: ($) => seq($.localize_clause, block("endlocalize")),
localize_clause: ($) => seq($.localize_block, optional($.template)),
endlocalize_block: ($) => block("endlocalize"),
localize_group: ($) => seq($.localize_clause, $.endlocalize_block),
/** django.templatetags.tz, taking "on" or "off" as localize does. */
localtime_clause: ($) =>
seq(
localtime_block: ($) =>
block("localtime", optional(part(choice("on", "off")))),
optional($.template),
),
localtime_group: ($) => seq($.localtime_clause, block("endlocaltime")),
lorem: ($) =>
localtime_clause: ($) => seq($.localtime_block, optional($.template)),
endlocaltime_block: ($) => block("endlocaltime"),
localtime_group: ($) => seq($.localtime_clause, $.endlocaltime_block),
lorem_block: ($) =>
block(
"lorem",
part($.filtered_value),
part(choice("w", "p", "b")),
optional(part("random")),
),
now: ($) => block("now", part($.string), optional(asVariable($))),
partial: ($) => block("partial", part($.identifier)),
partialdef_clause: ($) =>
seq(
now_block: ($) => block("now", part($.string), optional(asVariable($))),
partial_block: ($) => block("partial", part($.identifier)),
partialdef_block: ($) =>
block("partialdef", $.push_partial, optional(part("inline"))),
optional($.template),
),
partialdef_group: ($) =>
seq($.partialdef_clause, block("endpartialdef", $.pop_partial)),
partialdef_clause: ($) => seq($.partialdef_block, optional($.template)),
endpartialdef_block: ($) => block("endpartialdef", $.pop_partial),
partialdef_group: ($) => seq($.partialdef_clause, $.endpartialdef_block),
// querystring(context, *args, **kwargs)
query_string: ($) => simpleTag($, "querystring"),
regroup: ($) =>
querystring_block: ($) => simpleTag($, "querystring"),
regroup_block: ($) =>
block(
"regroup",
part($.filtered_value),
@@ -855,12 +876,14 @@ const django = grammar({
part($.attribute),
optional(asVariable($)),
),
reset_cycle: ($) => block("resetcycle", optional(part($.identifier))),
spaceless_clause: ($) => seq(block("spaceless"), optional($.template)),
spaceless_group: ($) => seq($.spaceless_clause, block("endspaceless")),
static: ($) =>
resetcycle_block: ($) => block("resetcycle", optional(part($.identifier))),
spaceless_block: ($) => block("spaceless"),
spaceless_clause: ($) => seq($.spaceless_block, optional($.template)),
endspaceless_block: ($) => block("endspaceless"),
spaceless_group: ($) => seq($.spaceless_clause, $.endspaceless_block),
static_block: ($) =>
block("static", part($.filtered_value), optional(asVariable($))),
template_tag_block: ($) =>
templatetag_block: ($) =>
block(
"templatetag",
part(
@@ -877,15 +900,16 @@ const django = grammar({
),
),
/** django.templatetags.tz. timezone_tag takes the one argument. */
timezone_clause: ($) =>
seq(block("timezone", part($.filtered_value)), optional($.template)),
timezone_group: ($) => seq($.timezone_clause, block("endtimezone")),
timezone_block: ($) => block("timezone", part($.filtered_value)),
timezone_clause: ($) => seq($.timezone_block, optional($.template)),
endtimezone_block: ($) => block("endtimezone"),
timezone_group: ($) => seq($.timezone_clause, $.endtimezone_block),
/**
* django.templatetags.i18n, registered under both spellings. do_translate
* 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.
*/
translate: ($) =>
translate_block: ($) =>
block(
choice("trans", "translate"),
part($.filtered_value),
@@ -914,13 +938,11 @@ const django = grammar({
),
optional(asVariable($)),
),
verbatim_group: ($) =>
seq(
block("verbatim", $.push_verbatim),
optional($.verbatim_content),
block("endverbatim", $.pop_verbatim),
),
width_ratio: ($) =>
verbatim_block: ($) => block("verbatim", $.push_verbatim),
verbatim_clause: ($) => seq($.verbatim_block, optional($.verbatim_content)),
endverbatim_block: ($) => block("endverbatim", $.pop_verbatim),
verbatim_group: ($) => seq($.verbatim_clause, $.endverbatim_block),
widthratio_block: ($) =>
block(
"widthratio",
part($.filtered_value),
@@ -928,9 +950,10 @@ const django = grammar({
part($.filtered_value),
optional(asVariable($)),
),
with_clause: ($) =>
seq(block("with", $._tag_open, $._tag_kwargs), optional($.template)),
with_group: ($) => seq($.with_clause, block("endwith")),
with_block: ($) => block("with", $._tag_open, $._tag_kwargs),
with_clause: ($) => seq($.with_block, optional($.template)),
endwith_block: ($) => block("endwith"),
with_group: ($) => seq($.with_clause, $.endwith_block),
},
});
+7 -2
View File
@@ -21,5 +21,10 @@
; scope span could have separated them; that is why this is a separate file
; rather than a narrower scope in locals.scm.
(blocktranslate_group
asvar: (identifier) @export.name) @export.from
(blocktrans_clause
(blocktrans_block
asvar: (identifier) @export.name)) @export.from
(blocktranslate_clause
(blocktranslate_block
asvar: (identifier) @export.name)) @export.from
+5 -5
View File
@@ -4,13 +4,13 @@
variable: (identifier) @variable.parameter
(block_clause
(block_block
(push_block) @type)
(partialdef_clause
(partialdef_block
(push_partial) @type)
(verbatim_group
(verbatim_block
(push_verbatim) @type)
(comment_content) @comment
@@ -192,8 +192,8 @@ tag: [
(filter
name: (identifier) @function.call)
(custom_tag
(custom_tag_block
tag: (identifier) @function.call)
(load
(load_block
(identifier) @function)
+22 -21
View File
@@ -15,41 +15,42 @@
; heads, so that the capture is both the name to look up and the range to
; report. A paired tag names the opening tag only.
(static
(static_block
tag: ("static") @library.static)
(get_static_prefix
(get_static_prefix_block
tag: ("get_static_prefix") @library.static)
(get_media_prefix
(get_media_prefix_block
tag: ("get_media_prefix") @library.static)
(blocktranslate_group
tag: [
("blocktrans")
("blocktranslate")] @library.i18n)
(blocktrans_block
tag: ("blocktrans") @library.i18n)
(translate
(blocktranslate_block
tag: ("blocktranslate") @library.i18n)
(translate_block
tag: [
("trans")
("translate")] @library.i18n)
(language_clause
(language_block
tag: ("language") @library.i18n)
(get_available_languages
(get_available_languages_block
tag: ("get_available_languages") @library.i18n)
(get_current_language
(get_current_language_block
tag: ("get_current_language") @library.i18n)
(get_current_language_bidi
(get_current_language_bidi_block
tag: ("get_current_language_bidi") @library.i18n)
(get_language_info
(get_language_info_block
tag: ("get_language_info") @library.i18n)
(get_language_info_list
(get_language_info_list_block
tag: ("get_language_info_list") @library.i18n)
(filter
@@ -59,10 +60,10 @@
("language_name_local")
("language_name_translated")] @library.i18n)
(cache_clause
(cache_block
tag: ("cache") @library.cache)
(localize_clause
(localize_block
tag: ("localize") @library.l10n)
(filter
@@ -70,13 +71,13 @@
("localize")
("unlocalize")] @library.l10n)
(localtime_clause
(localtime_block
tag: ("localtime") @library.tz)
(timezone_clause
(timezone_block
tag: ("timezone") @library.tz)
(get_current_timezone
(get_current_timezone_block
tag: ("get_current_timezone") @library.tz)
(filter
@@ -87,8 +88,8 @@
; "{% load static %}" makes every name in the library available; "{% load
; static from staticfiles %}" makes only the names listed available.
(load
(load_block
(library) @load.library)
(load
(load_block
(identifier) @load.name)
+2 -1
View File
@@ -23,4 +23,5 @@ variable: (identifier) @local.definition
; outside it, and carries an "asvar" field rather than "variable" so that this
; scope does not swallow it. A tool that wants it must define it in the scope
; around the block, which a locals query has no way to say.
(blocktranslate_group) @local.scope
(blocktrans_clause) @local.scope
(blocktranslate_clause) @local.scope
+13 -10
View File
@@ -1,17 +1,20 @@
(load
(load_block
(identifier) @name) @definition.function
(partialdef_clause (push_partial) @name) @definition.method
(partial (identifier) @name) @reference.call
(partialdef_block (push_partial) @name) @definition.method
(partial_block (identifier) @name) @reference.call
; every tag that opens a group names itself in a clause of its own, and every
; tag that does not is a group member directly
(template_block_groups
[
; a tag that opens no body names itself; a group is named by the first block of
; its first clause, so neither its end block nor the blocks opening its later
; clauses are references of their own
(tag_block_group
tag: _ @name) @reference.call
(tag_block_group
.
(_
tag: _ @name)
.
(_
(_
tag: _ @name))] @reference.call)
tag: _ @name))) @reference.call
(filter) @reference.call
+978 -872
View File
File diff suppressed because it is too large. Load diff
+962 -339
View File
File diff suppressed because it is too large. Load diff
+16741 -55473
View File
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -18,6 +18,8 @@ Autoescape
(content)
(autoescape_group
(autoescape_clause
(autoescape_block)
(template
(content))))
(content)))
(endautoescape_block))
(content))
+32 -16
View File
@@ -18,10 +18,12 @@ Block
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content))
==================
@@ -44,10 +46,12 @@ Block Matching End Tag
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content))
==================
@@ -72,17 +76,21 @@ Nested Blocks
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content))
==================
@@ -107,17 +115,21 @@ Nested Blocks End Tag
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content))
==================
@@ -142,15 +154,19 @@ Nested Blocks Mixed Tags
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content)))
(pop_block))
(endblock_block
(pop_block)))
(content))
+129 -10
View File
@@ -9,7 +9,10 @@ Blocktrans
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(content))
==================
@@ -23,7 +26,10 @@ Blocktranslate
(template
(content)
(blocktranslate_group
(blocktranslate_clause
(blocktranslate_block)
(content))
(endblocktranslate_block))
(content))
==================
@@ -36,7 +42,10 @@ Blocktrans Empty
(template
(content)
(blocktranslate_group)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block))
(endblocktrans_block))
(content))
==================
@@ -50,12 +59,15 @@ Blocktrans With A Placeholder
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(content)
(template_variable
(filtered_value
(value
(variable_attribute
(identifier))))))
(endblocktrans_block))
(content))
==================
@@ -69,7 +81,10 @@ Blocktrans Trimmed
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(content))
==================
@@ -83,12 +98,15 @@ Blocktrans With
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(content))
(endblocktrans_block))
(content))
==================
@@ -102,6 +120,8 @@ Blocktrans With Several Bindings
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
variable: (identifier)
(filtered_value
(value
@@ -111,8 +131,9 @@ Blocktrans With Several Bindings
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(content))
(endblocktrans_block))
(content))
==================
@@ -126,14 +147,17 @@ Blocktrans With A Filtered Binding
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))
(filter_expression
(filter)))
(filter))))
(content))
(endblocktrans_block))
(content))
==================
@@ -147,11 +171,14 @@ Blocktrans With Context
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
(filtered_value
(value
(literal
(string))))
(string)))))
(content))
(endblocktrans_block))
(content))
==================
@@ -165,8 +192,11 @@ Blocktrans With Asvar
(template
(content)
(blocktranslate_group
asvar: (identifier)
(blocktrans_clause
(blocktrans_block
asvar: (identifier))
(content))
(endblocktrans_block))
(content))
==================
@@ -180,13 +210,66 @@ Blocktrans With Count And Plural
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(content)
(plural_clause
(plural_block)
(content)))
(endblocktrans_block))
(content))
==================
Blocktrans With An Empty Singular
==================
{% blocktrans count n=x %}{% plural %}many{% endblocktrans %}
---
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(plural_clause
(plural_block)
(content)))
(endblocktrans_block))
(content))
==================
Blocktranslate With An Empty Plural
==================
{% blocktranslate count n=x %}one{% plural %}{% endblocktranslate %}
---
(template
(content)
(blocktranslate_group
(blocktranslate_clause
(blocktranslate_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))))
(content)
(plural_clause
(plural_block)))
(endblocktranslate_block))
(content))
==================
@@ -200,6 +283,8 @@ Blocktrans With Every Option
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block
variable: (identifier)
(filtered_value
(value
@@ -214,9 +299,12 @@ Blocktrans With Every Option
(value
(literal
(string))))
asvar: (identifier)
asvar: (identifier))
(content)
(content))
(plural_clause
(plural_block)
(content)))
(endblocktrans_block))
(content))
==================
@@ -230,8 +318,11 @@ Blocktrans With Its Options Reordered
(template
(content)
(blocktranslate_group
asvar: (identifier)
(blocktrans_clause
(blocktrans_block
asvar: (identifier))
(content))
(endblocktrans_block))
(content))
==================
@@ -244,6 +335,7 @@ Blocktrans Closed By The Other Spelling
---
==================
Blocktranslate Closed By The Other Spelling
:error
@@ -254,6 +346,7 @@ Blocktranslate Closed By The Other Spelling
---
==================
Blocktrans With Count And No Plural
:error
@@ -264,6 +357,7 @@ Blocktrans With Count And No Plural
---
==================
Blocktrans With Plural And No Count
:error
@@ -274,6 +368,7 @@ Blocktrans With Plural And No Count
---
==================
Blocktrans Counting Two Bindings
:error
@@ -284,6 +379,7 @@ Blocktrans Counting Two Bindings
---
==================
Blocktrans With Nothing To Bind
:error
@@ -294,6 +390,7 @@ Blocktrans With Nothing To Bind
---
==================
Blocktrans With An Unknown Option
:error
@@ -304,6 +401,7 @@ Blocktrans With An Unknown Option
---
==================
Blocktrans With Asvar And No Name
:error
@@ -314,6 +412,7 @@ Blocktrans With Asvar And No Name
---
==================
Blocktrans Holding A Tag
:error
@@ -324,6 +423,7 @@ Blocktrans Holding A Tag
---
==================
Blocktrans Holding A Comment
:error
@@ -334,6 +434,7 @@ Blocktrans Holding A Comment
---
==================
Blocktrans Holding Another Blocktrans
:error
@@ -344,6 +445,7 @@ Blocktrans Holding Another Blocktrans
---
==================
Blocktrans With Two Plurals
:error
@@ -354,6 +456,7 @@ Blocktrans With Two Plurals
---
==================
Blocktrans With An Argument On Plural
:error
@@ -363,6 +466,8 @@ Blocktrans With An Argument On Plural
---
==================
Blocktrans With Trimmed Twice
:error
@@ -373,6 +478,7 @@ Blocktrans With Trimmed Twice
---
==================
Blocktrans With With Twice
:error
@@ -383,6 +489,7 @@ Blocktrans With With Twice
---
==================
Blocktrans With Context Twice
:error
@@ -393,6 +500,7 @@ Blocktrans With Context Twice
---
==================
Blocktrans With Asvar Twice
:error
@@ -403,6 +511,7 @@ Blocktrans With Asvar Twice
---
==================
Blocktrans With Count Twice
:error
@@ -413,6 +522,7 @@ Blocktrans With Count Twice
---
==================
Blocktranslate With Trimmed Twice
:error
@@ -423,6 +533,7 @@ Blocktranslate With Trimmed Twice
---
==================
Blocktrans Repeating An Option Of The Tag Before It
==================
@@ -434,9 +545,15 @@ Blocktrans Repeating An Option Of The Tag Before It
(template
(content)
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(blocktranslate_group
(blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(content))
==================
@@ -447,3 +564,5 @@ Blocktrans With A Binding Twice
{% blocktrans with a=1 a=2 %}x{% endblocktrans %}
---
+32 -16
View File
@@ -10,13 +10,15 @@ Cache
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(literal
(number))))
(identifier)
(identifier))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
@@ -31,13 +33,15 @@ Cache With A Variable Timeout
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)
(identifier))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
@@ -52,6 +56,7 @@ Cache With A Filtered Timeout
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(literal
@@ -61,9 +66,10 @@ Cache With A Filtered Timeout
argument: (value
(literal
(number))))))
(identifier)
(identifier))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
@@ -78,13 +84,15 @@ Cache With A Quoted Fragment Name
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(literal
(number))))
(string)
(string))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
@@ -99,6 +107,7 @@ Cache Varying On Arguments
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(literal
@@ -111,9 +120,10 @@ Cache Varying On Arguments
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
@@ -128,6 +138,7 @@ Cache Varying On A Filtered Argument
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(literal
@@ -138,9 +149,10 @@ Cache Varying On A Filtered Argument
(variable_attribute
(identifier)))
(filter_expression
(filter)))
(filter))))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
@@ -155,6 +167,7 @@ Cache Using A Named Cache
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(literal
@@ -163,9 +176,10 @@ Cache Using A Named Cache
(filtered_value
(value
(literal
(string))))
(string)))))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
@@ -180,6 +194,7 @@ Cache Using An Unquoted Cache Name
(content)
(cache_group
(cache_clause
(cache_block
(filtered_value
(value
(literal
@@ -188,9 +203,10 @@ Cache Using An Unquoted Cache Name
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endcache_block))
(content))
==================
+14 -2
View File
@@ -11,7 +11,10 @@ This is ignored
(template
(content)
(comment_group
(comment_clause
(comment_block)
(comment_content))
(endcomment_block))
(content))
==================
@@ -24,7 +27,10 @@ Comment Empty
(template
(content)
(comment_group)
(comment_group
(comment_clause
(comment_block))
(endcomment_block))
(content))
==================
@@ -40,8 +46,11 @@ This is ignored
(template
(content)
(comment_group
(string)
(comment_clause
(comment_block
(string))
(comment_content))
(endcomment_block))
(content))
==================
@@ -57,5 +66,8 @@ Contains {% if x %} tag-like text
(template
(content)
(comment_group
(comment_clause
(comment_block)
(comment_content))
(endcomment_block))
(content))
+3 -3
View File
@@ -8,7 +8,7 @@ Csp Nonce Attr
(template
(content)
(csp_nonce_attr)
(csp_nonce_attr_block)
(content))
==================
@@ -21,7 +21,7 @@ Csp Nonce Attr With Argument And As
(template
(content)
(csp_nonce_attr
(csp_nonce_attr_block
(filtered_value
(value
(literal
@@ -39,7 +39,7 @@ Csp Nonce Attr With Media Keyword
(template
(content)
(csp_nonce_attr
(csp_nonce_attr_block
(filtered_value
(value
(literal
+1 -1
View File
@@ -10,5 +10,5 @@ Csrf Token
(template
(content)
(csrf_token)
(csrf_token_block)
(content))
+12 -12
View File
@@ -8,7 +8,7 @@ Custom Tag
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier))
(content))
@@ -22,7 +22,7 @@ Custom Tag With Arguments
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier)
(filtered_value
(value
@@ -48,7 +48,7 @@ Custom Tag With Keyword Arguments
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier)
(filtered_value
(value
@@ -71,7 +71,7 @@ Custom Tag With As
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier)
(filtered_value
(value
@@ -90,7 +90,7 @@ Custom Tag With Filtered Argument
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier)
(filtered_value
(value
@@ -110,10 +110,10 @@ Custom Tag Does Not Nest
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier))
(content)
(custom_tag
(custom_tag_block
tag: (identifier))
(content))
@@ -201,7 +201,7 @@ Custom Filter In A Tag
(template
(content)
(firstof
(firstof_block
(filtered_value
(value
(variable_attribute
@@ -277,7 +277,7 @@ A Name Reserved For A Tag Is Still An Argument
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier)
(filtered_value
(value
@@ -305,7 +305,7 @@ Custom Tag With Keyword Arguments And As
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier)
(identifier)
(filtered_value
@@ -330,14 +330,14 @@ Custom Tag Repeating A Keyword Of The Tag Before It
(template
(content)
(custom_tag
(custom_tag_block
tag: (identifier)
(identifier)
(filtered_value
(value
(literal
(number)))))
(custom_tag
(custom_tag_block
tag: (identifier)
(identifier)
(filtered_value
+5 -5
View File
@@ -11,7 +11,7 @@ Cycle Basic
(template
(content)
(cycle
(cycle_block
(filtered_value
(value
(literal
@@ -35,7 +35,7 @@ Cycle With As
(template
(content)
(cycle
(cycle_block
(filtered_value
(value
(literal
@@ -60,7 +60,7 @@ Cycle With As And Silent
(template
(content)
(cycle
(cycle_block
(filtered_value
(value
(literal
@@ -85,7 +85,7 @@ Cycle Referencing Existing Variable
(template
(content)
(cycle
(cycle_block
(filtered_value
(value
(variable_attribute
@@ -136,7 +136,7 @@ Cycle Spanning Lines
(template
(content)
(cycle
(cycle_block
(filtered_value
(value
(literal
+1 -1
View File
@@ -10,5 +10,5 @@ Debug
(template
(content)
(debug)
(debug_block)
(content))
+2 -2
View File
@@ -9,7 +9,7 @@ Extends With String
(template
(content)
(extends
(extends_block
(filtered_value
(value
(literal
@@ -27,7 +27,7 @@ Extends With Variable
(template
(content)
(extends
(extends_block
(filtered_value
(value
(variable_attribute
+12 -6
View File
@@ -14,10 +14,12 @@ hello
(content)
(filter_group
(filter_clause
(filter_block
(filter_expression
(filter))
(filter)))
(template
(content))))
(content)))
(endfilter_block))
(content))
==================
@@ -36,11 +38,13 @@ HELLO WORLD
(content)
(filter_group
(filter_clause
(filter_block
(filter_expression
(filter)
(filter))
(filter)))
(template
(content))))
(content)))
(endfilter_block))
(content))
==================
@@ -60,9 +64,11 @@ HELLO WORLD
(content)
(filter_group
(filter_clause
(filter_block
(filter_expression
(filter)
(filter))
(filter)))
(template
(content))))
(content)))
(endfilter_block))
(content))
+2 -2
View File
@@ -8,7 +8,7 @@ Firstof Basic
(template
(content)
(firstof
(firstof_block
(filtered_value
(value
(variable_attribute
@@ -33,7 +33,7 @@ Firstof With As
(template
(content)
(firstof
(firstof_block
(filtered_value
(value
(variable_attribute
+127 -74
View File
@@ -14,11 +14,12 @@ For Basic
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content)
(template_variable
@@ -26,7 +27,8 @@ For Basic
(value
(variable_attribute
(identifier)))))
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -45,12 +47,13 @@ For With Multiple Variables
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content)
(template_variable
@@ -58,7 +61,8 @@ For With Multiple Variables
(value
(variable_attribute
(identifier)))))
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -79,11 +83,12 @@ For With Empty
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content)
(template_variable
@@ -93,8 +98,10 @@ For With Empty
(identifier)))))
(content)))
(empty_clause
(empty_block)
(template
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -111,23 +118,27 @@ For With A Tag In Its Body
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(content)
(if_group
(if_clause
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(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))
==================
@@ -144,23 +155,27 @@ For With A Nested For
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content))))
(content)))
(endfor_block))
(content)))
(endfor_block))
(content))
==================
@@ -179,36 +194,43 @@ For With Tags In Both Branches
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(content)
(if_group
(if_clause
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content))))
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(endif_block))
(content)))
(empty_clause
(empty_block)
(template
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number))))
(number)))))
(template
(content))))
(content))))
(content)))
(endwith_block))
(content)))
(endfor_block))
(content))
==================
@@ -225,20 +247,24 @@ For With A Named Block In Its Body
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content)
(block_group
(block_clause
name: (push_block)
(block_block
name: (push_block))
(template
(content)))
(pop_block))
(content))))
(endblock_block
(pop_block)))
(content)))
(endfor_block))
(content))
==================
@@ -255,31 +281,37 @@ For Nested In A Tag
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(if_group
(if_clause
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(template
(content)))))))
(content))))
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier))))))
(template
(content)))
(endif_block))))
(endfor_block))
(content)))
(endif_block))
(content))
==================
@@ -294,11 +326,13 @@ For With An Empty Body
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))))
(endfor_block))
(content))
==================
@@ -315,13 +349,15 @@ a
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -338,14 +374,16 @@ a
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -362,6 +400,7 @@ a
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
@@ -371,9 +410,10 @@ a
(filter
argument: (value
(literal
(string))))))
(string)))))))
(template
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -392,16 +432,19 @@ b
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content)))
(empty_clause
(empty_block)
(template
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -418,23 +461,27 @@ For Reversed With A Tag In Its Body
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(template
(content)
(if_group
(if_clause
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(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))
==================
@@ -468,13 +515,15 @@ For Over A Variable Named Reversed
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -489,14 +538,16 @@ For Over An Attribute Of A Variable Named Reversed
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)
(attribute))))
(attribute)))))
(template
(content))))
(content)))
(endfor_block))
(content))
==================
@@ -511,15 +562,17 @@ For Over A Filtered Variable Named Reversed
(content)
(for_group
(for_clause
(for_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)))
(filter_expression
(filter)))
(filter))))
(template
(content))))
(content)))
(endfor_block))
(content))
==================
+25 -21
View File
@@ -8,7 +8,7 @@ Trans
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Translate
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -42,7 +42,7 @@ Trans With A Variable
(template
(content)
(translate
(translate_block
(filtered_value
(value
(variable_attribute
@@ -59,7 +59,7 @@ Trans With A Filtered Message
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -78,7 +78,7 @@ Trans Noop
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -95,7 +95,7 @@ Trans With As
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -113,7 +113,7 @@ Trans With Context
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -134,7 +134,7 @@ Trans With Every Option
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -156,7 +156,7 @@ Trans With Its Options Reordered
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -228,7 +228,7 @@ Get Available Languages
(template
(content)
(get_available_languages
(get_available_languages_block
variable: (identifier))
(content))
@@ -252,7 +252,7 @@ Get Current Language
(template
(content)
(get_current_language
(get_current_language_block
variable: (identifier))
(content))
@@ -266,7 +266,7 @@ Get Current Language Bidi
(template
(content)
(get_current_language_bidi
(get_current_language_bidi_block
variable: (identifier))
(content))
@@ -280,7 +280,7 @@ Get Language Info
(template
(content)
(get_language_info
(get_language_info_block
(filtered_value
(value
(literal
@@ -298,7 +298,7 @@ Get Language Info For A Variable
(template
(content)
(get_language_info
(get_language_info_block
(filtered_value
(value
(variable_attribute
@@ -336,7 +336,7 @@ Get Language Info List
(template
(content)
(get_language_info_list
(get_language_info_list_block
(filtered_value
(value
(variable_attribute
@@ -356,12 +356,14 @@ Language
(content)
(language_group
(language_clause
(language_block
(filtered_value
(value
(literal
(string))))
(string)))))
(template
(content))))
(content)))
(endlanguage_block))
(content))
==================
@@ -376,12 +378,14 @@ Language With A Variable
(content)
(language_group
(language_clause
(language_block
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endlanguage_block))
(content))
==================
@@ -509,7 +513,7 @@ Translate With A Context From An Attribute Of Noop
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
@@ -531,7 +535,7 @@ Translate With A Filtered Context Named After Noop
(template
(content)
(translate
(translate_block
(filtered_value
(value
(literal
+47 -23
View File
@@ -12,14 +12,16 @@ Hi
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier)
(attribute)))))
(attribute))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -36,13 +38,15 @@ working
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -63,6 +67,7 @@ other
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
@@ -72,10 +77,11 @@ other
(filtered_value
(value
(literal
(number)))))
(number))))))
(template
(content)))
(elif_clause
(elif_block
(predicate
(filtered_value
(value
@@ -85,12 +91,14 @@ other
(filtered_value
(value
(literal
(number)))))
(number))))))
(template
(content)))
(else_clause
(else_block)
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -107,6 +115,7 @@ yes
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
@@ -143,9 +152,10 @@ yes
(filtered_value
(value
(literal
(number)))))
(number))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -169,6 +179,7 @@ If Is Not None
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
@@ -178,9 +189,10 @@ If Is Not None
(filtered_value
(value
(literal
(none)))))
(none))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -195,6 +207,7 @@ If Is
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
@@ -204,9 +217,10 @@ If Is
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -221,6 +235,7 @@ If Is Not
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
@@ -230,9 +245,10 @@ If Is Not
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -247,6 +263,7 @@ If Is Not Not
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
@@ -256,9 +273,10 @@ If Is Not Not
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -273,13 +291,15 @@ If With A Repeated Not
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -294,13 +314,15 @@ If Not Before A Name Beginning With In
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content))))
(content)))
(endif_block))
(content))
==================
@@ -315,6 +337,7 @@ If Is Before A Name Beginning With Not
(content)
(if_group
(if_clause
(if_block
(predicate
(filtered_value
(value
@@ -324,7 +347,8 @@ If Is Before A Name Beginning With Not
(filtered_value
(value
(variable_attribute
(identifier)))))
(identifier))))))
(template
(content))))
(content)))
(endif_block))
(content))
+28 -9
View File
@@ -12,8 +12,10 @@ content
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content))))
(content)))
(endifchanged_block))
(content))
==================
@@ -30,6 +32,7 @@ content
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block
(filtered_value
(value
(variable_attribute
@@ -37,9 +40,10 @@ content
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endifchanged_block))
(content))
==================
@@ -58,11 +62,14 @@ unchanged
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause
(else_block)
(template
(content))))
(content)))
(endifchanged_block))
(content))
==================
@@ -81,6 +88,7 @@ unchanged
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block
(filtered_value
(value
(variable_attribute
@@ -90,12 +98,14 @@ unchanged
(variable_attribute
(identifier)))
(filter_expression
(filter)))
(filter))))
(template
(content)))
(else_clause
(else_block)
(template
(content))))
(content)))
(endifchanged_block))
(content))
==================
@@ -112,9 +122,12 @@ content
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause))
(else_clause
(else_block))
(endifchanged_block))
(content))
==================
@@ -137,19 +150,25 @@ c
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause
(else_block)
(template
(content)
(ifchanged_group
(ifchanged_clause
(ifchanged_block)
(template
(content)))
(else_clause
(else_block)
(template
(content))))
(content))))
(content)))
(endifchanged_block))
(content)))
(endifchanged_block))
(content))
==================
+8 -8
View File
@@ -8,7 +8,7 @@ Include With String
(template
(content)
(include
(include_block
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Include With Variable
(template
(content)
(include
(include_block
(filtered_value
(value
(variable_attribute
@@ -42,7 +42,7 @@ Include With A Filtered Name
(template
(content)
(include
(include_block
(filtered_value
(value
(literal
@@ -61,7 +61,7 @@ Include Only
(template
(content)
(include
(include_block
(filtered_value
(value
(literal
@@ -78,7 +78,7 @@ Include With Context
(template
(content)
(include
(include_block
(filtered_value
(value
(literal
@@ -100,7 +100,7 @@ Include With Several Bindings
(template
(content)
(include
(include_block
(filtered_value
(value
(literal
@@ -127,7 +127,7 @@ Include With Context And Only
(template
(content)
(include
(include_block
(filtered_value
(value
(literal
@@ -149,7 +149,7 @@ Include With Only Before With
(template
(content)
(include
(include_block
(filtered_value
(value
(literal
+17 -5
View File
@@ -10,8 +10,10 @@ Localize
(content)
(localize_group
(localize_clause
(localize_block)
(template
(content))))
(content)))
(endlocalize_block))
(content))
==================
@@ -26,8 +28,10 @@ Localize On
(content)
(localize_group
(localize_clause
(localize_block)
(template
(content))))
(content)))
(endlocalize_block))
(content))
==================
@@ -42,8 +46,10 @@ Localize Off
(content)
(localize_group
(localize_clause
(localize_block)
(template
(content))))
(content)))
(endlocalize_block))
(content))
==================
@@ -58,8 +64,10 @@ Localize Hugging Its Delimiters
(content)
(localize_group
(localize_clause
(localize_block)
(template
(content))))
(content)))
(endlocalize_block))
(content))
==================
@@ -74,11 +82,15 @@ Localize Nested
(content)
(localize_group
(localize_clause
(localize_block)
(template
(localize_group
(localize_clause
(localize_block)
(template
(content)))))))
(content)))
(endlocalize_block))))
(endlocalize_block))
(content))
==================
+4 -4
View File
@@ -8,7 +8,7 @@ Load Single Library
(template
(content)
(load
(load_block
(library
(identifier)))
(content))
@@ -23,7 +23,7 @@ Load Multiple Libraries
(template
(content)
(load
(load_block
(library
(identifier))
(library
@@ -40,7 +40,7 @@ Load Dotted Library
(template
(content)
(load
(load_block
(library
(identifier)
(identifier)))
@@ -56,7 +56,7 @@ Load Names From Library
(template
(content)
(load
(load_block
(identifier)
(identifier)
(library
+2 -2
View File
@@ -8,7 +8,7 @@ Lorem Words
(template
(content)
(lorem
(lorem_block
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Lorem Paragraphs Random
(template
(content)
(lorem
(lorem_block
(filtered_value
(value
(literal
+2 -2
View File
@@ -8,7 +8,7 @@ Now Basic
(template
(content)
(now
(now_block
(string))
(content))
@@ -22,7 +22,7 @@ Now With As
(template
(content)
(now
(now_block
(string)
variable: (identifier))
(content))
+1 -1
View File
@@ -8,6 +8,6 @@ Partial Basic
(template
(content)
(partial
(partial_block
(identifier))
(content))
+8 -4
View File
@@ -14,10 +14,12 @@ Partialdef Basic
(content)
(partialdef_group
(partialdef_clause
(push_partial)
(partialdef_block
(push_partial))
(template
(content)))
(pop_partial))
(endpartialdef_block
(pop_partial)))
(content))
==================
@@ -36,8 +38,10 @@ Partialdef Inline
(content)
(partialdef_group
(partialdef_clause
(push_partial)
(partialdef_block
(push_partial))
(template
(content)))
(pop_partial))
(endpartialdef_block
(pop_partial)))
(content))
+5 -5
View File
@@ -8,7 +8,7 @@ Querystring Empty
(template
(content)
(query_string)
(querystring_block)
(content))
==================
@@ -21,7 +21,7 @@ Querystring With Key Value
(template
(content)
(query_string
(querystring_block
(identifier)
(filtered_value
(value
@@ -39,7 +39,7 @@ Querystring With Identifier And Key Value
(template
(content)
(query_string
(querystring_block
(filtered_value
(value
(variable_attribute
@@ -61,7 +61,7 @@ Querystring With Expression Argument And As
(template
(content)
(query_string
(querystring_block
(filtered_value
(value
(variable_attribute
@@ -85,7 +85,7 @@ Querystring With Two Keys
(template
(content)
(query_string
(querystring_block
(identifier)
(filtered_value
(value
+1 -1
View File
@@ -8,7 +8,7 @@ Regroup Basic
(template
(content)
(regroup
(regroup_block
(filtered_value
(value
(variable_attribute
+2 -2
View File
@@ -8,7 +8,7 @@ Resetcycle Bare
(template
(content)
(reset_cycle)
(resetcycle_block)
(content))
==================
@@ -21,6 +21,6 @@ Resetcycle With Name
(template
(content)
(reset_cycle
(resetcycle_block
(identifier))
(content))
+3 -1
View File
@@ -14,6 +14,8 @@ Spaceless Basic
(content)
(spaceless_group
(spaceless_clause
(spaceless_block)
(template
(content))))
(content)))
(endspaceless_block))
(content))
+9 -9
View File
@@ -8,7 +8,7 @@ Static
(template
(content)
(static
(static_block
(filtered_value
(value
(literal
@@ -25,7 +25,7 @@ Static With A Variable Path
(template
(content)
(static
(static_block
(filtered_value
(value
(variable_attribute
@@ -42,7 +42,7 @@ Static With A Filtered Path
(template
(content)
(static
(static_block
(filtered_value
(value
(literal
@@ -61,7 +61,7 @@ Static With As
(template
(content)
(static
(static_block
(filtered_value
(value
(literal
@@ -109,7 +109,7 @@ Get Static Prefix
(template
(content)
(get_static_prefix)
(get_static_prefix_block)
(content))
==================
@@ -122,7 +122,7 @@ Get Static Prefix With As
(template
(content)
(get_static_prefix
(get_static_prefix_block
variable: (identifier))
(content))
@@ -136,7 +136,7 @@ Get Media Prefix With As
(template
(content)
(get_media_prefix
(get_media_prefix_block
variable: (identifier))
(content))
@@ -170,10 +170,10 @@ Load Names The Library, Not The Tag
(template
(content)
(load
(load_block
(library
(identifier)))
(static
(static_block
(filtered_value
(value
(literal
+2 -2
View File
@@ -8,7 +8,7 @@ Templatetag Openblock
(template
(content)
(template_tag_block)
(templatetag_block)
(content))
==================
@@ -21,5 +21,5 @@ Templatetag Closevariable
(template
(content)
(template_tag_block)
(templatetag_block)
(content))
+22 -10
View File
@@ -10,8 +10,10 @@ Localtime
(content)
(localtime_group
(localtime_clause
(localtime_block)
(template
(content))))
(content)))
(endlocaltime_block))
(content))
==================
@@ -26,8 +28,10 @@ Localtime On
(content)
(localtime_group
(localtime_clause
(localtime_block)
(template
(content))))
(content)))
(endlocaltime_block))
(content))
==================
@@ -42,8 +46,10 @@ Localtime Off
(content)
(localtime_group
(localtime_clause
(localtime_block)
(template
(content))))
(content)))
(endlocaltime_block))
(content))
==================
@@ -78,12 +84,14 @@ Timezone
(content)
(timezone_group
(timezone_clause
(timezone_block
(filtered_value
(value
(literal
(string))))
(string)))))
(template
(content))))
(content)))
(endtimezone_block))
(content))
==================
@@ -98,12 +106,14 @@ Timezone With A Variable
(content)
(timezone_group
(timezone_clause
(timezone_block
(filtered_value
(value
(variable_attribute
(identifier))))
(identifier)))))
(template
(content))))
(content)))
(endtimezone_block))
(content))
==================
@@ -118,14 +128,16 @@ Timezone With A Filtered Argument
(content)
(timezone_group
(timezone_clause
(timezone_block
(filtered_value
(value
(variable_attribute
(identifier)))
(filter_expression
(filter)))
(filter))))
(template
(content))))
(content)))
(endtimezone_block))
(content))
==================
@@ -158,7 +170,7 @@ Get Current Timezone
(template
(content)
(get_current_timezone
(get_current_timezone_block
variable: (identifier))
(content))
+29 -14
View File
@@ -9,9 +9,12 @@ Verbatim Basic
(template
(content)
(verbatim_group
(push_verbatim)
(verbatim_content)
(pop_verbatim))
(verbatim_clause
(verbatim_block
(push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content))
==================
@@ -25,8 +28,11 @@ Verbatim Empty
(template
(content)
(verbatim_group
(push_verbatim)
(pop_verbatim))
(verbatim_clause
(verbatim_block
(push_verbatim)))
(endverbatim_block
(pop_verbatim)))
(content))
==================
@@ -43,9 +49,12 @@ Verbatim Ignores Tags
(template
(content)
(verbatim_group
(push_verbatim)
(verbatim_content)
(pop_verbatim))
(verbatim_clause
(verbatim_block
(push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content))
==================
@@ -59,9 +68,12 @@ Verbatim With Name
(template
(content)
(verbatim_group
(push_verbatim)
(verbatim_content)
(pop_verbatim))
(verbatim_clause
(verbatim_block
(push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content))
==================
@@ -77,7 +89,10 @@ Avoid template rendering via the {% verbatim %}{% endverbatim %} block.
(template
(content)
(verbatim_group
(push_verbatim)
(verbatim_content)
(pop_verbatim))
(verbatim_clause
(verbatim_block
(push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content))
+20 -10
View File
@@ -12,12 +12,13 @@ With Basic
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(variable_attribute
(identifier)
(attribute))))
(attribute)))))
(template
(content)
(template_variable
@@ -25,7 +26,8 @@ With Basic
(value
(variable_attribute
(identifier)))))
(content))))
(content)))
(endwith_block))
(content))
==================
@@ -42,6 +44,7 @@ With Multiple Variables
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
@@ -51,7 +54,7 @@ With Multiple Variables
(filtered_value
(value
(literal
(number))))
(number)))))
(template
(content)
(template_variable
@@ -59,7 +62,8 @@ With Multiple Variables
(value
(variable_attribute
(identifier)))))
(content))))
(content)))
(endwith_block))
(content))
==================
@@ -94,22 +98,26 @@ With Repeating A Binding Of The Tag Before It
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number))))
(number)))))
(template
(content))))
(content)))
(endwith_block))
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number))))
(number)))))
(template
(content))))
(content)))
(endwith_block))
(content))
==================
@@ -124,11 +132,13 @@ With A Binding Named After A Literal
(content)
(with_group
(with_clause
(with_block
variable: (identifier)
(filtered_value
(value
(literal
(number))))
(number)))))
(template
(content))))
(content)))
(endwith_block))
(content))