Module: Finitio::Syntax::UnnamedConstraint

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

Instance Method Summary collapse

Methods included from Node

included, #metadata, #resolve_ruby_const, #unique_names!

Instance Method Details

#compile(var_name) ⇒ Object



8
9
10
11
12
13
# File 'lib/finitio/syntax/type/unnamed_constraint.rb', line 8

def compile(var_name)
  p = expression.compile(var_name)
  n = nil
  m = 
  Constraint.new(p, n, m)
end

#to_ast(var_name) ⇒ Object



15
16
17
18
19
# File 'lib/finitio/syntax/type/unnamed_constraint.rb', line 15

def to_ast(var_name)
  [ :constraint,
    "default",
    [:fn, [:parameters, var_name], [:source, expression.to_s.strip]] ]
end