Closed vsheffer closed 2 years ago
I have not handled the case of passing the environment so this may not be complete. If I need to add that please let me know.
I'm now thinking about removing environment.callFilter
, environment.callTest
, context.call
check and writing an AST modifier that looks into the Environment.passArrgument
and modifies AST from contextFunction(argument)
to contextFunction(contextRef, argument)
.
Thanks for PR, can you add environment case and new line before second var
and around if block?
Thanks.
In order to emulate macros I've added the ability to passContext to global functions. I'm not sure if this is in line with your future intentions for macros but this ability will allow my team to replace our current Python Jinaja2 macros with what we already have with no changes to the templates.