pub struct CppStructuralSpec;Trait Implementations§
Source§impl Debug for CppStructuralSpec
impl Debug for CppStructuralSpec
Source§impl Default for CppStructuralSpec
impl Default for CppStructuralSpec
Source§impl StatementFactSyntax for CppStructuralSpec
impl StatementFactSyntax for CppStructuralSpec
Source§fn supports_kind(&self, kind: StatementFactKind) -> bool
fn supports_kind(&self, kind: StatementFactKind) -> bool
Source§fn roles<'tree>(&self, node: Node<'tree>, role: Role) -> Vec<Node<'tree>>
fn roles<'tree>(&self, node: Node<'tree>, role: Role) -> Vec<Node<'tree>>
Source§fn is_code_child(&self, node: Node<'_>) -> bool
fn is_code_child(&self, node: Node<'_>) -> bool
Source§fn loop_variable(&self, node: Node<'_>, source: &str) -> Option<String>
fn loop_variable(&self, node: Node<'_>, source: &str) -> Option<String>
Source§fn is_counted_loop(&self, node: Node<'_>) -> bool
fn is_counted_loop(&self, node: Node<'_>) -> bool
Source§fn loop_initializers<'tree>(&self, node: Node<'tree>) -> Vec<Node<'tree>>
fn loop_initializers<'tree>(&self, node: Node<'tree>) -> Vec<Node<'tree>>
Source§fn is_alloca(&self, node: Node<'_>, source: &str) -> bool
fn is_alloca(&self, node: Node<'_>, source: &str) -> bool
Source§fn switch_enum<'tree>(
&self,
node: Node<'tree>,
source: &str,
) -> Option<Node<'tree>>
fn switch_enum<'tree>( &self, node: Node<'tree>, source: &str, ) -> Option<Node<'tree>>
Source§fn enumeration(
&self,
node: Node<'_>,
source: &str,
) -> Option<(EnumFact, Vec<EnumeratorFact>)>
fn enumeration( &self, node: Node<'_>, source: &str, ) -> Option<(EnumFact, Vec<EnumeratorFact>)>
Source§fn name<'tree>(&self, node: Node<'tree>) -> Option<Node<'tree>>
fn name<'tree>(&self, node: Node<'tree>) -> Option<Node<'tree>>
Source§fn reaches_following_statement(&self, _node: Node<'_>, _source: &str) -> bool
fn reaches_following_statement(&self, _node: Node<'_>, _source: &str) -> bool
Source§fn is_indentation_loop(&self, _node: Node<'_>) -> bool
fn is_indentation_loop(&self, _node: Node<'_>) -> bool
Source§fn is_transparent_body_owner(&self, _node: Node<'_>) -> bool
fn is_transparent_body_owner(&self, _node: Node<'_>) -> bool
Source§impl StructuralSpec for CppStructuralSpec
impl StructuralSpec for CppStructuralSpec
Source§fn call_site_facts(
&self,
node: Node<'_>,
source: &str,
context: &CallSiteContext,
) -> Option<CallSiteFacts>
fn call_site_facts( &self, node: Node<'_>, source: &str, context: &CallSiteContext, ) -> Option<CallSiteFacts>
A new_expression is a constructor call, and a call whose callee names
a function-like macro of this translation unit has an argument list
that belongs to the macro, not to the callable that finally runs
(#1478). CALL_TWICE(2) parses as an ordinary call of two source
arguments even when the expansion calls a three-parameter callable, so
the honest answer is unknown coverage and no argument rows at all —
never a fabricated list an exact-arity assertion could read as clean.
The boundary is deliberate: only macros defined in this file are known here, because that is what this file’s parse tree contains. A macro defined in an included header leaves the site exact, which is the same answer the analyzer gives today.
Source§fn scope_formation(&self, kind: NormalizedKind) -> ScopeFormation
fn scope_formation(&self, kind: NormalizedKind) -> ScopeFormation
An if statement is a scope: a C++ condition or init-statement
declaration is in effect in both branches and nowhere after.
fn language(&self) -> Language
Source§fn supports_boolean_literal_value(&self) -> bool
fn supports_boolean_literal_value(&self) -> bool
Source§fn supports_string_literal_value(&self) -> bool
fn supports_string_literal_value(&self) -> bool
None, which exact-value queries report as incomplete.Source§fn string_literal_value_may_be_absent(
&self,
node: Node<'_>,
source: &str,
) -> bool
fn string_literal_value_may_be_absent( &self, node: Node<'_>, source: &str, ) -> bool
Source§fn string_literal_value(&self, node: Node<'_>, source: &str) -> Option<String>
fn string_literal_value(&self, node: Node<'_>, source: &str) -> Option<String>
NormalizedKind::StringLiteral. The adapter must read the grammar’s
string-content and escape nodes rather than trimming source text.Source§fn kind_table(&self) -> &'static [(&'static str, NormalizedKind)]
fn kind_table(&self) -> &'static [(&'static str, NormalizedKind)]
Language::id_for_node_kind;
a per-language test must assert every entry resolves (id != 0) so
grammar bumps that rename nodes fail loudly.Source§fn statement_fact_syntax(&self) -> Option<&dyn StatementFactSyntax>
fn statement_fact_syntax(&self) -> Option<&dyn StatementFactSyntax>
Source§fn generator_construct(
&self,
node: Node<'_>,
_kind: NormalizedKind,
source: &str,
) -> Option<&'static str>
fn generator_construct( &self, node: Node<'_>, _kind: NormalizedKind, source: &str, ) -> Option<&'static str>
Source§fn refine_kind(
&self,
node: Node<'_>,
kind: NormalizedKind,
enclosing: Option<NormalizedKind>,
source: &str,
_context: &CallSiteContext,
) -> NormalizedKind
fn refine_kind( &self, node: Node<'_>, kind: NormalizedKind, enclosing: Option<NormalizedKind>, source: &str, _context: &CallSiteContext, ) -> NormalizedKind
enclosing
is the kind of the nearest enclosing normalized node, and context is
the per-file CallSiteContext from Self::call_site_context, for
refinements that depend on file-wide facts (Ruby’s value-position bare
calls).Source§fn supports_kind(&self, kind: NormalizedKind) -> bool
fn supports_kind(&self, kind: NormalizedKind) -> bool
kind.Source§fn supports_role(&self, role: Role) -> bool
fn supports_role(&self, role: Role) -> bool
role precisely enough to evaluate a
query that asks for it.Source§fn call_site_context(&self, root: Node<'_>, source: &str) -> CallSiteContext
fn call_site_context(&self, root: Node<'_>, source: &str) -> CallSiteContext
Source§fn occurrence_role_support(&self) -> &OccurrenceRoleSupport
fn occurrence_role_support(&self) -> &OccurrenceRoleSupport
Self::extract. Read moreSource§fn lexical_environment_support(&self) -> &LexicalEnvironmentSupport
fn lexical_environment_support(&self) -> &LexicalEnvironmentSupport
Source§fn binding_activation(
&self,
binder: Node<'_>,
scope: Range,
) -> Option<BindingActivation>
fn binding_activation( &self, binder: Node<'_>, scope: Range, ) -> Option<BindingActivation>
binder introduces into the scope whose range is scope,
and over which byte interval it is in effect. Read moreSource§fn materialization_support(&self) -> &DeclarationMaterializationSupport
fn materialization_support(&self) -> &DeclarationMaterializationSupport
Source§fn reference_edge_support(&self) -> &ReferenceEdgeSupport
fn reference_edge_support(&self) -> &ReferenceEdgeSupport
Source§fn identity_route_support(&self) -> &IdentityRouteSupport
fn identity_route_support(&self) -> &IdentityRouteSupport
Self::occurrence_role_support: the tables are total, so a default
would let a new adapter (or a new axis or relation) advertise support
nobody implemented. Adapters that answer nothing yet return
super::routes::NO_IDENTITY_ROUTE_SUPPORT.Source§fn extract(&self, node: Node<'_>, kind: NormalizedKind, sink: &mut RoleSink<'_>)
fn extract(&self, node: Node<'_>, kind: NormalizedKind, sink: &mut RoleSink<'_>)
node.Source§fn preprocess(&self, _source: &str) -> Option<Arc<dyn SourcePreprocessor>>
fn preprocess(&self, _source: &str) -> Option<Arc<dyn SourcePreprocessor>>
Source§fn reparse_grammar_gap(
&self,
_source: &str,
_tree: &Tree,
_cancellation: Option<&CancellationToken>,
) -> Option<Tree>
fn reparse_grammar_gap( &self, _source: &str, _tree: &Tree, _cancellation: Option<&CancellationToken>, ) -> Option<Tree>
None when tree stands as parsed. Read moreSource§fn refine_kind_with_parents<'tree>(
&self,
node: Node<'tree>,
kind: NormalizedKind,
enclosing: Option<NormalizedKind>,
source: &str,
context: &CallSiteContext,
_parents: &ParentIndex<'tree>,
) -> NormalizedKind
fn refine_kind_with_parents<'tree>( &self, node: Node<'tree>, kind: NormalizedKind, enclosing: Option<NormalizedKind>, source: &str, context: &CallSiteContext, _parents: &ParentIndex<'tree>, ) -> NormalizedKind
Source§fn should_extract(&self, _node: Node<'_>, _kind: NormalizedKind) -> bool
fn should_extract(&self, _node: Node<'_>, _kind: NormalizedKind) -> bool
Source§fn callee_provenance(
&self,
_node: Node<'_>,
_source: &str,
_charge: &mut dyn FnMut(usize) -> Result<(), StructuralFactCollectorStop>,
) -> Result<Option<CalleeProvenanceFact>, StructuralFactCollectorStop>
fn callee_provenance( &self, _node: Node<'_>, _source: &str, _charge: &mut dyn FnMut(usize) -> Result<(), StructuralFactCollectorStop>, ) -> Result<Option<CalleeProvenanceFact>, StructuralFactCollectorStop>
Source§fn supports_string_literal_parenthesized(&self) -> bool
fn supports_string_literal_parenthesized(&self) -> bool
Source§fn string_literal_parenthesized(&self, _node: Node<'_>) -> Option<bool>
fn string_literal_parenthesized(&self, _node: Node<'_>) -> Option<bool>
Source§fn comparison_operator_spans(
&self,
_node: Node<'_>,
_step: &mut dyn FnMut() -> bool,
) -> Option<Vec<Span>>
fn comparison_operator_spans( &self, _node: Node<'_>, _step: &mut dyn FnMut() -> bool, ) -> Option<Vec<Span>>
step before inspecting each child or growing the result and once
before returning a complete answer; a stopped callback must return None.Source§fn supports_assignment_shape(&self) -> bool
fn supports_assignment_shape(&self) -> bool
Source§fn assignment_shape(&self, _node: Node<'_>) -> Option<AssignmentShape>
fn assignment_shape(&self, _node: Node<'_>) -> Option<AssignmentShape>
Source§fn supports_integer_literal_value(&self) -> bool
fn supports_integer_literal_value(&self) -> bool
Source§fn integer_literal_value(
&self,
_node: Node<'_>,
_source: &str,
) -> Option<IntegerLiteralValue>
fn integer_literal_value( &self, _node: Node<'_>, _source: &str, ) -> Option<IntegerLiteralValue>
Source§fn duplicate_dictionary_key(
&self,
_node: Node<'_>,
_source: &str,
) -> Option<bool>
fn duplicate_dictionary_key( &self, _node: Node<'_>, _source: &str, ) -> Option<bool>
None means the key syntax is outside the supported
literal subset.Source§fn supports_duplicate_dictionary_keys(&self) -> bool
fn supports_duplicate_dictionary_keys(&self) -> bool
Source§fn supports_unsafe_context(&self) -> bool
fn supports_unsafe_context(&self) -> bool
Source§fn unsafe_context_value(
&self,
_node: Node<'_>,
_charge: &mut dyn FnMut(usize) -> Result<(), StructuralFactCollectorStop>,
) -> Result<Option<bool>, StructuralFactCollectorStop>
fn unsafe_context_value( &self, _node: Node<'_>, _charge: &mut dyn FnMut(usize) -> Result<(), StructuralFactCollectorStop>, ) -> Result<Option<bool>, StructuralFactCollectorStop>
Source§fn declaration_attributes(
&self,
_node: Node<'_>,
_source: &str,
) -> Option<DeclarationAttributes>
fn declaration_attributes( &self, _node: Node<'_>, _source: &str, ) -> Option<DeclarationAttributes>
Source§fn supports_async_callable_value(&self) -> bool
fn supports_async_callable_value(&self) -> bool
Source§fn boolean_literal_value(&self, node: Node<'_>) -> Option<bool>
fn boolean_literal_value(&self, node: Node<'_>) -> Option<bool>
NormalizedKind::BooleanLiteral.
This default reads tree-sitter’s underlying grammar symbol identity,
which remains structured even when a grammar aliases both tokens to a
common named boolean_literal node. For grammars that retain a named
wrapper, it reads that wrapper’s sole non-extra child. It never reads
source text.Source§fn async_callable_value(&self, _node: Node<'_>) -> Option<bool>
fn async_callable_value(&self, _node: Node<'_>) -> Option<bool>
Source§fn source_export_facts(
&self,
_root: Node<'_>,
_source: &str,
) -> Option<SourceExportFacts>
fn source_export_facts( &self, _root: Node<'_>, _source: &str, ) -> Option<SourceExportFacts>
Source§fn binding_scope_selection(
&self,
_binder: Node<'_>,
_candidate: BindingScopeCandidate<'_>,
) -> BindingScopeSelection
fn binding_scope_selection( &self, _binder: Node<'_>, _candidate: BindingScopeCandidate<'_>, ) -> BindingScopeSelection
Source§fn type_parameter_owner<'tree>(&self, _name: Node<'tree>) -> Option<Node<'tree>>
fn type_parameter_owner<'tree>(&self, _name: Node<'tree>) -> Option<Node<'tree>>
Source§fn type_parameter_scope_barrier(&self, _owner: Node<'_>) -> bool
fn type_parameter_scope_barrier(&self, _owner: Node<'_>) -> bool
Source§fn implicit_scope_binders<'tree>(
&self,
_scope_node: Node<'tree>,
) -> Option<Vec<ImplicitScopeBinder<'tree>>>
fn implicit_scope_binders<'tree>( &self, _scope_node: Node<'tree>, ) -> Option<Vec<ImplicitScopeBinder<'tree>>>
Source§fn declaration_binding_activation(
&self,
_declaration_name: Node<'_>,
_scope: Range,
) -> Option<BindingActivation>
fn declaration_binding_activation( &self, _declaration_name: Node<'_>, _scope: Range, ) -> Option<BindingActivation>
Source§fn import_binder_activation(
&self,
_declaration: Range,
scope: Range,
_scope_kind: Option<NormalizedKind>,
) -> ImportActivation
fn import_binder_activation( &self, _declaration: Range, scope: Range, _scope_kind: Option<NormalizedKind>, ) -> ImportActivation
declaration is in effect over, inside the scope whose range is
scope and whose normalized kind is scope_kind (None for the
synthesized whole-file scope). Read moreSource§fn occurrence_namespace(
&self,
role: OccurrenceRole,
declares: Option<NormalizedKind>,
) -> Option<Namespace>
fn occurrence_namespace( &self, role: OccurrenceRole, declares: Option<NormalizedKind>, ) -> Option<Namespace>
role resolves in, where declares is
the normalized kind of the fact this token names – the enclosing fact
whose own name span is exactly this token, and None when the token
names no fact. Read moreSource§fn curated_export_surface(
&self,
_root: Node<'_>,
_source: &str,
) -> CuratedExportSurface
fn curated_export_surface( &self, _root: Node<'_>, _source: &str, ) -> CuratedExportSurface
root curates by listing names
rather than by marking each declaration (Python’s module-level
__all__), gathered once per file so
Self::indirection_relation can read it per token. Read moreSource§fn indirection_relation(
&self,
_token: Node<'_>,
_source: &str,
_surface: &CuratedExportSurface,
) -> Option<RouteHopKind>
fn indirection_relation( &self, _token: Node<'_>, _source: &str, _surface: &CuratedExportSurface, ) -> Option<RouteHopKind>
Import for a plain import, Export for an export of a local
declaration, ReExport for an export whose subject comes from
elsewhere (pub use, export ... from, a name on Python’s __all__).
Read from the token’s enclosing statement through AST fields, plus the
file’s surface from Self::curated_export_surface. Read moreSource§fn declaration_ambient_use(&self, _node: Node<'_>) -> Option<AmbientUseRole>
fn declaration_ambient_use(&self, _node: Node<'_>) -> Option<AmbientUseRole>
node carries: whether importing
it can consume it without the importing file spelling the imported name. Read moreSource§fn qualified_path_root<'tree>(&self, _token: Node<'tree>) -> Option<Node<'tree>>
fn qualified_path_root<'tree>(&self, _token: Node<'tree>) -> Option<Node<'tree>>
token participates in: the
outermost chain node (a scoped_identifier, dotted_name,
nested_identifier, or language equivalent) whose ordered segments
include this token. None when the token is not part of a qualified
path — including when it is a bare single identifier, which is not a
path. Read moreSource§fn path_segment_tokens<'tree>(&self, _root: Node<'tree>) -> Vec<Node<'tree>>
fn path_segment_tokens<'tree>(&self, _root: Node<'tree>) -> Vec<Node<'tree>>
root, in
source order, read from the grammar’s own chain structure (AST fields,
never text splitting). Includes segment tokens that are not facts
(Rust’s crate/self/super path keywords), so ordinals state the
real position of each segment within the path. Read moreSource§fn segment_generic_arity(&self, _token: Node<'_>) -> Option<u32>
fn segment_generic_arity(&self, _token: Node<'_>) -> Option<u32>
token’s
segment position, read from the grammar’s argument-list field. None
means no generic arguments are spelled there — which is a statement
about the source text, not about the declaration’s own arity.Source§fn decode_spelling(&self, _raw: &str) -> Option<String>
fn decode_spelling(&self, _raw: &str) -> Option<String>
raw denotes once the grammar’s identifier escaping is
removed (Rust’s r#type is the identifier type). Read moreSource§fn embedded_syntax_kinds(&self) -> &'static [&'static str]
fn embedded_syntax_kinds(&self) -> &'static [&'static str]
fn embedded_syntax( &self, _node: Node<'_>, _source: &str, ) -> Vec<EmbeddedSyntaxTree>
fn embedded_leaf_facts( &self, _node: Node<'_>, _kind: NormalizedKind, _source: &str, _cancellation: Option<&CancellationToken>, ) -> Vec<EmbeddedLeafFact>
Auto Trait Implementations§
impl Freeze for CppStructuralSpec
impl RefUnwindSafe for CppStructuralSpec
impl Send for CppStructuralSpec
impl Sync for CppStructuralSpec
impl Unpin for CppStructuralSpec
impl UnsafeUnpin for CppStructuralSpec
impl UnwindSafe for CppStructuralSpec
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> 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