close #21
Mostly replaced Fixnum with integer also in the rx-file dependency all travis and testing with 2.4+
This commit is contained in:
@ -19,7 +19,7 @@ module Arm
|
||||
|
||||
# for the shift handling that makes the arm so unique
|
||||
def shift val , by
|
||||
raise "Not integer #{val}:#{val.class} #{inspect}" unless val.is_a? Fixnum
|
||||
raise "Not integer #{val}:#{val.class} #{inspect}" unless val.is_a? ::Integer
|
||||
val << by
|
||||
end
|
||||
|
||||
|
@ -63,7 +63,7 @@ module Arm
|
||||
if r_name.is_a? ::Risc::RegisterValue
|
||||
r_name = r_name.symbol
|
||||
end
|
||||
if r_name.is_a? Fixnum
|
||||
if r_name.is_a? ::Integer
|
||||
r_name = "r#{r_name}"
|
||||
end
|
||||
r = REGISTERS[r_name.to_s]
|
||||
|
@ -5,7 +5,7 @@ module Arm
|
||||
super(nil)
|
||||
@attributes = attributes
|
||||
@left = left
|
||||
@right = right.is_a?(Fixnum) ? IntegerConstant.new(right) : right
|
||||
@right = right.is_a?(::Integer) ? IntegerConstant.new(right) : right
|
||||
@attributes[:condition_code] = :al if @attributes[:condition_code] == nil
|
||||
@operand = 0
|
||||
@attributes[:update_status] = 1
|
||||
|
@ -85,7 +85,7 @@ module Parfait
|
||||
# add a type, meaning the instance given must be a valid type
|
||||
def add_type( type )
|
||||
hash = type.hash
|
||||
raise "upps #{hash} #{hash.class}" unless hash.is_a?(Fixnum)
|
||||
raise "upps #{hash} #{hash.class}" unless hash.is_a?(::Integer)
|
||||
was = types[hash]
|
||||
return was if was
|
||||
types[hash] = type
|
||||
|
@ -27,7 +27,7 @@ module Parfait
|
||||
def initialize( len )
|
||||
super()
|
||||
self.char_length = 0
|
||||
raise "Must init with int, not #{len.class}" unless len.kind_of? Fixnum
|
||||
raise "Must init with int, not #{len.class}" unless len.kind_of? ::Integer
|
||||
raise "Must init with positive, not #{len}" if len < 0
|
||||
set_length( len , 32 ) unless len == 0 #32 being ascii space
|
||||
#puts "type #{self.get_type} #{self.object_id.to_s(16)}"
|
||||
@ -87,7 +87,7 @@ module Parfait
|
||||
# the index starts at one, but may be negative to count from the end
|
||||
# indexes out of range will raise an error
|
||||
def set_char( at , char )
|
||||
raise "char not fixnum #{char.class}" unless char.kind_of? Fixnum
|
||||
raise "char not fixnum #{char.class}" unless char.kind_of? ::Integer
|
||||
index = range_correct_index(at)
|
||||
set_internal_byte( index , char)
|
||||
end
|
||||
@ -137,7 +137,7 @@ module Parfait
|
||||
def range_correct_index( at )
|
||||
index = at
|
||||
# index = self.length + at if at < 0
|
||||
raise "index not integer #{at.class}" unless at.is_a?(Fixnum)
|
||||
raise "index not integer #{at.class}" unless at.is_a?(::Integer)
|
||||
raise "index must be positive , not #{at}" if (index < 0)
|
||||
raise "index too large #{at} > #{self.length}" if (index >= self.length )
|
||||
return index + 11
|
||||
|
@ -36,7 +36,7 @@ require_relative "risc/method_compiler"
|
||||
require_relative "risc/block_compiler"
|
||||
require_relative "risc/assembler"
|
||||
|
||||
class Fixnum
|
||||
class Integer
|
||||
def fits_u8?
|
||||
self >= 0 and self <= 255
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ module Risc
|
||||
# Objects are data and get assembled after functions
|
||||
def self.add_object( objekt , depth)
|
||||
return false if Position.set?(objekt)
|
||||
return true if objekt.is_a? Fixnum
|
||||
return true if objekt.is_a? ::Integer
|
||||
return true if objekt.is_a?( Risc::Label)
|
||||
#puts message(objekt , depth)
|
||||
#puts "ADD #{objekt.inspect}, #{objekt.name}" if objekt.is_a? Parfait::CallableMethod
|
||||
|
@ -73,7 +73,7 @@ module Risc
|
||||
|
||||
def set_register( reg , val )
|
||||
old = get_register( reg ) # also ensures format
|
||||
if val.is_a? Fixnum
|
||||
if val.is_a? ::Integer
|
||||
@flags[:zero] = (val == 0)
|
||||
@flags[:plus] = (val >= 0)
|
||||
@flags[:minus] = (val < 0)
|
||||
@ -190,7 +190,7 @@ module Risc
|
||||
end
|
||||
raise "Unsupported action, must convert symbol to word:#{object}" if object.is_a?(Symbol)
|
||||
value = object.get_char( index )
|
||||
#value = value.object_id unless value.is_a? Fixnum
|
||||
#value = value.object_id unless value.is_a? ::Integer
|
||||
set_register( @instruction.register , value )
|
||||
true
|
||||
end
|
||||
|
@ -142,7 +142,7 @@ module Risc
|
||||
when Label
|
||||
ins = Risc.load_constant("#{right.class} to #{self.type}" , right , self)
|
||||
builder.compiler.add_constant(right.address) if builder
|
||||
when Fixnum
|
||||
when ::Integer
|
||||
ins = Risc.load_data("#{right.class} to #{self.type}" , right , self)
|
||||
when RegisterValue
|
||||
ins = Risc.transfer("#{right.type} to #{self.type}" , right , self)
|
||||
|
@ -206,7 +206,7 @@ module Risc
|
||||
case object
|
||||
when nil
|
||||
@stream.write_signed_int_32(0)
|
||||
when Fixnum
|
||||
when ::Integer
|
||||
@stream.write_signed_int_32(object)
|
||||
else
|
||||
@stream.write_signed_int_32(Position.get(object) + @linker.platform.loaded_at)
|
||||
|
Reference in New Issue
Block a user