refactored print loop, project structure
This commit is contained in:
parent
aaa0a8a507
commit
b0d9bb4643
9 changed files with 14 additions and 25 deletions
12
debug.go
12
debug.go
|
|
@ -13,12 +13,10 @@ func FmtToken(arg *Token) string {
|
|||
|
||||
switch arg.tag {
|
||||
case LIST:
|
||||
return fmt.Sprintf("(%s, List @ %p, %d)%s", "LIST", arg._inner,
|
||||
arg.position, suffix)
|
||||
return fmt.Sprintf("(%s, List @ %p)%s", "LIST", arg._inner, suffix)
|
||||
|
||||
default:
|
||||
return fmt.Sprintf("(%s, %s, %d)%s", GetTagAsStr(arg.tag), arg._inner,
|
||||
arg.position, suffix)
|
||||
return fmt.Sprintf("(%s, %s)%s", GetTagAsStr(arg.tag), arg._inner, suffix)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -54,12 +52,6 @@ loop:
|
|||
for iter := i; iter != nil; iter = iter.next {
|
||||
if iter.tag == LIST {
|
||||
lists.Push(iter._inner.(*Token))
|
||||
constructor.WriteString(FmtToken(&Token{
|
||||
next: iter.next,
|
||||
tag: STRING,
|
||||
position: iter.position,
|
||||
_inner: "[LIST]"}))
|
||||
continue
|
||||
}
|
||||
|
||||
constructor.WriteString(FmtToken(iter))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue