Sha256: 70b52118a3b645892ab4960c9f0a4502799b4d95354616ee1ed48510dd64cfa6

Contents?: true

Size: 562 Bytes

Versions: 9

Compression:

Stored size: 562 Bytes

Contents

require 'gherkin/tag_expression'

module Lucid
  module AST
    class Tags #:nodoc:
      attr_reader :tags

      def initialize(line, tags)
        @line, @tags = line, tags
      end

      def accept(visitor)
        visitor.visit_tags(self) do
          @tags.each do |tag|
            visitor.visit_tag_name(tag.name)
          end
        end
      end

      def accept_hook?(hook)
        Gherkin::TagExpression.new(hook.tag_expressions).evaluate(@tags)
      end

      def to_sexp
        @tags.map{|tag| [:tag, tag.name]}
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lucid-0.5.1 lib/lucid/ast/tags.rb
lucid-0.4.1 lib/lucid/ast/tags.rb
lucid-0.4.0 lib/lucid/ast/tags.rb
lucid-0.3.3 lib/lucid/ast/tags.rb
lucid-0.3.0 lib/lucid/ast/tags.rb
lucid-0.2.1 lib/lucid/ast/tags.rb
lucid-0.2.0 lib/lucid/ast/tags.rb
lucid-0.1.1 lib/lucid/ast/tags.rb
lucid-0.1.0 lib/lucid/ast/tags.rb