Finished Pretty Print function

This commit is contained in:
Aidan Hahn 2019-11-28 10:23:02 -08:00
parent 84013cb4a0
commit 7aa80376bb
No known key found for this signature in database
GPG key ID: 327711E983899316
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
package shsh package shsh
import ( import (
"collections" "strings"
) )
func FmtToken(arg *Token) string { func FmtToken(arg *Token) string {
@ -39,17 +39,17 @@ func PrintSExpression(arg *Token) {
lists.push(arg) lists.push(arg)
loop: loop:
// string builder? var constructor strings.Builder
i := lists.pop() i := lists.pop()
if i == nil { if i == nil {
goto done goto done
} }
for (iter := i; iter != nil; iter = i.next { for (iter := i; iter != nil; iter = i.next {
// add each string to string builder? constructor.WriteString(FmtToken(iter))
} }
// print stringbuilder? print(constructor.String())
goto loop goto loop
done: done: