Dart: resolve method name from method_signature/function_signature.
| 4531 | |
| 4532 | // Dart: resolve method name from method_signature/function_signature. |
| 4533 | static TSNode resolve_dart_method_name(TSNode child, const char *ck) { |
| 4534 | if (strcmp(ck, "method_signature") == 0) { |
| 4535 | TSNode func_sig = cbm_find_child_by_kind(child, "function_signature"); |
| 4536 | if (!ts_node_is_null(func_sig)) { |
| 4537 | TSNode name_node = func_name_node(func_sig); |
| 4538 | if (!ts_node_is_null(name_node)) { |
| 4539 | return name_node; |
| 4540 | } |
| 4541 | return cbm_find_child_by_kind(func_sig, "identifier"); |
| 4542 | } |
| 4543 | } |
| 4544 | if (strcmp(ck, "function_signature") == 0) { |
| 4545 | return cbm_find_child_by_kind(child, "identifier"); |
| 4546 | } |
| 4547 | TSNode null_node = {0}; |
| 4548 | return null_node; |
| 4549 | } |
| 4550 | |
| 4551 | // Arrow function: name on parent variable_declarator/field_definition, or the |
| 4552 | // key of an object-literal property — the Zustand "actions returned from a |
no test coverage detected