`for t in set(TOKEN_RX.findall(ln))` on lines not starting `//` or `*`. */
| 941 | |
| 942 | /* `for t in set(TOKEN_RX.findall(ln))` on lines not starting `//` or `*`. */ |
| 943 | static 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 | |
| 965 | bool cbm_ti_source_build_occurrences(cbm_ti_source_t *s) { |
| 966 | if (!s || !s->finished || s->failed) { |
no test coverage detected