rubyx/lib/ruby/return_statement.rb
Torsten Ruger 8cd9818f64 fix ruby return statement
assignment and normalizer on the way
2018-07-20 09:07:09 +03:00

24 lines
436 B
Ruby

module Ruby
class ReturnStatement < Statement
include Normalizer
attr_reader :return_value
def initialize(value)
@return_value = value
end
def to_vool
val , rest = *normalize_name(@return_value)
me = Vool::ReturnStatement.new(val)
return me unless rest
rest << me
rest
end
def to_s(depth = 0)
at_depth(depth , "return #{@return_value.to_s}")
end
end
end