Compare commits

..
2 Commits
44 changed files with 21639 additions and 59267 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 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,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 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.
Do not reach for lookahead to solve that instead: `ts_language_next_state` follows only the shift on `{%`, 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. 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 `else_clause` is shared by `if_group` and `ifchanged_group`. `comment_clause` and `verbatim_clause` hold raw
clause — their bodies are raw scanner text that admits no tags — and neither does `blocktranslate_group`, scanner text that admits no tags. `blocktranslate_group` has one clause per spelling, `blocktrans_clause` and
whose body is `_translate_body`. `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 **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 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 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
@@ -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 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.
@@ -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`, 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.
@@ -242,13 +257,13 @@ 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
binding from a reference — another reason to keep `asVariable` uniform. `{% blocktranslate %}`'s `asvar` 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: 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 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 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. 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. - `{% 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) =>
+218 -195
View File
@@ -204,6 +204,44 @@ function simpleTag($, tag, args = true, kwargs = true) {
return block(tag, ...parts, optional(asVariable($))); 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 * 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: * 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 * 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).
@@ -360,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,
@@ -385,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))),
@@ -479,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,
), ),
/** /**
@@ -562,45 +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),
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: ($) => blocktranslate_group: ($) =>
choice( choice(
...["blocktrans", "blocktranslate"].map((name) => seq($.blocktrans_clause, $.endblocktrans_block),
choice( seq($.blocktranslate_clause, $.endblocktranslate_block),
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),
),
),
),
), ),
/** /**
* 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
@@ -646,35 +670,32 @@ const django = grammar({
), ),
), ),
), ),
cache_clause: ($) => cache_block: ($) =>
seq( block(
block( "cache",
"cache", part($.filtered_value),
part($.filtered_value), part(choice($.identifier, $.string)),
part(choice($.identifier, $.string)), repeat(part($.filtered_value)),
repeat(part($.filtered_value)), optional(part(seq("using=", $.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(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)),
@@ -686,71 +707,71 @@ 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_group: ($) => seq($.filter_clause, block("endfilter")), filter_clause: ($) => seq($.filter_block, optional($.template)),
firstof: ($) => endfilter_block: ($) => block("endfilter"),
filter_group: ($) => seq($.filter_clause, $.endfilter_block),
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)), repeat(
repeat( seq(
seq( optional(SEP),
optional(SEP), ",",
",", optional(SEP),
optional(SEP), field("variable", $.identifier),
field("variable", $.identifier),
),
),
part("in"),
// do_for reads the flag off the end and takes the sequence from the
// bit before it, so the flag comes last or not at all. A bare
// "reversed" in the sequence position leaves nothing to iterate,
// naming a sequence only when a lookup or filter continues it or
// when the flag follows it as well
choice(
seq(part($.filtered_value), optional(part("reversed"))),
seq(
part(wordAsValue($, "reversed", true)),
optional(part("reversed")),
),
seq(part(wordAsValue($, "reversed", false)), part("reversed")),
), ),
), ),
optional($.template), part("in"),
// do_for reads the flag off the end and takes the sequence from the
// bit before it, so the flag comes last or not at all. A bare
// "reversed" in the sequence position leaves nothing to iterate,
// naming a sequence only when a lookup or filter continues it or
// when the flag follows it as well
choice(
seq(part($.filtered_value), optional(part("reversed"))),
seq(
part(wordAsValue($, "reversed", true)),
optional(part("reversed")),
),
seq(part(wordAsValue($, "reversed", false)), part("reversed")),
),
), ),
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: ($) => 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),
@@ -761,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,
@@ -800,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(
@@ -816,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")))), localize_clause: ($) => seq($.localize_block, optional($.template)),
optional($.template), endlocalize_block: ($) => block("endlocalize"),
), localize_group: ($) => seq($.localize_clause, $.endlocalize_block),
localize_group: ($) => seq($.localize_clause, block("endlocalize")),
/** 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")))), localtime_clause: ($) => seq($.localtime_block, optional($.template)),
optional($.template), endlocaltime_block: ($) => block("endlocaltime"),
), localtime_group: ($) => seq($.localtime_clause, $.endlocaltime_block),
localtime_group: ($) => seq($.localtime_clause, block("endlocaltime")), lorem_block: ($) =>
lorem: ($) =>
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"))), partialdef_clause: ($) => seq($.partialdef_block, optional($.template)),
optional($.template), endpartialdef_block: ($) => block("endpartialdef", $.pop_partial),
), partialdef_group: ($) => seq($.partialdef_clause, $.endpartialdef_block),
partialdef_group: ($) =>
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),
@@ -855,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(
@@ -877,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),
@@ -914,13 +938,11 @@ const django = grammar({
), ),
optional(asVariable($)), optional(asVariable($)),
), ),
verbatim_group: ($) => verbatim_block: ($) => block("verbatim", $.push_verbatim),
seq( verbatim_clause: ($) => seq($.verbatim_block, optional($.verbatim_content)),
block("verbatim", $.push_verbatim), endverbatim_block: ($) => block("endverbatim", $.pop_verbatim),
optional($.verbatim_content), verbatim_group: ($) => seq($.verbatim_clause, $.endverbatim_block),
block("endverbatim", $.pop_verbatim), widthratio_block: ($) =>
),
width_ratio: ($) =>
block( block(
"widthratio", "widthratio",
part($.filtered_value), part($.filtered_value),
@@ -928,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),
}, },
}); });
+7 -2
View File
@@ -21,5 +21,10 @@
; scope span could have separated them; that is why this is a separate file ; scope span could have separated them; that is why this is a separate file
; rather than a narrower scope in locals.scm. ; rather than a narrower scope in locals.scm.
(blocktranslate_group (blocktrans_clause
asvar: (identifier) @export.name) @export.from (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 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_group (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)
+22 -21
View File
@@ -15,41 +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)
(blocktranslate_group (blocktrans_block
tag: [ tag: ("blocktrans") @library.i18n)
("blocktrans")
("blocktranslate")] @library.i18n)
(translate (blocktranslate_block
tag: ("blocktranslate") @library.i18n)
(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
@@ -59,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
@@ -70,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
@@ -87,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)
+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 ; 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 ; 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. ; around the block, which a locals query has no way to say.
(blocktranslate_group) @local.scope (blocktrans_clause) @local.scope
(blocktranslate_clause) @local.scope
+14 -11
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
+2599 -2493
View File
File diff suppressed because it is too large. Load diff
+990 -367
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) (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))
+189 -70
View File
@@ -9,7 +9,10 @@ Blocktrans
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
(content)) (blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -23,7 +26,10 @@ Blocktranslate
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
(content)) (blocktranslate_clause
(blocktranslate_block)
(content))
(endblocktranslate_block))
(content)) (content))
================== ==================
@@ -36,7 +42,10 @@ Blocktrans Empty
(template (template
(content) (content)
(blocktranslate_group) (blocktranslate_group
(blocktrans_clause
(blocktrans_block))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -50,12 +59,15 @@ Blocktrans With A Placeholder
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
(content) (blocktrans_clause
(template_variable (blocktrans_block)
(filtered_value (content)
(value (template_variable
(variable_attribute (filtered_value
(identifier)))))) (value
(variable_attribute
(identifier))))))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -69,7 +81,10 @@ Blocktrans Trimmed
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
(content)) (blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -83,12 +98,15 @@ Blocktrans With
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
variable: (identifier) (blocktrans_clause
(filtered_value (blocktrans_block
(value variable: (identifier)
(variable_attribute (filtered_value
(identifier)))) (value
(content)) (variable_attribute
(identifier)))))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -102,17 +120,20 @@ Blocktrans With Several Bindings
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
variable: (identifier) (blocktrans_clause
(filtered_value (blocktrans_block
(value variable: (identifier)
(variable_attribute (filtered_value
(identifier)))) (value
variable: (identifier) (variable_attribute
(filtered_value (identifier))))
(value variable: (identifier)
(variable_attribute (filtered_value
(identifier)))) (value
(content)) (variable_attribute
(identifier)))))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -126,14 +147,17 @@ Blocktrans With A Filtered Binding
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
variable: (identifier) (blocktrans_clause
(filtered_value (blocktrans_block
(value variable: (identifier)
(variable_attribute (filtered_value
(identifier))) (value
(filter_expression (variable_attribute
(filter))) (identifier)))
(content)) (filter_expression
(filter))))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -147,11 +171,14 @@ Blocktrans With Context
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
(filtered_value (blocktrans_clause
(value (blocktrans_block
(literal (filtered_value
(string)))) (value
(content)) (literal
(string)))))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -165,8 +192,11 @@ Blocktrans With Asvar
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
asvar: (identifier) (blocktrans_clause
(content)) (blocktrans_block
asvar: (identifier))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -180,13 +210,66 @@ Blocktrans With Count And Plural
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
variable: (identifier) (blocktrans_clause
(filtered_value (blocktrans_block
(value variable: (identifier)
(variable_attribute (filtered_value
(identifier)))) (value
(content) (variable_attribute
(content)) (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)) (content))
================== ==================
@@ -200,23 +283,28 @@ Blocktrans With Every Option
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
variable: (identifier) (blocktrans_clause
(filtered_value (blocktrans_block
(value variable: (identifier)
(variable_attribute (filtered_value
(identifier)))) (value
variable: (identifier) (variable_attribute
(filtered_value (identifier))))
(value variable: (identifier)
(variable_attribute (filtered_value
(identifier)))) (value
(filtered_value (variable_attribute
(value (identifier))))
(literal (filtered_value
(string)))) (value
asvar: (identifier) (literal
(content) (string))))
(content)) asvar: (identifier))
(content)
(plural_clause
(plural_block)
(content)))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -230,8 +318,11 @@ Blocktrans With Its Options Reordered
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
asvar: (identifier) (blocktrans_clause
(content)) (blocktrans_block
asvar: (identifier))
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -244,6 +335,7 @@ Blocktrans Closed By The Other Spelling
--- ---
================== ==================
Blocktranslate Closed By The Other Spelling Blocktranslate Closed By The Other Spelling
:error :error
@@ -254,6 +346,7 @@ Blocktranslate Closed By The Other Spelling
--- ---
================== ==================
Blocktrans With Count And No Plural Blocktrans With Count And No Plural
:error :error
@@ -264,6 +357,7 @@ Blocktrans With Count And No Plural
--- ---
================== ==================
Blocktrans With Plural And No Count Blocktrans With Plural And No Count
:error :error
@@ -274,6 +368,7 @@ Blocktrans With Plural And No Count
--- ---
================== ==================
Blocktrans Counting Two Bindings Blocktrans Counting Two Bindings
:error :error
@@ -284,6 +379,7 @@ Blocktrans Counting Two Bindings
--- ---
================== ==================
Blocktrans With Nothing To Bind Blocktrans With Nothing To Bind
:error :error
@@ -294,6 +390,7 @@ Blocktrans With Nothing To Bind
--- ---
================== ==================
Blocktrans With An Unknown Option Blocktrans With An Unknown Option
:error :error
@@ -304,6 +401,7 @@ Blocktrans With An Unknown Option
--- ---
================== ==================
Blocktrans With Asvar And No Name Blocktrans With Asvar And No Name
:error :error
@@ -314,6 +412,7 @@ Blocktrans With Asvar And No Name
--- ---
================== ==================
Blocktrans Holding A Tag Blocktrans Holding A Tag
:error :error
@@ -324,6 +423,7 @@ Blocktrans Holding A Tag
--- ---
================== ==================
Blocktrans Holding A Comment Blocktrans Holding A Comment
:error :error
@@ -334,6 +434,7 @@ Blocktrans Holding A Comment
--- ---
================== ==================
Blocktrans Holding Another Blocktrans Blocktrans Holding Another Blocktrans
:error :error
@@ -344,6 +445,7 @@ Blocktrans Holding Another Blocktrans
--- ---
================== ==================
Blocktrans With Two Plurals Blocktrans With Two Plurals
:error :error
@@ -354,6 +456,7 @@ Blocktrans With Two Plurals
--- ---
================== ==================
Blocktrans With An Argument On Plural Blocktrans With An Argument On Plural
:error :error
@@ -363,6 +466,8 @@ Blocktrans With An Argument On Plural
--- ---
================== ==================
Blocktrans With Trimmed Twice Blocktrans With Trimmed Twice
:error :error
@@ -373,6 +478,7 @@ Blocktrans With Trimmed Twice
--- ---
================== ==================
Blocktrans With With Twice Blocktrans With With Twice
:error :error
@@ -383,6 +489,7 @@ Blocktrans With With Twice
--- ---
================== ==================
Blocktrans With Context Twice Blocktrans With Context Twice
:error :error
@@ -393,6 +500,7 @@ Blocktrans With Context Twice
--- ---
================== ==================
Blocktrans With Asvar Twice Blocktrans With Asvar Twice
:error :error
@@ -403,6 +511,7 @@ Blocktrans With Asvar Twice
--- ---
================== ==================
Blocktrans With Count Twice Blocktrans With Count Twice
:error :error
@@ -413,6 +522,7 @@ Blocktrans With Count Twice
--- ---
================== ==================
Blocktranslate With Trimmed Twice Blocktranslate With Trimmed Twice
:error :error
@@ -423,6 +533,7 @@ Blocktranslate With Trimmed Twice
--- ---
================== ==================
Blocktrans Repeating An Option Of The Tag Before It Blocktrans Repeating An Option Of The Tag Before It
================== ==================
@@ -434,9 +545,15 @@ Blocktrans Repeating An Option Of The Tag Before It
(template (template
(content) (content)
(blocktranslate_group (blocktranslate_group
(content)) (blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(blocktranslate_group (blocktranslate_group
(content)) (blocktrans_clause
(blocktrans_block)
(content))
(endblocktrans_block))
(content)) (content))
================== ==================
@@ -447,3 +564,5 @@ Blocktrans With A Binding Twice
{% blocktrans with a=1 a=2 %}x{% endblocktrans %} {% blocktrans with a=1 a=2 %}x{% endblocktrans %}
--- ---
+91 -75
View File
@@ -10,13 +10,15 @@ Cache
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(filtered_value (cache_block
(value (filtered_value
(literal (value
(number)))) (literal
(identifier) (number))))
(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
(filtered_value (cache_block
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier) (identifier))))
(identifier))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -52,18 +56,20 @@ Cache With A Filtered Timeout
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(filtered_value (cache_block
(value (filtered_value
(literal (value
(number))) (literal
(filter_expression (number)))
(filter (filter_expression
argument: (value (filter
(literal argument: (value
(number)))))) (literal
(identifier) (number))))))
(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
(filtered_value (cache_block
(value (filtered_value
(literal (value
(number)))) (literal
(string) (number))))
(string))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -99,21 +107,23 @@ Cache Varying On Arguments
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(filtered_value (cache_block
(value (filtered_value
(literal (value
(number)))) (literal
(identifier) (number))))
(filtered_value (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(filtered_value (identifier))))
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -128,19 +138,21 @@ Cache Varying On A Filtered Argument
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(filtered_value (cache_block
(value (filtered_value
(literal (value
(number)))) (literal
(identifier) (number))))
(filtered_value (identifier)
(value (filtered_value
(variable_attribute (value
(identifier))) (variable_attribute
(filter_expression (identifier)))
(filter))) (filter_expression
(filter))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -155,17 +167,19 @@ Cache Using A Named Cache
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(filtered_value (cache_block
(value (filtered_value
(literal (value
(number)))) (literal
(identifier) (number))))
(filtered_value (identifier)
(value (filtered_value
(literal (value
(string)))) (literal
(string)))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
@@ -180,17 +194,19 @@ Cache Using An Unquoted Cache Name
(content) (content)
(cache_group (cache_group
(cache_clause (cache_clause
(filtered_value (cache_block
(value (filtered_value
(literal (value
(number)))) (literal
(identifier) (number))))
(filtered_value (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content)))) (content)))
(endcache_block))
(content)) (content))
================== ==================
+17 -5
View File
@@ -11,7 +11,10 @@ This is ignored
(template (template
(content) (content)
(comment_group (comment_group
(comment_content)) (comment_clause
(comment_block)
(comment_content))
(endcomment_block))
(content)) (content))
================== ==================
@@ -24,7 +27,10 @@ Comment Empty
(template (template
(content) (content)
(comment_group) (comment_group
(comment_clause
(comment_block))
(endcomment_block))
(content)) (content))
================== ==================
@@ -40,8 +46,11 @@ This is ignored
(template (template
(content) (content)
(comment_group (comment_group
(string) (comment_clause
(comment_content)) (comment_block
(string))
(comment_content))
(endcomment_block))
(content)) (content))
================== ==================
@@ -57,5 +66,8 @@ Contains {% if x %} tag-like text
(template (template
(content) (content)
(comment_group (comment_group
(comment_content)) (comment_clause
(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
+17 -11
View File
@@ -14,10 +14,12 @@ hello
(content) (content)
(filter_group (filter_group
(filter_clause (filter_clause
(filter_expression (filter_block
(filter)) (filter_expression
(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_expression (filter_block
(filter) (filter_expression
(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_expression (filter_block
(filter) (filter_expression
(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
+207 -154
View File
@@ -14,11 +14,12 @@ For Basic
(content) (content)
(for_group (for_group
(for_clause (for_clause
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
variable: (identifier) (for_block
variable: (identifier) variable: (identifier)
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content) (content)
(for_group (for_group
(for_clause (for_clause
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content))) (content)))
(empty_clause (empty_clause
(empty_block)
(template (template
(content) (content)
(with_group (with_group
(with_clause (with_clause
variable: (identifier) (with_block
(filtered_value variable: (identifier)
(value (filtered_value
(literal (value
(number)))) (literal
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content) (content)
(for_group (for_group
(for_clause (for_clause
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content))))))) (content)))
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))))) (variable_attribute
(identifier))))))
(endfor_block))
(content)) (content))
================== ==================
@@ -315,13 +349,15 @@ a
(content) (content)
(for_group (for_group
(for_clause (for_clause
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -338,14 +374,16 @@ a
(content) (content)
(for_group (for_group
(for_clause (for_clause
variable: (identifier) (for_block
variable: (identifier) variable: (identifier)
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -362,18 +400,20 @@ a
(content) (content)
(for_group (for_group
(for_clause (for_clause
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier))) (variable_attribute
(filter_expression (identifier)))
(filter (filter_expression
argument: (value (filter
(literal argument: (value
(string)))))) (literal
(string)))))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
@@ -392,16 +432,19 @@ b
(content) (content)
(for_group (for_group
(for_clause (for_clause
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(identifier)))))
(template (template
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier) (variable_attribute
(attribute)))) (identifier)
(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
variable: (identifier) (for_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier))) (variable_attribute
(filter_expression (identifier)))
(filter))) (filter_expression
(filter))))
(template (template
(content)))) (content)))
(endfor_block))
(content)) (content))
================== ==================
+31 -27
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
(filtered_value (language_block
(value (filtered_value
(literal (value
(string)))) (literal
(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
(filtered_value (language_block
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
+163 -139
View File
@@ -12,14 +12,16 @@ Hi
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier) (variable_attribute
(attribute))))) (identifier)
(attribute))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -36,13 +38,15 @@ working
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -63,34 +67,38 @@ other
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(literal (value
(number))))) (literal
(number))))))
(template (template
(content))) (content)))
(elif_clause (elif_clause
(predicate (elif_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(literal (value
(number))))) (literal
(number))))))
(template (template
(content))) (content)))
(else_clause (else_clause
(else_block)
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -107,45 +115,47 @@ yes
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier))) (variable_attribute
(filter_expression (identifier)))
(filter))) (filter_expression
(binaryOperator) (filter)))
(filtered_value (binaryOperator)
(value (filtered_value
(literal (value
(number))))) (literal
(number))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -169,18 +179,20 @@ If Is Not None
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(literal (value
(none))))) (literal
(none))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -195,18 +207,20 @@ If Is
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -221,18 +235,20 @@ If Is Not
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -247,18 +263,20 @@ If Is Not Not
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(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
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(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
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
================== ==================
@@ -315,16 +337,18 @@ If Is Before A Name Beginning With Not
(content) (content)
(if_group (if_group
(if_clause (if_clause
(predicate (if_block
(filtered_value (predicate
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(binaryOperator) (identifier))))
(filtered_value (binaryOperator)
(value (filtered_value
(variable_attribute (value
(identifier))))) (variable_attribute
(identifier))))))
(template (template
(content)))) (content)))
(endif_block))
(content)) (content))
+44 -25
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,16 +32,18 @@ content
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(filtered_value (ifchanged_block
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(filtered_value (identifier))))
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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,21 +88,24 @@ unchanged
(content) (content)
(ifchanged_group (ifchanged_group
(ifchanged_clause (ifchanged_clause
(filtered_value (ifchanged_block
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(filtered_value (identifier))))
(value (filtered_value
(variable_attribute (value
(identifier))) (variable_attribute
(filter_expression (identifier)))
(filter))) (filter_expression
(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))
+33 -21
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
(filtered_value (timezone_block
(value (filtered_value
(literal (value
(string)))) (literal
(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
(filtered_value (timezone_block
(value (filtered_value
(variable_attribute (value
(identifier)))) (variable_attribute
(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
(filtered_value (timezone_block
(value (filtered_value
(variable_attribute (value
(identifier))) (variable_attribute
(filter_expression (identifier)))
(filter))) (filter_expression
(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))
+29 -14
View File
@@ -9,9 +9,12 @@ Verbatim Basic
(template (template
(content) (content)
(verbatim_group (verbatim_group
(push_verbatim) (verbatim_clause
(verbatim_content) (verbatim_block
(pop_verbatim)) (push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -25,8 +28,11 @@ Verbatim Empty
(template (template
(content) (content)
(verbatim_group (verbatim_group
(push_verbatim) (verbatim_clause
(pop_verbatim)) (verbatim_block
(push_verbatim)))
(endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -43,9 +49,12 @@ Verbatim Ignores Tags
(template (template
(content) (content)
(verbatim_group (verbatim_group
(push_verbatim) (verbatim_clause
(verbatim_content) (verbatim_block
(pop_verbatim)) (push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -59,9 +68,12 @@ Verbatim With Name
(template (template
(content) (content)
(verbatim_group (verbatim_group
(push_verbatim) (verbatim_clause
(verbatim_content) (verbatim_block
(pop_verbatim)) (push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content)) (content))
================== ==================
@@ -77,7 +89,10 @@ Avoid template rendering via the {% verbatim %}{% endverbatim %} block.
(template (template
(content) (content)
(verbatim_group (verbatim_group
(push_verbatim) (verbatim_clause
(verbatim_content) (verbatim_block
(pop_verbatim)) (push_verbatim))
(verbatim_content))
(endverbatim_block
(pop_verbatim)))
(content)) (content))
+46 -36
View File
@@ -12,12 +12,13 @@ With Basic
(content) (content)
(with_group (with_group
(with_clause (with_clause
variable: (identifier) (with_block
(filtered_value variable: (identifier)
(value (filtered_value
(variable_attribute (value
(identifier) (variable_attribute
(attribute)))) (identifier)
(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,16 +44,17 @@ With Multiple Variables
(content) (content)
(with_group (with_group
(with_clause (with_clause
variable: (identifier) (with_block
(filtered_value variable: (identifier)
(value (filtered_value
(literal (value
(number)))) (literal
variable: (identifier) (number))))
(filtered_value variable: (identifier)
(value (filtered_value
(literal (value
(number)))) (literal
(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
variable: (identifier) (with_block
(filtered_value variable: (identifier)
(value (filtered_value
(literal (value
(number)))) (literal
(number)))))
(template (template
(content)))) (content)))
(endwith_block))
(with_group (with_group
(with_clause (with_clause
variable: (identifier) (with_block
(filtered_value variable: (identifier)
(value (filtered_value
(literal (value
(number)))) (literal
(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
variable: (identifier) (with_block
(filtered_value variable: (identifier)
(value (filtered_value
(literal (value
(number)))) (literal
(number)))))
(template (template
(content)))) (content)))
(endwith_block))
(content)) (content))