Skip to main content

Crate swc_experimental_ecma_ast

Crate swc_experimental_ecma_ast 

Source

Macros§

define_optional_index_type

Structs§

ArrayLit
ArrayPat
ArrowExpr
AssignExpr
AssignPat
AssignPatProp
AssignProp
Ast
AST context that stores everything about the flattening AST.
AutoAccessor
AwaitExpr
BigInt
BigIntId
BinExpr
BindingIdent
BlockStmt
Bool
BreakStmt
CallExpr
CatchClause
Class
ClassDecl
ClassExpr
ClassMethod
ClassProp
ComputedPropName
CondExpr
Constructor
ContinueStmt
DebuggerStmt
Decorator
DoWhileStmt
EmptyStmt
ExportAll
ExportDecl
ExportDefaultDecl
ExportDefaultExpr
ExportDefaultSpecifier
ExportNamedSpecifier
ExportNamespaceSpecifier
ExprOrSpread
ExprStmt
ExtraDataId
FnDecl
FnExpr
ForInStmt
ForOfStmt
ForStmt
Function
GetterProp
Ident
IdentName
IfStmt
Import
ImportDecl
ImportDefaultSpecifier
ImportNamedSpecifier
ImportStarAsSpecifier
Invalid
JSXAttr
JSXClosingElement
JSXClosingFragment
JSXElement
JSXEmptyExpr
JSXExprContainer
JSXFragment
JSXMemberExpr
JSXNamespacedName
JSXOpeningElement
JSXOpeningFragment
JSXSpreadChild
JSXText
KeyValuePatProp
KeyValueProp
LabeledStmt
MemberExpr
MetaPropExpr
MethodProp
Module
NamedExport
NewExpr
NodeId
Null
Number
ObjectLit
ObjectPat
OptCall
OptChainExpr
OptionalNodeId
An 4 bytes optimized version of Option<NodeId> (8 bytes)
OptionalUtf8Ref
OptionalWtf8Ref
Param
ParenExpr
PrivateMethod
PrivateName
PrivateProp
Regex
RestPat
ReturnStmt
Script
SeqExpr
SetterProp
Span
Spans represent a region of code, used for error reporting.
SpreadDot3Token
SpreadElement
StaticBlock
Str
StringAllocator
Safety
SubRange
SubRange is a cheap way to represent a undetermined range of nodes in an arena, just like a std::vec::Vec.
Super
SuperPropExpr
SwitchCase
SwitchStmt
TaggedTpl
ThisExpr
ThrowStmt
Tpl
TplElement
TryStmt
TypedSubRange
A typed sub range of nodes in an arena.
UnaryExpr
UpdateExpr
UsingDecl
Utf8Ref
The reference to a wtf8 string in the string allocator.
VarDecl
VarDeclarator
WhileStmt
WithStmt
Wtf8Ref
The reference to a wtf8 string in the string allocator.
YieldExpr

Enums§

AssignOp
AssignTarget
AssignTargetPat
BinaryOp
BlockStmtOrExpr
Callee
ClassMember
Decl
DefaultDecl
EsVersion
Port from https://github.com/swc-project/swc/blob/main/crates/swc_ecma_ast/src/lib.rs
ExportSpecifier
Expr
ForHead
ImportPhase
ImportSpecifier
JSXAttrName
JSXAttrOrSpread
JSXAttrValue
JSXElementChild
JSXElementName
JSXExpr
JSXObject
Key
Lit
MemberProp
MetaPropKind
MethodKind
ModuleDecl
ModuleExportName
ModuleItem
NodeKind
The NodeKind is one-to-one mapping to the typed AST node declared with struct keyword (not enum).
ObjectPatProp
OptChainBase
ParamOrTsParamProp
Pat
Program
Prop
PropName
PropOrSpread
SimpleAssignTarget
Stmt
SuperProp
UnaryOp
UpdateOp
VarDeclKind
VarDeclOrExpr

Traits§

CloneIn
EsReserved
ExtraDataCompact
Some AST field can be represented as a single u64 value to store it as crate::ExtraData, and this trait is used to convert between the AST field and the u64 value.
GetSpan
NodeIdTrait
SetSpan
Visit
VisitMut
VisitMutWith
VisitWith

Functions§

is_valid_ascii_continue
is_valid_ascii_start
is_valid_continue
Returns true if c is a valid character for an identifier part after start.
is_valid_non_ascii_continue
is_valid_non_ascii_start
is_valid_start

Unions§

ExtraData
The extra data is used to represent the field of AST node. It’s usally another Id to point to the data structures in Ast, or it can be a primitive value, which is small enough to store in 8 bytes.
NodeData
Node data is the start index of Ast::extra_data.