pub enum StmtKind {
Show 17 variants
Expr(Expr),
Decl {
kind: DeclKind,
decls: Vec<Declarator>,
},
Block(Vec<Stmt>),
FuncDecl {
name: String,
params: Vec<Param>,
body: Vec<Stmt>,
},
If {
test: Expr,
cons: Box<Stmt>,
alt: Option<Box<Stmt>>,
},
While {
test: Expr,
body: Box<Stmt>,
},
DoWhile {
body: Box<Stmt>,
test: Expr,
},
For {
init: Option<Box<Stmt>>,
test: Option<Expr>,
update: Option<Expr>,
body: Box<Stmt>,
},
ForOf {
decl_kind: Option<DeclKind>,
target: Expr,
iter: Expr,
body: Box<Stmt>,
},
ForIn {
decl_kind: Option<DeclKind>,
target: Expr,
object: Expr,
body: Box<Stmt>,
},
Switch {
disc: Expr,
cases: Vec<SwitchCase>,
},
Return(Option<Expr>),
Break(Option<String>),
Continue(Option<String>),
Throw(Expr),
Try {
block: Vec<Stmt>,
handler: Option<(Option<Expr>, Vec<Stmt>)>,
finalizer: Option<Vec<Stmt>>,
},
Empty,
}Expand description
A JavaScript statement.
Variants§
Expr(Expr)
An expression evaluated for effect (value discarded).
Decl
var/let/const declaration list.
Block(Vec<Stmt>)
{ ... } block.
FuncDecl
function name(params) { body }.
If
While
DoWhile
For
C-style for (init; test; update) body.
ForOf
for (decl of iterable) body.
ForIn
for (decl in object) body.
Switch
Return(Option<Expr>)
Break(Option<String>)
Continue(Option<String>)
Throw(Expr)
Try
Empty
Trait Implementations§
impl StructuralPartialEq for StmtKind
Auto Trait Implementations§
impl Freeze for StmtKind
impl RefUnwindSafe for StmtKind
impl Send for StmtKind
impl Sync for StmtKind
impl Unpin for StmtKind
impl UnsafeUnpin for StmtKind
impl UnwindSafe for StmtKind
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