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

Function handle_throws

internal/cbm/extract_semantic.c:308–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306// --- Unified handlers ---
307
308void handle_throws(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec *spec, WalkState *state) {
309 bool has_throws = spec->throw_node_types && spec->throw_node_types[0];
310 bool has_clause = spec->throws_clause_field && spec->throws_clause_field[0];
311 if (!has_throws && !has_clause) {
312 return;
313 }
314
315 if (has_throws && is_throw_node(node, spec)) {
316 char *exc_name = resolve_exception_name(ctx->arena, node, ctx->source);
317 if (exc_name && exc_name[0]) {
318 if (strlen(exc_name) > MAX_EXCEPTION_NAME_LEN) {
319 exc_name[MAX_EXCEPTION_NAME_LEN] = '\0';
320 }
321 CBMThrow thr;
322 thr.exception_name = exc_name;
323 thr.enclosing_func_qn = state->enclosing_func_qn;
324 cbm_throws_push(&ctx->result->throws, ctx->arena, thr);
325 }
326 }
327
328 extract_throws_clause(ctx, node, spec, state->enclosing_func_qn);
329}
330
331void handle_readwrites(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec *spec, WalkState *state) {
332 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