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

Function check_script_module_level

internal/cbm/helpers.c:1549–1559  ·  view source on GitHub ↗

Check if parent node kind matches direct-or-grandparent for scripting languages. Returns true if pk matches root_kind, or pk matches wrapper_kind and grandparent is root_kind.

Source from the content-addressed store, hash-verified

1547// Check if parent node kind matches direct-or-grandparent for scripting languages.
1548// Returns true if pk matches root_kind, or pk matches wrapper_kind and grandparent is root_kind.
1549static bool check_script_module_level(TSNode parent, const char *pk, const char *root_kind,
1550 const char *wrapper_kind) {
1551 if (strcmp(pk, root_kind) == 0) {
1552 return true;
1553 }
1554 if (wrapper_kind && strcmp(pk, wrapper_kind) == 0) {
1555 TSNode gp = ts_node_parent(parent);
1556 return !ts_node_is_null(gp) && strcmp(ts_node_type(gp), root_kind) == 0;
1557 }
1558 return false;
1559}
1560
1561// Get the module-level parent type list for table-driven languages.
1562static const char **get_module_parents(CBMLanguage lang) {

Callers 1

cbm_is_module_level_pFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected