Mark the bytes of a line that sit in a code span or a quoted label. */
| 193 | |
| 194 | /* Mark the bytes of a line that sit in a code span or a quoted label. */ |
| 195 | static void c_mask(const c_line_t *ln, bool *mask) { |
| 196 | for (size_t i = 0; i < ln->n;) { |
| 197 | char q = ln->p[i]; |
| 198 | if (q != '`' && q != '"') { |
| 199 | i++; |
| 200 | continue; |
| 201 | } |
| 202 | size_t j = i + SKIP_ONE; |
| 203 | while (j < ln->n && ln->p[j] != q) { |
| 204 | j++; |
| 205 | } |
| 206 | if (j >= ln->n) { |
| 207 | i++; /* unpaired */ |
| 208 | continue; |
| 209 | } |
| 210 | for (size_t k = i; k <= j; k++) { |
| 211 | mask[k] = true; |
| 212 | } |
| 213 | i = j + SKIP_ONE; |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /* A command at p[i] (`\word` or `@word`, not inside a word or an address): |
| 218 | * the word's length, else 0. */ |