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

@ -14,8 +14,8 @@ module Ruby
def to_vool
cond , rest = *normalize_name(@condition)
fals = @if_false ? @if_false.normalize : nil
me = IfStatement.new(cond , @if_true.normalize, fals)
fals = @if_false ? @if_false.to_vool : nil
me = Vool::IfStatement.new(cond , @if_true.to_vool, fals)
return me unless rest
rest << me
rest