small fixes
This commit is contained in:
parent
b9b05378f5
commit
aaa94f0743
@ -26,7 +26,7 @@ module Register
|
||||
compiler = compiler_for(:Object , :set_internal_word , {:value => :Object} )
|
||||
source = "set_internal_word"
|
||||
me , index = self_and_int_arg(compiler,source)
|
||||
value = load_arg_at(compiler,source , 2)
|
||||
value = load_int_arg_at(compiler,source , 2)
|
||||
|
||||
# do the set
|
||||
compiler.add_code RegToSlot.new( source , value , me , index)
|
||||
|
@ -34,9 +34,12 @@ module Register
|
||||
# no return
|
||||
def set_internal_byte context
|
||||
compiler = compiler_for(:Word, :set_internal_byte , {:value => :Integer} )
|
||||
args = compiler.method.arguments
|
||||
len = args.instance_length
|
||||
raise "Compiler arg number mismatch, method=#{args} " if len != 3
|
||||
source = "set_internal_byte"
|
||||
me , index = self_and_int_arg(compiler,source)
|
||||
value = load_arg_at(compiler , source , 2 )
|
||||
value = load_int_arg_at(compiler , source , 2 )
|
||||
# do the set
|
||||
compiler.add_code RegToByte.new( source , value , me , index)
|
||||
return compiler.method
|
||||
|
@ -28,7 +28,7 @@ module Register
|
||||
attr_accessor :register , :array , :index
|
||||
|
||||
def to_s
|
||||
"#{self.class.name}: #{array}[#{index}] -> #{register}"
|
||||
"#{self.class.name}: #{register} -> #{array}[#{index}]"
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -60,16 +60,20 @@ module Parfait
|
||||
hash_code.to_sym
|
||||
end
|
||||
|
||||
def initialize( object_class , hash = nil)
|
||||
def initialize( object_class , hash = {})
|
||||
super()
|
||||
private_add_instance_variable :type ,:Type
|
||||
self.object_class = object_class
|
||||
hash.each do |name , type|
|
||||
private_add_instance_variable(name , type) unless name == :type
|
||||
end if hash
|
||||
end
|
||||
self.instance_methods = List.new
|
||||
end
|
||||
|
||||
def to_s
|
||||
""
|
||||
end
|
||||
|
||||
def methods
|
||||
m = self.instance_methods
|
||||
return m if m
|
||||
|
@ -1,7 +1,8 @@
|
||||
require_relative "test_add"
|
||||
require_relative "test_change"
|
||||
require_relative "test_byte_to_reg"
|
||||
require_relative "test_if"
|
||||
require_relative "test_called_if"
|
||||
require_relative "test_simple_if"
|
||||
require_relative "test_puts"
|
||||
require_relative "test_plus"
|
||||
require_relative "test_mult"
|
||||
|
Loading…
Reference in New Issue
Block a user