MCPcopy Create free account
hub / github.com/cogentcore/core / StringKey

Method StringKey

parse/token/token.go:220–227  ·  view source on GitHub ↗

StringKey encodes token into a string for optimized string-based map key lookup

()

Source from the content-addressed store, hash-verified

218
219// StringKey encodes token into a string for optimized string-based map key lookup
220func (kt KeyToken) StringKey() string {
221 tstr := string([]byte{byte(kt.Token)})
222 if kt.Token.IsKeyword() {
223 return tstr + kt.Key
224 } else {
225 return tstr
226 }
227}
228
229// KeyTokenList is a list (slice) of KeyTokens
230type KeyTokenList []KeyToken

Callers 2

CompileTokMapMethod · 0.80
MatchGroupMethod · 0.80

Calls 1

IsKeywordMethod · 0.80

Tested by

no test coverage detected