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

Function find_declarator_qualified_id

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

findDeclaratorQualifiedId (languages/c-cpp.ts:13): BFS for the declarator's `qualified_identifier`, skipping parameter_list + trailing_return_type so a qualified PARAMETER type can't be mistaken for the method name.

(declarator: Node)

Source from the content-addressed store, hash-verified

1930/// `qualified_identifier`, skipping parameter_list + trailing_return_type so a
1931/// qualified PARAMETER type can't be mistaken for the method name.
1932fn find_declarator_qualified_id(declarator: Node) -> Option<Node> {
1933 let mut queue: VecDeque<Node> = VecDeque::new();
1934 queue.push_back(declarator);
1935 while let Some(current) = queue.pop_front() {
1936 if current.kind() == "qualified_identifier" {
1937 return Some(current);
1938 }
1939 for i in 0..current.named_child_count() {
1940 if let Some(child) = current.named_child(i) {
1941 if child.kind() != "parameter_list" && child.kind() != "trailing_return_type" {
1942 queue.push_back(child);
1943 }
1944 }
1945 }
1946 }
1947 None
1948}
1949
1950/// cDeclaratorIdentifier (tree-sitter.ts:234): resolve the declared identifier
1951/// 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