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

Function php_loose_walk

internal/cbm/doclink_php.c:990–1011  ·  view source on GitHub ↗

The types of the file: top level, namespace bodies, top-level conditionals. */

Source from the content-addressed store, hash-verified

988
989/* The types of the file: top level, namespace bodies, top-level conditionals. */
990static void php_loose_walk(CBMExtractCtx *ctx, TSNode parent, int depth,
991 cbm_doclink_taken_fn taken) {
992 if (depth > PHP_COND_DEPTH) {
993 return;
994 }
995 TSTreeCursor cur = ts_tree_cursor_new(parent);
996 for (bool more = ts_tree_cursor_goto_first_child(&cur); more;
997 more = ts_tree_cursor_goto_next_sibling(&cur)) {
998 TSNode c = ts_tree_cursor_current_node(&cur);
999 if (php_is_type_decl(c)) {
1000 php_loose_type(ctx, c, taken);
1001 } else if (php_kind(c, "namespace_definition")) {
1002 TSNode body = ts_node_child_by_field_name(c, TS_FIELD("body"));
1003 if (!ts_node_is_null(body)) {
1004 php_loose_walk(ctx, body, depth + SKIP_ONE, taken);
1005 }
1006 } else if (php_is_branch(c)) {
1007 php_loose_walk(ctx, c, depth + SKIP_ONE, taken);
1008 }
1009 }
1010 ts_tree_cursor_delete(&cur);
1011}
1012
1013void cbm_doclink_php_loose_docs(CBMExtractCtx *ctx, const CBMDefinition *file_def,
1014 cbm_doclink_taken_fn taken) {

Callers 1

Calls 4

php_is_type_declFunction · 0.85
php_loose_typeFunction · 0.85
php_kindFunction · 0.85
php_is_branchFunction · 0.85

Tested by

no test coverage detected