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

Function c_declarator_name

internal/cbm/doclink_c.c:563–575  ·  view source on GitHub ↗

The name a declarator declares (through pointers, arrays, functions and * parentheses). */

Source from the content-addressed store, hash-verified

561/* The name a declarator declares (through pointers, arrays, functions and
562 * parentheses). */
563static TSNode c_declarator_name(TSNode d) {
564 for (int guard = 0; guard < CBM_SZ_32 && !ts_node_is_null(d); guard++) {
565 if (c_kind(d, "identifier") || c_kind(d, "type_identifier")) {
566 return d;
567 }
568 TSNode inner = ts_node_child_by_field_name(d, TS_FIELD("declarator"));
569 if (ts_node_is_null(inner)) {
570 inner = ts_node_named_child(d, 0); /* a parenthesized declarator */
571 }
572 d = inner;
573 }
574 return (TSNode){0};
575}
576
577static bool c_is_static(const char *src, TSNode decl) {
578 uint32_t nc = ts_node_named_child_count(decl);

Callers 1

c_static_namesFunction · 0.85

Calls 1

c_kindFunction · 0.85

Tested by

no test coverage detected