lib/lucid/ast/step_invocation.rb in lucid-0.0.8 vs lib/lucid/ast/step_invocation.rb in lucid-0.0.9

- old
+ new

@@ -34,29 +34,14 @@ def accept(visitor) return if Lucid.wants_to_quit visitor.visit_step(self) do invoke(visitor.runtime, visitor.configuration) - visit_step_result(visitor) + step_result.accept(visitor) end end - def visit_step_result(visitor) - visitor.visit_step_result( - StepResult.new( - keyword, - @step_match, - (@different_table || @multiline_arg), - @status, - @reported_exception, - source_indent, - @background, - file_colon_line - ) - ) - end - def invoke(runtime, configuration) find_step_match!(runtime, configuration) unless @skip_invoke || configuration.dry_run? || @exception || @step_collection.exception @skip_invoke = true begin @@ -145,17 +130,14 @@ def previous @step_collection.previous_step(self) end def actual_keyword - #repeat_keywords = rubify([language.keywords('but'), language.keywords('and')]).flatten.uniq.reject{|kw| kw == '* '} - #if repeat_keywords.index(@step.keyword) && previous keywords = Keywords.new(language) if keywords.repeat_keyword?(keyword) && previous previous.actual_keyword else - #keyword == '* ' ? language.code_keywords.first : keyword keyword == '* ' ? keywords.star_code_keyword : keyword end end class Keywords @@ -220,8 +202,24 @@ end def to_sexp [:step_invocation, @step.line, @step.keyword, @name, (@multiline_arg.nil? ? nil : @multiline_arg.to_sexp)].compact end + + private + + def step_result + StepResult.new( + keyword, + @step_match, + (@different_table || @multiline_arg), + @status, + @reported_exception, + source_indent, + @background, + file_colon_line + ) + end + end end end