Haskell: resolve function name from first named child (variable/name).
| 418 | |
| 419 | // Haskell: resolve function name from first named child (variable/name). |
| 420 | static TSNode resolve_haskell_func_name(TSNode node) { |
| 421 | if (ts_node_named_child_count(node) > 0) { |
| 422 | TSNode head = ts_node_named_child(node, 0); |
| 423 | const char *hk = ts_node_type(head); |
| 424 | if (strcmp(hk, "variable") == 0 || strcmp(hk, "name") == 0) { |
| 425 | return head; |
| 426 | } |
| 427 | if (ts_node_named_child_count(head) > 0) { |
| 428 | TSNode v = ts_node_named_child(head, 0); |
| 429 | const char *vk = ts_node_type(v); |
| 430 | if (strcmp(vk, "variable") == 0 || strcmp(vk, "name") == 0) { |
| 431 | return v; |
| 432 | } |
| 433 | } |
| 434 | } |
| 435 | TSNode null_node = {0}; |
| 436 | return null_node; |
| 437 | } |
| 438 | |
| 439 | // CommonLisp: resolve defun name from function_name field or defun_header→sym_lit. |
| 440 | static TSNode resolve_commonlisp_func_name(TSNode node) { |
no outgoing calls
no test coverage detected