cDeclaratorIdentifier (languages/c-cpp.ts): resolve the declared identifier through init/pointer/array/parenthesized declarator wrappers; a function_declarator means prototype/fn-ptr — null. (The C grammar's parenthesized_declarator exposes no `declarator` field, so that arm always terminates — bug-for-bug with getChildByField returning null there.)
(node: Node)
| 2617 | /// parenthesized_declarator exposes no `declarator` field, so that arm always |
| 2618 | /// terminates — bug-for-bug with getChildByField returning null there.) |
| 2619 | fn c_declarator_identifier(node: Node) -> Option<Node> { |
| 2620 | let mut cur = Some(node); |
| 2621 | let mut guard = 0; |
| 2622 | while let Some(n) = cur { |
| 2623 | guard += 1; |
| 2624 | if guard > 12 { |
| 2625 | return None; |
| 2626 | } |
| 2627 | match n.kind() { |
| 2628 | "identifier" => return Some(n), |
| 2629 | "function_declarator" => return None, |
| 2630 | "init_declarator" | "pointer_declarator" | "array_declarator" |
| 2631 | | "parenthesized_declarator" => { |
| 2632 | cur = n.child_by_field_name("declarator"); |
| 2633 | } |
| 2634 | _ => return None, |
| 2635 | } |
| 2636 | } |
| 2637 | None |
| 2638 | } |
| 2639 | |
| 2640 | /// CLASS_LIKE_SPECIFIERS (languages/c-cpp.ts). |
| 2641 | fn is_class_like_specifier(kind: &str) -> bool { |
no outgoing calls
no test coverage detected