StringKey encodes token into a string for optimized string-based map key lookup
()
| 218 | |
| 219 | // StringKey encodes token into a string for optimized string-based map key lookup |
| 220 | func (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 |
| 230 | type KeyTokenList []KeyToken |
no test coverage detected