-
Notifications
You must be signed in to change notification settings - Fork 77
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
Unable to use a variable or value index for object in assign tag #207
Comments
chippers
changed the title
Unable to use variable object index in assign tag
Unable to use variable or value index for object in assign tag
Oct 4, 2018
chippers
changed the title
Unable to use variable or value index for object in assign tag
Unable to use a variable or value index for object in assign tag
Oct 4, 2018
epage
added a commit
to epage/liquid-rust
that referenced
this issue
Oct 5, 2018
This does not fix it so the filter arguments support indexing. Fixes cobalt-org#207
I actually got something to work! Going to bed soon, it'll probably be tomorrow morning before I finish the merges and get the releases out |
epage
added a commit
to epage/liquid-rust
that referenced
this issue
Oct 5, 2018
This does not fix it so the filter arguments support indexing. Fixes cobalt-org#207
epage
added a commit
to epage/liquid-rust
that referenced
this issue
Oct 5, 2018
This does not fix it so the filter arguments support indexing. Fixes cobalt-org#207
epage
added a commit
to epage/liquid-rust
that referenced
this issue
Oct 5, 2018
This does not fix it so the filter arguments support indexing. Fixes cobalt-org#207
New cobalt release is now out! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
liquid-rust version: 0.16.0
rust version: 1.29.1
OS: Xubuntu 18.04
Hi again, and thanks for such a rapid fix yesterday.
Here, we are unable to use a value as an index to an object in an assign tag. I've updated the small testable case from yesterday as an example.
The failure is in assign, it works when
kv[1].name
is directly used. (what is the name of the{{ }}
blocks?)This is used quite a lot in arewewebyet, and many Jekyll project's I've written/read make use of this feature to shorthand variables that are otherwise unwieldy. It's possible to not use it, but this feature makes reading the code a lot easier.
I took a quick look at perhaps implementing the fix myself, but after a small bit of reading it seems like the fix would likely be relatively invasive for a codebase I am not familiar with yet. Here's some of the things I found that might help:
FilterChain
fn parse_output
expects there to only be a singleToken
of input to turn into anArgument
[Identifier("kv"), OpenSquare, IntegerLiteral(1), CloseSquare, Dot, Identifier("name")]
for the inputkv[1].name
liquid-c
, the parser has a special case forToken::OpenSquare
inparse_expression
andparse_variable
. It also has a special case forToken::Dot
, but inliquid-rust
the dots are already handled and put inside a single identifier - likeIdentifier("site.data.authors")
.Hopefully some of that is helpful, again not yet familiar with the codebase.
Thanks
The text was updated successfully, but these errors were encountered: