Compare loop semantics with Ruby implementation#117
Merged
osteele merged 3 commits intoNov 8, 2025
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make testpasses.make lintpasses.