Skip to content

Conversation

@osteele
Copy link
Owner

@osteele osteele commented Nov 15, 2025

This commit implements support for the 'or' operator in 'when' clauses of case statements, matching the official Shopify Liquid specification.

Changes:

  • Modified expressions.y grammar to accept 'or' as an alternative separator to commas in the expr2 rule for when statements
  • Regenerated y.go parser from the updated grammar
  • Added comprehensive test cases for 'or' operator usage:
    • Integer values with 'or' operator
    • String values matching Shopify documentation examples
    • Multiple 'or' operators (e.g., 1 or 2 or 3)

The implementation now supports both syntaxes as specified in the Shopify documentation:

  • Comma-separated: {% when 1, 2 %}
  • OR operator: {% when 1 or 2 %}
  • Multiple ORs: {% when 1 or 2 or 3 %}

All existing tests continue to pass, confirming backward compatibility.

This commit implements support for the 'or' operator in 'when' clauses
of case statements, matching the official Shopify Liquid specification.

Changes:
- Modified expressions.y grammar to accept 'or' as an alternative
  separator to commas in the expr2 rule for when statements
- Regenerated y.go parser from the updated grammar
- Added comprehensive test cases for 'or' operator usage:
  * Integer values with 'or' operator
  * String values matching Shopify documentation examples
  * Multiple 'or' operators (e.g., 1 or 2 or 3)

The implementation now supports both syntaxes as specified in the
Shopify documentation:
- Comma-separated: {% when 1, 2 %}
- OR operator: {% when 1 or 2 %}
- Multiple ORs: {% when 1 or 2 or 3 %}

All existing tests continue to pass, confirming backward compatibility.

Fixes #123
@osteele osteele changed the title Review and fix PR #123 documentation Implement OR operator Nov 15, 2025
@osteele osteele merged commit b9a72ce into main Nov 29, 2025
8 checks passed
@osteele osteele deleted the claude/verify-fix-pr-123-01UCRoZQayY2nCMuHTMfmYsH branch November 29, 2025 11:22
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