MCPcopy Index your code
hub / github.com/expr-lang/expr / IsValidIdentifier

Function IsValidIdentifier

parser/utils/utils.go:8–22  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

6)
7
8func IsValidIdentifier(str string) bool {
9 if len(str) == 0 {
10 return false
11 }
12 h, w := utf8.DecodeRuneInString(str)
13 if !IsAlphabetic(h) {
14 return false
15 }
16 for _, r := range str[w:] {
17 if !IsAlphaNumeric(r) {
18 return false
19 }
20 }
21 return true
22}
23
24func IsSpace(r rune) bool {
25 return unicode.IsSpace(r)

Callers 3

StringMethod · 0.92
StringMethod · 0.92

Calls 2

IsAlphabeticFunction · 0.85
IsAlphaNumericFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…