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.
| 138 | // standalone prefix token starts a raw string) and -1 on an unrecognizable |
| 139 | // raw form. |
| 140 | static 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 // |
no test coverage detected