2015-09-20 16:30:07 +03:00
|
|
|
module Bosl
|
|
|
|
Compiler.class_eval do
|
|
|
|
|
|
|
|
def on_field_def expression
|
2015-09-27 16:06:48 +03:00
|
|
|
#puts expression.inspect
|
2015-09-20 16:30:07 +03:00
|
|
|
type , name , value = *expression
|
2015-09-27 12:59:26 +03:00
|
|
|
|
2015-09-27 16:06:48 +03:00
|
|
|
index = method.ensure_local( name , type )
|
2015-09-20 16:30:07 +03:00
|
|
|
|
|
|
|
if value
|
|
|
|
value = process( value )
|
|
|
|
end
|
|
|
|
|
2015-09-27 16:06:48 +03:00
|
|
|
Virtual::Return.new( type , value )
|
2015-09-20 16:30:07 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|