refactor printer

This commit is contained in:
Vadym Slizov
2020-05-17 22:56:32 +03:00
parent 50f8a47119
commit 4971309b75
21 changed files with 6955 additions and 6862 deletions

View File

@@ -2,8 +2,6 @@ package token
type Position int
type Collection map[Position][]Token
//go:generate stringer -type=Position -output ./position_string.go
const (
Start Position = iota
@@ -86,3 +84,14 @@ const (
OpenParenthesisToken
CloseParenthesisToken
)
type Collection map[Position][]Token
func (c Collection) IsEmpty() bool {
for _, v := range c {
if len(v) > 0 {
return false
}
}
return true
}