2015-10-07 14:22:47 +02:00
|
|
|
module Phisol
|
2015-09-19 17:56:18 +02:00
|
|
|
Compiler.class_eval do
|
2015-05-04 13:22:22 +02:00
|
|
|
# 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
|
2014-06-25 01:47:59 +02:00
|
|
|
end
|
|
|
|
|
2015-09-19 17:56:18 +02:00
|
|
|
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
|
2015-10-05 23:27:13 +02:00
|
|
|
raise "classes dont yet play babushka, get coding #{name}" if @clazz
|
|
|
|
@clazz = Parfait::Space.object_space.get_class_by_name! name
|
|
|
|
puts "Compiling class #{@clazz.name.inspect}"
|
2015-09-20 15:30:39 +02:00
|
|
|
expression_value = process_all(expressions).last
|
2015-10-05 23:27:13 +02:00
|
|
|
@clazz = nil
|
2015-07-19 11:34:23 +02:00
|
|
|
return expression_value
|
2014-08-06 17:49:20 +02:00
|
|
|
end
|
2015-05-08 14:10:30 +02:00
|
|
|
end
|
2015-05-04 13:22:22 +02:00
|
|
|
end
|