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

Syntax error in assign statement #76

Open
rom-from-meiro opened this issue Feb 13, 2023 · 0 comments
Open

Syntax error in assign statement #76

rom-from-meiro opened this issue Feb 13, 2023 · 0 comments

Comments

@rom-from-meiro
Copy link

Checklist

  • [✓] I have searched the issue list
  • [✓] I have tested my example against Shopify Liquid. (This isn't necessary if the actual behavior is a panic, or an error for which IsTemplateError returns false.)

Expected Behavior

Ability to parse condition assignment in assign tag.

Actual Behavior

syntax error

2023/02/13 13:33:22 Liquid error (line 1): syntax error in "%assign con_0_Euh43 = user.name == \"Ryan\" and user.email == \"xx@gmail.com\"" in {% assign con_0_Euh43 = user.name == "Ryan" and user.email == "xx@gmail.com" %}

Detailed Description

While liquidjs correctly parses it this go implementation not.
See https://liquidjs.com/playground.html#eyUgYXNzaWduIGNvbl8wX0V1aDQzID0gdXNlci5uYW1lID09ICJSeWFuIiBhbmQgdXNlci5lbWFpbCA9PSAieHhAZ21haWwuY29tIiAlfSAKeyUgYXNzaWduIGNvbl8xX0V1aDQzID0gdXNlci5wcm9qZWN0ID09ICJFYXN5IGVtYWlsIiAlfSAKe3sgY29uXzBfRXVoNDMgfX0Ke3sgY29uXzFfRXVoNDMgfX0KeyUgaWYgY29uXzBfRXVoNDMgYW5kIGNvbl8xX0V1aDQzICV9CiAgPHA+SGVsbG88L3A+CnslIGVuZGlmICV9,ewogICJ1c2VyIjogewogICAgIm5hbWUiOiAiUnlhbiIsCiAgICAiZW1haWwiOiAieHhAZ21haWwuY29tIiwKICAgICJwcm9qZWN0IjogIkVhc3kgZW1haWwiCiAgfQp9
Even though it can be rewritten to use in if statement directly it is not a solution for because we are using https://github.com/zalify/easy-email which is making these assign statements

Possible Solution

I don't know. But I can help if you direct to somewhere.

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 a pull request may close this issue.

1 participant