Reorganized file structure

This commit is contained in:
Eduard Urbach 2024-06-10 15:51:39 +02:00
parent 8b595ef3ce
commit 722d07c321
Signed by: eduard
GPG key ID: 49226B848C78F6C8
57 changed files with 431 additions and 614 deletions

15
src/build/token/Token.go Normal file
View file

@ -0,0 +1,15 @@
package token
// Token represents a single element in a source file.
// The characters that make up an identifier are grouped into a single token.
// This makes parsing easier and allows us to do better syntax checks.
type Token struct {
Kind Kind
Position int
Bytes []byte
}
// Text returns the token text.
func (t Token) Text() string {
return string(t.Bytes)
}