refactor also building word

obviously created by copy/paste, more refactoring possible
This commit is contained in:
Torsten Ruger
2016-12-15 19:31:39 +02:00
parent 5ea6bfed27
commit dc56274940
4 changed files with 16 additions and 25 deletions

View File

@ -10,7 +10,7 @@ module Register
# return is stored in return_value
# (this method returns a new method off course, like all builtin)
def get_internal_word context
compiler = compiler_for(:get_internal_word , {:index => :Integer})
compiler = compiler_for(:Object , :get_internal_word )
source = "get_internal_word"
me , index = self_and_arg(compiler,source)
# reduce me to me[index]
@ -23,7 +23,7 @@ module Register
# self[index] = val basically. Index is the first arg , value the second
# no return
def set_internal_word context
compiler = compiler_for(:set_internal_word , {:index => :Integer, :value => :Object} )
compiler = compiler_for(:Object , :set_internal_word , {:value => :Object} )
source = "set_internal_word"
me , index = self_and_arg(compiler,source)
value = do_load(compiler,source)