fix code duplication
This commit is contained in:
parent
5131e5d050
commit
3e79e5cf8e
@ -71,16 +71,7 @@ module Parfait
|
|||||||
end
|
end
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
ret = "Layout["
|
"Layout[#{inspect_from(3)}]"
|
||||||
index = 3
|
|
||||||
while index <= self.get_length
|
|
||||||
item = get(index)
|
|
||||||
ret += item.inspect
|
|
||||||
ret += "," unless index == self.get_length
|
|
||||||
index = index + 1
|
|
||||||
end
|
|
||||||
ret += "]"
|
|
||||||
ret
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def sof_reference_name
|
def sof_reference_name
|
||||||
|
@ -164,8 +164,11 @@ module Parfait
|
|||||||
end
|
end
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
|
inspect_from 1
|
||||||
|
end
|
||||||
|
|
||||||
|
def inspect_from index
|
||||||
ret = ""
|
ret = ""
|
||||||
index = 1
|
|
||||||
while index <= self.get_length
|
while index <= self.get_length
|
||||||
item = get(index)
|
item = get(index)
|
||||||
ret += item.inspect
|
ret += item.inspect
|
||||||
|
@ -55,7 +55,6 @@ class TestPuts < MiniTest::Test
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_chain
|
def test_chain
|
||||||
show_ticks
|
|
||||||
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||||
"GetSlot","FunctionCall","SaveReturn","LoadConstant","GetSlot",
|
"GetSlot","FunctionCall","SaveReturn","LoadConstant","GetSlot",
|
||||||
"SetSlot","LoadConstant","SetSlot","RegisterTransfer","GetSlot",
|
"SetSlot","LoadConstant","SetSlot","RegisterTransfer","GetSlot",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user