[][src]Enum rustpython_parser::ast::Statement

pub enum Statement {
    Break,
    Continue,
    Return {
        value: Option<Box<Expression>>,
    },
    Import {
        import_parts: Vec<SingleImport>,
    },
    Pass,
    Assert {
        test: Expression,
        msg: Option<Expression>,
    },
    Delete {
        targets: Vec<Expression>,
    },
    Assign {
        targets: Vec<Expression>,
        value: Expression,
    },
    AugAssign {
        target: Box<Expression>,
        op: Operator,
        value: Box<Expression>,
    },
    Expression {
        expression: Expression,
    },
    Global {
        names: Vec<String>,
    },
    Nonlocal {
        names: Vec<String>,
    },
    If {
        test: Expression,
        body: Vec<LocatedStatement>,
        orelse: Option<Vec<LocatedStatement>>,
    },
    While {
        test: Expression,
        body: Vec<LocatedStatement>,
        orelse: Option<Vec<LocatedStatement>>,
    },
    With {
        items: Vec<WithItem>,
        body: Vec<LocatedStatement>,
    },
    For {
        target: Expression,
        iter: Expression,
        body: Vec<LocatedStatement>,
        orelse: Option<Vec<LocatedStatement>>,
    },
    AsyncFor {
        target: Expression,
        iter: Expression,
        body: Vec<LocatedStatement>,
        orelse: Option<Vec<LocatedStatement>>,
    },
    Raise {
        exception: Option<Expression>,
        cause: Option<Expression>,
    },
    Try {
        body: Vec<LocatedStatement>,
        handlers: Vec<ExceptHandler>,
        orelse: Option<Vec<LocatedStatement>>,
        finalbody: Option<Vec<LocatedStatement>>,
    },
    ClassDef {
        name: String,
        body: Vec<LocatedStatement>,
        bases: Vec<Expression>,
        keywords: Vec<Keyword>,
        decorator_list: Vec<Expression>,
    },
    FunctionDef {
        name: String,
        args: Parameters,
        body: Vec<LocatedStatement>,
        decorator_list: Vec<Expression>,
        returns: Option<Expression>,
    },
    AsyncFunctionDef {
        name: String,
        args: Parameters,
        body: Vec<LocatedStatement>,
        decorator_list: Vec<Expression>,
        returns: Option<Expression>,
    },
}

Abstract syntax tree nodes for python statements.

Variants

BreakContinueReturn

Fields of Return

value: Option<Box<Expression>>
Import

Fields of Import

import_parts: Vec<SingleImport>
PassAssert

Fields of Assert

test: Expressionmsg: Option<Expression>
Delete

Fields of Delete

targets: Vec<Expression>
Assign

Fields of Assign

targets: Vec<Expression>value: Expression
AugAssign

Fields of AugAssign

target: Box<Expression>op: Operatorvalue: Box<Expression>
Expression

Fields of Expression

expression: Expression
Global

Fields of Global

names: Vec<String>
Nonlocal

Fields of Nonlocal

names: Vec<String>
If

Fields of If

test: Expressionbody: Vec<LocatedStatement>orelse: Option<Vec<LocatedStatement>>
While

Fields of While

test: Expressionbody: Vec<LocatedStatement>orelse: Option<Vec<LocatedStatement>>
With

Fields of With

items: Vec<WithItem>body: Vec<LocatedStatement>
For

Fields of For

target: Expressioniter: Expressionbody: Vec<LocatedStatement>orelse: Option<Vec<LocatedStatement>>
AsyncFor

Fields of AsyncFor

target: Expressioniter: Expressionbody: Vec<LocatedStatement>orelse: Option<Vec<LocatedStatement>>
Raise

Fields of Raise

exception: Option<Expression>cause: Option<Expression>
Try

Fields of Try

body: Vec<LocatedStatement>handlers: Vec<ExceptHandler>orelse: Option<Vec<LocatedStatement>>finalbody: Option<Vec<LocatedStatement>>
ClassDef

Fields of ClassDef

name: Stringbody: Vec<LocatedStatement>bases: Vec<Expression>keywords: Vec<Keyword>decorator_list: Vec<Expression>
FunctionDef

Fields of FunctionDef

name: Stringargs: Parametersbody: Vec<LocatedStatement>decorator_list: Vec<Expression>returns: Option<Expression>
AsyncFunctionDef

Fields of AsyncFunctionDef

name: Stringargs: Parametersbody: Vec<LocatedStatement>decorator_list: Vec<Expression>returns: Option<Expression>

Trait Implementations

impl PartialEq<Statement> for Statement[src]

impl Debug for Statement[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]