[−][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
A break
statement.
A continue
statement.
A return
statement.
This is used to return from a function.
Fields of Return
value: Option<Expression>
An import
statement.
Fields of Import
names: Vec<ImportSymbol>
An import
from
statement.
Fields of ImportFrom
A pass
statement.
An assert
statement.
Fields of Assert
test: Expression
msg: Option<Expression>
A del
statement, to delete some variables.
Fields of Delete
targets: Vec<Expression>
Variable assignment. Note that we can assign to multiple targets.
Fields of Assign
targets: Vec<Expression>
value: Expression
Augmented assignment.
Fields of AugAssign
A type annotated assignment.
Fields of AnnAssign
An expression used as a statement.
Fields of Expression
expression: Expression
The global
statement,
to declare names as global variables.
A nonlocal
statement,
to declare names a non-local variables.
An if
statement.
Fields of If
A while
statement.
Fields of While
The with
statement.
A for
statement.
Contains the body of the loop, and the else
clause.
Fields of For
A raise
statement.
Fields of Raise
exception: Option<Expression>
cause: Option<Expression>
A try
statement.
Fields of ClassDef
A function definition. Contains the name of the function, it's body some decorators and formal parameters to the function.
Fields of FunctionDef
is_async: bool
name: String
args: Box<Parameters>
body: Suite
decorator_list: Vec<Expression>
returns: Option<Expression>
Trait Implementations
impl Debug for StatementType
[src][+]
impl PartialEq<StatementType> for StatementType
[src][+]
impl StructuralPartialEq for StatementType
[src]
Auto Trait Implementations
impl RefUnwindSafe for StatementType
impl Send for StatementType
impl Sync for StatementType
impl Unpin for StatementType
impl UnwindSafe for StatementType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,