Module: Finitio::Syntax::Constraints

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

Instance Method Summary collapse

Methods included from Node

included, #metadata, #resolve_ruby_const, #unique_names!

Instance Method Details

#compile(var_name) ⇒ Object



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

def compile(var_name)
  cs = captures[:constraint].map{|c| c.compile(var_name) }
  unique_names!(cs, 'constraint')
end

#to_ast(var_name) ⇒ Object



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

def to_ast(var_name)
  captures[:constraint].map{|c| c.to_ast(var_name) }
end