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

Function py_bind_scope_parameters

internal/cbm/extract_unified.c:291–307  ·  view source on GitHub ↗

Bind this node's parameters into the frame just pushed for it. Called after * every push in push_boundary_scopes, so the top frame is this node's own and * pop_expired_scopes unwinds them at exactly the right depth. */

Source from the content-addressed store, hash-verified

289 * every push in push_boundary_scopes, so the top frame is this node's own and
290 * pop_expired_scopes unwinds them at exactly the right depth. */
291static void py_bind_scope_parameters(CBMExtractCtx *ctx, TSNode node, WalkState *state) {
292 if (ctx->language != CBM_LANG_PYTHON || state->scope_top == 0) {
293 return;
294 }
295 const char *kind = ts_node_type(node);
296 if (strcmp(kind, "function_definition") != 0 && strcmp(kind, "lambda") != 0) {
297 return;
298 }
299 TSNode params = ts_node_child_by_field_name(node, TS_FIELD("parameters"));
300 if (ts_node_is_null(params)) {
301 return;
302 }
303 uint32_t count = ts_node_named_child_count(params);
304 for (uint32_t i = 0; i < count; i++) {
305 py_param_bind(state, py_parameter_name(ctx, ts_node_named_child(params, i)));
306 }
307}
308
309static bool push_scope(WalkState *state, uint8_t kind, uint32_t depth, const char *qn) {
310 if (!ensure_scope_capacity(state)) {

Callers 1

push_boundary_scopesFunction · 0.85

Calls 2

py_param_bindFunction · 0.85
py_parameter_nameFunction · 0.85

Tested by

no test coverage detected