cDeclaratorIdentifier (tree-sitter.ts:234): 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)
| 1928 | /// parenthesized_declarator exposes no `declarator` field, so that arm always |
| 1929 | /// terminates — bug-for-bug with getChildByField returning null there.) |
| 1930 | fn c_declarator_identifier(node: Node) -> Option<Node> { |
| 1931 | let mut cur = Some(node); |
| 1932 | let mut guard = 0; |
| 1933 | while let Some(n) = cur { |
| 1934 | guard += 1; |
| 1935 | if guard > 12 { |
| 1936 | return None; |
| 1937 | } |
| 1938 | match n.kind() { |
| 1939 | "identifier" => return Some(n), |
| 1940 | "function_declarator" => return None, |
| 1941 | "init_declarator" | "pointer_declarator" | "array_declarator" |
| 1942 | | "parenthesized_declarator" => { |
| 1943 | cur = n.child_by_field_name("declarator"); |
| 1944 | } |
| 1945 | _ => return None, |
| 1946 | } |
| 1947 | } |
| 1948 | None |
| 1949 | } |
| 1950 | |
| 1951 | /// isMacroMisparsedTypeDecl (languages/c-cpp.ts:261): `class MACRO Name {…}` |
| 1952 | /// misparse residue — bodyless class/struct specifier in `type` + a |
no outgoing calls
no test coverage detected