Removed unused code
All checks were successful
/ test (push) Successful in 14s

This commit is contained in:
Eduard Urbach 2025-06-20 17:20:25 +02:00
parent 714a722aaa
commit ec300c9a70
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
3 changed files with 0 additions and 35 deletions

View file

@ -1,4 +0,0 @@
package compiler
// Result contains everything we need to write an executable file to disk.
type Result struct{}

View file

@ -1,14 +0,0 @@
package token
// Count counts how often the given token appears in the token list.
func Count(tokens []Token, buffer []byte, kind Kind, name string) uint8 {
count := uint8(0)
for _, t := range tokens {
if t.Kind == kind && t.String(buffer) == name {
count++
}
}
return count
}

View file

@ -1,17 +0,0 @@
package token_test
import (
"testing"
"git.urbach.dev/cli/q/src/token"
"git.urbach.dev/go/assert"
)
func TestCount(t *testing.T) {
buffer := []byte(`a b b c c c`)
tokens := token.Tokenize(buffer)
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "a"), 1)
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "b"), 2)
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "c"), 3)
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "d"), 0)
}