rubyx/lib/bosl/compiler/operator_expressions.rb

21 lines
495 B
Ruby
Raw Normal View History

module Bosl
Compiler.class_eval do
# operator attr_reader :operator, :left, :right
def on_operator expression
2015-09-19 16:57:44 +02:00
operator , left , right = *expression
nil
end
def on_assign expression
puts "assign"
puts expression.inspect
name , value = *expression
name = name.to_a.first
v = process(value )
index = method.ensure_local( name )
method.source.add_code Virtual::Set.new(Virtual::FrameSlot.new(index ) , v )
end
end
end