MCPcopy Create free account
hub / github.com/davidblewett/rure-python / visit

Function visit

regex/regex-syntax/src/ast/visitor.rs:129–131  ·  view source on GitHub ↗

Executes an implementation of `Visitor` in constant stack space. This function will visit every node in the given `Ast` while calling the appropriate methods provided by the [`Visitor`](trait.Visitor.html) trait. The primary use case for this method is when one wants to perform case analysis over an `Ast` without using a stack size proportional to the depth of the `Ast`. Namely, this method will

(ast: &Ast, visitor: V)

Source from the content-addressed store, hash-verified

127/// If the visitor returns an error at any point, then visiting is stopped and
128/// the error is returned.
129pub fn visit<V: Visitor>(ast: &Ast, visitor: V) -> Result<V::Output, V::Err> {
130 HeapVisitor::new().visit(ast, visitor)
131}
132
133/// HeapVisitor visits every item in an `Ast` recursively using constant stack
134/// size and a heap size proportional to the size of the `Ast`.

Callers 2

checkMethod · 0.70
printMethod · 0.70

Calls 1

visitMethod · 0.45

Tested by

no test coverage detected