Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contextual analysis: Counting local variables in copied render contexts #92

Closed
jg-rp opened this issue Dec 20, 2022 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@jg-rp
Copy link
Owner

jg-rp commented Dec 20, 2022

We currently fail to count assign, capture, decrement and increment variables that appear in copied render contexts (like those used with {% render %}, for example).

When calling analyze_with_context() on bar.liquid below, we count other twice in all_variables and once in undefined_variables, but other does not appear in local_variables. Counting other as a local variable from line 1 of foo.liquid is probably more useful.

foo.liquid

{% assign other = 42 %}
{{ other }}

bar.liquid

{% assign some = 7 %}
{% render "foo.liquid" %}
{{ other }}
@jg-rp jg-rp added the bug Something isn't working label Dec 20, 2022
@jg-rp jg-rp closed this as completed in 1c165d8 Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant