Sha256: 1ada7d31c3e75fe980d5dc0ca0cef142d006b085e84d52b44234f6009fc5c041

Contents?: true

Size: 420 Bytes

Versions: 15

Compression:

Stored size: 420 Bytes

Contents

module Furnace::AST
  class MatcherSpecial
    attr_reader :type, :param

    def initialize(type, param=nil)
      @type, @param = type, param
    end

    class << self
      def define(type)
        lambda { |*args| new(type, args) }
      end

      def kind(type)
        @kind_lambdas       ||= {}
        @kind_lambdas[type] ||= lambda { |m| m.is_a?(MatcherSpecial) && m.type == type }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
furnace-0.3.0.beta1 lib/furnace/ast/matcher/special.rb
furnace-0.2.6 lib/furnace/ast/matcher/special.rb
furnace-0.2.5 lib/furnace/ast/matcher/special.rb
furnace-0.2.4 lib/furnace/ast/matcher/special.rb
furnace-0.2.3 lib/furnace/ast/matcher/special.rb
furnace-0.2.2 lib/furnace/ast/matcher/special.rb
furnace-0.2.1 lib/furnace/ast/matcher/special.rb
furnace-0.2.0 lib/furnace/ast/matcher/special.rb
furnace-0.1.2 lib/furnace/ast/matcher/special.rb
furnace-0.1.1 lib/furnace/ast/matcher/special.rb
furnace-0.1.0 lib/furnace/ast/matcher/special.rb
furnace-0.0.8 lib/furnace/ast/matcher/special.rb
furnace-0.0.7 lib/furnace/ast/matcher/special.rb
furnace-0.0.6 lib/furnace/ast/matcher/special.rb
furnace-0.0.4 lib/furnace/ast/matcher_special.rb