The value of a plain PHP string literal ('...' or "..." with no * interpolation or escapes), "" for an empty one; NULL for anything else. */
| 1817 | /* The value of a plain PHP string literal ('...' or "..." with no |
| 1818 | * interpolation or escapes), "" for an empty one; NULL for anything else. */ |
| 1819 | static 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`). */ |
| 1834 | static TSNode php_first_arg_value(TSNode call_node) { |
no test coverage detected