hasFunctionAncestor (tree-sitter.ts:295).
(node: Node)
| 2737 | |
| 2738 | /// hasFunctionAncestor (tree-sitter.ts:295). |
| 2739 | fn has_function_ancestor(node: Node) -> bool { |
| 2740 | let mut p = node.parent(); |
| 2741 | while let Some(n) = p { |
| 2742 | if n.kind() == "function_definition" { |
| 2743 | return true; |
| 2744 | } |
| 2745 | p = n.parent(); |
| 2746 | } |
| 2747 | false |
| 2748 | } |
| 2749 | |
| 2750 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 2751 | match s { |