Skip to content

Conversation

@osteele
Copy link
Owner

@osteele osteele commented Nov 8, 2025

Checklist

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

This commit addresses issue #6 by investigating how the loop modifiers
(reversed, limit, offset) interact when used together.

Key findings:
- Go implementation: modifiers are always applied in fixed order
  (reversed → offset → limit) regardless of syntax order
- Ruby/Shopify Liquid: syntax order matters, and reversed only works
  when placed before named parameters (limit/offset)

Changes:
- Add LOOP_SEMANTICS_INVESTIGATION.md with detailed analysis
- Add test_ruby_liquid.rb for Ruby reference implementation testing
- Update iteration_tags_test.go with tests for combined modifiers
- Document the behavior differences from Ruby implementation

The Go implementation provides more consistent and predictable behavior
by using a fixed application order, though this differs from the Ruby
reference implementation.
- Move test_ruby_liquid.rb to scripts/ to keep it with other utility scripts
- Make script executable
- Update docs/loop-semantics.md to reference the new location
@osteele osteele merged commit 610c36d into main Nov 8, 2025
6 of 7 checks passed
@osteele osteele deleted the claude/investigate-loop-semantics-011CUv7arpgHRb2GnTyb4j8v branch November 8, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants