tyler-sommer / stick

A golang port of the Twig templating engine
MIT License
183 stars 36 forks source link

Parse errors when accessing properties #12

Closed tyler-sommer closed 4 years ago

tyler-sommer commented 7 years ago
parse: expected "ARRAY_CLOSE", got "PUNCTUATION" in 
{{ prices[item.ID] }}

parse: expected "TAG_CLOSE", got "PUNCTUATION" in 
{{ get_index(item.ID, prices)*item.Quantity }}
tyler-sommer commented 5 years ago

Not abandoned!

I use stick pretty regularly in my own projects and find it to be pretty stable. This bug in particular just means parentheses must be used to group expressions, so I haven't bothered to worry about it. The most annoying part is expressions inside array indexes, which must be grouped:

{{ prices[(some_func(item.ID))] }}

If you're interested in using or contributing to stick, I'm more than happy to help in whatever way I can. Same goes for any problems you run into or questions-- please open an issue and I'm happy to (hopefully) help get it sorted out :)