Class: IV::Phonic::AST::FunctionCall

Inherits:
Expression show all
Defined in:
lib/iv/phonic/ast.rb

Instance Method Summary collapse

Methods inherited from Expression

as

Methods inherited from Node

#begin_position, #end_position, #program, #source

Constructor Details

#initialize(parent, expr) ⇒ FunctionCall

Returns a new instance of FunctionCall.



509
510
511
512
513
# File 'lib/iv/phonic/ast.rb', line 509

def initialize parent, expr
  super parent, expr
  @target = Expression.as self, expr[:target]
  @args = expr[:args].map{|arg| Expression.as self, arg }
end

Instance Method Details

#to_sourceObject



515
516
517
# File 'lib/iv/phonic/ast.rb', line 515

def to_source
  "#{@target.to_source}(#{args.map{|arg| arg.to_source }.join(', ')})"
end