`suite_name ( void )` after `void`: the written-out form of SUITE(name). On * a match `name` is the part after the prefix and the lexer stands behind the * `)`. */
| 509 | * a match `name` is the part after the prefix and the lexer stands behind the |
| 510 | * `)`. */ |
| 511 | static bool tm_suite_function(tm_lex_t *lx, const char *prefix, tm_tok_t *name) { |
| 512 | if (!prefix) { |
| 513 | return false; |
| 514 | } |
| 515 | tm_lex_t at = *lx; |
| 516 | size_t prefix_len = strlen(prefix); |
| 517 | tm_tok_t tok; |
| 518 | tm_next(lx, name); |
| 519 | if (name->kind == TM_TOK_IDENT && name->len > prefix_len && |
| 520 | memcmp(name->text, prefix, prefix_len) == 0) { |
| 521 | tm_next(lx, &tok); |
| 522 | if (tm_tok_punct(&tok, '(')) { |
| 523 | tm_next(lx, &tok); |
| 524 | if (tm_tok_is(&tok, "void")) { |
| 525 | tm_next(lx, &tok); |
| 526 | if (tm_tok_punct(&tok, ')')) { |
| 527 | name->text += prefix_len; |
| 528 | name->len -= prefix_len; |
| 529 | return true; |
| 530 | } |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | *lx = at; |
| 535 | return false; |
| 536 | } |
| 537 | |
| 538 | /* ── Scanner ─────────────────────────────────────────────────────── */ |
| 539 |
no test coverage detected