src/basilisp/lang/compiler/generator.py
def statementize(e: ast.AST) -> ast.AST:
    """Transform non-statements into ast.Expr nodes so they can
    stand alone as statements."""
    # noinspection PyPep8
    if isinstance(
        e,
        (
            ast.Assign,
            ast.AnnAssign,
            ast.AugAssign,
            ast.Expr,
            ast.Raise,
            ast.Assert,
            ast.Pass,
            ast.Import,
            ast.ImportFrom,
            ast.If,
            ast.For,
            ast.While,
            ast.Continue,
            ast.Break,
            ast.Try,
            ast.ExceptHandler,
            ast.With,
            ast.FunctionDef,
            ast.Return,
            ast.Yield,
            ast.YieldFrom,
            ast.Global,
            ast.ClassDef,
            ast.AsyncFunctionDef,
            ast.AsyncFor,
            ast.AsyncWith,
        ),
    ):
        return e
    return ast.Expr(value=e)
def statementize(e: ast.AST) -> ast.AST:
    # noinspection PyPep8
    if isinstance(
        e,
        (
            ast.Assign,
            ast.AnnAssign,
            ast.AugAssign,
            ast.Expr,
            ast.Raise,
            ast.Assert,
            ast.Pass,
            ast.Import,
            ast.ImportFrom,
            ast.If,
            ast.For,
            ast.While,
            ast.Continue,
            ast.Break,
            ast.Try,
            ast.ExceptHandler,
            ast.With,
            ast.FunctionDef,
            ast.Return,
            ast.Yield,
            ast.YieldFrom,
            ast.Global,
            ast.ClassDef,
            ast.AsyncFunctionDef,
            ast.AsyncFor,
            ast.AsyncWith,
        ),
    ):
        return e
    return ast.Expr(value=e)
def statementize ( e : ast . AST ) -> ast . AST : # noinspection PyPep8 if isinstance ( e , ( ast . Assign , ast . AnnAssign , ast . AugAssign , ast . Expr , ast . Raise , ast . Assert , ast . Pass , ast . Import , ast . ImportFrom , ast . If , ast . For , ast . While , ast . Continue , ast . Break , ast . Try , ast . ExceptHandler , ast . With , ast . FunctionDef , ast . Return , ast . Yield , ast . YieldFrom , ast . Global , ast . ClassDef , ast . AsyncFunctionDef , ast . AsyncFor , ast . AsyncWith , ) , ) : return e return ast . Expr ( value = e )
Transform non-statements into ast.Expr nodes so they can
    stand alone as statements.
Transform non - statements into ast . Expr nodes so they can stand alone as statements .