Sha256: 1e75bbcf5c4d96b0d0fe757e829d674a8996e91f839cf1290feefdee6f20cde6

Contents?: true

Size: 334 Bytes

Versions: 1

Compression:

Stored size: 334 Bytes

Contents

module Qrb
  module Syntax
    module UnionType

      def compile(factory)
        cds = captures[:sub_type].map{|x| x.compile(factory) }
        factory.union(cds)
      end

      def to_ast
        captures[:sub_type].map(&:to_ast).unshift(:union_type)
      end

    end # module UnionType
  end # module Syntax
end # module Qrb

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qrb-0.3.0 lib/qrb/syntax/union_type.rb