Module: Finitio::Syntax::StructType

Includes:
Node
Defined in:
lib/finitio/syntax/type/struct_type.rb

Instance Method Summary collapse

Methods included from Node

included, #metadata, #resolve_ruby_const, #unique_names!

Instance Method Details

#compile(factory) ⇒ Object



6
7
8
9
# File 'lib/finitio/syntax/type/struct_type.rb', line 6

def compile(factory)
  component_types = captures[:type].map{|x| x.compile(factory) }
  factory.struct(component_types)
end

#to_astObject



11
12
13
# File 'lib/finitio/syntax/type/struct_type.rb', line 11

def to_ast
  captures[:type].map(&:to_ast).unshift(:struct_type)
end