rubyx/lib/bosl/compiler/module_expression.rb

20 lines
518 B
Ruby
Raw Normal View History

module Bosl
Compiler.class_eval do
# module attr_reader :name ,:expressions
2015-09-20 15:30:39 +02:00
def on_module expression
2015-09-27 19:28:34 +02:00
name , rest = *expression
return process_all(rest).last
end
def on_class expression
2015-09-20 15:52:26 +02:00
#puts expression.inspect
2015-09-20 15:30:39 +02:00
name , derives , expressions = *expression
clazz = Parfait::Space.object_space.get_class_by_name! name
2015-07-30 18:18:41 +02:00
#puts "Compiling class #{clazz.name.inspect}"
2015-09-20 15:30:39 +02:00
expression_value = process_all(expressions).last
return expression_value
2014-08-06 17:49:20 +02:00
end
end
end