| 740 | } |
| 741 | |
| 742 | static bool is_fish_function_parameter(CBMExtractCtx *ctx, TSNode node, WalkState *state) { |
| 743 | if (strcmp(ts_node_type(node), "word") != 0) { |
| 744 | return false; |
| 745 | } |
| 746 | TSNode definition = ts_node_parent(node); |
| 747 | const char *field = |
| 748 | ts_node_is_null(definition) ? NULL : field_name_for_walk_node(state, definition, node); |
| 749 | if (!field || strcmp(field, "option") != 0 || |
| 750 | strcmp(ts_node_type(definition), "function_definition") != 0) { |
| 751 | return false; |
| 752 | } |
| 753 | for (TSNode previous = ts_node_prev_named_sibling(node); !ts_node_is_null(previous); |
| 754 | previous = ts_node_prev_named_sibling(previous)) { |
| 755 | char *text = cbm_node_text(ctx->arena, previous, ctx->source); |
| 756 | if (!text || text[0] != '-') { |
| 757 | continue; |
| 758 | } |
| 759 | return fish_argument_marker(ctx, previous); |
| 760 | } |
| 761 | return false; |
| 762 | } |
| 763 | |
| 764 | static bool is_tcl_procedure_parameter(TSNode node) { |
| 765 | TSNode argument = ts_node_parent(node); |
no test coverage detected