liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Allow loop modifiers to be more than just literals

Open aisbergg opened this issue 3 years ago • 0 comments

This PR adds the ability to specify variables and expressions in loop modifiers. Example:

{% assign limit = 3 %}
{% assign offset = 1 %}
{% for i in (1..5) limit:limit offset:offset %}
{{ i -}}
{%- endfor %}

results in:

2
3
4

Checklist

  • [x] I have read the contribution guidelines.
  • [x] make test passes.
  • [x] make lint passes.
  • [x] New and changed code is covered by tests.
  • [ ] Performance improvements include benchmarks.
  • [x] Changes match the documented (not just the implemented) behavior of Shopify.

aisbergg avatar Apr 22 '22 20:04 aisbergg