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

Function php_use_keyword_kind

internal/cbm/lsp/php_lsp.c:2819–2832  ·  view source on GitHub ↗

The `function` / `const` keyword of a use: an anonymous direct child of the * declaration (flat form) or of one clause (grouped form * `use A\{function f, const C, K}`). `fallback` when neither is present. * Mirrors the extractor's php_use_kind (extract_imports.c). */

Source from the content-addressed store, hash-verified

2817 * `use A\{function f, const C, K}`). `fallback` when neither is present.
2818 * Mirrors the extractor's php_use_kind (extract_imports.c). */
2819static int php_use_keyword_kind(TSNode node, int fallback) {
2820 uint32_t n = ts_node_child_count(node);
2821 for (uint32_t i = 0; i < n; i++) {
2822 TSNode c = ts_node_child(node, i);
2823 if (ts_node_is_null(c) || ts_node_is_named(c))
2824 continue;
2825 const char *k = ts_node_type(c);
2826 if (strcmp(k, "function") == 0)
2827 return CBM_PHP_USE_FUNCTION;
2828 if (strcmp(k, "const") == 0)
2829 return CBM_PHP_USE_CONST;
2830 }
2831 return fallback;
2832}
2833
2834static void collect_use_declaration(PHPLSPContext *ctx, TSNode use_decl) {
2835 /* Determine kind: function / const / class (default). */

Callers 1

collect_use_declarationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected