| 770 | } |
| 771 | |
| 772 | static bool is_fish_function_parameter(CBMExtractCtx *ctx, TSNode node, WalkState *state) { |
| 773 | if (strcmp(ts_node_type(node), "word") != 0) { |
| 774 | return false; |
| 775 | } |
| 776 | TSNode definition = ts_node_parent(node); |
| 777 | const char *field = |
| 778 | ts_node_is_null(definition) ? NULL : field_name_for_walk_node(state, definition, node); |
| 779 | if (!field || strcmp(field, "option") != 0 || |
| 780 | strcmp(ts_node_type(definition), "function_definition") != 0) { |
| 781 | return false; |
| 782 | } |
| 783 | for (TSNode previous = ts_node_prev_named_sibling(node); !ts_node_is_null(previous); |
| 784 | previous = ts_node_prev_named_sibling(previous)) { |
| 785 | char *text = cbm_node_text(ctx->arena, previous, ctx->source); |
| 786 | if (!text || text[0] != '-') { |
| 787 | continue; |
| 788 | } |
| 789 | return fish_argument_marker(ctx, previous); |
| 790 | } |
| 791 | return false; |
| 792 | } |
| 793 | |
| 794 | static bool is_tcl_procedure_parameter(TSNode node) { |
| 795 | TSNode argument = ts_node_parent(node); |
no test coverage detected