rename to to array function to to_arr
This commit is contained in:
parent
88eae0e6f0
commit
f2c4e542ac
@ -71,9 +71,9 @@ module Register
|
|||||||
ret
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_ac labels = []
|
def to_arr labels = []
|
||||||
ret = [self.class]
|
ret = [self.class]
|
||||||
ret += self.next.to_ac(labels) if self.next
|
ret += self.next.to_arr(labels) if self.next
|
||||||
ret
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ module Register
|
|||||||
ret
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_ac labels = []
|
def to_arr( labels = [] )
|
||||||
ret = super(labels)
|
ret = super(labels)
|
||||||
ret += self.label.to_ac(labels) if self.label
|
ret += self.label.to_arr(labels) if self.label
|
||||||
ret
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ module Register
|
|||||||
@name.split(".").length == 2
|
@name.split(".").length == 2
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_ac labels = []
|
def to_arr labels = []
|
||||||
return [] if labels.include?(self)
|
return [] if labels.include?(self)
|
||||||
labels << self
|
labels << self
|
||||||
super
|
super
|
||||||
|
@ -54,7 +54,7 @@ module Register
|
|||||||
@instruction.replace_next @label
|
@instruction.replace_next @label
|
||||||
assert_equal @label, @instruction.last
|
assert_equal @label, @instruction.last
|
||||||
assert_equal @label, @instruction.next
|
assert_equal @label, @instruction.next
|
||||||
assert_equal 2 , @instruction.length , @instruction.to_ac
|
assert_equal 2 , @instruction.length , @instruction.to_arr
|
||||||
end
|
end
|
||||||
def test_each_label1
|
def test_each_label1
|
||||||
@instruction.set_next @label
|
@instruction.set_next @label
|
||||||
|
Loading…
x
Reference in New Issue
Block a user