trying to get function calls to work (but will have to rework regeister handling)

This commit is contained in:
Torsten Ruger
2014-05-10 15:24:56 +03:00
parent 7d69132d90
commit 79a28ac5fa
9 changed files with 25 additions and 7 deletions

View File

@@ -14,14 +14,14 @@ module Vm
def assign_function context
@function = context.program.get_function @name
if @function
raise "error #{self}" unless @function.arity != args.length
raise "error #{self} , #{@function.args.length} != #{args.length}" if @function.arity != args.length
else
@function = context.program.get_or_create_function @name
end
end
def load_args
args.each_with_index do |arg , index|
add_code arg.load(index)
add_code arg.load("r#{index}".to_sym)
end
end