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

Raise a syntax error for an invalid range literal for ruby liquid parity #179

Merged
merged 1 commit into from Sep 1, 2022

Conversation

dylanahsmith
Copy link
Contributor

cc @charlespwd

Problem

Shopify/liquid#1607 fixed an exception during parsing, turning it into a proper Liquid::SyntaxError. However, that expression parsing had been ported to liquid-c, which had the same issue.

Solution

Use rb_check_funcall to handle the case where a literal range bound value doesn't respond to to_i and raise the same syntax error.

I'll open a corresponding liquid PR to fix the testing of this error.

@dylanahsmith dylanahsmith merged commit 6190681 into master Sep 1, 2022
@dylanahsmith dylanahsmith deleted the invalid-range-literal branch September 1, 2022 21:35
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.

None yet

2 participants