everything but dynamic dispatch
This commit is contained in:
@ -6,11 +6,13 @@ module Vool
|
||||
#
|
||||
# eg if( @var % 5) is not normalized
|
||||
# but if(tmp_123) is with tmp_123 = @var % 5 hoited above the if
|
||||
#
|
||||
# also constants count, though they may not be so useful in ifs, but returns
|
||||
def normalize_name( condition )
|
||||
if( condition.is_a?(ScopeStatement) and condition.single?)
|
||||
condition = condition.first
|
||||
end
|
||||
return [condition] if condition.respond_to?(:slot_definition)
|
||||
return [condition] if condition.is_a?(Named) or condition.is_a?(Constant)
|
||||
condition = condition.normalize
|
||||
local = "tmp_#{object_id}"
|
||||
assign = Statements.new [LocalAssignment.new( local , condition)]
|
||||
|
Reference in New Issue
Block a user