Repository navigation
WIP4 - #168
Draft
charlespwd wants to merge 1 commit into
Draft
WIP4#168charlespwd wants to merge 1 commit into
charlespwd wants to merge 1 commit into
Conversation
This was referenced Oct 27, 2026
Closed
Draft
Closed
This branch has not been deployed
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.
Warning
Research / WIP
Experimental output from
liquid-factory, shared for design and code feedback. This is a research draft for the WIP3 stack, not a merge-ready language change.In this PR
Add conformance cases for WIP3 expressions in
forcollections,limitand numericoffset.Problem
The loop parser still rejects expression forms that WIP3 already accepts in
assign. Extending it needs both new-behavior cases and fixed expectations for existing successful loops.Solution
specs/liquid_ruby/for_shared_expressions.ymlcovers grouped and ungrouped expressions, modifier boundaries, loop metadata, ranges, continuation, reversed iteration and empty loops. Existing-output expectations come from the pinned WIP3 baseline; the new results are the human-approved feature examples.Paired implementation: Shopify/liquid#2133. These cases target that WIP3 stack.
Feature boundary
Outcome
forcollections,limitandoffsetaccept the existing WIP3 expression forms, so a loop can use a grouped or boolean expression without first assigning it to a temporary variable.Scope
limitand numericoffsetvalues use expressions already supported by the WIP3 shared grammar: variable and property/index lookups, literals, ranges, groups, and logical, equality and comparison expressions where their value is meaningful in that position.orandandreturn operands, as they already do outsidefor.limit,offset,reversedandoffset: continuesyntax keeps its meaning. An expression-valued collection must not change the name/metadata or continuation behavior of loops that already succeed.case/whenalternatives keep their existingormeaning.Acceptance boundary
specs/liquid_ruby/for_shared_expressions.ymlstates the approved new results and byte-identical preservation cases.limitandoffset; the cases use existing operand-return behavior and positive integer operands without adding numeric coercion rules. A combined case preserves the collection/limit/offset/reversed boundaries.limitandoffset;offset: continue; reversed order; and empty/elsehandling.whenalternatives remain unchanged. The compatibility case protects their existing meaning while theforgrammar is broadened.Non-goals
offset: continue,reversed, orcase/whenalternatives.Dependencies
cp-boolean-expressions: the existing shared expression grammar and its evaluation behavior. Present at the pinned Liquid baseecf53f7af7749237b639579792e4c681cbd4a480; this run's Liquid PR targets that branch, notmain.aac52d5c55627375ff4e6984d1ce53e53e61afed.These cases are examples, not proof that every possible template keeps its output.