rubyx/lib/vool/statements/hoister.rb
Torsten Ruger 76a87dd418 extract hoisting to module
to be used in while statement
2017-09-05 12:04:12 +03:00

11 lines
276 B
Ruby

module Vool
module Hoister
def hoist_condition( method )
return [@condition] if @condition.is_a?(Vool::Named)
local = method.create_tmp
assign = LocalAssignment.new( local , @condition)
[Vool::LocalVariable.new(local) , assign]
end
end
end