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

Function import_targetable_label

src/pipeline/pass_pkgmap.c:1560–1572  ·  view source on GitHub ↗

True for node labels that represent an importable definition (so a symbol-name * fallback does not link to, e.g., a Variable or Field). */

Source from the content-addressed store, hash-verified

1558/* True for node labels that represent an importable definition (so a symbol-name
1559 * fallback does not link to, e.g., a Variable or Field). */
1560static bool import_targetable_label(const char *label) {
1561 if (!label) {
1562 return false;
1563 }
1564 static const char *ok[] = {"Class", "Interface", "Function", "Method", "Module", "Struct",
1565 "Enum", "Trait", "Type", "File", NULL};
1566 for (const char **l = ok; *l; l++) {
1567 if (strcmp(*l, label) == 0) {
1568 return true;
1569 }
1570 }
1571 return false;
1572}
1573
1574/* #2127: a Python import path spells the module chain that owns the imported
1575 * name (`from unittest.mock import patch` -> unittest, mock). Strategy 3 matches

Callers 3

resolve_exact_file_nodeFunction · 0.85
resolve_sibling_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected