Commit b9a72ce
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
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 19586ab commit b9a72ce
File tree
4 files changed
+112
-92
lines changed- expressions
- tags
4 files changed
+112
-92
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments