forgot to add compiled methods to the class, fixed

This commit is contained in:
Torsten Ruger
2014-08-07 15:37:32 +03:00
parent b9e259e11a
commit a9ab3ca13e
3 changed files with 4 additions and 3 deletions

View File

@ -27,8 +27,9 @@ module Ast
# check if it's a function definition and add
# if not, execute it, but that does means we should be in salama (executable), not ruby. ie throw an error for now
raise "only functions for now #{expression.inspect}" unless expression.is_a? Ast::FunctionExpression
puts "compiling expression #{expression}"
#puts "compiling expression #{expression}"
expression_value = expression.compile(method,message )
clazz.add_method_definition(expression_value)
#puts "compiled expression #{expression_value.inspect}"
end

View File

@ -17,7 +17,7 @@ module Boot
[:name , :super_class]
end
def add_method_definition method
raise "not a method #{method}" unless method.is_a? Virtual::MethodDefinition
raise "not a method #{method.class} #{method.inspect}" unless method.is_a? Virtual::MethodDefinition
raise "syserr " unless method.name.is_a? Symbol
@method_definitions << method
end