lib/furnace/ast/processor.rb in furnace-0.3.0 vs lib/furnace/ast/processor.rb in furnace-0.3.1
- old
+ new
@@ -228,20 +228,20 @@
# value of the handler is passed along.
#
# @param [AST::Node, nil] node
# @return [AST::Node]
def process(node)
- if node
- # Invoke a specific handler
- on_handler = :"on_#{node.type}"
- if respond_to? on_handler
- new_node = send on_handler, node
- else
- new_node = handler_missing(node)
- end
+ node = node.to_ast
- node = new_node if new_node
+ # Invoke a specific handler
+ on_handler = :"on_#{node.type}"
+ if respond_to? on_handler
+ new_node = send on_handler, node
+ else
+ new_node = handler_missing(node)
end
+
+ node = new_node if new_node
node
end
# {#process}es each node from `nodes` and returns an array of results.
\ No newline at end of file