[][src]Enum rustpython_parser::ast::StatementType

pub enum StatementType {
    Break,
    Continue,
    Return {
        value: Option<Expression>,
    },
    Import {
        names: Vec<ImportSymbol>,
    },
    ImportFrom {
        level: usize,
        module: Option<String>,
        names: Vec<ImportSymbol>,
    },
    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>,
    },
    AnnAssign {
        target: Box<Expression>,
        annotation: Box<Expression>,
        value: Option<Expression>,
    },
    Expression {
        expression: Expression,
    },
    Global {
        names: Vec<String>,
    },
    Nonlocal {
        names: Vec<String>,
    },
    If {
        test: Expression,
        body: Suite,
        orelse: Option<Suite>,
    },
    While {
        test: Expression,
        body: Suite,
        orelse: Option<Suite>,
    },
    With {
        is_async: bool,
        items: Vec<WithItem>,
        body: Suite,
    },
    For {
        is_async: bool,
        target: Box<Expression>,
        iter: Box<Expression>,
        body: Suite,
        orelse: Option<Suite>,
    },
    Raise {
        exception: Option<Expression>,
        cause: Option<Expression>,
    },
    Try {
        body: Suite,
        handlers: Vec<ExceptHandler>,
        orelse: Option<Suite>,
        finalbody: Option<Suite>,
    },
    ClassDef {
        name: String,
        body: Suite,
        bases: Vec<Expression>,
        keywords: Vec<Keyword>,
        decorator_list: Vec<Expression>,
    },
    FunctionDef {
        is_async: bool,
        name: String,
        args: Box<Parameters>,
        body: Suite,
        decorator_list: Vec<Expression>,
        returns: Option<Expression>,
    },
}

Abstract syntax tree nodes for python statements.

Variants

Break
Continue
Return

Fields of Return

value: Option<Expression>
Import

Fields of Import

names: Vec<ImportSymbol>
ImportFrom

Fields of ImportFrom

level: usizemodule: Option<String>names: Vec<ImportSymbol>
Pass
Assert

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>
AnnAssign

Fields of AnnAssign

target: Box<Expression>annotation: Box<Expression>value: Option<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: Suiteorelse: Option<Suite>
While

Fields of While

test: Expressionbody: Suiteorelse: Option<Suite>
With

Fields of With

is_async: boolitems: Vec<WithItem>body: Suite
For

Fields of For

is_async: booltarget: Box<Expression>iter: Box<Expression>body: Suiteorelse: Option<Suite>
Raise

Fields of Raise

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

Fields of Try

body: Suitehandlers: Vec<ExceptHandler>orelse: Option<Suite>finalbody: Option<Suite>
ClassDef

Fields of ClassDef

name: Stringbody: Suitebases: Vec<Expression>keywords: Vec<Keyword>decorator_list: Vec<Expression>
FunctionDef

Fields of FunctionDef

is_async: boolname: Stringargs: Box<Parameters>body: Suitedecorator_list: Vec<Expression>returns: Option<Expression>

Trait Implementations

impl PartialEq<StatementType> for StatementType[src]

impl Debug for StatementType[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for 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]