Sha256: 39b9b1bbe6204f71848506f8c703f2ff43277c29b288b38ea732cecc11d49fbd
Contents?: true
Size: 435 Bytes
Versions: 17
Compression:
Stored size: 435 Bytes
Contents
module Finitio module Syntax module UnionType include Node def compile(factory) cds = captures[:sub_type].map{|x| x.compile(factory) } cds.size == 1 ? cds.first : factory.union(cds) end def to_ast cds = captures[:sub_type].map(&:to_ast) cds.size == 1 ? cds.first : cds.unshift(:union_type) end end # module UnionType end # module Syntax end # module Finitio
Version data entries
17 entries across 17 versions & 1 rubygems