Added a tokenizer
This commit is contained in:
parent
16690d390f
commit
21cf4b5c6d
7 changed files with 274 additions and 12 deletions
17
src/token/List.go
Normal file
17
src/token/List.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package token
|
||||
|
||||
import "strings"
|
||||
|
||||
// List is a slice of tokens.
|
||||
type List []Token
|
||||
|
||||
// String implements string serialization.
|
||||
func (list List) String() string {
|
||||
builder := strings.Builder{}
|
||||
|
||||
for _, t := range list {
|
||||
builder.WriteString(t.String())
|
||||
}
|
||||
|
||||
return builder.String()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue