rename to to array function to to_arr

This commit is contained in:
Torsten Ruger 2017-01-04 21:32:09 +02:00
parent 88eae0e6f0
commit f2c4e542ac
4 changed files with 6 additions and 6 deletions

View File

@ -71,9 +71,9 @@ module Register
ret
end
def to_ac labels = []
def to_arr labels = []
ret = [self.class]
ret += self.next.to_ac(labels) if self.next
ret += self.next.to_arr(labels) if self.next
ret
end

View File

@ -20,9 +20,9 @@ module Register
ret
end
def to_ac labels = []
def to_arr( labels = [] )
ret = super(labels)
ret += self.label.to_ac(labels) if self.label
ret += self.label.to_arr(labels) if self.label
ret
end

View File

@ -27,7 +27,7 @@ module Register
@name.split(".").length == 2
end
def to_ac labels = []
def to_arr labels = []
return [] if labels.include?(self)
labels << self
super

View File

@ -54,7 +54,7 @@ module Register
@instruction.replace_next @label
assert_equal @label, @instruction.last
assert_equal @label, @instruction.next
assert_equal 2 , @instruction.length , @instruction.to_ac
assert_equal 2 , @instruction.length , @instruction.to_arr
end
def test_each_label1
@instruction.set_next @label