Enum parse_js::ast::Syntax

source ·
pub enum Syntax {
Show 67 variants IdentifierPattern { name: SourceRange, }, ArrayPattern { elements: Vec<Option<ArrayPatternElement>>, rest: Option<NodeId>, }, ObjectPattern { properties: Vec<NodeId>, rest: Option<NodeId>, }, ClassOrFunctionName { name: SourceRange, }, FunctionSignature { parameters: Vec<NodeId>, }, ClassDecl { name: Option<NodeId>, extends: Option<NodeId>, members: Vec<ClassMember>, }, FunctionDecl { generator: bool, is_async: bool, name: Option<NodeId>, signature: NodeId, body: NodeId, }, ParamDecl { rest: bool, pattern: NodeId, default_value: Option<NodeId>, }, VarDecl { mode: VarDeclMode, declarators: Vec<VariableDeclarator>, }, ArrowFunctionExpr { parenthesised: bool, is_async: bool, signature: NodeId, body: NodeId, }, BinaryExpr { parenthesised: bool, operator: OperatorName, left: NodeId, right: NodeId, }, CallExpr { optional_chaining: bool, parenthesised: bool, callee: NodeId, arguments: Vec<NodeId>, }, ClassExpr { parenthesised: bool, name: Option<NodeId>, extends: Option<NodeId>, members: Vec<ClassMember>, }, ConditionalExpr { parenthesised: bool, test: NodeId, consequent: NodeId, alternate: NodeId, }, ComputedMemberExpr { optional_chaining: bool, object: NodeId, member: NodeId, }, FunctionExpr { parenthesised: bool, is_async: bool, generator: bool, name: Option<NodeId>, signature: NodeId, body: NodeId, }, IdentifierExpr { name: SourceRange, }, ImportExpr { module: NodeId, }, ImportMeta {}, JsxAttribute { name: NodeId, value: Option<NodeId>, }, JsxElement { name: Option<NodeId>, attributes: Vec<NodeId>, children: Vec<NodeId>, }, JsxExpressionContainer { value: NodeId, }, JsxMember { base: SourceRange, path: Vec<SourceRange>, }, JsxName { namespace: Option<SourceRange>, name: SourceRange, }, JsxSpreadAttribute { value: NodeId, }, JsxText { value: SourceRange, }, LiteralArrayExpr { elements: Vec<ArrayElement>, }, LiteralBigIntExpr { value: String, }, LiteralBooleanExpr { value: bool, }, LiteralNull {}, LiteralNumberExpr { value: JsNumber, }, LiteralObjectExpr { members: Vec<NodeId>, }, LiteralRegexExpr {}, LiteralStringExpr { value: String, }, LiteralTemplateExpr { parts: Vec<LiteralTemplatePart>, }, LiteralUndefined {}, MemberExpr { parenthesised: bool, optional_chaining: bool, left: NodeId, right: SourceRange, }, SuperExpr {}, ThisExpr {}, UnaryExpr { parenthesised: bool, operator: OperatorName, argument: NodeId, }, UnaryPostfixExpr { parenthesised: bool, operator: OperatorName, argument: NodeId, }, BlockStmt { body: Vec<NodeId>, }, BreakStmt { label: Option<SourceRange>, }, ContinueStmt { label: Option<SourceRange>, }, DebuggerStmt {}, DoWhileStmt { condition: NodeId, body: NodeId, }, EmptyStmt {}, ExportDeclStmt { declaration: NodeId, default: bool, }, ExportDefaultExprStmt { expression: NodeId, }, ExportListStmt { names: ExportNames, from: Option<String>, }, ExpressionStmt { expression: NodeId, }, IfStmt { test: NodeId, consequent: NodeId, alternate: Option<NodeId>, }, ImportStmt { default: Option<NodeId>, names: Option<ExportNames>, module: String, }, ForStmt { header: ForStmtHeader, body: NodeId, }, LabelStmt { name: SourceRange, statement: NodeId, }, ReturnStmt { value: Option<NodeId>, }, SwitchStmt { test: NodeId, branches: Vec<NodeId>, }, ThrowStmt { value: NodeId, }, TryStmt { wrapped: NodeId, catch: Option<NodeId>, finally: Option<NodeId>, }, VarStmt { declaration: NodeId, }, WhileStmt { condition: NodeId, body: NodeId, }, TopLevel { body: Vec<NodeId>, }, CallArg { spread: bool, value: NodeId, }, CatchBlock { parameter: Option<NodeId>, body: NodeId, }, ObjectMember { typ: ObjectMemberType, }, ObjectPatternProperty { key: ClassOrObjectMemberKey, target: Option<NodeId>, default_value: Option<NodeId>, }, SwitchBranch { case: Option<NodeId>, body: Vec<NodeId>, },
}

Variants§

§

