MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / handle_throws

Function handle_throws

internal/cbm/extract_semantic.c:300–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298// --- Unified handlers ---
299
300void handle_throws(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec *spec, WalkState *state) {
301 bool has_throws = spec->throw_node_types && spec->throw_node_types[0];
302 bool has_clause = spec->throws_clause_field && spec->throws_clause_field[0];
303 if (!has_throws && !has_clause) {
304 return;
305 }
306
307 if (has_throws && is_throw_node(node, spec)) {
308 char *exc_name = resolve_exception_name(ctx->arena, node, ctx->source);
309 if (exc_name && exc_name[0]) {
310 if (strlen(exc_name) > MAX_EXCEPTION_NAME_LEN) {
311 exc_name[MAX_EXCEPTION_NAME_LEN] = '\0';
312 }
313 CBMThrow thr;
314 thr.exception_name = exc_name;
315 thr.enclosing_func_qn = state->enclosing_func_qn;
316 cbm_throws_push(&ctx->result->throws, ctx->arena, thr);
317 }
318 }
319
320 extract_throws_clause(ctx, node, spec, state->enclosing_func_qn);
321}
322
323void handle_readwrites(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec *spec, WalkState *state) {
324 if (!spec->assignment_node_types || !spec->assignment_node_types[0]) {

Callers 1

cbm_extract_unifiedFunction · 0.85

Calls 4

is_throw_nodeFunction · 0.85
resolve_exception_nameFunction · 0.85
cbm_throws_pushFunction · 0.85
extract_throws_clauseFunction · 0.85

Tested by

no test coverage detected