swc_ecma_quote_macros/ast/
stmt.rs

1use swc_ecma_ast::*;
2
3impl_enum!(
4    Stmt,
5    [
6        Block, Empty, Debugger, With, Return, Labeled, Break, Continue, If, Switch, Throw, Try,
7        While, DoWhile, For, ForIn, ForOf, Decl, Expr
8    ]
9);
10
11impl_struct!(EmptyStmt, [span]);
12impl_struct!(BlockStmt, [span, ctxt, stmts]);
13impl_struct!(DebuggerStmt, [span]);
14impl_struct!(WithStmt, [span, obj, body]);
15impl_struct!(LabeledStmt, [span, label, body]);
16impl_struct!(BreakStmt, [span, label]);
17impl_struct!(ContinueStmt, [span, label]);
18impl_struct!(IfStmt, [span, test, cons, alt]);
19impl_struct!(SwitchStmt, [span, discriminant, cases]);
20impl_struct!(ThrowStmt, [span, arg]);
21impl_struct!(TryStmt, [span, block, handler, finalizer]);
22impl_struct!(WhileStmt, [span, test, body]);
23impl_struct!(DoWhileStmt, [span, test, body]);
24impl_struct!(ForStmt, [span, init, test, update, body]);
25impl_struct!(ForInStmt, [span, left, right, body]);
26impl_struct!(ForOfStmt, [span, is_await, left, right, body]);
27impl_struct!(ReturnStmt, [span, arg]);
28impl_struct!(ExprStmt, [span, expr]);
29
30impl_enum!(VarDeclOrExpr, [VarDecl, Expr]);
31impl_enum!(ForHead, [VarDecl, UsingDecl, Pat]);
32
33impl_struct!(SwitchCase, [span, test, cons]);
34
35impl_struct!(CatchClause, [span, param, body]);