have to pass constants around now

as they are not global anymore
This commit is contained in:
Torsten Ruger
2018-07-01 14:11:29 +03:00
parent e10092a4be
commit e75aef933d
5 changed files with 11 additions and 9 deletions

View File

@ -18,8 +18,9 @@ module Risc
@risc_instructions = Risc.label(name, name)
@risc_instructions << Risc.label( name, "unreachable")
@current = @risc_instructions
@constants = []
end
attr_reader :method , :risc_instructions
attr_reader :method , :risc_instructions , :constants
# helper method for builtin mainly
# the class_name is a symbol, which is resolved to the instance_type of that class
@ -61,7 +62,7 @@ module Risc
end
def add_constant(const)
Risc.machine.add_constant(const)
@constants << const
end
# add a risc instruction after the current (insertion point)