liquid
liquid copied to clipboard
Expose the template lexical environment
I like to implement a tag, that require the full lexical context (bindings) to be copied. Currently the render.Context interface exposes the Get and Set function to manipulate the bindings, but those don't let me iterate over the whole thing. Thus, this PR adds a function that returns the full bindings. Usage example:
func (tc tagContext) myTag(rc render.Context) (s string, err error) {
bindings := rc.Bindings()
...
}
Checklist
- [x] I have read the contribution guidelines.
- [x]
make testpasses. - [x]
make lintpasses. - [ ] New and changed code is covered by tests.
- [ ] Performance improvements include benchmarks.
- [ ] Changes match the documented (not just the implemented) behavior of Shopify.