Source File
stream_token.go
Belonging Package
github.com/goccy/go-json/internal/decoder
package decoder// The tokens of a stream are read as encoding/json reads them: the stream keeps where it is in the objects and// the arrays which Token opened, so that a delimiter is checked by the grammar, and a value which Decode reads// between the tokens follows the comma or the colon before it.// tokenState is where the stream is between the tokens of the objects and the arrays which Token opened.type tokenState uint8const (// tokenTopValue is out of any: the values of the stream follow each other.tokenTopValue tokenState = iotatokenArrayStarttokenArrayValuetokenArrayCommatokenObjectStarttokenObjectKeytokenObjectColontokenObjectValuetokenObjectComma// tokenFailed is after a read which failed: every read returns its error.tokenFailed)// tokenValueEnd moves the state after a value, which is the key of an object where one is waited for, as// encoding/json of Go 1.27 reads it.func ( *Stream) () {switch .tokenState {case tokenArrayStart, tokenArrayValue:.tokenState = tokenArrayCommacase tokenObjectValue:.tokenState = tokenObjectCommacase tokenObjectStart, tokenObjectKey:.tokenState = tokenObjectColon}}
![]() |
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. |