This commit is contained in:
Torsten Ruger
2014-10-18 13:53:01 +03:00
parent f09a70a65b
commit 6e6dd257e4
4 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ module Ast
is = cond.compile(method,message)
# TODO should/will use different branches for different conditions.
# just a scetch : cond_val = cond_val.is_true?(method) unless cond_val.is_a? Virtual::BranchCondition
method.add_code Virtual::ImplicitBranch.new( true_block )
method.add_code Virtual::IsTrueBranch.new( true_block )
# compile the true block (as we think of it first, even it is second in sequential order)
method.current true_block

View File

@ -5,7 +5,7 @@ module Ast
start = Virtual::Label.new("while_start")
method.add_code start
is = condition.compile(method,message)
branch = Virtual::ImplicitBranch.new "while"
branch = Virtual::IsTrueBranch.new "while"
merge = Virtual::Label.new(branch.name)
branch.other = merge #false jumps to end of while
method.add_code branch

View File

@ -31,7 +31,7 @@ module Virtual
# implicit means there is no explcit test involved.
# normal ruby rules are false and nil are false, EVERYTHING else is true (and that includes 0)
class ImplicitBranch < Branch
class IsTrueBranch < Branch
end
class UnconditionalBranch < Branch