Module: Trxl::ExpressionList2

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



2902
2903
2904
# File 'lib/trxl/trxl_grammar.rb', line 2902

def eval(env = Environment.new)
  expressions.inject([]) { |arr, exp| arr << exp.eval(env) }
end

#expressionsObject



2906
2907
2908
# File 'lib/trxl/trxl_grammar.rb', line 2906

def expressions
  [ expression ] + more_expressions.elements.map { |e| e.expression }
end

#lengthObject



2910
2911
2912
# File 'lib/trxl/trxl_grammar.rb', line 2910

def length
  expressions.length
end

#to_s(env = Environment.new) ⇒ Object



2914
2915
2916
# File 'lib/trxl/trxl_grammar.rb', line 2914

def to_s(env = Environment.new)
  "#{expressions.map { |p| p.text_value }.join(',')}"
end