pub enum Statement {
VarDeclaration {
var_type: Type,
name: String,
value: Option<Expr>,
line: usize,
},
ArrayDeclaration {
element_type: Type,
name: String,
size: Expr,
line: usize,
},
Assignment {
target: Expr,
value: Expr,
line: usize,
},
If {
condition: Expr,
body: Vec<Statement>,
else_if: Vec<(Expr, Vec<Statement>, usize)>,
else_body: Option<Vec<Statement>>,
else_line: usize,
line: usize,
},
While {
condition: Expr,
body: Vec<Statement>,
line: usize,
},
Switch {
switch_type: String,
expr: Expr,
cases: Vec<SwitchCase>,
default: Option<Vec<Statement>>,
default_index: usize,
line: usize,
},
Return {
values: Vec<Expr>,
line: usize,
},
Expression {
expr: Expr,
line: usize,
},
OrphanCase {
case: SwitchCase,
line: usize,
},
Empty,
}Variants§
VarDeclaration
ArrayDeclaration
Assignment
If
Fields
While
Switch
Fields
§
cases: Vec<SwitchCase>Return
Expression
OrphanCase
A case that appeared outside of a switch statement.
Parsed for error recovery; the type checker emits CASE_WITHOUT_SWITCH.
Empty
Trait Implementations§
Auto Trait Implementations§
impl Forget for Statement
impl Freeze for Statement
impl Move for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more