Process a single node for throw extraction (called from iterative walker).
| 106 | |
| 107 | // Process a single node for throw extraction (called from iterative walker). |
| 108 | static void process_throw_node(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec *spec) { |
| 109 | if (is_throw_node(node, spec)) { |
| 110 | char *exc_name = resolve_exception_name(ctx->arena, node, ctx->source); |
| 111 | if (exc_name && exc_name[0]) { |
| 112 | if (strlen(exc_name) > MAX_EXCEPTION_NAME_LEN) { |
| 113 | exc_name[MAX_EXCEPTION_NAME_LEN] = '\0'; |
| 114 | } |
| 115 | CBMThrow thr; |
| 116 | thr.exception_name = exc_name; |
| 117 | thr.enclosing_func_qn = cbm_enclosing_func_qn_cached(ctx, node); |
| 118 | cbm_throws_push(&ctx->result->throws, ctx->arena, thr); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | extract_throws_clause(ctx, node, spec, cbm_enclosing_func_qn_cached(ctx, node)); |
| 123 | } |
| 124 | |
| 125 | // Iterative throw walker |
| 126 | static void walk_throws(CBMExtractCtx *ctx, TSNode root, const CBMLangSpec *spec) { |
no test coverage detected