Skip to main content

Module syntax

Module syntax 

Source
Expand description

Immutable, parser-owned syntax data.

Child edges are owned values and public traversal only exposes shared borrows. There are deliberately no parent links or interior-mutable caches: a parsed SourceFile can be shared without changing the tree it describes.

Structs§

ArrayBindingPattern
ArrayLiteral
ArrowFunction
AsExpression
AssignmentArrayPattern
AssignmentBindingPattern
AssignmentExpression
AssignmentMemberTarget
AssignmentObjectPattern
AssignmentObjectProperty
AutoAccessor
AwaitExpression
BigIntLiteral
BinaryExpression
Block
BooleanLiteral
CallExpression
CallSignature
CatchClause
ClassDeclaration
ClassExpression
ClassHeritage
ClassProperty
ConditionalExpression
ConditionalType
ConstructSignature
ConstructorDeclaration
ConstructorType
DeclarationModifiers
Decorator
DoWhileStatement
EnumDeclaration
EnumMember
ExportAllDeclaration
ExportDefaultDeclaration
ExportSpecifier
ExpressionStatement
ForInStatement
ForOfStatement
ForStatement
FunctionDeclaration
FunctionExpression
FunctionLike
FunctionType
FunctionTypeParameter
Identifier
IfStatement
ImportAttribute
ImportAttributes
ImportClause
ImportDeclaration
ImportEqualsDeclaration
ImportExpression
ImportSpecifier
ImportType
IndexSignature
IndexedAccessType
InferType
InterfaceDeclaration
JumpStatement
LabeledStatement
LogicalExpression
MappedType
MemberExpression
MethodDeclaration
MissingNode
Recovery payload for an omitted grammar node. Its enclosing Node still carries the insertion range and identity.
NamespaceDeclaration
NewExpression
Node
The common immutable header for every AST node.
NodeId
A stable identity assigned by the parser to one AST node.
NonNullExpression
NullLiteral
NumericLiteral
ObjectBindingPattern
ObjectBindingProperty
ObjectLiteral
ObjectMethod
ObjectProperty
ObjectType
Parameter
ParameterModifiers
PrivateIdentifier
RegexLiteral
RestBindingPattern
ReturnStatement
SatisfiesExpression
SequenceExpression
SourceFile
The immutable parser product. Diagnostics retain parser order by value; callers cannot mutate the tree, token stream, or diagnostics through this API.
SpreadElement
StringLiteral
SwitchCase
SwitchStatement
TaggedTemplateExpression
TemplateElement
TemplateLiteral
TemplateLiteralType
ThrowStatement
Token
An immutable lexical token. Its lexeme stays in SourceText, avoiding one allocation and reference-counted handle per scanner token.
TryStatement
TupleElement
TupleType
TypeAliasDeclaration
TypeAnnotation
TypeArgumentList
TypeAssertionExpression
TypeIndexSignature
TypeMethodSignature
TypeParameter
TypeParameterList
TypePredicate
TypePropertySignature
TypeQuery
TypeReference
UnaryExpression
UpdateExpression
VariableDeclaration
VariableDeclarator
WhileStatement
WithStatement
YieldExpression

Enums§

Accessibility
ArrayBindingElement
ArrayElement
AssignmentArrayElement
AssignmentOperator
AssignmentTarget
BinaryOperator
BindingPattern
CallArgument
ClassMember
EntityName
ExportDeclaration
ExportDefaultValue
ExportNamedDeclaration
ExportSpecifierMode
Expression
ExternalModuleReference
ForBinding
ForInitializer
ForOfMode
FunctionBody
ImportBinding
ImportSpecifierMode
KeywordType
Literal
LogicalOperator
MappedModifier
MemberProperty
MetaProperty
ModuleExportName
NodeKind
A grammar node kind. A value of this type can never name a token.
ObjectMember
PropertyModifier
PropertyName
Statement
SyntaxKind
The complete syntax-kind space, with token and node categories represented by different variants instead of a shared integer namespace.
TokenKind
A lexical token kind. This is intentionally separate from NodeKind.
TypeLiteral
TypeMember
TypeNode
Type syntax is kept in this closed enum so erasure never has to inspect a runtime expression variant.
TypeOperator
UnaryOperator
UpdateOperator
VariableKind
Variance

Traits§

NodeData
Data stored in a typed AST node.

Type Aliases§

AssignmentTargetNode
BigIntLiteralNode
BindingPatternNode
BlockNode
BooleanLiteralNode
CatchClauseNode
ClassMemberNode
DecoratorNode
EnumMemberNode
ExportSpecifierNode
Expr
ExpressionNode
IdentifierNode
ImportSpecifierNode
NullLiteralNode
NumericLiteralNode
ObjectMemberNode
ParameterNode
Pattern
PrivateIdentifierNode
RegexLiteralNode
StatementNode
Stmt
StringLiteralNode
SwitchCaseNode
TemplateElementNode
Ty
TypeAnnotationNode
TypeMemberNode
TypeNodeRef
TypeParameterNode
VariableDeclaratorNode