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

Function php_count_names

internal/cbm/doclink_php.c:827–841  ·  view source on GitHub ↗

Count the short names of the top-level types and functions of kids[0, n) * and of braced namespace bodies among them. */

Source from the content-addressed store, hash-verified

825/* Count the short names of the top-level types and functions of kids[0, n)
826 * and of braced namespace bodies among them. */
827static void php_count_names(php_walk_t *w, const TSNode *kids, int n) {
828 for (int i = 0; i < n; i++) {
829 TSNode c = kids[i];
830 if (php_is_type_decl(c) || php_kind(c, "function_definition")) {
831 php_count_name(w, c);
832 } else if (php_kind(c, "if_statement")) {
833 php_cond_decls(w, c, 0, true);
834 } else if (php_kind(c, "namespace_definition")) {
835 TSNode body = ts_node_child_by_field_name(c, TS_FIELD("body"));
836 int bn = 0;
837 TSNode *bk = ts_node_is_null(body) ? NULL : php_children(w, body, &bn);
838 php_count_names(w, bk, bn);
839 }
840 }
841}
842
843static void php_namespace_rec(php_walk_t *w, TSNode def, uint32_t first, uint32_t last) {
844 TSNode name = ts_node_child_by_field_name(def, TS_FIELD("name"));

Callers 1

Calls 5

php_is_type_declFunction · 0.85
php_kindFunction · 0.85
php_count_nameFunction · 0.85
php_cond_declsFunction · 0.85
php_childrenFunction · 0.85

Tested by

no test coverage detected