We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8372401 commit 0b6d133Copy full SHA for 0b6d133
internal/scanner/scanner.go
@@ -2064,14 +2064,13 @@ func isInUnicodeRanges(cp rune, ranges []rune) bool {
2064
return false
2065
}
2066
2067
-var tokenToText map[ast.Kind]string
2068
-
2069
-func init() {
2070
- tokenToText = make(map[ast.Kind]string, len(textToToken))
2071
- for text, key := range textToToken {
2072
- tokenToText[key] = text
+var tokenToText = func() [ast.KindCount]string {
+ var result [ast.KindCount]string
+ for text, kind := range textToToken {
+ result[kind] = text
2073
2074
-}
+ return result
+}()
2075
2076
func TokenToString(token ast.Kind) string {
2077
return tokenToText[token]
0 commit comments