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

Function find_include_path_node

internal/cbm/extract_imports.c:1136–1149  ·  view source on GitHub ↗

Find the path node inside a preproc_include/preproc_import node.

Source from the content-addressed store, hash-verified

1134
1135// Find the path node inside a preproc_include/preproc_import node.
1136static TSNode find_include_path_node(TSNode node) {
1137 TSNode path_node = ts_node_child_by_field_name(node, TS_FIELD("path"));
1138 if (ts_node_is_null(path_node)) {
1139 uint32_t nc = ts_node_child_count(node);
1140 for (uint32_t j = 0; j < nc; j++) {
1141 TSNode c = ts_node_child(node, j);
1142 const char *ck = ts_node_type(c);
1143 if (strcmp(ck, "string_literal") == 0 || strcmp(ck, "system_lib_string") == 0) {
1144 return c;
1145 }
1146 }
1147 }
1148 return path_node;
1149}
1150
1151// Strip angle brackets from a system include path (<stdio.h> → stdio.h).
1152static char *strip_angle_brackets(CBMArena *a, char *path) {

Callers 1

parse_c_imports_inFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected