Sha256: 2a4e8c754b04b366ecae77a9998ab9670c67869700c7e6d811cbb6825d05c946

Contents?: true

Size: 697 Bytes

Versions: 21

Compression:

Stored size: 697 Bytes

Contents

module Cucumber
  module Ast
    # Holds the value of a comment parsed from a feature file:
    #
    #   # Lorem ipsum
    #   # dolor sit amet
    #
    # This gets parsed into a Comment with value <tt>"# Lorem ipsum\n# dolor sit amet\n"</tt>
    #
    class Comment
      def initialize(value)
        @value = value
      end

      def empty?
        @value.nil? || @value == ""
      end

      def accept(visitor)
        return if $cucumber_interrupted
        @value.strip.split("\n").each do |line|
          visitor.visit_comment_line(line.strip)
        end
      end
      
      def to_sexp
        (@value.nil? || @value == '') ? nil : [:comment, @value]
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 5 rubygems

Version Path
aslakhellesoy-cucumber-0.3.92 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.93.1 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.93 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.94.1 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.94 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.95 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.96 lib/cucumber/ast/comment.rb
kosmas58-cucumber-0.3.92 lib/cucumber/ast/comment.rb
kosmas58-cucumber-0.3.93.1 lib/cucumber/ast/comment.rb
kosmas58-cucumber-0.3.94 lib/cucumber/ast/comment.rb
kosmas58-cucumber-0.3.95 lib/cucumber/ast/comment.rb
kosmas58-cucumber-0.3.96 lib/cucumber/ast/comment.rb
pezra-cucumber-0.3.94.1 lib/cucumber/ast/comment.rb
square-cucumber-0.3.93.1.1 lib/cucumber/ast/comment.rb
square-cucumber-0.3.93.1 lib/cucumber/ast/comment.rb
cucumber-0.3.96 lib/cucumber/ast/comment.rb
cucumber-0.3.95 lib/cucumber/ast/comment.rb
cucumber-0.3.94 lib/cucumber/ast/comment.rb
cucumber-0.3.91 lib/cucumber/ast/comment.rb
cucumber-0.3.92 lib/cucumber/ast/comment.rb