pub enum JsStmt {
Show 20 variants
Expr(JsExpr, Span, Trivia),
VariableDecl {
kind: String,
id: String,
init: Option<JsExpr>,
span: Span,
trivia: Trivia,
},
Import {
source: String,
specifiers: Vec<String>,
span: Span,
trivia: Trivia,
},
Export {
declaration: Box<JsStmt>,
span: Span,
trivia: Trivia,
},
ExportAll {
source: String,
span: Span,
trivia: Trivia,
},
ExportNamed {
source: Option<String>,
specifiers: Vec<String>,
span: Span,
trivia: Trivia,
},
FunctionDecl {
id: String,
params: Vec<String>,
body: Vec<JsStmt>,
is_async: bool,
span: Span,
trivia: Trivia,
},
Return(Option<JsExpr>, Span, Trivia),
If {
test: JsExpr,
consequent: Box<JsStmt>,
alternate: Option<Box<JsStmt>>,
span: Span,
trivia: Trivia,
},
While {
test: JsExpr,
body: Box<JsStmt>,
span: Span,
trivia: Trivia,
},
For {
init: Option<Box<JsStmt>>,
test: Option<JsExpr>,
update: Option<JsExpr>,
body: Box<JsStmt>,
span: Span,
trivia: Trivia,
},
ForIn {
left: Box<JsStmt>,
right: JsExpr,
body: Box<JsStmt>,
span: Span,
trivia: Trivia,
},
ForOf {
left: Box<JsStmt>,
right: JsExpr,
body: Box<JsStmt>,
span: Span,
trivia: Trivia,
},
Try {
block: Box<JsStmt>,
handler: Option<(String, Box<JsStmt>)>,
finalizer: Option<Box<JsStmt>>,
span: Span,
trivia: Trivia,
},
Switch {
discriminant: JsExpr,
cases: Vec<(Option<JsExpr>, Vec<JsStmt>)>,
span: Span,
trivia: Trivia,
},
Throw(JsExpr, Span, Trivia),
Block(Vec<JsStmt>, Span, Trivia),
Break(Span, Trivia),
Continue(Span, Trivia),
Other(String, Span, Trivia),
}Expand description
JavaScript 语句
Variants§
Expr(JsExpr, Span, Trivia)
表达式语句
VariableDecl
变量声明
Fields
Import
导入语句
Export
导出语句
ExportAll
导出所有
ExportNamed
导出命名
Fields
FunctionDecl
函数声明
Fields
Return(Option<JsExpr>, Span, Trivia)
返回语句
If
if 语句
Fields
While
while 语句
For
for 语句
Fields
ForIn
for-in 语句
Fields
ForOf
for-of 语句
Fields
Try
try/catch 语句
Fields
Switch
switch 语句
Fields
Throw(JsExpr, Span, Trivia)
throw 语句
Block(Vec<JsStmt>, Span, Trivia)
块语句
Break(Span, Trivia)
break 语句
Continue(Span, Trivia)
continue 语句
Other(String, Span, Trivia)
其他语句
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JsStmt
impl<'de> Deserialize<'de> for JsStmt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for JsStmt
Auto Trait Implementations§
impl Freeze for JsStmt
impl RefUnwindSafe for JsStmt
impl Send for JsStmt
impl Sync for JsStmt
impl Unpin for JsStmt
impl UnsafeUnpin for JsStmt
impl UnwindSafe for JsStmt
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