From ec300c9a70cab7643a5e2cf976607c2992654f4e Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 20 Jun 2025 17:20:25 +0200 Subject: [PATCH] Removed unused code --- src/compiler/Result.go | 4 ---- src/token/Count.go | 14 -------------- src/token/Count_test.go | 17 ----------------- 3 files changed, 35 deletions(-) delete mode 100644 src/compiler/Result.go delete mode 100644 src/token/Count.go delete mode 100644 src/token/Count_test.go diff --git a/src/compiler/Result.go b/src/compiler/Result.go deleted file mode 100644 index 398ced5..0000000 --- a/src/compiler/Result.go +++ /dev/null @@ -1,4 +0,0 @@ -package compiler - -// Result contains everything we need to write an executable file to disk. -type Result struct{} \ No newline at end of file diff --git a/src/token/Count.go b/src/token/Count.go deleted file mode 100644 index f3dc148..0000000 --- a/src/token/Count.go +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/src/token/Count_test.go b/src/token/Count_test.go deleted file mode 100644 index a255a55..0000000 --- a/src/token/Count_test.go +++ /dev/null @@ -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) -} \ No newline at end of file