split compilers resolve_type into the three possibilities

cleaner code, though temporary it shifts some dirt
into the index method. up next
This commit is contained in:
Torsten Ruger
2018-07-16 12:03:40 +03:00
parent 3343017dba
commit 29363e7f72
7 changed files with 47 additions and 35 deletions

View File

@ -69,8 +69,12 @@ module Risc
# scope related slots are resolved by the compiler by methood/block
def slot_type( slot , type)
case slot
when :frame , :arguments , :receiver
new_type = self.resolve_type(slot)
when :frame
new_type = self.frame_type
when :arguments
new_type = self.arg_type
when :receiver
new_type = self.receiver_type
when Symbol
new_type = type.type_for(slot)
raise "Not found object #{slot}: in #{type}" unless new_type