Sha256: d0faa49d1ea8c8b1bf7813c53043592c72eb17bec4d28d6ca55ea2af3a8712bd

Contents?: true

Size: 432 Bytes

Versions: 10

Compression:

Stored size: 432 Bytes

Contents

module Finitio
  module Syntax
    module TypeDef
      include Node

      capture :type
      capture :type_name

      def compile(system)
        t = type.compile(system)
        n = type_name && type_name.to_str
        m = metadata
        system.add_type(t, n, m)
        t
      end

      def to_ast
        [:type_def, type_name, type.to_ast]
      end

    end # module TypeDef
  end # module Syntax
end # module Finitio

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
finitio-0.7.0 lib/finitio/syntax/type/type_def.rb
finitio-0.7.0.pre.rc4 lib/finitio/syntax/type/type_def.rb
finitio-0.7.0.pre.rc3 lib/finitio/syntax/type/type_def.rb
finitio-0.7.0.pre.rc2 lib/finitio/syntax/type/type_def.rb
finitio-0.7.0.pre.rc1 lib/finitio/syntax/type/type_def.rb
finitio-0.6.1 lib/finitio/syntax/type/type_def.rb
finitio-0.6.0 lib/finitio/syntax/type/type_def.rb
finitio-0.5.2 lib/finitio/syntax/type/type_def.rb
finitio-0.5.1 lib/finitio/syntax/type/type_def.rb
finitio-0.5.0 lib/finitio/syntax/type/type_def.rb