Module: Trxl::WhenExpressionList2

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



1359
1360
1361
1362
1363
# File 'lib/trxl/trxl_grammar.rb', line 1359

def eval(env = Environment.new)
  when_expressions.inject([]) do |exprs, expr|
    exprs << expr.eval(env)
  end
end

#when_expressionsObject



1365
1366
1367
# File 'lib/trxl/trxl_grammar.rb', line 1365

def when_expressions
  [ when_expression ] + more_when_expressions.elements.map { |e| e.when_expression }
end