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

Function cs_namespace_header_end

internal/cbm/doclink_cs.c:1913–1930  ·  view source on GitHub ↗

Keep malformed dotted candidates until their known delimiter. Dropping an * invalid file-scoped header would place its declarations in the root. The * next recorded declaration bounds this scan even when no delimiter exists. */

Source from the content-addressed store, hash-verified

1911 * invalid file-scoped header would place its declarations in the root. The
1912 * next recorded declaration bounds this scan even when no delimiter exists. */
1913static uint32_t cs_namespace_header_end(cs_scan_t *s, uint32_t a, uint32_t stop) {
1914 const char *src = s->ctx->source;
1915 uint32_t i = a;
1916 while (i < stop) {
1917 uint32_t next = cs_skip_space(src, i, stop);
1918 if (next != i) {
1919 i = next;
1920 continue;
1921 }
1922 unsigned char c = (unsigned char)src[i];
1923 if (!cs_word_char(c) && c != '@' && c != '.') {
1924 break;
1925 }
1926 s->cost_steps++;
1927 i++;
1928 }
1929 return i;
1930}
1931
1932/* End of the identifier starting at src[i] (i itself when there is none);
1933 * `dotted` accepts a qualified name. */

Callers 1

cs_text_itemFunction · 0.85

Calls 2

cs_skip_spaceFunction · 0.85
cs_word_charFunction · 0.85

Tested by

no test coverage detected