(req: &Request<'_, S>, state: &mut State, mut ctx: MatchContext)
| 281 | } |
| 282 | |
| 283 | fn _match<S: StrDrive>(req: &Request<'_, S>, state: &mut State, mut ctx: MatchContext) -> bool { |
| 284 | let mut context_stack = vec![]; |
| 285 | let mut popped_result = false; |
| 286 | |
| 287 | #[allow( |
| 288 | clippy::never_loop, |
| 289 | reason = "'result loop is not an actual loop but break label" |
| 290 | )] |
| 291 | 'coro: loop { |
| 292 | popped_result = 'result: loop { |
| 293 | let yielded = 'context: loop { |
| 294 | match ctx.jump { |
| 295 | Jump::OpCode => {} |
| 296 | Jump::Assert1 => { |
| 297 | if popped_result { |
| 298 | ctx.skip_code_from(req, 1); |
| 299 | } else { |
| 300 | break 'result false; |
| 301 | } |
| 302 | } |
| 303 | Jump::AssertNot1 => { |
| 304 | if popped_result { |
| 305 | break 'result false; |
| 306 | } |
| 307 | state.marks.pop(); |
| 308 | ctx.skip_code_from(req, 1); |
| 309 | } |
| 310 | Jump::Branch1 => { |
| 311 | let branch_offset = ctx.count as usize; |
| 312 | let next_length = ctx.peek_code(req, branch_offset) as isize; |
| 313 | if next_length == 0 { |
| 314 | state.marks.pop_discard(); |
| 315 | break 'result false; |
| 316 | } |
| 317 | state.cursor = ctx.cursor; |
| 318 | let next_ctx = ctx.next_offset(branch_offset + 1, Jump::Branch2); |
| 319 | ctx.count += next_length; |
| 320 | break 'context next_ctx; |
| 321 | } |
| 322 | Jump::Branch2 => { |
| 323 | if popped_result { |
| 324 | break 'result true; |
| 325 | } |
| 326 | state.marks.pop_keep(); |
| 327 | ctx.jump = Jump::Branch1; |
| 328 | continue 'context; |
| 329 | } |
| 330 | Jump::Repeat1 => { |
| 331 | state.repeat_stack.pop(); |
| 332 | break 'result popped_result; |
| 333 | } |
| 334 | Jump::UntilBacktrace => { |
| 335 | if !popped_result { |
| 336 | state.repeat_stack[ctx.repeat_ctx_id].count -= 1; |
| 337 | state.cursor = ctx.cursor; |
| 338 | } |
| 339 | break 'result popped_result; |
| 340 | } |
no test coverage detected