pub enum Stmt {
Show 17 variants
VarDecl {
name: String,
init: Option<Expr>,
},
DestructureDecl {
pattern: DestructurePattern,
init: Expr,
},
Assign {
target: Expr,
value: Expr,
},
Expr(Expr),
Block(Vec<Stmt>),
If {
cond: Expr,
then_branch: Box<Stmt>,
else_branch: Option<Box<Stmt>>,
},
While {
cond: Expr,
body: Box<Stmt>,
},
For {
init: Option<Box<Stmt>>,
cond: Option<Expr>,
step: Option<Expr>,
body: Box<Stmt>,
},
Directive(String),
FunctionDecl {
name: String,
params: Vec<String>,
body: Vec<Stmt>,
is_async: bool,
is_generator: bool,
},
ClassDecl {
name: String,
super_class: Option<String>,
constructor: Option<(Vec<String>, Vec<Stmt>)>,
methods: Vec<(String, Vec<String>, Vec<Stmt>)>,
},
Return(Option<Expr>),
TryCatch {
try_block: Vec<Stmt>,
catch_param: Option<String>,
catch_block: Option<Vec<Stmt>>,
finally_block: Option<Vec<Stmt>>,
},
Throw(Expr),
Break(Option<String>),
Continue(Option<String>),
Switch {
discriminant: Expr,
cases: Vec<SwitchCase>,
},
}Variants§
VarDecl
DestructureDecl
Assign
Expr(Expr)
Block(Vec<Stmt>)
If
While
For
Directive(String)
FunctionDecl
ClassDecl
Fields
Return(Option<Expr>)
TryCatch
Fields
Throw(Expr)
Break(Option<String>)
Continue(Option<String>)
Switch
Trait Implementations§
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl !RefUnwindSafe for Stmt
impl !Send for Stmt
impl !Sync for Stmt
impl !UnwindSafe for Stmt
impl Forget for Stmt
impl Freeze for Stmt
impl Move for Stmt
impl Unpin for Stmt
impl UnsafeUnpin 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