moved all the normalize stuff over to the ruby layer

Which is how it should have been from the start
This commit is contained in:
Torsten Ruger
2018-07-19 14:47:29 +03:00
parent 38350dd198
commit ae3d64eb53
15 changed files with 5 additions and 179 deletions

View File

@ -27,30 +27,6 @@ module Vool
@arguments << block
end
def normalize
statements = Statements.new([])
arguments = []
@arguments.each_with_index do |arg , index |
normalize_arg(arg , arguments , statements)
end
if statements.empty?
return SendStatement.new(@name, @receiver , @arguments)
else
statements << SendStatement.new(@name, @receiver , arguments)
return statements
end
end
def normalize_arg(arg , arguments , statements)
if arg.respond_to?(:slot_definition) and !arg.is_a?(SendStatement)
arguments << arg
return
end
assign = LocalAssignment.new( "tmp_#{arg.object_id}".to_sym, arg)
statements << assign
arguments << LocalVariable.new(assign.name)
end
def to_s
"#{receiver}.#{name}(#{arguments.join(', ')})"
end