pub enum TsStmt {
Show 16 variants
Expr(TsExpr),
Const(String, Option<TsType>, TsExpr),
Let(String, Option<TsType>, TsExpr),
Var(String, Option<TsType>, TsExpr),
If(TsExpr, Vec<TsStmt>, Vec<TsStmt>),
Switch(TsExpr, Vec<(TsExpr, Vec<TsStmt>)>, Vec<TsStmt>),
For(Box<TsStmt>, TsExpr, TsExpr, Vec<TsStmt>),
ForOf(String, TsExpr, Vec<TsStmt>),
ForIn(String, TsExpr, Vec<TsStmt>),
While(TsExpr, Vec<TsStmt>),
Return(TsExpr),
Throw(TsExpr),
TryCatch(Vec<TsStmt>, String, Vec<TsStmt>, Vec<TsStmt>),
Block(Vec<TsStmt>),
Break,
Continue,
}Expand description
TypeScript statement AST node.
Variants§
Expr(TsExpr)
Expression statement: expr;
Const(String, Option<TsType>, TsExpr)
const x: T = expr;
Let(String, Option<TsType>, TsExpr)
let x: T = expr;
Var(String, Option<TsType>, TsExpr)
var x: T = expr;
If(TsExpr, Vec<TsStmt>, Vec<TsStmt>)
if (cond) { then } else { else_ }
Switch(TsExpr, Vec<(TsExpr, Vec<TsStmt>)>, Vec<TsStmt>)
switch (expr) { case x: ... default: ... }
For(Box<TsStmt>, TsExpr, TsExpr, Vec<TsStmt>)
for (let i = init; cond; step) { body }
ForOf(String, TsExpr, Vec<TsStmt>)
for (const x of iter) { body }
ForIn(String, TsExpr, Vec<TsStmt>)
for (const k in obj) { body }
While(TsExpr, Vec<TsStmt>)
while (cond) { body }
Return(TsExpr)
return expr;
Throw(TsExpr)
throw expr;
TryCatch(Vec<TsStmt>, String, Vec<TsStmt>, Vec<TsStmt>)
try { body } catch (e) { handler } finally { fin }
Block(Vec<TsStmt>)
{ stmts }
Break
break;
Continue
continue;
Trait Implementations§
impl StructuralPartialEq for TsStmt
Auto Trait Implementations§
impl Freeze for TsStmt
impl RefUnwindSafe for TsStmt
impl Send for TsStmt
impl Sync for TsStmt
impl Unpin for TsStmt
impl UnsafeUnpin for TsStmt
impl UnwindSafe for TsStmt
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