Follows epsilon transitions and adds them for processing to nlist, starting at and including ip.
(
&mut self,
nlist: &mut Threads,
thread_caps: &mut [Option<usize>],
ip: usize,
at: InputAt,
)
| 285 | /// Follows epsilon transitions and adds them for processing to nlist, |
| 286 | /// starting at and including ip. |
| 287 | fn add( |
| 288 | &mut self, |
| 289 | nlist: &mut Threads, |
| 290 | thread_caps: &mut [Option<usize>], |
| 291 | ip: usize, |
| 292 | at: InputAt, |
| 293 | ) { |
| 294 | self.stack.push(FollowEpsilon::IP(ip)); |
| 295 | while let Some(frame) = self.stack.pop() { |
| 296 | match frame { |
| 297 | FollowEpsilon::IP(ip) => { |
| 298 | self.add_step(nlist, thread_caps, ip, at); |
| 299 | } |
| 300 | FollowEpsilon::Capture { slot, pos } => { |
| 301 | thread_caps[slot] = pos; |
| 302 | } |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | /// A helper function for add that avoids excessive pushing to the stack. |
| 308 | fn add_step( |