def set_macro(parser, expression, name): """Macro that allows setting of a value in the context.""" return partial(set_node, expression_evaluator(expression), name_setter(name))
def for_macro(parser, name, expression): """A macro that implements a 'for' loop.""" match, block = parser.parse_block("for", "endfor", RE_ENDFOR) return partial(for_node, name_setter(name), expression_evaluator(expression), block)