Added a tokenizer

This commit is contained in:
Eduard Urbach 2023-10-31 11:57:37 +01:00
parent 16690d390f
commit 21cf4b5c6d
Signed by: eduard
GPG key ID: 49226B848C78F6C8
7 changed files with 274 additions and 12 deletions

17
src/token/List.go Normal file
View 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()
}