pub enum Statement {
Show 22 variants
Expression(Expression),
VarDeclaration {
kind: VarKind,
decls: Vec<(Pattern, Option<Expression>)>,
},
Block(Vec<Statement>),
If {
test: Expression,
consequent: Box<Statement>,
alternate: Option<Box<Statement>>,
},
While {
test: Expression,
body: Box<Statement>,
},
DoWhile {
body: Box<Statement>,
test: Expression,
},
For {
init: Option<Box<Statement>>,
test: Option<Expression>,
update: Option<Expression>,
body: Box<Statement>,
},
ForIn {
decl_kind: Option<VarKind>,
pattern: Pattern,
object: Expression,
body: Box<Statement>,
of: bool,
is_await: bool,
},
FunctionDeclaration {
name: String,
params: Vec<Param>,
body: Vec<Statement>,
is_async: bool,
is_generator: bool,
},
Return(Option<Expression>),
Break(Option<String>),
Continue(Option<String>),
Labeled(String, Box<Statement>),
Throw(Expression),
Switch {
discriminant: Expression,
cases: Vec<SwitchCase>,
},
Try {
block: Vec<Statement>,
catch_param: Option<Pattern>,
catch_block: Option<Vec<Statement>>,
finally_block: Option<Vec<Statement>>,
},
Import {
source: String,
default: Option<String>,
namespace: Option<String>,
named: Vec<(String, String)>,
side_effect_only: bool,
},
ExportNamed {
specifiers: Vec<(String, String)>,
source: Option<String>,
},
ExportDefault(Expression),
ExportDecl {
declaration: Box<Statement>,
names: Vec<String>,
},
ExportAll {
source: String,
},
Empty,
}Variants§
Expression(Expression)
VarDeclaration
Block(Vec<Statement>)
If
While
DoWhile
For
ForIn
Fields
§
object: ExpressionFunctionDeclaration
Return(Option<Expression>)
Break(Option<String>)
break; / break label;。
Continue(Option<String>)
continue; / continue label;。
Labeled(String, Box<Statement>)
label: statement(ラベル付き文。主にループの break label/continue label の
ターゲットとして使う)。
Throw(Expression)
Switch
Try
Fields
Import
import ... from "spec" 宣言。
例: import def, { a, b as c }, * as ns from "mod"。
Fields
ExportNamed
export { a, b as c } / export { x } from "mod"(再エクスポート)。
Fields
ExportDefault(Expression)
export default <expr>。
ExportDecl
export var/let/const/function/class ...(宣言を実行しつつ名前を export)。
内側の宣言文と、そこから公開する名前のリストを保持する。
ExportAll
export * from "mod"(全名前の再エクスポート)。
Empty
Trait Implementations§
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
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