Past the `(…)` group at `i` (strings inside skipped).
(s: &[u8], i: usize)
| 174 | |
| 175 | /// Past the `(…)` group at `i` (strings inside skipped). |
| 176 | fn paren_group_end(s: &[u8], i: usize) -> Option<usize> { |
| 177 | let mut depth = 0usize; |
| 178 | let mut j = i; |
| 179 | while j < s.len() { |
| 180 | let c = s[j]; |
| 181 | if c == b'"' || c == b'\'' { |
| 182 | j = quoted_end(s, j); |
| 183 | continue; |
| 184 | } |
| 185 | if c == b'(' { |
| 186 | depth += 1; |
| 187 | } else if c == b')' { |
| 188 | depth = depth.saturating_sub(1); |
| 189 | if depth == 0 { |
| 190 | return Some(j + 1); |
| 191 | } |
| 192 | } |
| 193 | j += 1; |
| 194 | } |
| 195 | None |
| 196 | } |
| 197 | |
| 198 | /// namespaceHead: after the `namespace` keyword ending at `from`, the name as |
| 199 | /// written and the offset of the body's `{`. |
no test coverage detected