fix plus, which inherited bugs from operator

This commit is contained in:
2020-03-15 12:58:39 +02:00
parent 7232c28ecd
commit 3a983b4fc8
3 changed files with 27 additions and 35 deletions

View File

@ -182,3 +182,7 @@ end
def Risc.allocate_length
21
end
# see test in test/slot_machine/macro/test_init.rb
def Risc.init_length
14 # initial label ignored in above test
end

View File

@ -44,7 +44,7 @@ module Risc
# how many instruction up until the main starts, ie
# ticks(main_at) will be the label for main
def main_at
14
Risc.init_length
end
def get_return
@ -66,7 +66,10 @@ module Risc
end
return last
end
alias :risc :main_ticks
def risc(num)
return @instruction if @instruction
@instruction = main_ticks(num)
end
# collect the classes of all executed istructions
def all_classes(max = 300)