renamed program to boot_space, as in object_space at boot time. thats the way its going
This commit is contained in:
@ -58,7 +58,7 @@ module Ast
|
||||
|
||||
def compile context , into
|
||||
value = Vm::StringConstant.new(string)
|
||||
context.program.add_object value
|
||||
context.object_space.add_object value
|
||||
value
|
||||
end
|
||||
def attributes
|
||||
|
@ -8,7 +8,7 @@ module Ast
|
||||
end
|
||||
def compile context , into
|
||||
params = args.collect{ |a| a.compile(context, into) }
|
||||
function = context.program.get_or_create_function(name)
|
||||
function = context.object_space.get_or_create_function(name)
|
||||
raise "Forward declaration not implemented (#{name}) #{inspect}" if function == nil
|
||||
call = Vm::CallSite.new( name , params , function)
|
||||
current_function = context.function
|
||||
|
@ -27,7 +27,7 @@ module Ast
|
||||
args << arg_value
|
||||
end
|
||||
function = Vm::Function.new(name , args )
|
||||
context.program.add_function function
|
||||
context.object_space.add_function function
|
||||
|
||||
parent_locals = context.locals
|
||||
parent_function = context.function
|
||||
|
@ -15,6 +15,13 @@ module Ast
|
||||
[:name , :expressions]
|
||||
end
|
||||
def compile context , into
|
||||
# create the class or module
|
||||
# check if it'sa function definition and add
|
||||
# if not, execute it, but that does means we should be in crystal (executable), not ruby. ie throw an error for now
|
||||
clazz = context.object_space.get_or_create_class name
|
||||
|
||||
|
||||
|
||||
expression_value = expression.compile(context , into)
|
||||
puts "compiled return expression #{expression_value.inspect}, now return in 7"
|
||||
# copied from function expression: TODO make function
|
||||
|
Reference in New Issue
Block a user