A command at p[i] (`\word` or `@word`, not inside a word or an address): * the word's length, else 0. */
| 217 | /* A command at p[i] (`\word` or `@word`, not inside a word or an address): |
| 218 | * the word's length, else 0. */ |
| 219 | static size_t c_command_at(const char *p, size_t i, size_t n) { |
| 220 | if ((p[i] != '\\' && p[i] != '@') || |
| 221 | (i > 0 && |
| 222 | (c_ident_char(p[i - SKIP_ONE]) || p[i - SKIP_ONE] == '\\' || p[i - SKIP_ONE] == '@'))) { |
| 223 | return 0; |
| 224 | } |
| 225 | size_t k = i + SKIP_ONE; |
| 226 | while (k < n && isalpha((unsigned char)p[k])) { |
| 227 | k++; |
| 228 | } |
| 229 | return k - i - SKIP_ONE; |
| 230 | } |
| 231 | |
| 232 | static bool c_word_is(const char *w, size_t n, const char *lit) { |
| 233 | return strlen(lit) == n && memcmp(w, lit, n) == 0; |
no test coverage detected