improved scope rules
This commit is contained in:
1 parent
ca01dd5f95
commit
aceae012fa
7 files changed
+15412
-15051
No files matched your search
@@ -3,5 +3,17 @@
|
||||
|
||||
variable: (identifier) @local.definition
|
||||
|
||||
; The tags whose Node pushes a context, so that what they bind is not visible
|
||||
; after them. Verified by rendering: "{% block b %}{% now "Y" as n %}{% endblock %}{{ n }}"
|
||||
; is empty, while the same around an "{% if %}" is not, because if does not push.
|
||||
(with_clause) @local.scope
|
||||
(for_clause) @local.scope
|
||||
(block_clause) @local.scope
|
||||
(partialdef_clause) @local.scope
|
||||
|
||||
; blocktranslate pushes a context for its "with" and "count" bindings. Its
|
||||
; asvar target is not one of them: it is written in the same tag but assigned
|
||||
; outside it, and carries an "asvar" field rather than "variable" so that this
|
||||
; scope does not swallow it. A tool that wants it must define it in the scope
|
||||
; around the block, which a locals query has no way to say.
|
||||
(blocktranslate_group) @local.scope
|
||||
Reference in new issue
Block a user