rename to to array function to to_arr
This commit is contained in:
parent
88eae0e6f0
commit
f2c4e542ac
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user