MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / find_declarator_qualified_id

Function find_declarator_qualified_id

codegraph-kernel/src/ccpp/mod.rs:2618–2637  ·  view source on GitHub ↗

findDeclaratorQualifiedId (languages/c-cpp.ts:13): BFS for the declarator's `qualified_identifier`, skipping the parts that hold types or expressions (DECLARATOR_NON_NAME_PARTS: parameter_list, trailing_return_type, noexcept, throw_specifier, requires_clause) so a qualified PARAMETER type, or a call in `noexcept(…)`, can't be mistaken for the method name.

(declarator: Node)

Source from the content-addressed store, hash-verified

2616/// throw_specifier, requires_clause) so a qualified PARAMETER type, or a call
2617/// in `noexcept(…)`, can't be mistaken for the method name.
2618fn find_declarator_qualified_id(declarator: Node) -> Option<Node> {
2619 let mut queue: VecDeque<Node> = VecDeque::new();
2620 queue.push_back(declarator);
2621 while let Some(current) = queue.pop_front() {
2622 if current.kind() == "qualified_identifier" {
2623 return Some(current);
2624 }
2625 for i in 0..current.named_child_count() {
2626 if let Some(child) = current.named_child(i) {
2627 if !matches!(
2628 child.kind(),
2629 "parameter_list" | "trailing_return_type" | "noexcept" | "throw_specifier" | "requires_clause"
2630 ) {
2631 queue.push_back(child);
2632 }
2633 }
2634 }
2635 }
2636 None
2637}
2638
2639/// cDeclaratorIdentifier (languages/c-cpp.ts): resolve the declared identifier
2640/// through init/pointer/array/parenthesized declarator wrappers; a

Callers 2

receiver_type_ofMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected