Macros§
Structs§
- Array
Lit - Array
Pat - Arrow
Expr - Assign
Expr - Assign
Pat - Assign
PatProp - Assign
Prop - Ast
- AST context that stores everything about the flattening AST.
- Auto
Accessor - Await
Expr - BigInt
- BigInt
Id - BinExpr
- Binding
Ident - Block
Stmt - Bool
- Break
Stmt - Call
Expr - Catch
Clause - Class
- Class
Decl - Class
Expr - Class
Method - Class
Prop - Computed
Prop Name - Cond
Expr - Constructor
- Continue
Stmt - Debugger
Stmt - Decorator
- DoWhile
Stmt - Empty
Stmt - Export
All - Export
Decl - Export
Default Decl - Export
Default Expr - Export
Default Specifier - Export
Named Specifier - Export
Namespace Specifier - Expr
OrSpread - Expr
Stmt - Extra
Data Id - FnDecl
- FnExpr
- ForIn
Stmt - ForOf
Stmt - ForStmt
- Function
- Getter
Prop - Ident
- Ident
Name - IfStmt
- Import
- Import
Decl - Import
Default Specifier - Import
Named Specifier - Import
Star AsSpecifier - Invalid
- JSXAttr
- JSXClosing
Element - JSXClosing
Fragment - JSXElement
- JSXEmpty
Expr - JSXExpr
Container - JSXFragment
- JSXMember
Expr - JSXNamespaced
Name - JSXOpening
Element - JSXOpening
Fragment - JSXSpread
Child - JSXText
- KeyValue
PatProp - KeyValue
Prop - Labeled
Stmt - Member
Expr - Meta
Prop Expr - Method
Prop - Module
- Named
Export - NewExpr
- NodeId
- Null
- Number
- Object
Lit - Object
Pat - OptCall
- OptChain
Expr - Optional
Node Id - An 4 bytes optimized version of
Option<NodeId>(8 bytes) - Optional
Utf8 Ref - Optional
Wtf8 Ref - Param
- Paren
Expr - Private
Method - Private
Name - Private
Prop - Regex
- RestPat
- Return
Stmt - Script
- SeqExpr
- Setter
Prop - Span
- Spans represent a region of code, used for error reporting.
- Spread
Dot3 Token - Spread
Element - Static
Block - Str
- String
Allocator - Safety
- SubRange
- SubRange is a cheap way to represent a undetermined range of nodes in an arena, just like a std::vec::Vec.
- Super
- Super
Prop Expr - Switch
Case - Switch
Stmt - Tagged
Tpl - This
Expr - Throw
Stmt - Tpl
- TplElement
- TryStmt
- Typed
SubRange - A typed sub range of nodes in an arena.
- Unary
Expr - Update
Expr - Using
Decl - Utf8Ref
- The reference to a wtf8 string in the string allocator.
- VarDecl
- VarDeclarator
- While
Stmt - With
Stmt - Wtf8Ref
- The reference to a wtf8 string in the string allocator.
- Yield
Expr
Enums§
- Assign
Op - Assign
Target - Assign
Target Pat - Binary
Op - Block
Stmt OrExpr - Callee
- Class
Member - Decl
- Default
Decl - EsVersion
- Port from https://github.com/swc-project/swc/blob/main/crates/swc_ecma_ast/src/lib.rs
- Export
Specifier - Expr
- ForHead
- Import
Phase - Import
Specifier - JSXAttr
Name - JSXAttr
OrSpread - JSXAttr
Value - JSXElement
Child - JSXElement
Name - JSXExpr
- JSXObject
- Key
- Lit
- Member
Prop - Meta
Prop Kind - Method
Kind - Module
Decl - Module
Export Name - Module
Item - Node
Kind - The NodeKind is one-to-one mapping to the typed AST node declared with struct keyword (not enum).
- Object
PatProp - OptChain
Base - Param
OrTs Param Prop - Pat
- Program
- Prop
- Prop
Name - Prop
OrSpread - Simple
Assign Target - Stmt
- Super
Prop - UnaryOp
- Update
Op - VarDecl
Kind - VarDecl
OrExpr
Traits§
- CloneIn
- EsReserved
- Extra
Data Compact - 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
- Node
IdTrait - SetSpan
- Visit
- Visit
Mut - Visit
MutWith - Visit
With
Functions§
- is_
valid_ ascii_ continue - is_
valid_ ascii_ start - is_
valid_ continue - Returns true if
cis a valid character for an identifier part after start. - is_
valid_ non_ ascii_ continue - is_
valid_ non_ ascii_ start - is_
valid_ start
Unions§
- Extra
Data - 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.
- Node
Data - Node data is the start index of Ast::extra_data.