Also make risc compilers a linked lists

also via util::compiler_ist
leave collection as much in place as possible
(though collections and seperate block_compilers are about to go)
This commit is contained in:
2019-09-28 15:07:20 +03:00
parent 2eb9364283
commit 9f81d78767
10 changed files with 49 additions and 29 deletions

View File

@ -6,6 +6,7 @@ module Util
def add_method_compiler(comp)
raise "not compiler #{comp.class}" unless comp.respond_to?(:find_compiler)
raise "nil compiler #{self}" unless comp
if(@next_compiler)
@next_compiler.add_method_compiler(comp)
else
@ -18,6 +19,12 @@ module Util
@next_compiler.each_compiler(&block) if @next_compiler
end
def find_compiler_name name
return self if @callable.name == name
return nil unless @next_compiler
@next_compiler.find_compiler_name(name)
end
def find_compiler &block
return self if block.yield(self)
@next_compiler.find_compiler(&block) if @next_compiler