IdentifierPattern

Fields

§

ArrayPattern

Fields

§

ObjectPattern

Fields

§properties: Vec<NodeId>
§

ClassOrFunctionName

Fields

§

FunctionSignature

Fields

§parameters: Vec<NodeId>
§

ClassDecl

Fields

§extends: Option<NodeId>
§members: Vec<ClassMember>
§

FunctionDecl

Fields

§generator: bool
§is_async: bool
§signature: NodeId
§body: NodeId
§

ParamDecl

Fields

§rest: bool
§pattern: NodeId
§default_value: Option<NodeId>
§

VarDecl

Fields

§declarators: Vec<VariableDeclarator>
§

ArrowFunctionExpr

Fields

§parenthesised: bool
§is_async: bool
§signature: NodeId
§body: NodeId
§

BinaryExpr

Fields

§parenthesised: bool
§operator: OperatorName
§left: NodeId
§right: NodeId
§

CallExpr

Fields

§optional_chaining: bool
§parenthesised: bool
§callee: NodeId
§arguments: Vec<NodeId>
§

ClassExpr

Fields

§parenthesised: bool
§extends: Option<NodeId>
§members: Vec<ClassMember>
§

ConditionalExpr

Fields

§parenthesised: bool
§test: NodeId
§consequent: NodeId
§alternate: NodeId
§

ComputedMemberExpr

Fields

§optional_chaining: bool
§object: NodeId
§member: NodeId
§

FunctionExpr

Fields

§parenthesised: bool
§is_async: bool
§generator: bool
§signature: NodeId
§body: NodeId
§

IdentifierExpr

Fields

§

ImportExpr

Fields

§module: NodeId
§

ImportMeta

Fields

§

JsxAttribute

Fields

§name: NodeId
§value: Option<NodeId>
§

JsxElement

Fields

§attributes: Vec<NodeId>
§children: Vec<NodeId>
§

JsxExpressionContainer

Fields

§value: NodeId
§

JsxMember

Fields

§

JsxName

Fields

§namespace: Option<SourceRange>
§

JsxSpreadAttribute

Fields

§value: NodeId
§

JsxText

Fields

§

LiteralArrayExpr

Fields

§elements: Vec<ArrayElement>
§

LiteralBigIntExpr

Fields

§value: String
§

LiteralBooleanExpr

Fields

§value: bool
§

LiteralNull

Fields

§

LiteralNumberExpr

Fields

§value: JsNumber
§

LiteralObjectExpr

Fields

§members: Vec<NodeId>
§

LiteralRegexExpr

Fields

§

LiteralStringExpr

Fields

§value: String
§

LiteralTemplateExpr

Fields

§

LiteralUndefined

Fields

§

MemberExpr

Fields

§parenthesised: bool
§optional_chaining: bool
§left: NodeId
§

SuperExpr

Fields

§

ThisExpr

Fields

§

UnaryExpr

Fields

§parenthesised: bool
§operator: OperatorName
§argument: NodeId
§

UnaryPostfixExpr

Fields

§parenthesised: bool
§operator: OperatorName
§argument: NodeId
§

BlockStmt

Fields

§body: Vec<NodeId>
§

BreakStmt

Fields

§

ContinueStmt

Fields

§

DebuggerStmt

Fields

§

DoWhileStmt

Fields

§condition: NodeId
§body: NodeId
§

EmptyStmt

Fields

§

ExportDeclStmt

Fields

§declaration: NodeId
§default: bool
§

ExportDefaultExprStmt

Fields

§expression: NodeId
§

ExportListStmt

Fields

§

ExpressionStmt

Fields

§expression: NodeId
§

IfStmt

Fields

§test: NodeId
§consequent: NodeId
§alternate: Option<NodeId>
§

ImportStmt

Fields

§default: Option<NodeId>
§module: String
§

ForStmt

Fields

§body: NodeId
§

LabelStmt

Fields

§statement: NodeId
§

ReturnStmt

Fields

§value: Option<NodeId>
§

SwitchStmt

Fields

§test: NodeId
§branches: Vec<NodeId>
§

ThrowStmt

Fields

§value: NodeId
§

TryStmt

Fields

§wrapped: NodeId
§catch: Option<NodeId>
§finally: Option<NodeId>
§

VarStmt

Fields

§declaration: NodeId
§

WhileStmt

Fields

§condition: NodeId
§body: NodeId
§

TopLevel

Fields

§body: Vec<NodeId>
§

CallArg

Fields

§spread: bool
§value: NodeId
§

CatchBlock

Fields

§parameter: Option<NodeId>
§body: NodeId
§

ObjectMember

Fields

§

ObjectPatternProperty

Fields

§target: Option<NodeId>
§default_value: Option<NodeId>
§

SwitchBranch

Fields

§body: Vec<NodeId>

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.