fix while.to_vool

sanitize normalizer on the way
- return ruby, let caller to_vool
- return single statement, not single? statements
This commit is contained in:
Torsten Ruger
2018-07-20 17:51:17 +03:00
parent 9b8bd57db4
commit 6a58a71c0a
5 changed files with 47 additions and 10 deletions

View File

@ -14,11 +14,9 @@ module Ruby
def to_vool
cond , rest = *normalize_name(@condition)
fals = @if_false ? @if_false.to_vool : nil
me = Vool::IfStatement.new(cond , @if_true.to_vool, fals)
me = Vool::IfStatement.new(cond.to_vool , @if_true.to_vool, @if_false&.to_vool)
return me unless rest
rest << me
rest
Vool::Statements.new([ rest.to_vool , me])
end
def has_false?