lib/macros4cuke/coll-walker-factory.rb in macros4cuke-0.4.03 vs lib/macros4cuke/coll-walker-factory.rb in macros4cuke-0.4.04

- old
+ new

@@ -22,47 +22,47 @@ visitor = Enumerator.new do |result_receiver| # 'result_receiver' is a Yielder loop do case current_node - when MacroCollection - result_receiver << [:on_collection, level, current_node] - level += 1 - backlog << StringNode.new(:on_collection_end, nil) + when MacroCollection + result_receiver << [:on_collection, level, current_node] + level += 1 + backlog << StringNode.new(:on_collection_end, nil) - when MacroStep - result_receiver << emit_on_step(current_node, level, backlog) - level += 1 + when MacroStep + result_receiver << emit_on_step(current_node, level, backlog) + level += 1 - when StringNode - level -= 1 if current_node.event.to_s =~ /_end$/ - event = [current_node.event, level, current_node.text] - event << current_node.extra unless current_node.extra.nil? - result_receiver << event + when StringNode + level -= 1 if current_node.event.to_s =~ /_end$/ + event = [current_node.event, level, current_node.text] + event << current_node.extra unless current_node.extra.nil? + result_receiver << event - when Templating::Engine - result_receiver << emit_on_renderer(current_node, level, backlog) - level += 1 + when Templating::Engine + result_receiver << emit_on_renderer(current_node, level, backlog) + level += 1 - when Templating::StaticText - result_receiver << [:on_static_text, level, current_node.source] + when Templating::StaticText + result_receiver << [:on_static_text, level, current_node.source] - when Templating::Comment - result_receiver << [:on_comment, level, current_node.source] + when Templating::Comment + result_receiver << [:on_comment, level, current_node.source] - when Templating::EOLine - result_receiver << [:on_eol, level, nil] + when Templating::EOLine + result_receiver << [:on_eol, level, nil] - when Templating::Placeholder - result_receiver << [:on_placeholder, level, current_node.name] + when Templating::Placeholder + result_receiver << [:on_placeholder, level, current_node.name] - when Templating::Section - result_receiver << emit_on_section(current_node, level, backlog) - level += 1 + when Templating::Section + result_receiver << emit_on_section(current_node, level, backlog) + level += 1 - else - err_msg = "Don't know how to format a #{current_node.class}." - fail(InternalError, err_msg) + else + err_msg = "Don't know how to format a #{current_node.class}." + fail(InternalError, err_msg) end current_node = backlog.shift break if current_node.nil? end