Where a `//` comment starts in the line text [ls, le), outside string and * rune literals; le when there is none. */
| 352 | /* Where a `//` comment starts in the line text [ls, le), outside string and |
| 353 | * rune literals; le when there is none. */ |
| 354 | static const char *op_comment_start(const char *ls, const char *le) { |
| 355 | char quote = 0; |
| 356 | for (const char *p = ls; p < le; p++) { |
| 357 | if (quote) { |
| 358 | if (*p == '\\' && quote != '`' && p + SKIP_ONE < le) { |
| 359 | p++; |
| 360 | } else if (*p == quote) { |
| 361 | quote = 0; |
| 362 | } |
| 363 | } else if (op_is_quote(*p)) { |
| 364 | quote = *p; |
| 365 | } else if (*p == '/' && p + SKIP_ONE < le && p[SKIP_ONE] == '/') { |
| 366 | return p; |
| 367 | } |
| 368 | } |
| 369 | return le; |
| 370 | } |
| 371 | |
| 372 | static const char *op_line_start(const char *text, const char *p) { |
| 373 | while (p > text && p[-SKIP_ONE] != '\n') { |
no test coverage detected