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

Function tm_suite_function

src/mcp/test_impact.c:511–536  ·  view source on GitHub ↗

`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 * `)`. */

Source from the content-addressed store, hash-verified

509 * a match `name` is the part after the prefix and the lexer stands behind the
510 * `)`. */
511static 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

Callers 2

tm_file_scope_identFunction · 0.85
tm_identFunction · 0.85

Calls 3

tm_nextFunction · 0.85
tm_tok_punctFunction · 0.85
tm_tok_isFunction · 0.85

Tested by

no test coverage detected