fix if to_vool

and add (simple) hoisting tests
This commit is contained in:
Torsten Ruger
2018-07-20 17:30:08 +03:00
parent 98788b52d3
commit 9b8bd57db4
5 changed files with 108 additions and 54 deletions

View File

@ -12,7 +12,7 @@ module Ruby
if( condition.is_a?(ScopeStatement) and condition.single?)
condition = condition.first
end
return [condition] if condition.is_a?(Named) or condition.is_a?(Constant)
return [condition.to_vool] if condition.is_a?(Named) or condition.is_a?(Constant)
condition = condition.to_vool
local = "tmp_#{object_id}".to_sym
assign = Vool::Statements.new [Vool::LocalAssignment.new( local , condition)]