SemanticBuilder

Struct SemanticBuilder 

Source
pub struct SemanticBuilder<'a> { /* private fields */ }
Expand description

Semantic analysis (scopes, symbols, references) Semantic Builder

Traverses a parsed AST and builds a Semantic representation of the program.

The main API is the build method.

Implementations§

Source§

impl<'a> SemanticBuilder<'a>

Source

pub fn new() -> SemanticBuilder<'a>

Source

pub fn with_check_syntax_error(self, yes: bool) -> SemanticBuilder<'a>

Enable/disable additional syntax checks.

Set this to true to enable additional syntax checks. Without these, there is no guarantee that the parsed program follows the ECMAScript spec.

By default, this is false.

Source

pub fn with_cfg(self, _cfg: bool) -> SemanticBuilder<'a>

Source

pub fn with_scope_tree_child_ids(self, yes: bool) -> SemanticBuilder<'a>

Source

pub fn with_stats(self, stats: Stats) -> SemanticBuilder<'a>

Provide statistics about AST to optimize memory usage of semantic analysis.

Accurate statistics can greatly improve performance, especially for large ASTs. If no stats are provided, SemanticBuilder::build will compile stats by performing a complete AST traversal. If semantic analysis has already been performed on this AST, get the existing stats with Semantic::stats, and pass them in with this method, to avoid the stats collection AST pass.

Source

pub fn with_excess_capacity(self, excess_capacity: f64) -> SemanticBuilder<'a>

Request SemanticBuilder to allocate excess capacity for scopes, symbols, and references.

excess_capacity is provided as a fraction. e.g. to over-allocate by 20%, pass 0.2 as excess_capacity.

Has no effect if a Stats object is provided with SemanticBuilder::with_stats, only if SemanticBuilder is calculating stats itself.

This is useful when you intend to modify Semantic, adding more nodes, scopes, symbols, or references. Allocating excess capacity for these additions at the outset prevents Semantic’s data structures needing to grow later on which involves memory copying. For large ASTs with a lot of semantic data, re-allocation can be very costly.

Source

pub fn build(self, program: &'a Program<'a>) -> SemanticBuilderReturn<'a>

Finalize the builder.

§Panics

Trait Implementations§

Source§

impl Default for SemanticBuilder<'_>

Source§

fn default() -> SemanticBuilder<'_>

Returns the “default value” for a type. Read more
Source§

impl<'a> Visit<'a> for SemanticBuilder<'a>

Source§

fn enter_scope(&mut self, flags: ScopeFlags, scope_id: &Cell<Option<ScopeId>>)

Source§

fn leave_scope(&mut self)

Source§

