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

Function raw_string_after_prefix

internal/cbm/preprocessor.cpp:140–154  ·  view source on GitHub ↗

If the identifier just scanned is a raw-string prefix (R, LR, uR, UR, u8R) immediately followed by a quote, return skip_raw_string(...). Returns 0 for an ordinary identifier (including an identifier merely ENDING in R — only a standalone prefix token starts a raw string) and -1 on an unrecognizable raw form.

Source from the content-addressed store, hash-verified

138// standalone prefix token starts a raw string) and -1 on an unrecognizable
139// raw form.
140static int raw_string_after_prefix(const char *source, int source_len, int start, int end) {
141 static const char *prefixes[] = {"R", "LR", "uR", "UR", "u8R", NULL};
142 size_t idlen = (size_t)(end - start);
143 bool is_prefix = false;
144 for (int p = 0; prefixes[p]; p++) {
145 if (idlen == strlen(prefixes[p]) && strncmp(source + start, prefixes[p], idlen) == 0) {
146 is_prefix = true;
147 break;
148 }
149 }
150 if (!is_prefix || end >= source_len || source[end] != '"') {
151 return 0;
152 }
153 return skip_raw_string(source, source_len, end);
154}
155
156// Advance past comments and string/char literals so only real code tokens
157// consume the candidate budget (#1989 review). Handles line-spliced //

Callers 2

Calls 1

skip_raw_stringFunction · 0.85

Tested by

no test coverage detected