Sequence walker, threads the continuation across nodes. */
(&self, nodes: &[Node], pos: usize, caps: &mut Caps, k: &mut dyn FnMut(usize, &mut Caps) -> bool)
| 111 | |
| 112 | /* Sequence walker, threads the continuation across nodes. */ |
| 113 | fn m_seq(&self, nodes: &[Node], pos: usize, caps: &mut Caps, k: &mut dyn FnMut(usize, &mut Caps) -> bool) -> bool { |
| 114 | match nodes.split_first() { |
| 115 | None => k(pos, caps), |
| 116 | Some((first, rest)) => { |
| 117 | self.m(first, pos, caps, &mut |p, c| self.m_seq(rest, p, c, k)) |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | /* Repetition. Single codepoint atoms run iteratively to bound recursion. */ |
| 123 | fn repeat(&self, rep: &Rep, pos: usize, count: usize, caps: &mut Caps, k: &mut dyn FnMut(usize, &mut Caps) -> bool) -> bool { |