pub struct NodeArena {Show 94 fields
pub nodes: Vec<Node>,
pub interner: Interner,
pub identifiers: Vec<IdentifierData>,
pub qualified_names: Vec<QualifiedNameData>,
pub computed_properties: Vec<ComputedPropertyData>,
pub literals: Vec<LiteralData>,
pub binary_exprs: Vec<BinaryExprData>,
pub unary_exprs: Vec<UnaryExprData>,
pub call_exprs: Vec<CallExprData>,
pub access_exprs: Vec<AccessExprData>,
pub conditional_exprs: Vec<ConditionalExprData>,
pub literal_exprs: Vec<LiteralExprData>,
pub parenthesized: Vec<ParenthesizedData>,
pub unary_exprs_ex: Vec<UnaryExprDataEx>,
pub type_assertions: Vec<TypeAssertionData>,
pub template_exprs: Vec<TemplateExprData>,
pub template_spans: Vec<TemplateSpanData>,
pub tagged_templates: Vec<TaggedTemplateData>,
pub functions: Vec<FunctionData>,
pub classes: Vec<ClassData>,
pub interfaces: Vec<InterfaceData>,
pub type_aliases: Vec<TypeAliasData>,
pub enums: Vec<EnumData>,
pub enum_members: Vec<EnumMemberData>,
pub modules: Vec<ModuleData>,
pub module_blocks: Vec<ModuleBlockData>,
pub signatures: Vec<SignatureData>,
pub index_signatures: Vec<IndexSignatureData>,
pub property_decls: Vec<PropertyDeclData>,
pub method_decls: Vec<MethodDeclData>,
pub constructors: Vec<ConstructorData>,
pub accessors: Vec<AccessorData>,
pub parameters: Vec<ParameterData>,
pub type_parameters: Vec<TypeParameterData>,
pub decorators: Vec<DecoratorData>,
pub heritage_clauses: Vec<HeritageData>,
pub expr_with_type_args: Vec<ExprWithTypeArgsData>,
pub if_statements: Vec<IfStatementData>,
pub loops: Vec<LoopData>,
pub blocks: Vec<BlockData>,
pub variables: Vec<VariableData>,
pub return_data: Vec<ReturnData>,
pub expr_statements: Vec<ExprStatementData>,
pub switch_data: Vec<SwitchData>,
pub case_clauses: Vec<CaseClauseData>,
pub try_data: Vec<TryData>,
pub catch_clauses: Vec<CatchClauseData>,
pub labeled_data: Vec<LabeledData>,
pub jump_data: Vec<JumpData>,
pub with_data: Vec<WithData>,
pub type_refs: Vec<TypeRefData>,
pub composite_types: Vec<CompositeTypeData>,
pub function_types: Vec<FunctionTypeData>,
pub type_queries: Vec<TypeQueryData>,
pub type_literals: Vec<TypeLiteralData>,
pub array_types: Vec<ArrayTypeData>,
pub tuple_types: Vec<TupleTypeData>,
pub wrapped_types: Vec<WrappedTypeData>,
pub conditional_types: Vec<ConditionalTypeData>,
pub infer_types: Vec<InferTypeData>,
pub type_operators: Vec<TypeOperatorData>,
pub indexed_access_types: Vec<IndexedAccessTypeData>,
pub mapped_types: Vec<MappedTypeData>,
pub literal_types: Vec<LiteralTypeData>,
pub template_literal_types: Vec<TemplateLiteralTypeData>,
pub named_tuple_members: Vec<NamedTupleMemberData>,
pub type_predicates: Vec<TypePredicateData>,
pub import_decls: Vec<ImportDeclData>,
pub import_clauses: Vec<ImportClauseData>,
pub named_imports: Vec<NamedImportsData>,
pub specifiers: Vec<SpecifierData>,
pub export_decls: Vec<ExportDeclData>,
pub export_assignments: Vec<ExportAssignmentData>,
pub import_attributes: Vec<ImportAttributesData>,
pub import_attribute: Vec<ImportAttributeData>,
pub binding_patterns: Vec<BindingPatternData>,
pub binding_elements: Vec<BindingElementData>,
pub property_assignments: Vec<PropertyAssignmentData>,
pub shorthand_properties: Vec<ShorthandPropertyData>,
pub spread_data: Vec<SpreadData>,
pub variable_declarations: Vec<VariableDeclarationData>,
pub for_in_of: Vec<ForInOfData>,
pub jsx_elements: Vec<JsxElementData>,
pub jsx_opening: Vec<JsxOpeningData>,
pub jsx_closing: Vec<JsxClosingData>,
pub jsx_fragments: Vec<JsxFragmentData>,
pub jsx_attributes: Vec<JsxAttributesData>,
pub jsx_attribute: Vec<JsxAttributeData>,
pub jsx_spread_attributes: Vec<JsxSpreadAttributeData>,
pub jsx_expressions: Vec<JsxExpressionData>,
pub jsx_text: Vec<JsxTextData>,
pub jsx_namespaced_names: Vec<JsxNamespacedNameData>,
pub source_files: Vec<SourceFileData>,
pub extended_info: Vec<ExtendedNodeInfo>,
}Expand description
Arena for thin nodes with typed data pools. Provides O(1) allocation and cache-efficient storage.
Fields§
§nodes: Vec<Node>The thin node headers (16 bytes each)
interner: InternerString interner for resolving identifier atoms This is populated from the scanner after parsing completes
identifiers: Vec<IdentifierData>§qualified_names: Vec<QualifiedNameData>§computed_properties: Vec<ComputedPropertyData>§literals: Vec<LiteralData>§binary_exprs: Vec<BinaryExprData>§unary_exprs: Vec<UnaryExprData>§call_exprs: Vec<CallExprData>§access_exprs: Vec<AccessExprData>§conditional_exprs: Vec<ConditionalExprData>§literal_exprs: Vec<LiteralExprData>§parenthesized: Vec<ParenthesizedData>§unary_exprs_ex: Vec<UnaryExprDataEx>§type_assertions: Vec<TypeAssertionData>§template_exprs: Vec<TemplateExprData>§template_spans: Vec<TemplateSpanData>§tagged_templates: Vec<TaggedTemplateData>§functions: Vec<FunctionData>§classes: Vec<ClassData>§interfaces: Vec<InterfaceData>§type_aliases: Vec<TypeAliasData>§enums: Vec<EnumData>§enum_members: Vec<EnumMemberData>§modules: Vec<ModuleData>§module_blocks: Vec<ModuleBlockData>§signatures: Vec<SignatureData>§index_signatures: Vec<IndexSignatureData>§property_decls: Vec<PropertyDeclData>§method_decls: Vec<MethodDeclData>§constructors: Vec<ConstructorData>§accessors: Vec<AccessorData>§parameters: Vec<ParameterData>§type_parameters: Vec<TypeParameterData>§decorators: Vec<DecoratorData>§heritage_clauses: Vec<HeritageData>§expr_with_type_args: Vec<ExprWithTypeArgsData>§if_statements: Vec<IfStatementData>§loops: Vec<LoopData>§blocks: Vec<BlockData>§variables: Vec<VariableData>§return_data: Vec<ReturnData>§expr_statements: Vec<ExprStatementData>§switch_data: Vec<SwitchData>§case_clauses: Vec<CaseClauseData>§try_data: Vec<TryData>§catch_clauses: Vec<CatchClauseData>§labeled_data: Vec<LabeledData>§jump_data: Vec<JumpData>§with_data: Vec<WithData>§type_refs: Vec<TypeRefData>§composite_types: Vec<CompositeTypeData>§function_types: Vec<FunctionTypeData>§type_queries: Vec<TypeQueryData>§type_literals: Vec<TypeLiteralData>§array_types: Vec<ArrayTypeData>§tuple_types: Vec<TupleTypeData>§wrapped_types: Vec<WrappedTypeData>§conditional_types: Vec<ConditionalTypeData>§infer_types: Vec<InferTypeData>§type_operators: Vec<TypeOperatorData>§indexed_access_types: Vec<IndexedAccessTypeData>§mapped_types: Vec<MappedTypeData>§literal_types: Vec<LiteralTypeData>§template_literal_types: Vec<TemplateLiteralTypeData>§named_tuple_members: Vec<NamedTupleMemberData>§type_predicates: Vec<TypePredicateData>§import_decls: Vec<ImportDeclData>§import_clauses: Vec<ImportClauseData>§named_imports: Vec<NamedImportsData>§specifiers: Vec<SpecifierData>§export_decls: Vec<ExportDeclData>§export_assignments: Vec<ExportAssignmentData>§import_attributes: Vec<ImportAttributesData>§import_attribute: Vec<ImportAttributeData>§binding_patterns: Vec<BindingPatternData>§binding_elements: Vec<BindingElementData>§property_assignments: Vec<PropertyAssignmentData>§shorthand_properties: Vec<ShorthandPropertyData>§spread_data: Vec<SpreadData>§variable_declarations: Vec<VariableDeclarationData>§for_in_of: Vec<ForInOfData>§jsx_elements: Vec<JsxElementData>§jsx_opening: Vec<JsxOpeningData>§jsx_closing: Vec<JsxClosingData>§jsx_fragments: Vec<JsxFragmentData>§jsx_attributes: Vec<JsxAttributesData>§jsx_attribute: Vec<JsxAttributeData>§jsx_spread_attributes: Vec<JsxSpreadAttributeData>§jsx_expressions: Vec<JsxExpressionData>§jsx_text: Vec<JsxTextData>§jsx_namespaced_names: Vec<JsxNamespacedNameData>§source_files: Vec<SourceFileData>§extended_info: Vec<ExtendedNodeInfo>Implementations§
Source§impl NodeArena
impl NodeArena
Sourcepub fn get_mut(&mut self, index: NodeIndex) -> Option<&mut Node>
pub fn get_mut(&mut self, index: NodeIndex) -> Option<&mut Node>
Get a mutable thin node by index
Sourcepub fn get_extended(&self, index: NodeIndex) -> Option<&ExtendedNodeInfo>
pub fn get_extended(&self, index: NodeIndex) -> Option<&ExtendedNodeInfo>
Get extended info for a node
Sourcepub fn get_extended_mut(
&mut self,
index: NodeIndex,
) -> Option<&mut ExtendedNodeInfo>
pub fn get_extended_mut( &mut self, index: NodeIndex, ) -> Option<&mut ExtendedNodeInfo>
Get mutable extended info for a node
Sourcepub fn get_identifier(&self, node: &Node) -> Option<&IdentifierData>
pub fn get_identifier(&self, node: &Node) -> Option<&IdentifierData>
Get identifier data for a node. Returns None if node is not an identifier or has no data.
Sourcepub fn get_literal(&self, node: &Node) -> Option<&LiteralData>
pub fn get_literal(&self, node: &Node) -> Option<&LiteralData>
Get literal data for a node. Returns None if node is not a literal or has no data.
Sourcepub fn get_binary_expr(&self, node: &Node) -> Option<&BinaryExprData>
pub fn get_binary_expr(&self, node: &Node) -> Option<&BinaryExprData>
Get binary expression data. Returns None if node is not a binary expression or has no data.
Sourcepub fn get_call_expr(&self, node: &Node) -> Option<&CallExprData>
pub fn get_call_expr(&self, node: &Node) -> Option<&CallExprData>
Get call expression data. Returns None if node is not a call/new expression or has no data.
Sourcepub fn is_immediately_invoked(&self, func_idx: NodeIndex) -> bool
pub fn is_immediately_invoked(&self, func_idx: NodeIndex) -> bool
Check if a function-like node is immediately invoked (IIFE pattern).
Detects patterns like (function() {})(), (() => expr)(),
((fn))() (arbitrary paren nesting), and new (function() {})().
Sourcepub fn skip_parenthesized(&self, idx: NodeIndex) -> NodeIndex
pub fn skip_parenthesized(&self, idx: NodeIndex) -> NodeIndex
Skip through parenthesized expressions to the underlying expression.
Unwraps any number of (expr) wrappers.
Uses a bounded loop (max 100 iterations) to guard against pathological input.
Sourcepub fn skip_parenthesized_and_assertions(&self, idx: NodeIndex) -> NodeIndex
pub fn skip_parenthesized_and_assertions(&self, idx: NodeIndex) -> NodeIndex
Skip through parenthesized, non-null assertion, and type assertion expressions.
Unwraps (expr), expr!, expr as T, <T>expr, and expr satisfies T wrappers.
Uses a bounded loop (max 100 iterations) to guard against pathological input.
Sourcepub fn is_namespace_instantiated(&self, namespace_idx: NodeIndex) -> bool
pub fn is_namespace_instantiated(&self, namespace_idx: NodeIndex) -> bool
Check whether a namespace/module declaration is instantiated (has runtime value declarations).
Returns true if the namespace contains value declarations (variables, functions,
classes, enums, expression statements, export assignments), or is a
NAMESPACE_EXPORT_DECLARATION (export as namespace X), which always produces a
runtime global.
Recursively walks dotted namespaces (namespace Foo.Bar) and EXPORT_DECLARATION
wrappers to find the innermost MODULE_BLOCK, then checks each statement.
Sourcepub fn get_access_expr(&self, node: &Node) -> Option<&AccessExprData>
pub fn get_access_expr(&self, node: &Node) -> Option<&AccessExprData>
Get access expression data (property access or element access). Returns None if node is not an access expression or has no data.
Sourcepub fn get_conditional_expr(&self, node: &Node) -> Option<&ConditionalExprData>
pub fn get_conditional_expr(&self, node: &Node) -> Option<&ConditionalExprData>
Get conditional expression data (ternary: a ? b : c). Returns None if node is not a conditional expression or has no data.
Sourcepub fn get_qualified_name(&self, node: &Node) -> Option<&QualifiedNameData>
pub fn get_qualified_name(&self, node: &Node) -> Option<&QualifiedNameData>
Get qualified name data (A.B syntax). Returns None if node is not a qualified name or has no data.
Sourcepub fn get_literal_expr(&self, node: &Node) -> Option<&LiteralExprData>
pub fn get_literal_expr(&self, node: &Node) -> Option<&LiteralExprData>
Get literal expression data (array or object literal). Returns None if node is not a literal expression or has no data.
Sourcepub fn get_property_assignment(
&self,
node: &Node,
) -> Option<&PropertyAssignmentData>
pub fn get_property_assignment( &self, node: &Node, ) -> Option<&PropertyAssignmentData>
Get property assignment data. Returns None if node is not a property assignment or has no data.
Sourcepub fn get_type_assertion(&self, node: &Node) -> Option<&TypeAssertionData>
pub fn get_type_assertion(&self, node: &Node) -> Option<&TypeAssertionData>
Get type assertion data (as/satisfies/type assertion). Returns None if node is not a type assertion or has no data.
Sourcepub fn get_unary_expr(&self, node: &Node) -> Option<&UnaryExprData>
pub fn get_unary_expr(&self, node: &Node) -> Option<&UnaryExprData>
Get unary expression data (prefix or postfix). Returns None if node is not a unary expression or has no data.
Sourcepub fn get_unary_expr_ex(&self, node: &Node) -> Option<&UnaryExprDataEx>
pub fn get_unary_expr_ex(&self, node: &Node) -> Option<&UnaryExprDataEx>
Get extended unary expression data (await/yield/non-null/spread). Returns None if node is not an await/yield/non-null/spread expression or has no data.
Sourcepub fn get_function(&self, node: &Node) -> Option<&FunctionData>
pub fn get_function(&self, node: &Node) -> Option<&FunctionData>
Get function data. Returns None if node is not a function-like node or has no data.
Sourcepub fn get_class(&self, node: &Node) -> Option<&ClassData>
pub fn get_class(&self, node: &Node) -> Option<&ClassData>
Get class data. Returns None if node is not a class declaration/expression or has no data.
Sourcepub fn get_block(&self, node: &Node) -> Option<&BlockData>
pub fn get_block(&self, node: &Node) -> Option<&BlockData>
Get block data. Returns None if node is not a block or has no data.
Sourcepub fn get_source_file(&self, node: &Node) -> Option<&SourceFileData>
pub fn get_source_file(&self, node: &Node) -> Option<&SourceFileData>
Get source file data. Returns None if node is not a source file or has no data.
Sourcepub fn get_variable(&self, node: &Node) -> Option<&VariableData>
pub fn get_variable(&self, node: &Node) -> Option<&VariableData>
Get variable data (VariableStatement or VariableDeclarationList).
Sourcepub fn get_variable_declaration(
&self,
node: &Node,
) -> Option<&VariableDeclarationData>
pub fn get_variable_declaration( &self, node: &Node, ) -> Option<&VariableDeclarationData>
Get variable declaration data.
Sourcepub fn get_interface(&self, node: &Node) -> Option<&InterfaceData>
pub fn get_interface(&self, node: &Node) -> Option<&InterfaceData>
Get interface data.
Sourcepub fn get_type_alias(&self, node: &Node) -> Option<&TypeAliasData>
pub fn get_type_alias(&self, node: &Node) -> Option<&TypeAliasData>
Get type alias data.
Sourcepub fn get_enum_member(&self, node: &Node) -> Option<&EnumMemberData>
pub fn get_enum_member(&self, node: &Node) -> Option<&EnumMemberData>
Get enum member data.
Sourcepub fn get_module(&self, node: &Node) -> Option<&ModuleData>
pub fn get_module(&self, node: &Node) -> Option<&ModuleData>
Get module data.
Sourcepub fn get_module_block(&self, node: &Node) -> Option<&ModuleBlockData>
pub fn get_module_block(&self, node: &Node) -> Option<&ModuleBlockData>
Get module block data.
Sourcepub fn get_if_statement(&self, node: &Node) -> Option<&IfStatementData>
pub fn get_if_statement(&self, node: &Node) -> Option<&IfStatementData>
Get if statement data.
Sourcepub fn get_for_in_of(&self, node: &Node) -> Option<&ForInOfData>
pub fn get_for_in_of(&self, node: &Node) -> Option<&ForInOfData>
Get for-in/for-of data.
Sourcepub fn get_switch(&self, node: &Node) -> Option<&SwitchData>
pub fn get_switch(&self, node: &Node) -> Option<&SwitchData>
Get switch data.
Sourcepub fn get_case_clause(&self, node: &Node) -> Option<&CaseClauseData>
pub fn get_case_clause(&self, node: &Node) -> Option<&CaseClauseData>
Get case clause data.
Sourcepub fn get_catch_clause(&self, node: &Node) -> Option<&CatchClauseData>
pub fn get_catch_clause(&self, node: &Node) -> Option<&CatchClauseData>
Get catch clause data.
Sourcepub fn get_labeled_statement(&self, node: &Node) -> Option<&LabeledData>
pub fn get_labeled_statement(&self, node: &Node) -> Option<&LabeledData>
Get labeled statement data.
Sourcepub fn get_jump_data(&self, node: &Node) -> Option<&JumpData>
pub fn get_jump_data(&self, node: &Node) -> Option<&JumpData>
Get jump data (break/continue statements).
Sourcepub fn get_with_statement(&self, node: &Node) -> Option<&IfStatementData>
pub fn get_with_statement(&self, node: &Node) -> Option<&IfStatementData>
Get with statement data (stored in if statement pool).
Sourcepub fn get_import_decl(&self, node: &Node) -> Option<&ImportDeclData>
pub fn get_import_decl(&self, node: &Node) -> Option<&ImportDeclData>
Get import declaration data (handles both IMPORT_DECLARATION and IMPORT_EQUALS_DECLARATION).
Sourcepub fn get_import_clause(&self, node: &Node) -> Option<&ImportClauseData>
pub fn get_import_clause(&self, node: &Node) -> Option<&ImportClauseData>
Get import clause data.
Sourcepub fn get_named_imports(&self, node: &Node) -> Option<&NamedImportsData>
pub fn get_named_imports(&self, node: &Node) -> Option<&NamedImportsData>
Get named imports/exports data.
Works for NAMED_IMPORTS, NAMESPACE_IMPORT, and NAMED_EXPORTS (they share the same data structure).
Sourcepub fn get_specifier(&self, node: &Node) -> Option<&SpecifierData>
pub fn get_specifier(&self, node: &Node) -> Option<&SpecifierData>
Get import/export specifier data.
Sourcepub fn get_export_decl(&self, node: &Node) -> Option<&ExportDeclData>
pub fn get_export_decl(&self, node: &Node) -> Option<&ExportDeclData>
Get export declaration data.
Sourcepub fn get_export_assignment(
&self,
node: &Node,
) -> Option<&ExportAssignmentData>
pub fn get_export_assignment( &self, node: &Node, ) -> Option<&ExportAssignmentData>
Get export assignment data (export = expr).
Sourcepub fn get_parameter(&self, node: &Node) -> Option<&ParameterData>
pub fn get_parameter(&self, node: &Node) -> Option<&ParameterData>
Get parameter data.
Sourcepub fn get_property_decl(&self, node: &Node) -> Option<&PropertyDeclData>
pub fn get_property_decl(&self, node: &Node) -> Option<&PropertyDeclData>
Get property declaration data.
Sourcepub fn get_method_decl(&self, node: &Node) -> Option<&MethodDeclData>
pub fn get_method_decl(&self, node: &Node) -> Option<&MethodDeclData>
Get method declaration data.
Sourcepub fn get_constructor(&self, node: &Node) -> Option<&ConstructorData>
pub fn get_constructor(&self, node: &Node) -> Option<&ConstructorData>
Get constructor data.
Sourcepub fn get_accessor(&self, node: &Node) -> Option<&AccessorData>
pub fn get_accessor(&self, node: &Node) -> Option<&AccessorData>
Get accessor data (get/set accessor).
Sourcepub fn get_decorator(&self, node: &Node) -> Option<&DecoratorData>
pub fn get_decorator(&self, node: &Node) -> Option<&DecoratorData>
Get decorator data.
Sourcepub fn get_type_ref(&self, node: &Node) -> Option<&TypeRefData>
pub fn get_type_ref(&self, node: &Node) -> Option<&TypeRefData>
Get type reference data.
Sourcepub fn get_expression_statement(
&self,
node: &Node,
) -> Option<&ExprStatementData>
pub fn get_expression_statement( &self, node: &Node, ) -> Option<&ExprStatementData>
Get expression statement data (returns the expression node index).
Sourcepub fn get_return_statement(&self, node: &Node) -> Option<&ReturnData>
pub fn get_return_statement(&self, node: &Node) -> Option<&ReturnData>
Get return statement data (returns the expression node index).
Sourcepub fn get_jsx_element(&self, node: &Node) -> Option<&JsxElementData>
pub fn get_jsx_element(&self, node: &Node) -> Option<&JsxElementData>
Get JSX element data.
Sourcepub fn get_jsx_opening(&self, node: &Node) -> Option<&JsxOpeningData>
pub fn get_jsx_opening(&self, node: &Node) -> Option<&JsxOpeningData>
Get JSX opening/self-closing element data.
Sourcepub fn get_jsx_closing(&self, node: &Node) -> Option<&JsxClosingData>
pub fn get_jsx_closing(&self, node: &Node) -> Option<&JsxClosingData>
Get JSX closing element data.
Sourcepub fn get_jsx_fragment(&self, node: &Node) -> Option<&JsxFragmentData>
pub fn get_jsx_fragment(&self, node: &Node) -> Option<&JsxFragmentData>
Get JSX fragment data.
Sourcepub fn get_jsx_attributes(&self, node: &Node) -> Option<&JsxAttributesData>
pub fn get_jsx_attributes(&self, node: &Node) -> Option<&JsxAttributesData>
Get JSX attributes data.
Sourcepub fn get_jsx_attribute(&self, node: &Node) -> Option<&JsxAttributeData>
pub fn get_jsx_attribute(&self, node: &Node) -> Option<&JsxAttributeData>
Get JSX attribute data.
Sourcepub fn get_jsx_spread_attribute(
&self,
node: &Node,
) -> Option<&JsxSpreadAttributeData>
pub fn get_jsx_spread_attribute( &self, node: &Node, ) -> Option<&JsxSpreadAttributeData>
Get JSX spread attribute data.
Sourcepub fn get_jsx_expression(&self, node: &Node) -> Option<&JsxExpressionData>
pub fn get_jsx_expression(&self, node: &Node) -> Option<&JsxExpressionData>
Get JSX expression data.
Sourcepub fn get_jsx_text(&self, node: &Node) -> Option<&JsxTextData>
pub fn get_jsx_text(&self, node: &Node) -> Option<&JsxTextData>
Get JSX text data.
Sourcepub fn get_jsx_namespaced_name(
&self,
node: &Node,
) -> Option<&JsxNamespacedNameData>
pub fn get_jsx_namespaced_name( &self, node: &Node, ) -> Option<&JsxNamespacedNameData>
Get JSX namespaced name data.
Sourcepub fn get_signature(&self, node: &Node) -> Option<&SignatureData>
pub fn get_signature(&self, node: &Node) -> Option<&SignatureData>
Get signature data (call, construct, method, property signatures).
Sourcepub fn get_index_signature(&self, node: &Node) -> Option<&IndexSignatureData>
pub fn get_index_signature(&self, node: &Node) -> Option<&IndexSignatureData>
Get index signature data.
Sourcepub fn get_heritage_clause(&self, node: &Node) -> Option<&HeritageData>
pub fn get_heritage_clause(&self, node: &Node) -> Option<&HeritageData>
Get heritage clause data.
Sourcepub fn get_composite_type(&self, node: &Node) -> Option<&CompositeTypeData>
pub fn get_composite_type(&self, node: &Node) -> Option<&CompositeTypeData>
Get composite type data (union or intersection).
Sourcepub fn get_array_type(&self, node: &Node) -> Option<&ArrayTypeData>
pub fn get_array_type(&self, node: &Node) -> Option<&ArrayTypeData>
Get array type data.
Sourcepub fn get_tuple_type(&self, node: &Node) -> Option<&TupleTypeData>
pub fn get_tuple_type(&self, node: &Node) -> Option<&TupleTypeData>
Get tuple type data.
Sourcepub fn get_function_type(&self, node: &Node) -> Option<&FunctionTypeData>
pub fn get_function_type(&self, node: &Node) -> Option<&FunctionTypeData>
Get function type data.
Sourcepub fn get_type_literal(&self, node: &Node) -> Option<&TypeLiteralData>
pub fn get_type_literal(&self, node: &Node) -> Option<&TypeLiteralData>
Get type literal data.
Sourcepub fn get_conditional_type(&self, node: &Node) -> Option<&ConditionalTypeData>
pub fn get_conditional_type(&self, node: &Node) -> Option<&ConditionalTypeData>
Get conditional type data.
Sourcepub fn get_mapped_type(&self, node: &Node) -> Option<&MappedTypeData>
pub fn get_mapped_type(&self, node: &Node) -> Option<&MappedTypeData>
Get mapped type data.
Sourcepub fn get_indexed_access_type(
&self,
node: &Node,
) -> Option<&IndexedAccessTypeData>
pub fn get_indexed_access_type( &self, node: &Node, ) -> Option<&IndexedAccessTypeData>
Get indexed access type data.
Sourcepub fn get_literal_type(&self, node: &Node) -> Option<&LiteralTypeData>
pub fn get_literal_type(&self, node: &Node) -> Option<&LiteralTypeData>
Get literal type data.
Sourcepub fn get_wrapped_type(&self, node: &Node) -> Option<&WrappedTypeData>
pub fn get_wrapped_type(&self, node: &Node) -> Option<&WrappedTypeData>
Get wrapped type data (parenthesized, optional, rest types).
Sourcepub fn get_heritage(&self, node: &Node) -> Option<&HeritageData>
pub fn get_heritage(&self, node: &Node) -> Option<&HeritageData>
Get heritage clause data.
Sourcepub fn get_expr_type_args(&self, node: &Node) -> Option<&ExprWithTypeArgsData>
pub fn get_expr_type_args(&self, node: &Node) -> Option<&ExprWithTypeArgsData>
Get expression with type arguments data (e.g., extends Base<T>).
Sourcepub fn get_type_query(&self, node: &Node) -> Option<&TypeQueryData>
pub fn get_type_query(&self, node: &Node) -> Option<&TypeQueryData>
Get type query data (typeof in type position).
Sourcepub fn get_type_operator(&self, node: &Node) -> Option<&TypeOperatorData>
pub fn get_type_operator(&self, node: &Node) -> Option<&TypeOperatorData>
Get type operator data (keyof, unique, readonly).
Sourcepub fn get_infer_type(&self, node: &Node) -> Option<&InferTypeData>
pub fn get_infer_type(&self, node: &Node) -> Option<&InferTypeData>
Get infer type data.
Sourcepub fn get_template_literal_type(
&self,
node: &Node,
) -> Option<&TemplateLiteralTypeData>
pub fn get_template_literal_type( &self, node: &Node, ) -> Option<&TemplateLiteralTypeData>
Get template literal type data.
Sourcepub fn get_named_tuple_member(
&self,
node: &Node,
) -> Option<&NamedTupleMemberData>
pub fn get_named_tuple_member( &self, node: &Node, ) -> Option<&NamedTupleMemberData>
Get named tuple member data.
Sourcepub fn get_type_predicate(&self, node: &Node) -> Option<&TypePredicateData>
pub fn get_type_predicate(&self, node: &Node) -> Option<&TypePredicateData>
Get type predicate data.
Sourcepub fn get_type_parameter(&self, node: &Node) -> Option<&TypeParameterData>
pub fn get_type_parameter(&self, node: &Node) -> Option<&TypeParameterData>
Get type parameter data.
Sourcepub fn get_parenthesized(&self, node: &Node) -> Option<&ParenthesizedData>
pub fn get_parenthesized(&self, node: &Node) -> Option<&ParenthesizedData>
Get parenthesized expression data. Returns None if node is not a parenthesized expression or has no data.
Sourcepub fn get_template_expr(&self, node: &Node) -> Option<&TemplateExprData>
pub fn get_template_expr(&self, node: &Node) -> Option<&TemplateExprData>
Get template expression data.
Sourcepub fn get_template_span(&self, node: &Node) -> Option<&TemplateSpanData>
pub fn get_template_span(&self, node: &Node) -> Option<&TemplateSpanData>
Get template span data. Accepts both TEMPLATE_SPAN (expression-level)
and TEMPLATE_LITERAL_TYPE_SPAN (type-level) since both store data in
the same template_spans array.
Sourcepub fn get_tagged_template(&self, node: &Node) -> Option<&TaggedTemplateData>
pub fn get_tagged_template(&self, node: &Node) -> Option<&TaggedTemplateData>
Get tagged template expression data.
Sourcepub fn get_spread(&self, node: &Node) -> Option<&SpreadData>
pub fn get_spread(&self, node: &Node) -> Option<&SpreadData>
Get spread element/assignment data.
Sourcepub fn get_shorthand_property(
&self,
node: &Node,
) -> Option<&ShorthandPropertyData>
pub fn get_shorthand_property( &self, node: &Node, ) -> Option<&ShorthandPropertyData>
Get shorthand property assignment data.
Sourcepub fn get_binding_pattern(&self, node: &Node) -> Option<&BindingPatternData>
pub fn get_binding_pattern(&self, node: &Node) -> Option<&BindingPatternData>
Get binding pattern data (ObjectBindingPattern or ArrayBindingPattern).
Sourcepub fn get_binding_element(&self, node: &Node) -> Option<&BindingElementData>
pub fn get_binding_element(&self, node: &Node) -> Option<&BindingElementData>
Get binding element data.
Sourcepub fn get_computed_property(
&self,
node: &Node,
) -> Option<&ComputedPropertyData>
pub fn get_computed_property( &self, node: &Node, ) -> Option<&ComputedPropertyData>
Get computed property name data
Source§impl NodeArena
impl NodeArena
pub fn get_identifier_at(&self, index: NodeIndex) -> Option<&IdentifierData>
pub fn get_literal_at(&self, index: NodeIndex) -> Option<&LiteralData>
pub fn get_binary_expr_at(&self, index: NodeIndex) -> Option<&BinaryExprData>
pub fn get_call_expr_at(&self, index: NodeIndex) -> Option<&CallExprData>
pub fn get_access_expr_at(&self, index: NodeIndex) -> Option<&AccessExprData>
pub fn get_conditional_expr_at( &self, index: NodeIndex, ) -> Option<&ConditionalExprData>
pub fn get_qualified_name_at( &self, index: NodeIndex, ) -> Option<&QualifiedNameData>
pub fn get_literal_expr_at(&self, index: NodeIndex) -> Option<&LiteralExprData>
pub fn get_property_assignment_at( &self, index: NodeIndex, ) -> Option<&PropertyAssignmentData>
pub fn get_type_assertion_at( &self, index: NodeIndex, ) -> Option<&TypeAssertionData>
pub fn get_unary_expr_at(&self, index: NodeIndex) -> Option<&UnaryExprData>
pub fn get_unary_expr_ex_at(&self, index: NodeIndex) -> Option<&UnaryExprDataEx>
pub fn get_function_at(&self, index: NodeIndex) -> Option<&FunctionData>
pub fn get_class_at(&self, index: NodeIndex) -> Option<&ClassData>
pub fn get_block_at(&self, index: NodeIndex) -> Option<&BlockData>
pub fn get_source_file_at(&self, index: NodeIndex) -> Option<&SourceFileData>
pub fn get_variable_at(&self, index: NodeIndex) -> Option<&VariableData>
pub fn get_variable_declaration_at( &self, index: NodeIndex, ) -> Option<&VariableDeclarationData>
pub fn get_interface_at(&self, index: NodeIndex) -> Option<&InterfaceData>
pub fn get_type_alias_at(&self, index: NodeIndex) -> Option<&TypeAliasData>
pub fn get_enum_at(&self, index: NodeIndex) -> Option<&EnumData>
pub fn get_enum_member_at(&self, index: NodeIndex) -> Option<&EnumMemberData>
pub fn get_module_at(&self, index: NodeIndex) -> Option<&ModuleData>
pub fn get_module_block_at(&self, index: NodeIndex) -> Option<&ModuleBlockData>
pub fn get_if_statement_at(&self, index: NodeIndex) -> Option<&IfStatementData>
pub fn get_loop_at(&self, index: NodeIndex) -> Option<&LoopData>
pub fn get_for_in_of_at(&self, index: NodeIndex) -> Option<&ForInOfData>
pub fn get_switch_at(&self, index: NodeIndex) -> Option<&SwitchData>
pub fn get_case_clause_at(&self, index: NodeIndex) -> Option<&CaseClauseData>
pub fn get_try_at(&self, index: NodeIndex) -> Option<&TryData>
pub fn get_catch_clause_at(&self, index: NodeIndex) -> Option<&CatchClauseData>
pub fn get_labeled_statement_at(&self, index: NodeIndex) -> Option<&LabeledData>
pub fn get_jump_data_at(&self, index: NodeIndex) -> Option<&JumpData>
pub fn get_with_statement_at( &self, index: NodeIndex, ) -> Option<&IfStatementData>
pub fn get_import_decl_at(&self, index: NodeIndex) -> Option<&ImportDeclData>
pub fn get_import_clause_at( &self, index: NodeIndex, ) -> Option<&ImportClauseData>
pub fn get_named_imports_at( &self, index: NodeIndex, ) -> Option<&NamedImportsData>
pub fn get_specifier_at(&self, index: NodeIndex) -> Option<&SpecifierData>
pub fn get_export_decl_at(&self, index: NodeIndex) -> Option<&ExportDeclData>
pub fn get_export_assignment_at( &self, index: NodeIndex, ) -> Option<&ExportAssignmentData>
pub fn get_parameter_at(&self, index: NodeIndex) -> Option<&ParameterData>
pub fn get_property_decl_at( &self, index: NodeIndex, ) -> Option<&PropertyDeclData>
pub fn get_method_decl_at(&self, index: NodeIndex) -> Option<&MethodDeclData>
pub fn get_constructor_at(&self, index: NodeIndex) -> Option<&ConstructorData>
pub fn get_accessor_at(&self, index: NodeIndex) -> Option<&AccessorData>
pub fn get_decorator_at(&self, index: NodeIndex) -> Option<&DecoratorData>
pub fn get_type_ref_at(&self, index: NodeIndex) -> Option<&TypeRefData>
pub fn get_expression_statement_at( &self, index: NodeIndex, ) -> Option<&ExprStatementData>
pub fn get_return_statement_at(&self, index: NodeIndex) -> Option<&ReturnData>
pub fn get_jsx_element_at(&self, index: NodeIndex) -> Option<&JsxElementData>
pub fn get_jsx_opening_at(&self, index: NodeIndex) -> Option<&JsxOpeningData>
pub fn get_jsx_closing_at(&self, index: NodeIndex) -> Option<&JsxClosingData>
pub fn get_jsx_fragment_at(&self, index: NodeIndex) -> Option<&JsxFragmentData>
pub fn get_jsx_attributes_at( &self, index: NodeIndex, ) -> Option<&JsxAttributesData>
pub fn get_jsx_attribute_at( &self, index: NodeIndex, ) -> Option<&JsxAttributeData>
pub fn get_jsx_spread_attribute_at( &self, index: NodeIndex, ) -> Option<&JsxSpreadAttributeData>
pub fn get_jsx_expression_at( &self, index: NodeIndex, ) -> Option<&JsxExpressionData>
pub fn get_jsx_text_at(&self, index: NodeIndex) -> Option<&JsxTextData>
pub fn get_jsx_namespaced_name_at( &self, index: NodeIndex, ) -> Option<&JsxNamespacedNameData>
pub fn get_signature_at(&self, index: NodeIndex) -> Option<&SignatureData>
pub fn get_index_signature_at( &self, index: NodeIndex, ) -> Option<&IndexSignatureData>
pub fn get_heritage_clause_at(&self, index: NodeIndex) -> Option<&HeritageData>
pub fn get_composite_type_at( &self, index: NodeIndex, ) -> Option<&CompositeTypeData>
pub fn get_array_type_at(&self, index: NodeIndex) -> Option<&ArrayTypeData>
pub fn get_tuple_type_at(&self, index: NodeIndex) -> Option<&TupleTypeData>
pub fn get_function_type_at( &self, index: NodeIndex, ) -> Option<&FunctionTypeData>
pub fn get_type_literal_at(&self, index: NodeIndex) -> Option<&TypeLiteralData>
pub fn get_conditional_type_at( &self, index: NodeIndex, ) -> Option<&ConditionalTypeData>
pub fn get_mapped_type_at(&self, index: NodeIndex) -> Option<&MappedTypeData>
pub fn get_indexed_access_type_at( &self, index: NodeIndex, ) -> Option<&IndexedAccessTypeData>
pub fn get_literal_type_at(&self, index: NodeIndex) -> Option<&LiteralTypeData>
pub fn get_wrapped_type_at(&self, index: NodeIndex) -> Option<&WrappedTypeData>
pub fn get_expr_type_args_at( &self, index: NodeIndex, ) -> Option<&ExprWithTypeArgsData>
pub fn get_type_query_at(&self, index: NodeIndex) -> Option<&TypeQueryData>
pub fn get_type_operator_at( &self, index: NodeIndex, ) -> Option<&TypeOperatorData>
pub fn get_infer_type_at(&self, index: NodeIndex) -> Option<&InferTypeData>
pub fn get_template_literal_type_at( &self, index: NodeIndex, ) -> Option<&TemplateLiteralTypeData>
pub fn get_named_tuple_member_at( &self, index: NodeIndex, ) -> Option<&NamedTupleMemberData>
pub fn get_type_predicate_at( &self, index: NodeIndex, ) -> Option<&TypePredicateData>
pub fn get_type_parameter_at( &self, index: NodeIndex, ) -> Option<&TypeParameterData>
pub fn get_parenthesized_at( &self, index: NodeIndex, ) -> Option<&ParenthesizedData>
pub fn get_template_expr_at( &self, index: NodeIndex, ) -> Option<&TemplateExprData>
pub fn get_template_span_at( &self, index: NodeIndex, ) -> Option<&TemplateSpanData>
pub fn get_tagged_template_at( &self, index: NodeIndex, ) -> Option<&TaggedTemplateData>
pub fn get_spread_at(&self, index: NodeIndex) -> Option<&SpreadData>
pub fn get_shorthand_property_at( &self, index: NodeIndex, ) -> Option<&ShorthandPropertyData>
pub fn get_binding_pattern_at( &self, index: NodeIndex, ) -> Option<&BindingPatternData>
pub fn get_binding_element_at( &self, index: NodeIndex, ) -> Option<&BindingElementData>
pub fn get_computed_property_at( &self, index: NodeIndex, ) -> Option<&ComputedPropertyData>
Source§impl NodeArena
impl NodeArena
pub fn new() -> NodeArena
Sourcepub fn set_interner(&mut self, interner: Interner)
pub fn set_interner(&mut self, interner: Interner)
Set the interner (called after parsing to transfer ownership from scanner)
Sourcepub fn resolve_identifier_text<'a>(
&'a self,
data: &'a IdentifierData,
) -> &'a str
pub fn resolve_identifier_text<'a>( &'a self, data: &'a IdentifierData, ) -> &'a str
Resolve an identifier text using Atom (fast) or escaped_text (fallback).
Sourcepub fn with_capacity(capacity: usize) -> NodeArena
pub fn with_capacity(capacity: usize) -> NodeArena
Create an arena with pre-allocated capacity. Uses heuristic ratios based on typical TypeScript AST composition.
pub fn clear(&mut self)
Sourcepub fn add_token(&mut self, kind: u16, pos: u32, end: u32) -> NodeIndex
pub fn add_token(&mut self, kind: u16, pos: u32, end: u32) -> NodeIndex
Add a token node (no additional data)
Sourcepub fn create_modifier(&mut self, kind: SyntaxKind, pos: u32) -> NodeIndex
pub fn create_modifier(&mut self, kind: SyntaxKind, pos: u32) -> NodeIndex
Create a modifier token (static, public, private, etc.)
Sourcepub fn add_identifier(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: IdentifierData,
) -> NodeIndex
pub fn add_identifier( &mut self, kind: u16, pos: u32, end: u32, data: IdentifierData, ) -> NodeIndex
Add an identifier node
Sourcepub fn add_literal(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: LiteralData,
) -> NodeIndex
pub fn add_literal( &mut self, kind: u16, pos: u32, end: u32, data: LiteralData, ) -> NodeIndex
Add a literal node
Sourcepub fn add_binary_expr(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: BinaryExprData,
) -> NodeIndex
pub fn add_binary_expr( &mut self, kind: u16, pos: u32, end: u32, data: BinaryExprData, ) -> NodeIndex
Add a binary expression
Sourcepub fn add_call_expr(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: CallExprData,
) -> NodeIndex
pub fn add_call_expr( &mut self, kind: u16, pos: u32, end: u32, data: CallExprData, ) -> NodeIndex
Add a call expression
Sourcepub fn add_function(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: FunctionData,
) -> NodeIndex
pub fn add_function( &mut self, kind: u16, pos: u32, end: u32, data: FunctionData, ) -> NodeIndex
Add a function node
Sourcepub fn add_class(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ClassData,
) -> NodeIndex
pub fn add_class( &mut self, kind: u16, pos: u32, end: u32, data: ClassData, ) -> NodeIndex
Add a class node
Sourcepub fn add_block(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: BlockData,
) -> NodeIndex
pub fn add_block( &mut self, kind: u16, pos: u32, end: u32, data: BlockData, ) -> NodeIndex
Add a block node
Sourcepub fn add_source_file(
&mut self,
pos: u32,
end: u32,
data: SourceFileData,
) -> NodeIndex
pub fn add_source_file( &mut self, pos: u32, end: u32, data: SourceFileData, ) -> NodeIndex
Add a source file node
Sourcepub fn add_qualified_name(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: QualifiedNameData,
) -> NodeIndex
pub fn add_qualified_name( &mut self, kind: u16, pos: u32, end: u32, data: QualifiedNameData, ) -> NodeIndex
Add a qualified name node
Sourcepub fn add_computed_property(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ComputedPropertyData,
) -> NodeIndex
pub fn add_computed_property( &mut self, kind: u16, pos: u32, end: u32, data: ComputedPropertyData, ) -> NodeIndex
Add a computed property name node
Sourcepub fn add_unary_expr(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: UnaryExprData,
) -> NodeIndex
pub fn add_unary_expr( &mut self, kind: u16, pos: u32, end: u32, data: UnaryExprData, ) -> NodeIndex
Add a unary expression node
Sourcepub fn add_access_expr(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: AccessExprData,
) -> NodeIndex
pub fn add_access_expr( &mut self, kind: u16, pos: u32, end: u32, data: AccessExprData, ) -> NodeIndex
Add a property/element access expression node
Sourcepub fn add_conditional_expr(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ConditionalExprData,
) -> NodeIndex
pub fn add_conditional_expr( &mut self, kind: u16, pos: u32, end: u32, data: ConditionalExprData, ) -> NodeIndex
Add a conditional expression node (a ? b : c)
Sourcepub fn add_literal_expr(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: LiteralExprData,
) -> NodeIndex
pub fn add_literal_expr( &mut self, kind: u16, pos: u32, end: u32, data: LiteralExprData, ) -> NodeIndex
Add an object/array literal expression node
Sourcepub fn add_parenthesized(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ParenthesizedData,
) -> NodeIndex
pub fn add_parenthesized( &mut self, kind: u16, pos: u32, end: u32, data: ParenthesizedData, ) -> NodeIndex
Add a parenthesized expression node
Sourcepub fn add_unary_expr_ex(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: UnaryExprDataEx,
) -> NodeIndex
pub fn add_unary_expr_ex( &mut self, kind: u16, pos: u32, end: u32, data: UnaryExprDataEx, ) -> NodeIndex
Add a spread/await/yield expression node
Sourcepub fn add_type_assertion(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypeAssertionData,
) -> NodeIndex
pub fn add_type_assertion( &mut self, kind: u16, pos: u32, end: u32, data: TypeAssertionData, ) -> NodeIndex
Add a type assertion expression node
Sourcepub fn add_template_expr(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TemplateExprData,
) -> NodeIndex
pub fn add_template_expr( &mut self, kind: u16, pos: u32, end: u32, data: TemplateExprData, ) -> NodeIndex
Add a template expression node
Sourcepub fn add_template_span(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TemplateSpanData,
) -> NodeIndex
pub fn add_template_span( &mut self, kind: u16, pos: u32, end: u32, data: TemplateSpanData, ) -> NodeIndex
Add a template span node
Sourcepub fn add_tagged_template(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TaggedTemplateData,
) -> NodeIndex
pub fn add_tagged_template( &mut self, kind: u16, pos: u32, end: u32, data: TaggedTemplateData, ) -> NodeIndex
Add a tagged template expression node
Sourcepub fn add_interface(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: InterfaceData,
) -> NodeIndex
pub fn add_interface( &mut self, kind: u16, pos: u32, end: u32, data: InterfaceData, ) -> NodeIndex
Add an interface declaration node
Sourcepub fn add_type_alias(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypeAliasData,
) -> NodeIndex
pub fn add_type_alias( &mut self, kind: u16, pos: u32, end: u32, data: TypeAliasData, ) -> NodeIndex
Add a type alias declaration node
Sourcepub fn add_enum(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: EnumData,
) -> NodeIndex
pub fn add_enum( &mut self, kind: u16, pos: u32, end: u32, data: EnumData, ) -> NodeIndex
Add an enum declaration node
Sourcepub fn add_enum_member(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: EnumMemberData,
) -> NodeIndex
pub fn add_enum_member( &mut self, kind: u16, pos: u32, end: u32, data: EnumMemberData, ) -> NodeIndex
Add an enum member node
Sourcepub fn add_module(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ModuleData,
) -> NodeIndex
pub fn add_module( &mut self, kind: u16, pos: u32, end: u32, data: ModuleData, ) -> NodeIndex
Add a module declaration node
Sourcepub fn add_module_block(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ModuleBlockData,
) -> NodeIndex
pub fn add_module_block( &mut self, kind: u16, pos: u32, end: u32, data: ModuleBlockData, ) -> NodeIndex
Add a module block node: { statements }
Sourcepub fn add_signature(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: SignatureData,
) -> NodeIndex
pub fn add_signature( &mut self, kind: u16, pos: u32, end: u32, data: SignatureData, ) -> NodeIndex
Add a signature node (property/method signature)
Sourcepub fn add_index_signature(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: IndexSignatureData,
) -> NodeIndex
pub fn add_index_signature( &mut self, kind: u16, pos: u32, end: u32, data: IndexSignatureData, ) -> NodeIndex
Add an index signature node
Sourcepub fn add_property_decl(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: PropertyDeclData,
) -> NodeIndex
pub fn add_property_decl( &mut self, kind: u16, pos: u32, end: u32, data: PropertyDeclData, ) -> NodeIndex
Add a property declaration node
Sourcepub fn add_method_decl(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: MethodDeclData,
) -> NodeIndex
pub fn add_method_decl( &mut self, kind: u16, pos: u32, end: u32, data: MethodDeclData, ) -> NodeIndex
Add a method declaration node
Sourcepub fn add_constructor(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ConstructorData,
) -> NodeIndex
pub fn add_constructor( &mut self, kind: u16, pos: u32, end: u32, data: ConstructorData, ) -> NodeIndex
Add a constructor declaration node
Sourcepub fn add_accessor(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: AccessorData,
) -> NodeIndex
pub fn add_accessor( &mut self, kind: u16, pos: u32, end: u32, data: AccessorData, ) -> NodeIndex
Add an accessor declaration node (get/set)
Sourcepub fn add_parameter(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ParameterData,
) -> NodeIndex
pub fn add_parameter( &mut self, kind: u16, pos: u32, end: u32, data: ParameterData, ) -> NodeIndex
Add a parameter declaration node
Sourcepub fn add_type_parameter(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypeParameterData,
) -> NodeIndex
pub fn add_type_parameter( &mut self, kind: u16, pos: u32, end: u32, data: TypeParameterData, ) -> NodeIndex
Add a type parameter declaration node
Sourcepub fn add_decorator(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: DecoratorData,
) -> NodeIndex
pub fn add_decorator( &mut self, kind: u16, pos: u32, end: u32, data: DecoratorData, ) -> NodeIndex
Add a decorator node
Sourcepub fn add_heritage(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: HeritageData,
) -> NodeIndex
pub fn add_heritage( &mut self, kind: u16, pos: u32, end: u32, data: HeritageData, ) -> NodeIndex
Add a heritage clause node
Sourcepub fn add_expr_with_type_args(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ExprWithTypeArgsData,
) -> NodeIndex
pub fn add_expr_with_type_args( &mut self, kind: u16, pos: u32, end: u32, data: ExprWithTypeArgsData, ) -> NodeIndex
Add an expression with type arguments node
Sourcepub fn add_if_statement(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: IfStatementData,
) -> NodeIndex
pub fn add_if_statement( &mut self, kind: u16, pos: u32, end: u32, data: IfStatementData, ) -> NodeIndex
Add an if statement node
Sourcepub fn add_loop(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: LoopData,
) -> NodeIndex
pub fn add_loop( &mut self, kind: u16, pos: u32, end: u32, data: LoopData, ) -> NodeIndex
Add a loop node (for/while/do)
Sourcepub fn add_variable(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: VariableData,
) -> NodeIndex
pub fn add_variable( &mut self, kind: u16, pos: u32, end: u32, data: VariableData, ) -> NodeIndex
Add a variable statement/declaration list node
Sourcepub fn add_variable_with_flags(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: VariableData,
flags: u16,
) -> NodeIndex
pub fn add_variable_with_flags( &mut self, kind: u16, pos: u32, end: u32, data: VariableData, flags: u16, ) -> NodeIndex
Add a variable statement/declaration list node with flags
Sourcepub fn add_return(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ReturnData,
) -> NodeIndex
pub fn add_return( &mut self, kind: u16, pos: u32, end: u32, data: ReturnData, ) -> NodeIndex
Add a return/throw statement node
Sourcepub fn add_expr_statement(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ExprStatementData,
) -> NodeIndex
pub fn add_expr_statement( &mut self, kind: u16, pos: u32, end: u32, data: ExprStatementData, ) -> NodeIndex
Add an expression statement node
Sourcepub fn add_switch(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: SwitchData,
) -> NodeIndex
pub fn add_switch( &mut self, kind: u16, pos: u32, end: u32, data: SwitchData, ) -> NodeIndex
Add a switch statement node
Sourcepub fn add_case_clause(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: CaseClauseData,
) -> NodeIndex
pub fn add_case_clause( &mut self, kind: u16, pos: u32, end: u32, data: CaseClauseData, ) -> NodeIndex
Add a case/default clause node
Sourcepub fn add_try(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TryData,
) -> NodeIndex
pub fn add_try( &mut self, kind: u16, pos: u32, end: u32, data: TryData, ) -> NodeIndex
Add a try statement node
Sourcepub fn add_catch_clause(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: CatchClauseData,
) -> NodeIndex
pub fn add_catch_clause( &mut self, kind: u16, pos: u32, end: u32, data: CatchClauseData, ) -> NodeIndex
Add a catch clause node
Sourcepub fn add_labeled(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: LabeledData,
) -> NodeIndex
pub fn add_labeled( &mut self, kind: u16, pos: u32, end: u32, data: LabeledData, ) -> NodeIndex
Add a labeled statement node
Sourcepub fn add_jump(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JumpData,
) -> NodeIndex
pub fn add_jump( &mut self, kind: u16, pos: u32, end: u32, data: JumpData, ) -> NodeIndex
Add a break/continue statement node
Sourcepub fn add_with(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: WithData,
) -> NodeIndex
pub fn add_with( &mut self, kind: u16, pos: u32, end: u32, data: WithData, ) -> NodeIndex
Add a with statement node
Sourcepub fn add_type_ref(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypeRefData,
) -> NodeIndex
pub fn add_type_ref( &mut self, kind: u16, pos: u32, end: u32, data: TypeRefData, ) -> NodeIndex
Add a type reference node
Sourcepub fn add_composite_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: CompositeTypeData,
) -> NodeIndex
pub fn add_composite_type( &mut self, kind: u16, pos: u32, end: u32, data: CompositeTypeData, ) -> NodeIndex
Add a union/intersection type node
Sourcepub fn add_function_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: FunctionTypeData,
) -> NodeIndex
pub fn add_function_type( &mut self, kind: u16, pos: u32, end: u32, data: FunctionTypeData, ) -> NodeIndex
Add a function/constructor type node
Sourcepub fn add_type_query(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypeQueryData,
) -> NodeIndex
pub fn add_type_query( &mut self, kind: u16, pos: u32, end: u32, data: TypeQueryData, ) -> NodeIndex
Add a type query node (typeof)
Sourcepub fn add_type_literal(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypeLiteralData,
) -> NodeIndex
pub fn add_type_literal( &mut self, kind: u16, pos: u32, end: u32, data: TypeLiteralData, ) -> NodeIndex
Add a type literal node
Sourcepub fn add_array_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ArrayTypeData,
) -> NodeIndex
pub fn add_array_type( &mut self, kind: u16, pos: u32, end: u32, data: ArrayTypeData, ) -> NodeIndex
Add an array type node
Sourcepub fn add_tuple_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TupleTypeData,
) -> NodeIndex
pub fn add_tuple_type( &mut self, kind: u16, pos: u32, end: u32, data: TupleTypeData, ) -> NodeIndex
Add a tuple type node
Sourcepub fn add_wrapped_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: WrappedTypeData,
) -> NodeIndex
pub fn add_wrapped_type( &mut self, kind: u16, pos: u32, end: u32, data: WrappedTypeData, ) -> NodeIndex
Add an optional/rest type node
Sourcepub fn add_conditional_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ConditionalTypeData,
) -> NodeIndex
pub fn add_conditional_type( &mut self, kind: u16, pos: u32, end: u32, data: ConditionalTypeData, ) -> NodeIndex
Add a conditional type node
Sourcepub fn add_infer_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: InferTypeData,
) -> NodeIndex
pub fn add_infer_type( &mut self, kind: u16, pos: u32, end: u32, data: InferTypeData, ) -> NodeIndex
Add an infer type node
Sourcepub fn add_type_operator(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypeOperatorData,
) -> NodeIndex
pub fn add_type_operator( &mut self, kind: u16, pos: u32, end: u32, data: TypeOperatorData, ) -> NodeIndex
Add a type operator node (keyof, unique, readonly)
Sourcepub fn add_indexed_access_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: IndexedAccessTypeData,
) -> NodeIndex
pub fn add_indexed_access_type( &mut self, kind: u16, pos: u32, end: u32, data: IndexedAccessTypeData, ) -> NodeIndex
Add an indexed access type node
Sourcepub fn add_mapped_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: MappedTypeData,
) -> NodeIndex
pub fn add_mapped_type( &mut self, kind: u16, pos: u32, end: u32, data: MappedTypeData, ) -> NodeIndex
Add a mapped type node
Sourcepub fn add_literal_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: LiteralTypeData,
) -> NodeIndex
pub fn add_literal_type( &mut self, kind: u16, pos: u32, end: u32, data: LiteralTypeData, ) -> NodeIndex
Add a literal type node
Sourcepub fn add_template_literal_type(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TemplateLiteralTypeData,
) -> NodeIndex
pub fn add_template_literal_type( &mut self, kind: u16, pos: u32, end: u32, data: TemplateLiteralTypeData, ) -> NodeIndex
Add a template literal type node
Sourcepub fn add_named_tuple_member(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: NamedTupleMemberData,
) -> NodeIndex
pub fn add_named_tuple_member( &mut self, kind: u16, pos: u32, end: u32, data: NamedTupleMemberData, ) -> NodeIndex
Add a named tuple member node
Sourcepub fn add_type_predicate(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: TypePredicateData,
) -> NodeIndex
pub fn add_type_predicate( &mut self, kind: u16, pos: u32, end: u32, data: TypePredicateData, ) -> NodeIndex
Add a type predicate node
Sourcepub fn add_import_decl(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ImportDeclData,
) -> NodeIndex
pub fn add_import_decl( &mut self, kind: u16, pos: u32, end: u32, data: ImportDeclData, ) -> NodeIndex
Add an import declaration node
Sourcepub fn add_import_clause(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ImportClauseData,
) -> NodeIndex
pub fn add_import_clause( &mut self, kind: u16, pos: u32, end: u32, data: ImportClauseData, ) -> NodeIndex
Add an import clause node
Sourcepub fn add_named_imports(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: NamedImportsData,
) -> NodeIndex
pub fn add_named_imports( &mut self, kind: u16, pos: u32, end: u32, data: NamedImportsData, ) -> NodeIndex
Add a namespace/named imports node
Sourcepub fn add_specifier(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: SpecifierData,
) -> NodeIndex
pub fn add_specifier( &mut self, kind: u16, pos: u32, end: u32, data: SpecifierData, ) -> NodeIndex
Add an import/export specifier node
Sourcepub fn add_export_decl(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ExportDeclData,
) -> NodeIndex
pub fn add_export_decl( &mut self, kind: u16, pos: u32, end: u32, data: ExportDeclData, ) -> NodeIndex
Add an export declaration node
Sourcepub fn add_export_assignment(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ExportAssignmentData,
) -> NodeIndex
pub fn add_export_assignment( &mut self, kind: u16, pos: u32, end: u32, data: ExportAssignmentData, ) -> NodeIndex
Add an export assignment node
Sourcepub fn add_import_attributes(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ImportAttributesData,
) -> NodeIndex
pub fn add_import_attributes( &mut self, kind: u16, pos: u32, end: u32, data: ImportAttributesData, ) -> NodeIndex
Add an import attributes node
Sourcepub fn add_import_attribute(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ImportAttributeData,
) -> NodeIndex
pub fn add_import_attribute( &mut self, kind: u16, pos: u32, end: u32, data: ImportAttributeData, ) -> NodeIndex
Add an import attribute node
Sourcepub fn add_binding_pattern(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: BindingPatternData,
) -> NodeIndex
pub fn add_binding_pattern( &mut self, kind: u16, pos: u32, end: u32, data: BindingPatternData, ) -> NodeIndex
Add a binding pattern node
Sourcepub fn add_binding_element(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: BindingElementData,
) -> NodeIndex
pub fn add_binding_element( &mut self, kind: u16, pos: u32, end: u32, data: BindingElementData, ) -> NodeIndex
Add a binding element node
Sourcepub fn add_property_assignment(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: PropertyAssignmentData,
) -> NodeIndex
pub fn add_property_assignment( &mut self, kind: u16, pos: u32, end: u32, data: PropertyAssignmentData, ) -> NodeIndex
Add a property assignment node
Sourcepub fn add_shorthand_property(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ShorthandPropertyData,
) -> NodeIndex
pub fn add_shorthand_property( &mut self, kind: u16, pos: u32, end: u32, data: ShorthandPropertyData, ) -> NodeIndex
Add a shorthand property assignment node
Sourcepub fn add_spread(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: SpreadData,
) -> NodeIndex
pub fn add_spread( &mut self, kind: u16, pos: u32, end: u32, data: SpreadData, ) -> NodeIndex
Add a spread assignment node
Sourcepub fn add_jsx_element(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxElementData,
) -> NodeIndex
pub fn add_jsx_element( &mut self, kind: u16, pos: u32, end: u32, data: JsxElementData, ) -> NodeIndex
Add a JSX element node
Sourcepub fn add_jsx_opening(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxOpeningData,
) -> NodeIndex
pub fn add_jsx_opening( &mut self, kind: u16, pos: u32, end: u32, data: JsxOpeningData, ) -> NodeIndex
Add a JSX opening/self-closing element node
Sourcepub fn add_jsx_closing(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxClosingData,
) -> NodeIndex
pub fn add_jsx_closing( &mut self, kind: u16, pos: u32, end: u32, data: JsxClosingData, ) -> NodeIndex
Add a JSX closing element node
Sourcepub fn add_jsx_fragment(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxFragmentData,
) -> NodeIndex
pub fn add_jsx_fragment( &mut self, kind: u16, pos: u32, end: u32, data: JsxFragmentData, ) -> NodeIndex
Add a JSX fragment node
Sourcepub fn add_jsx_attributes(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxAttributesData,
) -> NodeIndex
pub fn add_jsx_attributes( &mut self, kind: u16, pos: u32, end: u32, data: JsxAttributesData, ) -> NodeIndex
Add a JSX attributes node
Sourcepub fn add_jsx_attribute(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxAttributeData,
) -> NodeIndex
pub fn add_jsx_attribute( &mut self, kind: u16, pos: u32, end: u32, data: JsxAttributeData, ) -> NodeIndex
Add a JSX attribute node
Sourcepub fn add_jsx_spread_attribute(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxSpreadAttributeData,
) -> NodeIndex
pub fn add_jsx_spread_attribute( &mut self, kind: u16, pos: u32, end: u32, data: JsxSpreadAttributeData, ) -> NodeIndex
Add a JSX spread attribute node
Sourcepub fn add_jsx_expression(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxExpressionData,
) -> NodeIndex
pub fn add_jsx_expression( &mut self, kind: u16, pos: u32, end: u32, data: JsxExpressionData, ) -> NodeIndex
Add a JSX expression node
Sourcepub fn add_jsx_text(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxTextData,
) -> NodeIndex
pub fn add_jsx_text( &mut self, kind: u16, pos: u32, end: u32, data: JsxTextData, ) -> NodeIndex
Add a JSX text node
Sourcepub fn add_jsx_namespaced_name(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: JsxNamespacedNameData,
) -> NodeIndex
pub fn add_jsx_namespaced_name( &mut self, kind: u16, pos: u32, end: u32, data: JsxNamespacedNameData, ) -> NodeIndex
Add a JSX namespaced name node
Sourcepub fn add_variable_declaration(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: VariableDeclarationData,
) -> NodeIndex
pub fn add_variable_declaration( &mut self, kind: u16, pos: u32, end: u32, data: VariableDeclarationData, ) -> NodeIndex
Add a variable declaration node (individual)
Sourcepub fn add_for_in_of(
&mut self,
kind: u16,
pos: u32,
end: u32,
data: ForInOfData,
) -> NodeIndex
pub fn add_for_in_of( &mut self, kind: u16, pos: u32, end: u32, data: ForInOfData, ) -> NodeIndex
Add a for-in/for-of statement node
Source§impl NodeArena
impl NodeArena
Sourcepub fn has_modifier(
&self,
modifiers: &Option<NodeList>,
kind: SyntaxKind,
) -> bool
pub fn has_modifier( &self, modifiers: &Option<NodeList>, kind: SyntaxKind, ) -> bool
Check whether a modifier list contains a modifier of the given kind.
This is the single source of truth for the “scan modifiers for a kind” pattern used across all pipeline stages.
Sourcepub fn has_modifier_ref(
&self,
modifiers: Option<&NodeList>,
kind: SyntaxKind,
) -> bool
pub fn has_modifier_ref( &self, modifiers: Option<&NodeList>, kind: SyntaxKind, ) -> bool
Like has_modifier but accepts Option<&NodeList>.
Sourcepub fn find_modifier(
&self,
modifiers: &Option<NodeList>,
kind: SyntaxKind,
) -> Option<NodeIndex>
pub fn find_modifier( &self, modifiers: &Option<NodeList>, kind: SyntaxKind, ) -> Option<NodeIndex>
Find the first modifier of the given kind, returning its NodeIndex.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeArena
impl<'de> Deserialize<'de> for NodeArena
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeArena, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeArena, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl NodeAccess for NodeArena
Implementation of NodeAccess for NodeArena
impl NodeAccess for NodeArena
Implementation of NodeAccess for NodeArena
Source§fn get_identifier_text(&self, index: NodeIndex) -> Option<&str>
fn get_identifier_text(&self, index: NodeIndex) -> Option<&str>
Source§fn get_literal_text(&self, index: NodeIndex) -> Option<&str>
fn get_literal_text(&self, index: NodeIndex) -> Option<&str>
Source§impl Serialize for NodeArena
impl Serialize for NodeArena
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for NodeArena
impl RefUnwindSafe for NodeArena
impl Send for NodeArena
impl Sync for NodeArena
impl Unpin for NodeArena
impl UnsafeUnpin for NodeArena
impl UnwindSafe for NodeArena
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more