src/basilisp/lang/compiler/generator.py
def __fn_recur_to_py_ast(ctx: GeneratorContext, node: Recur) -> GeneratedPyAST:
    """Return a Python AST node for `recur` occurring inside a `fn*`."""
    assert node.op == NodeOp.RECUR
    assert ctx.recur_point.is_variadic is not None
    recur_nodes: List[ast.AST] = []
    recur_deps: List[ast.AST] = []
    for expr in node.exprs:
        expr_ast = gen_py_ast(ctx, expr)
        recur_nodes.append(expr_ast.node)
        recur_deps.extend(expr_ast.dependencies)

    return GeneratedPyAST(
        node=ast.Call(
            func=_TRAMPOLINE_ARGS_FN_NAME,
            args=list(
                chain([ast.NameConstant(ctx.recur_point.is_variadic)], recur_nodes)
            ),
            keywords=[],
        ),
        dependencies=recur_deps,
    )
def __fn_recur_to_py_ast(ctx: GeneratorContext, node: Recur) -> GeneratedPyAST:
    """Return a Python AST node for `recur` occurring inside a `fn*`."""
    assert node.op == NodeOp.RECUR
    assert ctx.recur_point.is_variadic is not None
    recur_nodes: List[ast.AST] = []
    recur_deps: List[ast.AST] = []
    for expr in node.exprs:
        expr_ast = gen_py_ast(ctx, expr)
        recur_nodes.append(expr_ast.node)
        recur_deps.extend(expr_ast.dependencies)

    return GeneratedPyAST(
        node=ast.Call(
            func=_TRAMPOLINE_ARGS_FN_NAME,
            args=list(
                chain([ast.NameConstant(ctx.recur_point.is_variadic)], recur_nodes)
            ),
            keywords=[],
        ),
        dependencies=recur_deps,
    )
def __fn_recur_to_py_ast ( ctx : GeneratorContext , node : Recur ) -> GeneratedPyAST : assert node . op == NodeOp . RECUR assert ctx . recur_point . is_variadic is not None recur_nodes : List [ ast . AST ] = [ ] recur_deps : List [ ast . AST ] = [ ] for expr in node . exprs : expr_ast = gen_py_ast ( ctx , expr ) recur_nodes . append ( expr_ast . node ) recur_deps . extend ( expr_ast . dependencies ) return GeneratedPyAST ( node = ast . Call ( func = _TRAMPOLINE_ARGS_FN_NAME , args = list ( chain ( [ ast . NameConstant ( ctx . recur_point . is_variadic ) ] , recur_nodes ) ) , keywords = [ ] , ) , dependencies = recur_deps , )
Return a Python AST node for `recur` occurring inside a `fn*`.
Return a Python AST node for recur occurring inside a fn * .