pub enum IRStatement {
Show 17 variants
Return(Option<IRExpr>),
Assign {
target: String,
value: IRExpr,
var_type: Option<IRType>,
},
If {
condition: IRExpr,
then_body: Box<IRBody>,
else_body: Option<Box<IRBody>>,
},
Raise {
exception: Option<IRExpr>,
},
While {
condition: IRExpr,
body: Box<IRBody>,
},
Expression(IRExpr),
TryExcept {
try_body: Box<IRBody>,
except_handlers: Vec<IRExceptHandler>,
finally_body: Option<Box<IRBody>>,
},
For {
target: String,
iterable: IRExpr,
body: Box<IRBody>,
else_body: Option<Box<IRBody>>,
},
With {
context_expr: IRExpr,
optional_vars: Option<String>,
body: Box<IRBody>,
},
AttributeAssign {
object: IRExpr,
attribute: String,
value: IRExpr,
},
AugAssign {
target: String,
value: IRExpr,
op: IROp,
},
AttributeAugAssign {
object: IRExpr,
attribute: String,
value: IRExpr,
op: IROp,
},
DynamicImport {
target: String,
module_name: IRExpr,
},
IndexAssign {
container: IRExpr,
index: IRExpr,
value: IRExpr,
},
TupleUnpack {
targets: Vec<String>,
value: IRExpr,
},
Yield {
value: Option<IRExpr>,
},
ImportModule {
module_name: String,
alias: Option<String>,
},
}Expand description
IR representation of statements
Variants§
Return(Option<IRExpr>)
Assign
If
Raise
While
Expression(IRExpr)
TryExcept
Fields
§
except_handlers: Vec<IRExceptHandler>For
With
AttributeAssign
AugAssign
AttributeAugAssign
DynamicImport
IndexAssign
TupleUnpack
Yield
ImportModule
Trait Implementations§
Source§impl Clone for IRStatement
impl Clone for IRStatement
Source§fn clone(&self) -> IRStatement
fn clone(&self) -> IRStatement
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IRStatement
impl RefUnwindSafe for IRStatement
impl Send for IRStatement
impl Sync for IRStatement
impl Unpin for IRStatement
impl UnwindSafe for IRStatement
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more