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

Method scanDigits

parser/lexer/lexer.go:192–201  ·  view source on GitHub ↗

returns lower-case ch iff ch is ASCII letter

(ch rune, base, n int)

Source from the content-addressed store, hash-verified

190func lower(ch rune) rune { return ('a' - 'A') | ch } // returns lower-case ch iff ch is ASCII letter
191
192func (l *Lexer) scanDigits(ch rune, base, n int) rune {
193 for n > 0 && digitVal(ch) < base {
194 ch = l.next()
195 n--
196 }
197 if n > 0 {
198 l.error("invalid char escape")
199 }
200 return ch
201}
202
203func (l *Lexer) scanEscape(quote rune) rune {
204 ch := l.next() // read character after '/'

Callers 1

scanEscapeMethod · 0.95

Calls 3

nextMethod · 0.95
errorMethod · 0.95
digitValFunction · 0.85

Tested by

no test coverage detected