Enum move_ir_types::ast::Statement_
source · [−]pub enum Statement_ {
Abort(Option<Box<Exp>>),
Assert(Box<Exp>, Box<Exp>),
Return(Box<Exp>),
Assign(Vec<LValue>, Exp),
Exp(Box<Exp>),
Jump(BlockLabel),
JumpIf(Box<Exp>, BlockLabel),
JumpIfFalse(Box<Exp>, BlockLabel),
Unpack(StructName, Vec<Type>, Fields<Var>, Box<Exp>),
}
Expand description
A Block_
is composed of zero or more “statements,” which can be translated into one or more
bytecode instructions.
Variants
Abort(Option<Box<Exp>>)
abort e
.
Assert(Box<Exp>, Box<Exp>)
assert(e_1, e_2)
Return(Box<Exp>)
return e_1, ... , e_j
Assign(Vec<LValue>, Exp)
l_1, ..., l_n = e
Exp(Box<Exp>)
A statement representing an expression e
.
Jump(BlockLabel)
jump lbl
JumpIf(Box<Exp>, BlockLabel)
jump_if (e) lbl
JumpIfFalse(Box<Exp>, BlockLabel)
jump_if_false (e) lbl
Unpack(StructName, Vec<Type>, Fields<Var>, Box<Exp>)
n { f_1: x_1, ... , f_j: x_j } = e
Implementations
sourceimpl Statement_
impl Statement_
sourcepub fn return_empty() -> Self
pub fn return_empty() -> Self
Creates a statement that returns no values.
Trait Implementations
sourceimpl Clone for Statement_
impl Clone for Statement_
sourcefn clone(&self) -> Statement_
fn clone(&self) -> Statement_
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Statement_
impl Debug for Statement_
sourceimpl Display for Statement_
impl Display for Statement_
sourceimpl PartialEq<Statement_> for Statement_
impl PartialEq<Statement_> for Statement_
sourcefn eq(&self, other: &Statement_) -> bool
fn eq(&self, other: &Statement_) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Statement_) -> bool
fn ne(&self, other: &Statement_) -> bool
This method tests for !=
.
impl StructuralPartialEq for Statement_
Auto Trait Implementations
impl RefUnwindSafe for Statement_
impl Send for Statement_
impl Sync for Statement_
impl Unpin for Statement_
impl UnwindSafe for Statement_
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more