first ginger parfait test
This commit is contained in:
@ -19,6 +19,20 @@ module Ast
|
||||
end
|
||||
|
||||
class ClassExpression < ModuleExpression
|
||||
def compile method , message
|
||||
clazz = ::Virtual::Object.space.get_or_create_class name
|
||||
puts "Created class #{clazz.name.inspect}"
|
||||
# context.current_class = clazz
|
||||
expressions.each do |expression|
|
||||
# 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}"
|
||||
expression_value = expression.compile(method,message )
|
||||
#puts "compiled expression #{expression_value.inspect}"
|
||||
end
|
||||
|
||||
return clazz
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user