Extract second argument name (handler ref for route registrations). Normalize a string-form route handler to a resolvable handler name. * 'showUsers' → showUsers * 'UserController@show' → show (Laravel "Controller@method") * The method segment after '@' is the resolvable function/method name. */
| 1566 | * 'UserController@show' → show (Laravel "Controller@method") |
| 1567 | * The method segment after '@' is the resolvable function/method name. */ |
| 1568 | static const char *normalize_string_handler(CBMArena *a, const char *raw) { |
| 1569 | const char *unq = strip_quotes(a, raw); |
| 1570 | if (!unq || !unq[0]) { |
| 1571 | return NULL; |
| 1572 | } |
| 1573 | const char *at = strchr(unq, '@'); |
| 1574 | if (at && at[1]) { |
| 1575 | return cbm_arena_strdup(a, at + 1); |
| 1576 | } |
| 1577 | return unq; |
| 1578 | } |
| 1579 | |
| 1580 | static const char *extract_handler_arg(CBMExtractCtx *ctx, TSNode args) { |
| 1581 | uint32_t nc = ts_node_named_child_count(args); |
no test coverage detected