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:
@ -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
|
||||
|
Reference in New Issue
Block a user