Enum Syntax

Source
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

Fields

§name: String
§

ArrayPattern

Fields

§rest: Option<Node>
§

ObjectPattern

Fields

§properties: Vec<Node>
§rest: Option<Node>
§

ClassOrFunctionName

Fields

§name: String
§

Function

Fields

§arrow: bool
§async_: bool
§generator: bool
§parameters: Vec<Node>
§body: Node
§

FunctionBody

Fields

§body: Vec<Node>
§

ClassDecl

Fields

§export: bool
§export_default: bool
§name: Option<Node>
§extends: Option<Node>
§members: Vec<Node>
§

FunctionDecl

Fields

§export: bool
§export_default: bool
§name: Option<Node>
§function: Node
§

ParamDecl

Fields

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

VarDecl

Fields

§export: bool
§

ArrowFunctionExpr

Fields

§parenthesised: bool
§function: Node
§

BinaryExpr

Fields

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

CallExpr

Fields

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

ClassExpr

Fields

§parenthesised: bool
§name: Option<Node>
§extends: Option<Node>
§members: Vec<Node>
§

ConditionalExpr

Fields

§parenthesised: bool
§test: Node
§consequent: Node
§alternate: Node
§

ComputedMemberExpr

Fields

§optional_chaining: bool
§object: Node
§member: Node
§

FunctionExpr

Fields

§parenthesised: bool
§name: Option<Node>
§function: Node
§

IdentifierExpr

Fields

§name: String
§

ImportExpr

Fields

§module: Node
§

ImportMeta

§

JsxAttribute

Fields

§name: Node
§value: Option<Node>
§

JsxElement

Fields

§name: Option<Node>
§attributes: Vec<Node>
§children: Vec<Node>
§

JsxExpressionContainer

Fields

§value: Node
§

JsxMemberExpression

Fields

§base: Node
§path: Vec<String>
§

JsxName

Fields

§namespace: Option<String>
§name: String
§

JsxSpreadAttribute

Fields

§value: Node
§

JsxText

Fields

§value: String
§

LiteralArrayExpr

Fields

§elements: Vec<ArrayElement>
§

LiteralBigIntExpr

Fields

§value: String
§

LiteralBooleanExpr

Fields

§value: bool
§

LiteralNull

§

LiteralNumberExpr

Fields

§value: JsNumber
§

LiteralObjectExpr

Fields

§members: Vec<Node>
§

LiteralRegexExpr

Fields

§value: String
§

LiteralStringExpr

Fields

§value: String
§

LiteralTemplateExpr

§

MemberExpr

Fields

§parenthesised: bool
§optional_chaining: bool
§left: Node
§right: String
§

SuperExpr

§

ThisExpr

§

TaggedTemplateExpr

Fields

§function: Node
§

UnaryExpr

Fields

§parenthesised: bool
§operator: OperatorName
§argument: Node
§

UnaryPostfixExpr

Fields

§parenthesised: bool
§operator: OperatorName
§argument: Node
§

BlockStmt

Fields

§body: Vec<Node>
§

BreakStmt

Fields

§

ContinueStmt

Fields

§

DebuggerStmt

§

DoWhileStmt

Fields

§condition: Node
§body: Node
§

EmptyStmt

§

ExportDefaultExprStmt

Fields

§expression: Node
§

ExportListStmt

Fields

§

ExpressionStmt

Fields

§expression: Node
§

IfStmt

Fields

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

ImportStmt

Fields

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

ForStmt

Fields

§init: ForInit
§condition: Option<Node>
§post: Option<Node>
§body: Node
§

ForInStmt

Fields

§decl_mode: Option<VarDeclMode>
§pat: Node
§rhs: Node
§body: Node
§

ForOfStmt

Fields

§await_: bool
§decl_mode: Option<VarDeclMode>
§pat: Node
§rhs: Node
§body: Node
§

LabelStmt

Fields

§name: String
§statement: Node
§

ReturnStmt

Fields

§value: Option<Node>
§

SwitchStmt

Fields

§test: Node
§branches: Vec<Node>
§

ThrowStmt

Fields

§value: Node
§

TryStmt

Fields

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

WhileStmt

Fields

§condition: Node
§body: Node
§

TopLevel

Fields

§body: Vec<Node>
§

CallArg

Fields

§spread: bool
§value: Node
§

CatchBlock

Fields

§parameter: Option<Node>
§body: Vec<Node>
§

ClassMember

§

ForBody

Fields

§body: Vec<Node>
§

ObjectMember

§

ObjectPatternProperty

Fields

§target: Node
§shorthand: bool
§default_value: Option<Node>
§

SwitchBranch

Fields

§case: Option<Node>
§body: Vec<Node>

Trait Implementations§

Source§

impl Debug for Syntax

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for Syntax

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.