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