rubyx/lib/vool/assignment.rb
Torsten Rüger 155c042009 Fix forgotten block compiler
Especially on the way down to risc
2019-08-13 19:32:17 +03:00

26 lines
554 B
Ruby

module Vool
class Assignment < Statement
attr_reader :name , :value
def initialize(name , value )
raise "Name nil #{self}" unless name
raise "Value nil #{self}" unless value
@name , @value = name , value
end
def each(&block)
block.call(self)
@value.each(&block)
end
def to_s(depth = 0)
at_depth(depth , "#{@name} = #{@value}")
end
def chain_assign(assign , compiler)
return assign unless @value.is_a?(CallStatement)
@value.to_mom(compiler) << assign
end
end
end