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

Function ti_scan_line

src/mcp/test_impact_source.c:943–963  ·  view source on GitHub ↗

`for t in set(TOKEN_RX.findall(ln))` on lines not starting `//` or `*`. */

Source from the content-addressed store, hash-verified

941
942/* `for t in set(TOKEN_RX.findall(ln))` on lines not starting `//` or `*`. */
943static bool ti_scan_line(cbm_ti_source_t *s, int file, int line) {
944 size_t len = 0;
945 const char *text = cbm_ti_source_line(s, file, line, &len);
946 size_t i = ti_skip_space(text, 0, len);
947 if (i < len && (text[i] == '*' || (text[i] == '/' && i + 1 < len && text[i + 1] == '/'))) {
948 return true;
949 }
950 while (i < len) {
951 if (!ti_start(text[i])) {
952 i++;
953 continue;
954 }
955 size_t e = ti_word_end(text, i, len);
956 if (!cbm_ti_is_keyword(text + i, e - i) &&
957 !ti_note_occurrence(s, text + i, e - i, file, line)) {
958 return false;
959 }
960 i = e;
961 }
962 return true;
963}
964
965bool cbm_ti_source_build_occurrences(cbm_ti_source_t *s) {
966 if (!s || !s->finished || s->failed) {

Callers 1

Calls 6

cbm_ti_source_lineFunction · 0.85
ti_skip_spaceFunction · 0.85
ti_startFunction · 0.85
ti_word_endFunction · 0.85
cbm_ti_is_keywordFunction · 0.85
ti_note_occurrenceFunction · 0.85

Tested by

no test coverage detected