Consume a '..', "..", or `..` run starting at the opening quote. Doubled * quotes escape everywhere; a backslash escapes in strings and "..". Sets * *raw_newline when the run crosses a line break. False if it never closes. */
| 66 | * quotes escape everywhere; a backslash escapes in strings and "..". Sets |
| 67 | * *raw_newline when the run crosses a line break. False if it never closes. */ |
| 68 | static bool sqlv_skip_quoted(sqlv_scan_t *sc, bool *raw_newline) { |
| 69 | char q = sc->s[sc->i]; |
| 70 | sqlv_step(sc); |
| 71 | while (sc->i < sc->len) { |
| 72 | char c = sc->s[sc->i]; |
| 73 | if (c == '\n') { |
| 74 | *raw_newline = true; |
| 75 | } |
| 76 | if (c == '\\' && q != '`' && sc->i + 1 < sc->len) { |
| 77 | sqlv_step(sc); |
| 78 | sqlv_step(sc); |
| 79 | continue; |
| 80 | } |
| 81 | sqlv_step(sc); |
| 82 | if (c == q) { |
| 83 | if (sqlv_at(sc, 0) != q) { |
| 84 | return true; |
| 85 | } |
| 86 | sqlv_step(sc); /* doubled quote: an escaped quote character */ |
| 87 | } |
| 88 | } |
| 89 | return false; |
| 90 | } |
| 91 | |
| 92 | /* $tag$ ... $tag$ (PostgreSQL). Returns false, consuming nothing, when the `$` |
| 93 | * does not open a dollar quote ($1 parameters, a lone $). */ |
no test coverage detected