Past the string or character literal whose quote is at `i` (it stops at a newline).
(s: &[u8], i: usize)
| 155 | |
| 156 | /// Past the string or character literal whose quote is at `i` (it stops at a newline). |
| 157 | fn quoted_end(s: &[u8], i: usize) -> usize { |
| 158 | let quote = s[i]; |
| 159 | let mut j = i + 1; |
| 160 | while j < s.len() { |
| 161 | let c = s[j]; |
| 162 | if c == b'\\' { |
| 163 | j += if at(s, j + 1) == b'\r' && at(s, j + 2) == b'\n' { 3 } else { 2 }; |
| 164 | } else if c == quote { |
| 165 | return j + 1; |
| 166 | } else if c == b'\n' { |
| 167 | return j; |
| 168 | } else { |
| 169 | j += 1; |
| 170 | } |
| 171 | } |
| 172 | s.len() |
| 173 | } |
| 174 | |
| 175 | /// Past the `(…)` group at `i` (strings inside skipped). |
| 176 | fn paren_group_end(s: &[u8], i: usize) -> Option<usize> { |
no test coverage detected