kernel functions are not fixed to be Object functions
This commit is contained in:
@ -8,6 +8,7 @@ module Ast
|
||||
end
|
||||
def compile context , into
|
||||
params = args.collect{ |a| a.compile(context, into) }
|
||||
#TOOD, this needs dynamic resolution
|
||||
function = context.current_class.get_or_create_function(name)
|
||||
raise "Forward declaration not implemented (#{name}) #{inspect}" if function == nil
|
||||
call = Vm::CallSite.new( name , params , function)
|
||||
|
@ -38,7 +38,7 @@ module Core
|
||||
context.object_space.add_object buffer # and save it (function local variable: a no no)
|
||||
int = putint_function.args.first
|
||||
moved_int = putint_function.new_local
|
||||
utoa = context.current_class.get_or_create_function(:utoa)
|
||||
utoa = context.object_space.get_or_create_class(:Object).get_or_create_function(:utoa)
|
||||
b = putint_function.body
|
||||
b.mov( moved_int , int ) #move arg up
|
||||
#b.a buffer => int # string to write to
|
||||
|
Reference in New Issue
Block a user