Module: Trxl::ElsifExpressionList2

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#elsif_expressionsObject



1039
1040
1041
# File 'lib/trxl/trxl_grammar.rb', line 1039

def elsif_expressions
  [ elsif_expression ] + tail.elements.map { |e| e.elsif_expression }
end

#eval(env = Environment.new) ⇒ Object



1033
1034
1035
1036
1037
# File 'lib/trxl/trxl_grammar.rb', line 1033

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