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

Bracketed identifier parsing with and without dots #39

Open
jg-rp opened this issue Jan 11, 2022 · 2 comments
Open

Bracketed identifier parsing with and without dots #39

jg-rp opened this issue Jan 11, 2022 · 2 comments
Labels
future Fixes to be included in the 'future' environment

Comments

@jg-rp
Copy link
Owner

jg-rp commented Jan 11, 2022

Python liquid will successfully parse a chained identifier containing a bracketed index or identifier, followed immediately by another identifier, with no separating dot.

{{ products[0]title }}

Ruby Liquid will raise a Liquid::SyntaxError when parsing the above template, instead expecting {{ products[0].title }}. Python Liquid will accept either without error.

Similarly, Python Liquid will handle {{ products.[0].title }}, while Ruby Liquid will again raise a Liquid::SyntaxError.

@jg-rp
Copy link
Owner Author

jg-rp commented Jan 23, 2022

Related, Python Liquid will parse {{ products.0.title }} and {{ products[0].title }}. Ruby Liquid only accepts the later, raising a Liquid::SyntaxError for the former, whether in strict mode or not.

@jg-rp
Copy link
Owner Author

jg-rp commented Jan 23, 2022

And, with the initial example of {{ products[0]title }}, Ruby Liquid only raise an exception in strict mode. Lax mode does parse it successfully.

@jg-rp jg-rp added the version 2 Fix or include in version 2 of Python Liquid label Mar 15, 2022
@jg-rp jg-rp added future Fixes to be included in the 'future' environment and removed version 2 Fix or include in version 2 of Python Liquid labels Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future Fixes to be included in the 'future' environment
Projects
None yet
Development

No branches or pull requests

1 participant