show an entire empty list when printing an empty list
This commit is contained in:
parent
3b0fb09e30
commit
6a66c00ae5
1 changed files with 4 additions and 0 deletions
|
|
@ -35,6 +35,10 @@ func (t *Token) String() string {
|
||||||
|
|
||||||
case LIST:
|
case LIST:
|
||||||
repr := "("
|
repr := "("
|
||||||
|
if t.Inner.(*Token) == nil {
|
||||||
|
return repr + ")"
|
||||||
|
}
|
||||||
|
|
||||||
for i := t.Inner.(*Token); i != nil; i = i.Next {
|
for i := t.Inner.(*Token); i != nil; i = i.Next {
|
||||||
repr = repr + i.String() + " "
|
repr = repr + i.String() + " "
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue