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

Function find_declarator_qualified_id

codegraph-kernel/src/ccpp/mod.rs:2616–2635  ·  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

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