jinja2.environment.CodeGenerator.function_scoping

CodeGenerator.function_scoping(node, frame, children=None, find_special=True)[source]

In Jinja a few statements require the help of anonymous functions. Those are currently macros and call blocks and in the future also recursive loops. As there is currently technical limitation that doesn’t allow reading and writing a variable in a scope where the initial value is coming from an outer scope, this function tries to fall back with a common error message. Additionally the frame passed is modified so that the argumetns are collected and callers are looked up.

This will return the modified frame.