fix ruby return statement
assignment and normalizer on the way
This commit is contained in:
@ -8,15 +8,15 @@ module Ruby
|
||||
# but if(tmp_123) is with tmp_123 = @var % 5 hoisted above the if
|
||||
#
|
||||
# also constants count, though they may not be so useful in ifs, but returns
|
||||
def to_vool_name( condition )
|
||||
def normalize_name( condition )
|
||||
if( condition.is_a?(ScopeStatement) and condition.single?)
|
||||
condition = condition.first
|
||||
end
|
||||
return [condition] if condition.is_a?(Named) or condition.is_a?(Constant)
|
||||
condition = condition.normalize
|
||||
condition = condition.to_vool
|
||||
local = "tmp_#{object_id}".to_sym
|
||||
assign = Statements.new [LocalAssignment.new( local , condition)]
|
||||
[LocalVariable.new(local) , assign]
|
||||
assign = Vool::Statements.new [Vool::LocalAssignment.new( local , condition)]
|
||||
[Vool::LocalVariable.new(local) , assign]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user