pub enum Syntax {
Show 70 variants
IdentifierPattern {
name: String,
},
ArrayPattern {
elements: Vec<Option<ArrayPatternElement>>,
rest: Option<Node>,
},
ObjectPattern {
properties: Vec<Node>,
rest: Option<Node>,
},
ClassOrFunctionName {
name: String,
},
Function {
arrow: bool,
async_: bool,
generator: bool,
parameters: Vec<Node>,
body: Node,
},
FunctionBody {
body: Vec<Node>,
},
ClassDecl {
export: bool,
export_default: bool,
name: Option<Node>,
extends: Option<Node>,
members: Vec<Node>,
},
FunctionDecl {
export: bool,
export_default: bool,
name: Option<Node>,
function: Node,
},
ParamDecl {
rest: bool,
pattern: Node,
default_value: Option<Node>,
},
VarDecl {
export: bool,
mode: VarDeclMode,
declarators: Vec<VariableDeclarator>,
},
ArrowFunctionExpr {
parenthesised: bool,
function: Node,
},
BinaryExpr {
parenthesised: bool,
operator: OperatorName,
left: Node,
right: Node,
},
CallExpr {
optional_chaining: bool,
parenthesised: bool,
callee: Node,
arguments: Vec<Node>,
},
ClassExpr {
parenthesised: bool,
name: Option<Node>,
extends: Option<Node>,
members: Vec<Node>,
},
ConditionalExpr {
parenthesised: bool,
test: Node,
consequent: Node,
alternate: Node,
},
ComputedMemberExpr {
optional_chaining: bool,
object: Node,
member: Node,
},
FunctionExpr {
parenthesised: bool,
name: Option<Node>,
function: Node,
},
IdentifierExpr {
name: String,
},
ImportExpr {
module: Node,
},
ImportMeta {},
JsxAttribute {
name: Node,
value: Option<Node>,
},
JsxElement {
name: Option<Node>,
attributes: Vec<Node>,
children: Vec<Node>,
},
JsxExpressionContainer {
value: Node,
},
JsxMemberExpression {
base: Node,
path: Vec<String>,
},
JsxName {
namespace: Option<String>,
name: String,
},
JsxSpreadAttribute {
value: Node,
},
JsxText {
value: String,
},
LiteralArrayExpr {
elements: Vec<ArrayElement>,
},
LiteralBigIntExpr {
value: String,
},
LiteralBooleanExpr {
value: bool,
},
LiteralNull {},
LiteralNumberExpr {
value: JsNumber,
},
LiteralObjectExpr {
members: Vec<Node>,
},
LiteralRegexExpr {
value: String,
},
LiteralStringExpr {
value: String,
},
LiteralTemplateExpr {
parts: Vec<LiteralTemplatePart>,
},
MemberExpr {
parenthesised: bool,
optional_chaining: bool,
left: Node,
right: String,
},
SuperExpr {},
ThisExpr {},
TaggedTemplateExpr {
function: Node,
parts: Vec<LiteralTemplatePart>,
},
UnaryExpr {
parenthesised: bool,
operator: OperatorName,
argument: Node,
},
UnaryPostfixExpr {
parenthesised: bool,
operator: OperatorName,
argument: Node,
},
BlockStmt {
body: Vec<Node>,
},
BreakStmt {
label: Option<String>,
},
ContinueStmt {
label: Option<String>,
},
DebuggerStmt {},
DoWhileStmt {
condition: Node,
body: Node,
},
EmptyStmt {},
ExportDefaultExprStmt {
expression: Node,
},
ExportListStmt {
names: ExportNames,
from: Option<String>,
},
ExpressionStmt {
expression: Node,
},
IfStmt {
test: Node,
consequent: Node,
alternate: Option<Node>,
},
ImportStmt {
default: Option<Node>,
names: Option<ExportNames>,
module: String,
},
ForStmt {
init: ForInit,
condition: Option<Node>,
post: Option<Node>,
body: Node,
},
ForInStmt {
decl_mode: Option<VarDeclMode>,
pat: Node,
rhs: Node,
body: Node,
},
ForOfStmt {
await_: bool,
decl_mode: Option<VarDeclMode>,
pat: Node,
rhs: Node,
body: Node,
},
LabelStmt {
name: String,
statement: Node,
},
ReturnStmt {
value: Option<Node>,
},
SwitchStmt {
test: Node,
branches: Vec<Node>,
},
ThrowStmt {
value: Node,
},
TryStmt {
wrapped: Node,
catch: Option<Node>,
finally: Option<Node>,
},
WhileStmt {
condition: Node,
body: Node,
},
TopLevel {
body: Vec<Node>,
},
CallArg {
spread: bool,
value: Node,
},
CatchBlock {
parameter: Option<Node>,
body: Vec<Node>,
},
ClassMember {
key: ClassOrObjectMemberKey,
static_: bool,
value: ClassOrObjectMemberValue,
},
ForBody {
body: Vec<Node>,
},
ObjectMember {
typ: ObjectMemberType,
},
ObjectPatternProperty {
key: ClassOrObjectMemberKey,
target: Node,
shorthand: bool,
default_value: Option<Node>,
},
SwitchBranch {
case: Option<Node>,
body: Vec<Node>,
},
}
Variants§
IdentifierPattern
ArrayPattern
ObjectPattern
ClassOrFunctionName
Function
FunctionBody
ClassDecl
Fields
FunctionDecl
ParamDecl
VarDecl
ArrowFunctionExpr
BinaryExpr
CallExpr
ClassExpr
ConditionalExpr
ComputedMemberExpr
FunctionExpr
IdentifierExpr
ImportExpr
ImportMeta
JsxAttribute
JsxElement
JsxExpressionContainer
JsxMemberExpression
JsxName
JsxSpreadAttribute
JsxText
LiteralArrayExpr
Fields
§
elements: Vec<ArrayElement>
LiteralBigIntExpr
LiteralBooleanExpr
LiteralNull
LiteralNumberExpr
LiteralObjectExpr
LiteralRegexExpr
LiteralStringExpr
LiteralTemplateExpr
Fields
§
parts: Vec<LiteralTemplatePart>
MemberExpr
SuperExpr
ThisExpr
TaggedTemplateExpr
UnaryExpr
UnaryPostfixExpr
BlockStmt
BreakStmt
ContinueStmt
DebuggerStmt
DoWhileStmt
EmptyStmt
ExportDefaultExprStmt
ExportListStmt
ExpressionStmt
IfStmt
ImportStmt
ForStmt
ForInStmt
ForOfStmt
LabelStmt
ReturnStmt
SwitchStmt
ThrowStmt
TryStmt
WhileStmt
TopLevel
CallArg
CatchBlock
ClassMember
ForBody
ObjectMember
Fields
§
typ: ObjectMemberType
ObjectPatternProperty
SwitchBranch
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Syntax
impl !RefUnwindSafe for Syntax
impl !Send for Syntax
impl !Sync for Syntax
impl Unpin for Syntax
impl !UnwindSafe for Syntax
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