| 787 | } |
| 788 | |
| 789 | static bool is_fish_function_parameter(CBMExtractCtx *ctx, TSNode node, WalkState *state) { |
| 790 | if (strcmp(ts_node_type(node), "word") != 0) { |
| 791 | return false; |
| 792 | } |
| 793 | TSNode definition = ts_node_parent(node); |
| 794 | const char *field = |
| 795 | ts_node_is_null(definition) ? NULL : field_name_for_walk_node(state, definition, node); |
| 796 | if (!field || strcmp(field, "option") != 0 || |
| 797 | strcmp(ts_node_type(definition), "function_definition") != 0) { |
| 798 | return false; |
| 799 | } |
| 800 | for (TSNode previous = ts_node_prev_named_sibling(node); !ts_node_is_null(previous); |
| 801 | previous = ts_node_prev_named_sibling(previous)) { |
| 802 | char *text = cbm_node_text(ctx->arena, previous, ctx->source); |
| 803 | if (!text || text[0] != '-') { |
| 804 | continue; |
| 805 | } |
| 806 | return fish_argument_marker(ctx, previous); |
| 807 | } |
| 808 | return false; |
| 809 | } |
| 810 | |
| 811 | static bool is_tcl_procedure_parameter(TSNode node) { |
| 812 | TSNode argument = ts_node_parent(node); |
no test coverage detected