MCPcopy Index your code
hub / github.com/Shopify/go-lua / readHexNumber

Method readHexNumber

scanner.go:215–233  ·  view source on GitHub ↗
(x float64)

Source from the content-addressed store, hash-verified

213}
214
215func (s *scanner) readHexNumber(x float64) (n float64, c rune, i int) {
216 if c, n = s.current, x; !isHexadecimal(c) {
217 return
218 }
219 for {
220 switch {
221 case '0' <= c && c <= '9':
222 c = c - '0'
223 case 'a' <= c && c <= 'f':
224 c = c - 'a' + 10
225 case 'A' <= c && c <= 'F':
226 c = c - 'A' + 10
227 default:
228 return
229 }
230 s.advance()
231 c, n, i = s.current, n*16.0+float64(c), i+1
232 }
233}
234
235func (s *scanner) readNumber() token {
236 const bits64, base10 = 64, 10

Callers 1

readNumberMethod · 0.95

Calls 2

advanceMethod · 0.95
isHexadecimalFunction · 0.85

Tested by

no test coverage detected