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

Function tm_ident

src/mcp/test_impact.c:1149–1203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1147}
1148
1149static void tm_ident(tm_scan_t *sc, const tm_tok_t *tok) {
1150 const cbm_test_conventions_t *conv = &sc->m->conv;
1151 tm_tok_t name;
1152 if (tm_tok_is(tok, "namespace")) {
1153 sc->m->incomplete = true; /* file-scope-only model cannot map namespace identities */
1154 }
1155 if (sc->m->descriptor_mode) {
1156 if (tm_descriptor_ident(sc, tok))
1157 return;
1158 if (tm_cbm_active(sc) && tm_tok_is(tok, "void")) {
1159 if (sc->depth == 0) {
1160 tm_file_scope_ident(sc, tok);
1161 } else {
1162 tm_lex_t ahead = sc->lx;
1163 if (tm_suite_function(&ahead, conv->suite_fn_prefix, &name) &&
1164 tm_body_opens(&ahead)) {
1165 tm_scan_mapping(sc, CBM_TEST_MODEL_MAPPING_UNSUPPORTED_FORM, -1, tok->line);
1166 }
1167 }
1168 }
1169 return;
1170 }
1171 bool perf = tm_tok_is(tok, conv->suite_run_perf_macro);
1172 if (perf || tm_tok_is(tok, conv->suite_run_macro)) {
1173 if (tm_macro_arg(&sc->lx, &name)) {
1174 tm_add_runner_suite(sc, &name, perf);
1175 } else {
1176 sc->m->incomplete = true;
1177 }
1178 return;
1179 }
1180 if (sc->depth == 0) {
1181 if (tm_tok_is(tok, conv->run_macro)) {
1182 sc->m->incomplete = true;
1183 }
1184 tm_file_scope_ident(sc, tok);
1185 return;
1186 }
1187 if (tm_tok_is(tok, conv->case_macro) || tm_tok_is(tok, conv->suite_macro)) {
1188 sc->m->incomplete = true; /* configured definitions below file scope are unsupported */
1189 }
1190 if (tm_tok_is(tok, "void")) {
1191 tm_lex_t ahead = sc->lx;
1192 if (tm_suite_function(&ahead, conv->suite_fn_prefix, &name) && tm_body_opens(&ahead)) {
1193 sc->m->incomplete = true;
1194 }
1195 }
1196 if (tm_tok_is(tok, conv->run_macro)) {
1197 if (sc->open == TM_OPEN_SUITE && tm_macro_arg(&sc->lx, &name)) {
1198 tm_add_registration(sc, &name, tok->line);
1199 } else {
1200 sc->m->incomplete = true;
1201 }
1202 }
1203}
1204
1205static bool tm_scan_source(cbm_test_model_t *m, const char *file, const char *text, size_t len,
1206 int language_kind) {

Callers 1

tm_scan_sourceFunction · 0.85

Calls 10

tm_tok_isFunction · 0.85
tm_descriptor_identFunction · 0.85
tm_cbm_activeFunction · 0.85
tm_file_scope_identFunction · 0.85
tm_suite_functionFunction · 0.85
tm_body_opensFunction · 0.85
tm_scan_mappingFunction · 0.85
tm_macro_argFunction · 0.85
tm_add_runner_suiteFunction · 0.85
tm_add_registrationFunction · 0.85

Tested by

no test coverage detected