update and fix class compilation
This commit is contained in:
parent
f2fc9c5f89
commit
77f0a08060
@ -12,7 +12,7 @@ GIT
|
||||
|
||||
GIT
|
||||
remote: git://github.com/salama/salama-reader.git
|
||||
revision: 8e07a7568f4b41d0f9b06c6c851b4fa785b88fc4
|
||||
revision: e8bc570d2530e501a08ed35eb5b6fac26dc78309
|
||||
specs:
|
||||
salama-reader (0.2.0)
|
||||
ast (~> 2.1.0)
|
||||
|
@ -4,8 +4,8 @@ module Bosl
|
||||
|
||||
# call_site - attr_reader :name, :args , :receiver
|
||||
|
||||
def on_call expession
|
||||
name , arguments , receiver = *expession
|
||||
def on_call expression
|
||||
name , arguments , receiver = *expression
|
||||
name = name.to_a.first
|
||||
|
||||
if receiver
|
||||
|
@ -6,18 +6,11 @@ module Bosl
|
||||
end
|
||||
|
||||
def on_class expression
|
||||
clazz = Parfait::Space.object_space.get_class_by_name! expression.name
|
||||
puts expression.inspect
|
||||
name , derives , expressions = *expression
|
||||
clazz = Parfait::Space.object_space.get_class_by_name! name
|
||||
#puts "Compiling class #{clazz.name.inspect}"
|
||||
expression_value = nil
|
||||
expression.expressions.each do |expr|
|
||||
# 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 #{expr.inspect}" unless expr.is_a? Ast::FunctionExpression
|
||||
#puts "compiling expression #{expression}"
|
||||
expression_value = process(expr )
|
||||
#puts "compiled expression #{expression_value.inspect}"
|
||||
end
|
||||
expression_value = process_all(expressions).last
|
||||
|
||||
return expression_value
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user