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

Function gc_skip

src/pipeline/pass_operator.c:1057–1078  ·  view source on GitHub ↗

Past a string / rune literal or a comment starting at p; p when none. */

Source from the content-addressed store, hash-verified

1055
1056/* Past a string / rune literal or a comment starting at p; p when none. */
1057static const char *gc_skip(const char *p) {
1058 if (*p == '"' || *p == '\'') {
1059 char q = *p++;
1060 while (*p && *p != q && *p != '\n') {
1061 p += (*p == '\\' && p[SKIP_ONE]) ? PAIR_LEN : SKIP_ONE;
1062 }
1063 return *p == q ? p + SKIP_ONE : p;
1064 }
1065 if (*p == '`') {
1066 const char *e = strchr(p + SKIP_ONE, '`');
1067 return e ? e + SKIP_ONE : p + strlen(p);
1068 }
1069 if (p[0] == '/' && p[SKIP_ONE] == '/') {
1070 const char *e = strchr(p, '\n');
1071 return e ? e : p + strlen(p);
1072 }
1073 if (p[0] == '/' && p[SKIP_ONE] == '*') {
1074 const char *e = strstr(p + PAIR_LEN, "*/");
1075 return e ? e + PAIR_LEN : p + strlen(p);
1076 }
1077 return p;
1078}
1079
1080/* The '}' closing the block opened at `open`. */
1081static const char *gc_block_end(const char *open) {

Callers 7

gc_block_endFunction · 0.85
gc_argsFunction · 0.85
gc_body_loadsFunction · 0.85
gc_localFunction · 0.85
gc_evalFunction · 0.85
gc_body_ofFunction · 0.85
gc_callsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected