(str string)
| 2212 | } |
| 2213 | |
| 2214 | func GetIdentifierToken(str string) ast.Kind { |
| 2215 | if len(str) >= 2 && len(str) <= 12 && str[0] >= 'a' && str[0] <= 'z' { |
| 2216 | keyword := textToKeyword[str] |
| 2217 | if keyword != ast.KindUnknown { |
| 2218 | return keyword |
| 2219 | } |
| 2220 | } |
| 2221 | return ast.KindIdentifier |
| 2222 | } |
| 2223 | |
| 2224 | func IsValidIdentifier(s string) bool { |
| 2225 | if len(s) == 0 { |
no test coverage detected