MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / visit_pre_post

Method visit_pre_post

src/expr/src/visit.rs:410–436  ·  view source on GitHub ↗
(&self, pre: &mut F1, post: &mut F2)

Source from the content-addressed store, hash-verified

408 Ok(())
409 }
410 fn visit_pre_post<F1, F2>(&self, pre: &mut F1, post: &mut F2)
411 where
412 F1: FnMut(&Self) -> Option<Vec<&Self>>,
413 F2: FnMut(&Self),
414 {
415 use VisitAction::*;
416 let mut stack = vec![Enter(self)];
417 while let Some(action) = stack.pop() {
418 match action {
419 Enter(elt) => {
420 stack.push(Leave(elt));
421 if let Some(children) = pre(elt) {
422 for child in children.into_iter().rev() {
423 stack.push(Enter(child));
424 }
425 } else {
426 for child in elt.children().rev() {
427 stack.push(Enter(child));
428 }
429 }
430 }
431 Leave(elt) => {
432 post(elt);
433 }
434 }
435 }
436 }
437
438 #[allow(clippy::as_conversions)]
439 fn visit_mut_pre_post<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)

Callers 3

typMethod · 0.80
arityMethod · 0.80
lower_subqueriesMethod · 0.80

Calls 4

childrenMethod · 0.65
popMethod · 0.45
pushMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected