class Unparser::AST::Walker
Controlled AST walker walking the AST in deeth first search with pre order
def self.call(node, controller, &block)
- Api: - private
Parameters:
-
node
(Parser::AST::Node
) --
def self.call(node, controller, &block) new(block, controller).call(node) end
def call(node)
- Api: - private
Returns:
-
(undefined)
-
Parameters:
-
node
(Parser::AST::Node
) --
def call(node) return unless controller.call(node) block.call(node) node.children.each do |child| break unless child.instance_of?(Parser::AST::Node) call(child) end end