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

Function operator_start

src/pipeline/doc_links_cs.c:3603–3616  ·  view source on GitHub ↗

Where the reference's last segment starts an operator, a conversion or an * indexer: its offset in `s`, or CS_NONE. */

Source from the content-addressed store, hash-verified

3601/* Where the reference's last segment starts an operator, a conversion or an
3602 * indexer: its offset in `s`, or CS_NONE. */
3603static int operator_start(const char *s, char name[CS_OP_NAME]) {
3604 int depth = 0;
3605 for (size_t i = 0; s[i]; i++) {
3606 if ((i == 0 || (s[i - SKIP_ONE] == '.' && depth == 0)) && operator_at(s + i, name)) {
3607 return (int)i;
3608 }
3609 if (is_open_bracket(s[i])) {
3610 depth++;
3611 } else if (is_close_bracket(s[i])) {
3612 depth--;
3613 }
3614 }
3615 return CS_NONE;
3616}
3617
3618/* A doc ID writes a type parameter by its position: `0 (of the type and the
3619 * types around it), ``0 (of the method). Such a parameter is kept as it

Callers 1

parse_crefFunction · 0.85

Calls 3

operator_atFunction · 0.85
is_open_bracketFunction · 0.85
is_close_bracketFunction · 0.85

Tested by

no test coverage detected