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)
| 2593 | /// throw_specifier, requires_clause) so a qualified PARAMETER type, or a call |
| 2594 | /// in `noexcept(…)`, can't be mistaken for the method name. |
| 2595 | fn find_declarator_qualified_id(declarator: Node) -> Option<Node> { |
| 2596 | let mut queue: VecDeque<Node> = VecDeque::new(); |
| 2597 | queue.push_back(declarator); |
| 2598 | while let Some(current) = queue.pop_front() { |
| 2599 | if current.kind() == "qualified_identifier" { |
| 2600 | return Some(current); |
| 2601 | } |
| 2602 | for child in current.named_children(&mut current.walk()) { |
| 2603 | if !matches!( |
| 2604 | child.kind(), |
| 2605 | "parameter_list" | "trailing_return_type" | "noexcept" | "throw_specifier" | "requires_clause" |
| 2606 | ) { |
| 2607 | queue.push_back(child); |
| 2608 | } |
| 2609 | } |
| 2610 | } |
| 2611 | None |
| 2612 | } |
| 2613 | |
| 2614 | /// cDeclaratorIdentifier (languages/c-cpp.ts): resolve the declared identifier |
| 2615 | /// through init/pointer/array/parenthesized declarator wrappers; a |
no test coverage detected