From 94e4980c7e113779a1f486c108952875141652d4 Mon Sep 17 00:00:00 2001 From: Magnus Kokk Date: Thu, 18 May 2023 19:04:17 +0300 Subject: [PATCH] simplify generator --- internal/tokentype/tokentypes-gen/main.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/internal/tokentype/tokentypes-gen/main.go b/internal/tokentype/tokentypes-gen/main.go index 480e64e..71688bc 100644 --- a/internal/tokentype/tokentypes-gen/main.go +++ b/internal/tokentype/tokentypes-gen/main.go @@ -4,7 +4,6 @@ import ( "fmt" "log" "os" - "strings" "github.com/iancoleman/strcase" "github.com/mgnsk/balafon/internal/parser/token" @@ -47,19 +46,8 @@ func main() { id = "EOF" } - // TODO: name lex tokens correctly - trimmedID := strings.Trim(id, ":") - - varName := strcase.ToCamel(trimmedID) - - if varName == "" { - fmt.Printf("skipping %q\n", id) - typ++ - continue - } - words = append(words, word{ - varName: varName, + varName: strcase.ToCamel(id), id: id, typ: typ, })