liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Invalid Variable Handling

Open greeneca opened this issue 14 years ago • 2 comments

When using a tag that assigns a variable, such as a for loop, it seems to accept variable names that it shouldn't. for instance if I try:

{% for a/b in x %}
    #Do Stuff
{% endfor %}

The variable that is assigned is b not a/b or a

greeneca avatar Oct 18 '12 14:10 greeneca

@greeneca i think that a/b is not a valid variable name in liquid. from what i can see, only word-characters are allowed (characters, numbers and the underscore)

phoet avatar Jun 09 '13 13:06 phoet

I think I probably meant to say that it should throw a parse error, not actually set the variable a/b.

Charlie Greene [email protected]

On Sun, Jun 9, 2013 at 10:32 AM, Peter Schröder [email protected]:

@greeneca https://github.com/greeneca i think that a/b is not a valid variable name in liquid. from what i can see, only word-characters are allowed (characters, numbers and the underscore)

— Reply to this email directly or view it on GitHubhttps://github.com/Shopify/liquid/issues/150#issuecomment-19166148 .

greeneca avatar Jun 10 '13 01:06 greeneca