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

Function php_plain_string_value

internal/cbm/extract_calls.c:1819–1831  ·  view source on GitHub ↗

The value of a plain PHP string literal ('...' or "..." with no * interpolation or escapes), "" for an empty one; NULL for anything else. */

Source from the content-addressed store, hash-verified

1817/* The value of a plain PHP string literal ('...' or "..." with no
1818 * interpolation or escapes), "" for an empty one; NULL for anything else. */
1819static const char *php_plain_string_value(CBMArena *a, TSNode node, const char *source) {
1820 const char *kind = ts_node_type(node);
1821 if (strcmp(kind, "string") != 0 && strcmp(kind, "encapsed_string") != 0) {
1822 return NULL;
1823 }
1824 uint32_t nc = ts_node_named_child_count(node);
1825 for (uint32_t i = 0; i < nc; i++) {
1826 if (strcmp(ts_node_type(ts_node_named_child(node, i)), "string_content") != 0) {
1827 return NULL;
1828 }
1829 }
1830 return nc == 0 ? "" : cbm_node_text(a, ts_node_named_child(node, 0), source);
1831}
1832
1833/* The first argument's value node of a PHP call (unwrapping `argument`). */
1834static TSNode php_first_arg_value(TSNode call_node) {

Callers 2

php_group_array_prefixFunction · 0.85
php_laravel_route_uriFunction · 0.85

Calls 1

cbm_node_textFunction · 0.85

Tested by

no test coverage detected