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

Function check_script_module_level

internal/cbm/helpers.c:1008–1018  ·  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

1006// Check if parent node kind matches direct-or-grandparent for scripting languages.
1007// Returns true if pk matches root_kind, or pk matches wrapper_kind and grandparent is root_kind.
1008static bool check_script_module_level(TSNode parent, const char *pk, const char *root_kind,
1009 const char *wrapper_kind) {
1010 if (strcmp(pk, root_kind) == 0) {
1011 return true;
1012 }
1013 if (wrapper_kind && strcmp(pk, wrapper_kind) == 0) {
1014 TSNode gp = ts_node_parent(parent);
1015 return !ts_node_is_null(gp) && strcmp(ts_node_type(gp), root_kind) == 0;
1016 }
1017 return false;
1018}
1019
1020// Get the module-level parent type list for table-driven languages.
1021static 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