add space after -
list items start with - but without the space one can’t distinguish from -1
This commit is contained in:
parent
224bd84b01
commit
1ee0f7c006
@ -34,14 +34,14 @@ module Sof
|
|||||||
|
|
||||||
# The output of a Array can be a long or a short format
|
# The output of a Array can be a long or a short format
|
||||||
# The short is used for 7 or less SimpleNodes
|
# The short is used for 7 or less SimpleNodes
|
||||||
def out io , level = 0
|
def out io , level
|
||||||
super
|
super
|
||||||
short = true
|
short = true
|
||||||
children.each do |c|
|
children.each do |c|
|
||||||
short = false unless c.is_a?(SimpleNode)
|
short = false unless c.is_a?(SimpleNode)
|
||||||
end
|
end
|
||||||
if(short and children.length < 7 )
|
if(short and children.length < 7 )
|
||||||
short_out(io,level)
|
short_out(io , level)
|
||||||
else
|
else
|
||||||
long_out(io , level)
|
long_out(io , level)
|
||||||
end
|
end
|
||||||
@ -53,7 +53,7 @@ module Sof
|
|||||||
def short_out(io,level)
|
def short_out(io,level)
|
||||||
io.write("[")
|
io.write("[")
|
||||||
@children.each_with_index do |child , i|
|
@children.each_with_index do |child , i|
|
||||||
child.out(io , level + 1)
|
child.out(io , level + 1 )
|
||||||
io.write ", " unless (i+1) == children.length
|
io.write ", " unless (i+1) == children.length
|
||||||
end
|
end
|
||||||
io.write("]")
|
io.write("]")
|
||||||
@ -65,7 +65,7 @@ module Sof
|
|||||||
indent = " " * level
|
indent = " " * level
|
||||||
@children.each_with_index do |child , i|
|
@children.each_with_index do |child , i|
|
||||||
io.write "\n#{indent}" unless i == 0
|
io.write "\n#{indent}" unless i == 0
|
||||||
io.write "-"
|
io.write "- "
|
||||||
child.out(io , level + 1)
|
child.out(io , level + 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user