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

Function find_c_params

internal/cbm/extract_defs.c:2989–3000  ·  view source on GitHub ↗

C/C++/CUDA/GLSL: parameters live on function_declarator inside declarator chain.

Source from the content-addressed store, hash-verified

2987
2988// C/C++/CUDA/GLSL: parameters live on function_declarator inside declarator chain.
2989static TSNode find_c_params(TSNode func_node) {
2990 TSNode decl = ts_node_child_by_field_name(func_node, TS_FIELD("declarator"));
2991 for (int d = 0; d < C_RETURN_WALK_DEPTH && !ts_node_is_null(decl); d++) {
2992 TSNode params = ts_node_child_by_field_name(decl, TS_FIELD("parameters"));
2993 if (!ts_node_is_null(params)) {
2994 return params;
2995 }
2996 decl = ts_node_child_by_field_name(decl, TS_FIELD("declarator"));
2997 }
2998 TSNode null_node = {0};
2999 return null_node;
3000}
3001
3002// C++: resolve trailing return type (auto f() -> Type) on a declarator node.
3003// Updates def->return_type and def->return_types if trailing type found.

Callers 1

extract_func_defFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected