(lazy: bool, mc: MetaCharacter, re: &[char], text: &[char], range: T, end: &mut usize)
| 190 | } |
| 191 | |
| 192 | fn ismatch_char<T: RangeBounds<usize>>(lazy: bool, mc: MetaCharacter, re: &[char], text: &[char], range: T, end: &mut usize) -> bool |
| 193 | { |
| 194 | let mut i = 0; |
| 195 | let n = text.len(); |
| 196 | if !lazy |
| 197 | { |
| 198 | loop |
| 199 | { |
| 200 | if i == n || !(mc.contains(text[i])) |
| 201 | { |
| 202 | break; |
| 203 | } |
| 204 | i += 1; |
| 205 | } |
| 206 | } |
| 207 | loop |
| 208 | { |
| 209 | if ismatch_here(re, &text[i..], end) && range.contains(&i) |
| 210 | { |
| 211 | *end += i; |
| 212 | return true; |
| 213 | } |
| 214 | if lazy |
| 215 | { |
| 216 | if i == n || !(mc.contains(text[i])) |
| 217 | { |
| 218 | return false; |
| 219 | } |
| 220 | i += i; |
| 221 | } |
| 222 | else |
| 223 | { |
| 224 | if i == 0 |
| 225 | { |
| 226 | return false; |
| 227 | } |
| 228 | i -= 1; |
| 229 | } |
| 230 | } |
| 231 | } |
no test coverage detected