MCPcopy Create free account
hub / github.com/expr-lang/expr / digitVal

Function digitVal

parser/lexer/lexer.go:180–188  ·  view source on GitHub ↗
(ch rune)

Source from the content-addressed store, hash-verified

178}
179
180func digitVal(ch rune) int {
181 switch {
182 case '0' <= ch && ch <= '9':
183 return int(ch - '0')
184 case 'a' <= lower(ch) && lower(ch) <= 'f':
185 return int(lower(ch) - 'a' + 10)
186 }
187 return 16 // larger than any legal digit val
188}
189
190func lower(ch rune) rune { return ('a' - 'A') | ch } // returns lower-case ch iff ch is ASCII letter
191

Callers 2

scanDigitsMethod · 0.85
scanEscapeMethod · 0.85

Calls 1

lowerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…