Try to extract URL/topic from a positional argument (string or constant).
| 1504 | |
| 1505 | // Try to extract URL/topic from a positional argument (string or constant). |
| 1506 | static const char *extract_positional_url(CBMExtractCtx *ctx, TSNode arg, const char *ak) { |
| 1507 | if (is_string_like(ak)) { |
| 1508 | char *text = cbm_node_text(ctx->arena, arg, ctx->source); |
| 1509 | const char *validated = strip_and_validate_string_arg(ctx->arena, text); |
| 1510 | if (validated) { |
| 1511 | return validated; |
| 1512 | } |
| 1513 | } |
| 1514 | if (strcmp(ak, "identifier") == 0) { |
| 1515 | char *const_name = cbm_node_text(ctx->arena, arg, ctx->source); |
| 1516 | if (const_name) { |
| 1517 | return lookup_string_constant(ctx, const_name); |
| 1518 | } |
| 1519 | } |
| 1520 | return NULL; |
| 1521 | } |
| 1522 | |
| 1523 | // Extract URL/topic from keyword or positional args. |
| 1524 | static const char *extract_url_or_topic_arg(CBMExtractCtx *ctx, TSNode args) { |
no test coverage detected