rubyx/lib/vm/function_call.rb
2014-05-13 21:06:12 +03:00

26 lines
491 B
Ruby

module Vm
# name and args , return
class FunctionCall < Value
def initialize(name , args , function )
@name = name
@args = args
@function = function
end
attr_reader :function , :args , :name
def load_args into
args.each_with_index do |arg , index|
puts "load " + arg.inspect
arg.load( into , index )
end
end
def do_call into
into.add_code CMachine.instance.function_call into , self
end
end
end