pub enum Stmt {
Show 20 variants
LocalDecl {
name: String,
init: Option<Expr>,
},
LocalMulti {
names: Vec<String>,
inits: Vec<Expr>,
},
Assign {
target: Vec<Expr>,
value: Vec<Expr>,
},
CompoundAssign {
target: Expr,
op: BinOp,
value: Expr,
},
Call(Expr),
Do(Vec<Stmt>),
While {
cond: Expr,
body: Vec<Stmt>,
},
RepeatUntil {
body: Vec<Stmt>,
cond: Expr,
},
If {
cond: Expr,
then_body: Vec<Stmt>,
elseif_branches: Vec<(Expr, Vec<Stmt>)>,
else_body: Option<Vec<Stmt>>,
},
NumericFor {
var: String,
start: Expr,
limit: Expr,
step: Option<Expr>,
body: Vec<Stmt>,
},
GenericFor {
vars: Vec<String>,
iter: Vec<Expr>,
body: Vec<Stmt>,
},
FuncDecl {
name: Vec<String>,
params: Vec<String>,
vararg: bool,
body: Vec<Stmt>,
},
LocalFunc {
name: String,
params: Vec<String>,
vararg: bool,
body: Vec<Stmt>,
},
Return(Vec<Expr>),
Break,
Continue,
Match {
expr: Expr,
arms: Vec<MatchArm>,
},
Import {
path: String,
alias: Option<String>,
},
Export(String),
Expr(Expr),
}Variants§
LocalDecl
local name [= expr]
LocalMulti
local name1, name2 = expr1, expr2
Assign
target = expr
CompoundAssign
compound assign: target op= expr
Call(Expr)
function call statement
Do(Vec<Stmt>)
do … end
While
while cond do … end
RepeatUntil
repeat … until cond
If
if cond then … [elseif …] [else …] end
Fields
NumericFor
numeric for: for i = start, limit[, step] do … end
GenericFor
generic for: for names in expr do … end
FuncDecl
function name(params) body end
LocalFunc
local function name(params) body end
Return(Vec<Expr>)
return [expr, …]
Break
break
Continue
continue
Match
match expr { case pattern => body }
Import
import “module” [as name]
Export(String)
export name
Expr(Expr)
expr (standalone expression — error unless call)
Trait Implementations§
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnsafeUnpin for Stmt
impl UnwindSafe for Stmt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.