push the callable into the callable compiler

thus generalizing for .callable access
keep block and method aliases for destinction in derived classes
This commit is contained in:
Torsten Ruger
2018-07-30 10:26:11 +03:00
parent 285a88b59f
commit 2dc03f8d1b
5 changed files with 32 additions and 29 deletions

View File

@ -10,7 +10,8 @@ module Risc
class CallableCompiler
def initialize( )
def initialize( callable )
@callable = callable
@regs = []
@risc_instructions = Risc.label(source_name, source_name)
@risc_instructions << Risc.label( source_name, "unreachable")
@ -18,7 +19,7 @@ module Risc
@constants = []
@block_compilers = []
end
attr_reader :risc_instructions , :constants , :block_compilers
attr_reader :risc_instructions , :constants , :block_compilers , :callable
# convert the given mom instruction to_risc and then add it (see add_code)
# continue down the instruction chain unti depleted