rename function_call to call_site in all levels to avoid confusion
This commit is contained in:
25
lib/vm/call_site.rb
Normal file
25
lib/vm/call_site.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
module Vm
|
||||
|
||||
# name and args , return
|
||||
|
||||
class CallSite < 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
|
Reference in New Issue
Block a user