rustpython-parser 0.4.0

Python language parser for Python3.
Documentation
---
source: parser/src/parser.rs
expression: parse_ast
---
Call(
    ExprCall {
        range: 0..141,
        func: Attribute(
            ExprAttribute {
                range: 0..8,
                value: Constant(
                    ExprConstant {
                        range: 0..3,
                        value: Str(
                            " ",
                        ),
                        kind: None,
                    },
                ),
                attr: Identifier(
                    "join",
                ),
                ctx: Load,
            },
        ),
        args: [
            GeneratorExp(
                ExprGeneratorExp {
                    range: 14..139,
                    elt: Name(
                        ExprName {
                            range: 14..17,
                            id: Identifier(
                                "sql",
                            ),
                            ctx: Load,
                        },
                    ),
                    generators: [
                        Comprehension {
                            range: 22..139,
                            target: Name(
                                ExprName {
                                    range: 26..29,
                                    id: Identifier(
                                        "sql",
                                    ),
                                    ctx: Store,
                                },
                            ),
                            iter: Tuple(
                                ExprTuple {
                                    range: 33..139,
                                    elts: [
                                        IfExp(
                                            ExprIfExp {
                                                range: 43..80,
                                                test: Name(
                                                    ExprName {
                                                        range: 65..70,
                                                        id: Identifier(
                                                            "limit",
                                                        ),
                                                        ctx: Load,
                                                    },
                                                ),
                                                body: BinOp(
                                                    ExprBinOp {
                                                        range: 43..61,
                                                        left: Constant(
                                                            ExprConstant {
                                                                range: 43..53,
                                                                value: Str(
                                                                    "LIMIT %d",
                                                                ),
                                                                kind: None,
                                                            },
                                                        ),
                                                        op: Mod,
                                                        right: Name(
                                                            ExprName {
                                                                range: 56..61,
                                                                id: Identifier(
                                                                    "limit",
                                                                ),
                                                                ctx: Load,
                                                            },
                                                        ),
                                                    },
                                                ),
                                                orelse: Constant(
                                                    ExprConstant {
                                                        range: 76..80,
                                                        value: None,
                                                        kind: None,
                                                    },
                                                ),
                                            },
                                        ),
                                        IfExp(
                                            ExprIfExp {
                                                range: 90..132,
                                                test: Name(
                                                    ExprName {
                                                        range: 116..122,
                                                        id: Identifier(
                                                            "offset",
                                                        ),
                                                        ctx: Load,
                                                    },
                                                ),
                                                body: BinOp(
                                                    ExprBinOp {
                                                        range: 91..111,
                                                        left: Constant(
                                                            ExprConstant {
                                                                range: 91..102,
                                                                value: Str(
                                                                    "OFFSET %d",
                                                                ),
                                                                kind: None,
                                                            },
                                                        ),
                                                        op: Mod,
                                                        right: Name(
                                                            ExprName {
                                                                range: 105..111,
                                                                id: Identifier(
                                                                    "offset",
                                                                ),
                                                                ctx: Load,
                                                            },
                                                        ),
                                                    },
                                                ),
                                                orelse: Constant(
                                                    ExprConstant {
                                                        range: 128..132,
                                                        value: None,
                                                        kind: None,
                                                    },
                                                ),
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                },
                            ),
                            ifs: [],
                            is_async: false,
                        },
                    ],
                },
            ),
        ],
        keywords: [],
    },
)