hasFunctionAncestor (tree-sitter.ts:295).
(node: Node)
| 1972 | |
| 1973 | /// hasFunctionAncestor (tree-sitter.ts:295). |
| 1974 | fn has_function_ancestor(node: Node) -> bool { |
| 1975 | let mut p = node.parent(); |
| 1976 | while let Some(n) = p { |
| 1977 | if n.kind() == "function_definition" { |
| 1978 | return true; |
| 1979 | } |
| 1980 | p = n.parent(); |
| 1981 | } |
| 1982 | false |
| 1983 | } |
| 1984 | |
| 1985 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1986 | match s { |