package decoder
import (
"github.com/goccy/go-json/internal/jsonnum"
)
const maxUint64Digits = jsonnum .MaxUint64Digits
func parseDigits(buf []byte , cursor int64 ) (uint64 , int64 , int ) {
return jsonnum .ParseDigits (buf , cursor )
}
func isFloatContinuation(c byte ) bool {
return jsonnum .IsFloatContinuation (c )
}
func parseFloatFast(buf []byte , cursor int64 ) (float64 , int64 , bool ) {
return jsonnum .ParseFloatTerminated (buf , cursor )
}
func numberEnd(buf []byte , start int64 ) (int64 , error ) {
n , place := jsonnum .Scan (buf [start :])
end := start + int64 (n )
if place != jsonnum .Valid {
return 0 , numberPlaceError (buf , end , start , place )
}
if !validEndNumberChar [buf [end ]] {
return 0 , syntaxErrorAt (buf , end , whereAfterTop )
}
return end , nil
}
func skipDigits(buf []byte , c int64 ) int64 {
for buf [c ]-'0' <= 9 {
c ++
}
return c
}
func numberPlaceError(buf []byte , cursor , start int64 , place jsonnum .Place ) error {
where := whereNumber
switch place {
case jsonnum .Fraction :
where = whereFraction
case jsonnum .Exponent :
where = whereExponent
}
return numberSyntaxError (buf , cursor , start , where )
}
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .