Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

or separated conditions in case/when #86

Closed
jg-rp opened this issue Dec 2, 2022 · 0 comments
Closed

or separated conditions in case/when #86

jg-rp opened this issue Dec 2, 2022 · 0 comments
Labels
bug Something isn't working incompatibility Behavioural differences between Python and Ruby Liquid

Comments

@jg-rp
Copy link
Owner

jg-rp commented Dec 2, 2022

Python Liquid supports ored when tag expressions by virtue of treating every when tag sub-expression as a complete boolean expression. This is not consistent with Ruby Liquid.

In general, Ruby Liquid will accept any conditional expression any int, float, range, literal or variable within a when tag "list", the result of which is compared to the case object. Handling of tokens that don't fall in to that list of expressions is "lax", meaning it is a little "fuzzy". If a when sub-expression (after splitting on or and ,) starts with invalid tokens, it is silently ignored. If a sub-expression starts with a valid int, float, range, literal or variable, trailing tokens will be silently ignored.

Also, Python Liquid's naive approach to splitting when expressions on , fails when a comma appears in a string literal.

@jg-rp jg-rp added incompatibility Behavioural differences between Python and Ruby Liquid bug Something isn't working labels Dec 2, 2022
@jg-rp jg-rp closed this as completed in 973b39c Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working incompatibility Behavioural differences between Python and Ruby Liquid
Projects
None yet
Development

No branches or pull requests

1 participant