fn enter_node(&mut self, kind: AstKind<'a>)

Source§

fn leave_node(&mut self, kind: AstKind<'a>)

Source§

fn visit_program(&mut self, program: &Program<'a>)

Source§

fn visit_break_statement(&mut self, stmt: &BreakStatement<'a>)

Source§

fn visit_class(&mut self, class: &Class<'a>)

Source§

fn visit_block_statement(&mut self, it: &BlockStatement<'a>)

Source§

fn visit_continue_statement(&mut self, stmt: &ContinueStatement<'a>)

Source§

fn visit_do_while_statement(&mut self, stmt: &DoWhileStatement<'a>)

Source§

fn visit_logical_expression(&mut self, expr: &LogicalExpression<'a>)

Source§

fn visit_assignment_expression(&mut self, expr: &AssignmentExpression<'a>)

Source§

fn visit_conditional_expression(&mut self, expr: &ConditionalExpression<'a>)

Source§

fn visit_for_statement(&mut self, stmt: &ForStatement<'a>)

Source§

fn visit_for_in_statement(&mut self, stmt: &ForInStatement<'a>)

Source§

fn visit_for_of_statement(&mut self, stmt: &ForOfStatement<'a>)

Source§

fn visit_if_statement(&mut self, stmt: &IfStatement<'a>)

Source§

fn visit_labeled_statement(&mut self, stmt: &LabeledStatement<'a>)

Source§

fn visit_return_statement(&mut self, stmt: &ReturnStatement<'a>)

Source§

fn visit_switch_statement(&mut self, stmt: &SwitchStatement<'a>)

Source§

fn visit_switch_case(&mut self, case: &SwitchCase<'a>)

Source§

fn visit_throw_statement(&mut self, stmt: &ThrowStatement<'a>)

Source§

fn visit_try_statement(&mut self, stmt: &TryStatement<'a>)

Source§

fn visit_while_statement(&mut self, stmt: &WhileStatement<'a>)

Source§

fn visit_with_statement(&mut self, stmt: &WithStatement<'a>)

Source§

fn visit_function(&mut self, func: &Function<'a>, flags: ScopeFlags)

Source§

fn visit_arrow_function_expression( &mut self, expr: &ArrowFunctionExpression<'a>, )

Source§

fn visit_update_expression(&mut self, it: &UpdateExpression<'a>)

Source§

fn visit_member_expression(&mut self, it: &MemberExpression<'a>)

Source§

fn visit_simple_assignment_target(&mut self, it: &SimpleAssignmentTarget<'a>)

Source§

fn visit_assignment_target_property_identifier( &mut self, it: &AssignmentTargetPropertyIdentifier<'a>, )

Source§

fn visit_export_default_declaration_kind( &mut self, it: &ExportDefaultDeclarationKind<'a>, )

Source§

fn visit_export_named_declaration(&mut self, it: &ExportNamedDeclaration<'a>)

Source§

fn visit_export_specifier(&mut self, it: &ExportSpecifier<'a>)

Source§

fn visit_ts_export_assignment(&mut self, it: &TSExportAssignment<'a>)

Source§

fn alloc<T>(&self, t: &T) -> &'a T

Source§

fn visit_expression(&mut self, it: &Expression<'a>)

Source§

fn visit_identifier_name(&mut self, it: &IdentifierName<'a>)

Source§

fn visit_identifier_reference(&mut self, it: &IdentifierReference<'a>)

Source§

fn visit_binding_identifier(&mut self, it: &BindingIdentifier<'a>)

Source§

fn visit_label_identifier(&mut self, it: &LabelIdentifier<'a>)

Source§

fn visit_this_expression(&mut self, it: &ThisExpression)

Source§

fn visit_array_expression(&mut self, it: &ArrayExpression<'a>)

Source§

fn visit_array_expression_element(&mut self, it: &ArrayExpressionElement<'a>)

Source§

fn visit_elision(&mut self, it: &Elision)

Source§

fn visit_object_expression(&mut self, it: &ObjectExpression<'a>)

Source§

fn visit_object_property_kind(&mut self, it: &ObjectPropertyKind<'a>)

Source§

fn visit_object_property(&mut self, it: &ObjectProperty<'a>)

Source§

fn visit_property_key(&mut self, it: &PropertyKey<'a>)

Source§

fn visit_template_literal(&mut self, it: &TemplateLiteral<'a>)

Source§

fn visit_tagged_template_expression( &mut self, it: &TaggedTemplateExpression<'a>, )

Source§

fn visit_template_element(&mut self, it: &TemplateElement<'a>)

Source§

fn visit_computed_member_expression( &mut self, it: &ComputedMemberExpression<'a>, )

Source§

fn visit_static_member_expression(&mut self, it: &StaticMemberExpression<'a>)

Source§

fn visit_private_field_expression(&mut self, it: &PrivateFieldExpression<'a>)

Source§

fn visit_call_expression(&mut self, it: &CallExpression<'a>)

Source§

fn visit_new_expression(&mut self, it: &NewExpression<'a>)

Source§

fn visit_meta_property(&mut self, it: &MetaProperty<'a>)

Source§

fn visit_spread_element(&mut self, it: &SpreadElement<'a>)

Source§

fn visit_argument(&mut self, it: &Argument<'a>)

Source§

fn visit_unary_expression(&mut self, it: &UnaryExpression<'a>)

Source§

fn visit_binary_expression(&mut self, it: &BinaryExpression<'a>)

Source§

fn visit_private_in_expression(&mut self, it: &PrivateInExpression<'a>)

Source§

fn visit_assignment_target(&mut self, it: &AssignmentTarget<'a>)

Source§

fn visit_assignment_target_pattern(&mut self, it: &AssignmentTargetPattern<'a>)

Source§

fn visit_array_assignment_target(&mut self, it: &ArrayAssignmentTarget<'a>)

Source§

fn visit_object_assignment_target(&mut self, it: &ObjectAssignmentTarget<'a>)

Source§

fn visit_assignment_target_rest(&mut self, it: &AssignmentTargetRest<'a>)

Source§

fn visit_assignment_target_maybe_default( &mut self, it: &AssignmentTargetMaybeDefault<'a>, )

Source§

fn visit_assignment_target_with_default( &mut self, it: &AssignmentTargetWithDefault<'a>, )

Source§

fn visit_assignment_target_property( &mut self, it: &AssignmentTargetProperty<'a>, )

Source§

fn visit_assignment_target_property_property( &mut self, it: &AssignmentTargetPropertyProperty<'a>, )

Source§

fn visit_sequence_expression(&mut self, it: &SequenceExpression<'a>)

Source§

fn visit_super(&mut self, it: &Super)

Source§

fn visit_await_expression(&mut self, it: &AwaitExpression<'a>)

Source§

fn visit_chain_expression(&mut self, it: &ChainExpression<'a>)

Source§

fn visit_chain_element(&mut self, it: &ChainElement<'a>)

Source§

fn visit_parenthesized_expression(&mut self, it: &ParenthesizedExpression<'a>)

Source§

fn visit_statement(&mut self, it: &Statement<'a>)

Source§

fn visit_directive(&mut self, it: &Directive<'a>)

Source§

fn visit_hashbang(&mut self, it: &Hashbang<'a>)

Source§

fn visit_declaration(&mut self, it: &Declaration<'a>)

Source§

fn visit_variable_declaration(&mut self, it: &VariableDeclaration<'a>)

Source§

fn visit_variable_declarator(&mut self, it: &VariableDeclarator<'a>)

Source§

fn visit_empty_statement(&mut self, it: &EmptyStatement)

Source§

fn visit_expression_statement(&mut self, it: &ExpressionStatement<'a>)

Source§

fn visit_for_statement_init(&mut self, it: &ForStatementInit<'a>)

Source§

fn visit_for_statement_left(&mut self, it: &ForStatementLeft<'a>)

Source§

fn visit_catch_clause(&mut self, it: &CatchClause<'a>)

Source§

fn visit_catch_parameter(&mut self, it: &CatchParameter<'a>)

Source§

fn visit_debugger_statement(&mut self, it: &DebuggerStatement)

Source§

fn visit_binding_pattern(&mut self, it: &BindingPattern<'a>)

Source§

fn visit_binding_pattern_kind(&mut self, it: &BindingPatternKind<'a>)

Source§

fn visit_assignment_pattern(&mut self, it: &AssignmentPattern<'a>)

Source§

fn visit_object_pattern(&mut self, it: &ObjectPattern<'a>)

Source§

fn visit_binding_property(&mut self, it: &BindingProperty<'a>)

Source§

fn visit_array_pattern(&mut self, it: &ArrayPattern<'a>)

Source§

fn visit_binding_rest_element(&mut self, it: &BindingRestElement<'a>)

Source§

fn visit_formal_parameters(&mut self, it: &FormalParameters<'a>)

Source§

fn visit_formal_parameter(&mut self, it: &FormalParameter<'a>)

Source§

fn visit_function_body(&mut self, it: &FunctionBody<'a>)

Source§

fn visit_yield_expression(&mut self, it: &YieldExpression<'a>)

Source§

fn visit_class_body(&mut self, it: &ClassBody<'a>)

Source§

fn visit_class_element(&mut self, it: &ClassElement<'a>)

Source§

fn visit_method_definition(&mut self, it: &MethodDefinition<'a>)

Source§

fn visit_property_definition(&mut self, it: &PropertyDefinition<'a>)

Source§

fn visit_private_identifier(&mut self, it: &PrivateIdentifier<'a>)

Source§

fn visit_static_block(&mut self, it: &StaticBlock<'a>)

Source§

fn visit_module_declaration(&mut self, it: &ModuleDeclaration<'a>)

Source§

fn visit_accessor_property(&mut self, it: &AccessorProperty<'a>)

Source§

fn visit_import_expression(&mut self, it: &ImportExpression<'a>)

Source§

fn visit_import_declaration(&mut self, it: &ImportDeclaration<'a>)

Source§

fn visit_import_declaration_specifier( &mut self, it: &ImportDeclarationSpecifier<'a>, )

Source§

fn visit_import_specifier(&mut self, it: &ImportSpecifier<'a>)

Source§

fn visit_import_default_specifier(&mut self, it: &ImportDefaultSpecifier<'a>)

Source§

fn visit_import_namespace_specifier( &mut self, it: &ImportNamespaceSpecifier<'a>, )

Source§

fn visit_with_clause(&mut self, it: &WithClause<'a>)

Source§

fn visit_import_attribute(&mut self, it: &ImportAttribute<'a>)

Source§

fn visit_import_attribute_key(&mut self, it: &ImportAttributeKey<'a>)

Source§

fn visit_export_default_declaration( &mut self, it: &ExportDefaultDeclaration<'a>, )

Source§

fn visit_export_all_declaration(&mut self, it: &ExportAllDeclaration<'a>)

Source§

fn visit_module_export_name(&mut self, it: &ModuleExportName<'a>)

Source§

fn visit_v_8_intrinsic_expression(&mut self, it: &V8IntrinsicExpression<'a>)

Source§

fn visit_boolean_literal(&mut self, it: &BooleanLiteral)

Source§

fn visit_null_literal(&mut self, it: &NullLiteral)

Source§

fn visit_numeric_literal(&mut self, it: &NumericLiteral<'a>)

Source§

fn visit_string_literal(&mut self, it: &StringLiteral<'a>)

Source§

fn visit_big_int_literal(&mut self, it: &BigIntLiteral<'a>)

Source§

fn visit_reg_exp_literal(&mut self, it: &RegExpLiteral<'a>)

Source§

fn visit_jsx_element(&mut self, it: &JSXElement<'a>)

Source§

fn visit_jsx_opening_element(&mut self, it: &JSXOpeningElement<'a>)

Source§

fn visit_jsx_closing_element(&mut self, it: &JSXClosingElement<'a>)

Source§

fn visit_jsx_fragment(&mut self, it: &JSXFragment<'a>)

Source§

fn visit_jsx_opening_fragment(&mut self, it: &JSXOpeningFragment)

Source§

fn visit_jsx_closing_fragment(&mut self, it: &JSXClosingFragment)

Source§

fn visit_jsx_element_name(&mut self, it: &JSXElementName<'a>)

Source§

fn visit_jsx_namespaced_name(&mut self, it: &JSXNamespacedName<'a>)

Source§

fn visit_jsx_member_expression(&mut self, it: &JSXMemberExpression<'a>)

Source§

fn visit_jsx_member_expression_object( &mut self, it: &JSXMemberExpressionObject<'a>, )

Source§

fn visit_jsx_expression_container(&mut self, it: &JSXExpressionContainer<'a>)

Source§

fn visit_jsx_expression(&mut self, it: &JSXExpression<'a>)

Source§

fn visit_jsx_empty_expression(&mut self, it: &JSXEmptyExpression)

Source§

fn visit_jsx_attribute_item(&mut self, it: &JSXAttributeItem<'a>)

Source§

fn visit_jsx_attribute(&mut self, it: &JSXAttribute<'a>)

Source§

fn visit_jsx_spread_attribute(&mut self, it: &JSXSpreadAttribute<'a>)

Source§

fn visit_jsx_attribute_name(&mut self, it: &JSXAttributeName<'a>)

Source§

fn visit_jsx_attribute_value(&mut self, it: &JSXAttributeValue<'a>)

Source§

fn visit_jsx_identifier(&mut self, it: &JSXIdentifier<'a>)

Source§

fn visit_jsx_child(&mut self, it: &JSXChild<'a>)

Source§

fn visit_jsx_spread_child(&mut self, it: &JSXSpreadChild<'a>)

Source§

fn visit_jsx_text(&mut self, it: &JSXText<'a>)

Source§

fn visit_ts_this_parameter(&mut self, it: &TSThisParameter<'a>)

Source§

fn visit_ts_enum_declaration(&mut self, it: &TSEnumDeclaration<'a>)

Source§

fn visit_ts_enum_body(&mut self, it: &TSEnumBody<'a>)

Source§

fn visit_ts_enum_member(&mut self, it: &TSEnumMember<'a>)

Source§

fn visit_ts_enum_member_name(&mut self, it: &TSEnumMemberName<'a>)

Source§

fn visit_ts_type_annotation(&mut self, it: &TSTypeAnnotation<'a>)

Source§

fn visit_ts_literal_type(&mut self, it: &TSLiteralType<'a>)

Source§

fn visit_ts_literal(&mut self, it: &TSLiteral<'a>)

Source§

fn visit_ts_type(&mut self, it: &TSType<'a>)

Source§

fn visit_ts_conditional_type(&mut self, it: &TSConditionalType<'a>)

Source§

fn visit_ts_union_type(&mut self, it: &TSUnionType<'a>)

Source§

fn visit_ts_intersection_type(&mut self, it: &TSIntersectionType<'a>)

Source§

fn visit_ts_parenthesized_type(&mut self, it: &TSParenthesizedType<'a>)

Source§

fn visit_ts_type_operator(&mut self, it: &TSTypeOperator<'a>)

Source§

fn visit_ts_array_type(&mut self, it: &TSArrayType<'a>)

Source§

fn visit_ts_indexed_access_type(&mut self, it: &TSIndexedAccessType<'a>)

Source§

fn visit_ts_tuple_type(&mut self, it: &TSTupleType<'a>)

Source§

fn visit_ts_named_tuple_member(&mut self, it: &TSNamedTupleMember<'a>)

Source§

fn visit_ts_optional_type(&mut self, it: &TSOptionalType<'a>)

Source§

fn visit_ts_rest_type(&mut self, it: &TSRestType<'a>)

Source§

fn visit_ts_tuple_element(&mut self, it: &TSTupleElement<'a>)

Source§

fn visit_ts_any_keyword(&mut self, it: &TSAnyKeyword)

Source§

fn visit_ts_string_keyword(&mut self, it: &TSStringKeyword)

Source§

fn visit_ts_boolean_keyword(&mut self, it: &TSBooleanKeyword)

Source§

fn visit_ts_number_keyword(&mut self, it: &TSNumberKeyword)

Source§

fn visit_ts_never_keyword(&mut self, it: &TSNeverKeyword)

Source§

fn visit_ts_intrinsic_keyword(&mut self, it: &TSIntrinsicKeyword)

Source§

fn visit_ts_unknown_keyword(&mut self, it: &TSUnknownKeyword)

Source§

fn visit_ts_null_keyword(&mut self, it: &TSNullKeyword)

Source§

fn visit_ts_undefined_keyword(&mut self, it: &TSUndefinedKeyword)

Source§

fn visit_ts_void_keyword(&mut self, it: &TSVoidKeyword)

Source§

fn visit_ts_symbol_keyword(&mut self, it: &TSSymbolKeyword)

Source§

fn visit_ts_this_type(&mut self, it: &TSThisType)

Source§

fn visit_ts_object_keyword(&mut self, it: &TSObjectKeyword)

Source§

fn visit_ts_big_int_keyword(&mut self, it: &TSBigIntKeyword)

Source§

fn visit_ts_type_reference(&mut self, it: &TSTypeReference<'a>)

Source§

fn visit_ts_type_name(&mut self, it: &TSTypeName<'a>)

Source§

fn visit_ts_qualified_name(&mut self, it: &TSQualifiedName<'a>)

Source§

fn visit_ts_type_parameter_instantiation( &mut self, it: &TSTypeParameterInstantiation<'a>, )

Source§

fn visit_ts_type_parameter(&mut self, it: &TSTypeParameter<'a>)

Source§

fn visit_ts_type_parameter_declaration( &mut self, it: &TSTypeParameterDeclaration<'a>, )

Source§

fn visit_ts_type_alias_declaration(&mut self, it: &TSTypeAliasDeclaration<'a>)

Source§

fn visit_ts_class_implements(&mut self, it: &TSClassImplements<'a>)

Source§

fn visit_ts_interface_declaration(&mut self, it: &TSInterfaceDeclaration<'a>)

Source§

fn visit_ts_interface_body(&mut self, it: &TSInterfaceBody<'a>)

Source§

fn visit_ts_property_signature(&mut self, it: &TSPropertySignature<'a>)

Source§

fn visit_ts_signature(&mut self, it: &TSSignature<'a>)

Source§

fn visit_ts_index_signature(&mut self, it: &TSIndexSignature<'a>)

Source§

fn visit_ts_call_signature_declaration( &mut self, it: &TSCallSignatureDeclaration<'a>, )

Source§

fn visit_ts_method_signature(&mut self, it: &TSMethodSignature<'a>)

Source§

fn visit_ts_construct_signature_declaration( &mut self, it: &TSConstructSignatureDeclaration<'a>, )

Source§

fn visit_ts_index_signature_name(&mut self, it: &TSIndexSignatureName<'a>)

Source§

fn visit_ts_interface_heritage(&mut self, it: &TSInterfaceHeritage<'a>)

Source§

fn visit_ts_type_predicate(&mut self, it: &TSTypePredicate<'a>)

Source§

fn visit_ts_type_predicate_name(&mut self, it: &TSTypePredicateName<'a>)

Source§

fn visit_ts_module_declaration(&mut self, it: &TSModuleDeclaration<'a>)

Source§

fn visit_ts_module_declaration_name(&mut self, it: &TSModuleDeclarationName<'a>)

Source§

fn visit_ts_module_declaration_body(&mut self, it: &TSModuleDeclarationBody<'a>)

Source§

fn visit_ts_global_declaration(&mut self, it: &TSGlobalDeclaration<'a>)

Source§

fn visit_ts_module_block(&mut self, it: &TSModuleBlock<'a>)

Source§

fn visit_ts_type_literal(&mut self, it: &TSTypeLiteral<'a>)

Source§

fn visit_ts_infer_type(&mut self, it: &TSInferType<'a>)

Source§

fn visit_ts_type_query(&mut self, it: &TSTypeQuery<'a>)

Source§

fn visit_ts_type_query_expr_name(&mut self, it: &TSTypeQueryExprName<'a>)

Source§

fn visit_ts_import_type(&mut self, it: &TSImportType<'a>)

Source§

fn visit_ts_import_type_qualifier(&mut self, it: &TSImportTypeQualifier<'a>)

Source§

fn visit_ts_import_type_qualified_name( &mut self, it: &TSImportTypeQualifiedName<'a>, )

Source§

fn visit_ts_function_type(&mut self, it: &TSFunctionType<'a>)

Source§

fn visit_ts_constructor_type(&mut self, it: &TSConstructorType<'a>)

Source§

fn visit_ts_mapped_type(&mut self, it: &TSMappedType<'a>)

Source§

fn visit_ts_template_literal_type(&mut self, it: &TSTemplateLiteralType<'a>)

Source§

fn visit_ts_as_expression(&mut self, it: &TSAsExpression<'a>)

Source§

fn visit_ts_satisfies_expression(&mut self, it: &TSSatisfiesExpression<'a>)

Source§

fn visit_ts_type_assertion(&mut self, it: &TSTypeAssertion<'a>)

Source§

fn visit_ts_import_equals_declaration( &mut self, it: &TSImportEqualsDeclaration<'a>, )

Source§

fn visit_ts_module_reference(&mut self, it: &TSModuleReference<'a>)

Source§

fn visit_ts_external_module_reference( &mut self, it: &TSExternalModuleReference<'a>, )

Source§

fn visit_ts_non_null_expression(&mut self, it: &TSNonNullExpression<'a>)

Source§

fn visit_decorator(&mut self, it: &Decorator<'a>)

Source§

fn visit_ts_namespace_export_declaration( &mut self, it: &TSNamespaceExportDeclaration<'a>, )

Source§

fn visit_ts_instantiation_expression( &mut self, it: &TSInstantiationExpression<'a>, )

Source§

fn visit_js_doc_nullable_type(&mut self, it: &JSDocNullableType<'a>)

Source§

fn visit_js_doc_non_nullable_type(&mut self, it: &JSDocNonNullableType<'a>)

Source§

fn visit_js_doc_unknown_type(&mut self, it: &JSDocUnknownType)

Source§

fn visit_span(&mut self, it: &Span)

Source§

fn visit_directives(&mut self, it: &Vec<'a, Directive<'a>>)

Source§

fn visit_statements(&mut self, it: &Vec<'a, Statement<'a>>)

Source§

fn visit_array_expression_elements( &mut self, it: &Vec<'a, ArrayExpressionElement<'a>>, )

Source§

fn visit_object_property_kinds(&mut self, it: &Vec<'a, ObjectPropertyKind<'a>>)

Source§

fn visit_template_elements(&mut self, it: &Vec<'a, TemplateElement<'a>>)

Source§

fn visit_expressions(&mut self, it: &Vec<'a, Expression<'a>>)

Source§

fn visit_arguments(&mut self, it: &Vec<'a, Argument<'a>>)

Source§

fn visit_assignment_target_properties( &mut self, it: &Vec<'a, AssignmentTargetProperty<'a>>, )

Source§

fn visit_variable_declarators(&mut self, it: &Vec<'a, VariableDeclarator<'a>>)

Source§

fn visit_switch_cases(&mut self, it: &Vec<'a, SwitchCase<'a>>)

Source§

fn visit_binding_properties(&mut self, it: &Vec<'a, BindingProperty<'a>>)

Source§

fn visit_formal_parameter_list(&mut self, it: &Vec<'a, FormalParameter<'a>>)

Source§

fn visit_decorators(&mut self, it: &Vec<'a, Decorator<'a>>)

Source§

fn visit_ts_class_implements_list( &mut self, it: &Vec<'a, TSClassImplements<'a>>, )

Source§

fn visit_class_elements(&mut self, it: &Vec<'a, ClassElement<'a>>)

Source§

fn visit_import_declaration_specifiers( &mut self, it: &Vec<'a, ImportDeclarationSpecifier<'a>>, )

Source§

fn visit_import_attributes(&mut self, it: &Vec<'a, ImportAttribute<'a>>)

Source§

fn visit_export_specifiers(&mut self, it: &Vec<'a, ExportSpecifier<'a>>)

Source§

fn visit_jsx_children(&mut self, it: &Vec<'a, JSXChild<'a>>)

Source§

fn visit_jsx_attribute_items(&mut self, it: &Vec<'a, JSXAttributeItem<'a>>)

Source§

fn visit_ts_enum_members(&mut self, it: &Vec<'a, TSEnumMember<'a>>)

Source§

fn visit_ts_types(&mut self, it: &Vec<'a, TSType<'a>>)

Source§

fn visit_ts_tuple_elements(&mut self, it: &Vec<'a, TSTupleElement<'a>>)

Source§

fn visit_ts_type_parameters(&mut self, it: &Vec<'a, TSTypeParameter<'a>>)

Source§

fn visit_ts_interface_heritages( &mut self, it: &Vec<'a, TSInterfaceHeritage<'a>>, )

Source§

fn visit_ts_signatures(&mut self, it: &Vec<'a, TSSignature<'a>>)

Source§

fn visit_ts_index_signature_names( &mut self, it: &Vec<'a, TSIndexSignatureName<'a>>, )

Source§

fn visit_spans(&mut self, it: &Vec<'a, Span>)

Auto Trait Implementations§

§

impl<'a> !Freeze for SemanticBuilder<'a>

§

impl<'a> !RefUnwindSafe for SemanticBuilder<'a>

§

impl<'a> !Send for SemanticBuilder<'a>

§

impl<'a> !Sync for SemanticBuilder<'a>

§

impl<'a> Unpin for SemanticBuilder<'a>

§

impl<'a> !UnwindSafe for SemanticBuilder<'a>

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<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.