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
Lua tables that contains objects are not rendered with pongo2 #119
Comments
Thanks for reporting! I'll look into this. |
@usernope what is your expected output? If the output is really blank, Algernon's only failing is probably that it does not output |
@tooolbox I've tried it with just the text "test2" and it doesn't render it. object_list seems to have a length of 0. |
Ah, so the output contains no instances of the text Interesting. This, or approximately this, was working as of #79 so perhaps some kind of regression. |
Hi, I'd just like to check if anyone has managed to reproduce the problem or if it's something on my side. Thanks. |
I reproduced with the latest release on Windows. Straight sequences and key-value tables work fine, but nesting a table makes the length zero. Also checked with I had a suspicion which turned out to be true, though: I don't use |
Thanks @tooolbox serve2 seems to work with pongo2 for now. |
If I place I get:
Could you please let me know:
@tooolbox Does this appear to work on Windows when using the latest |
Hey @xyproto I believe the problem is the output should look roughly like this:
But you just get this:
The whole second loop generates no output and if you do I tested and repro'd with latest release rather than latest commit, because I don't actually have a Go compiler on this windows box, long story 😅 But, quickly scanning over the interim commit messages, I don't see anything that would seem to affect this? |
When adding some logging to Algernon, for what the Lua state contains, I get this: INFO[3816] GOT <nil>: o2 ==> map[1:2] (map[int]int)
INFO[3816] GOT <nil>: number_list ==> map[1:1 2:2 3:3] (map[int]int)
INFO[3816] GOT <nil>: o1 ==> map[1:1] (map[int]int)
INFO[3816] GOT <nil>: _G ==> map[_GOPHER_LUA_VERSION:GopherLua 0.1 _VERSION:Lua 5.1 title:This is the title] (map[string]string)
INFO[3816] GOT <nil>: math ==> map[huge:9223372036854775807 pi:3] (map[string]int)
INFO[3816] GOT <nil>: o3 ==> map[1:3] (map[int]int) It looks like I wonder if this could be an issue with the Lua interpreter, or if maps of objects just needs to be handled in a different way within Algernon. I'll check the type of |
I think the "next action" here might be to switch to a different Lua implementation. |
Oh my! Well, is it really the Lua implementation, or is the implementation of the
Just something to check into before you need to go to those lengths, I think. |
You are right. I think my comment was a bit rushed. There is also #126, thought, that I am contemplating how to resolve without changing the Lua implementation. |
I'm using algernon to try to output data from a lua script into a pongo2 template.
In the code below number_list outputs exactly as I'd expect but nothing renders for object_list.
What am I doing wrong?
data.lua
index.po2
The text was updated successfully, but these errors were encountered: