MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / parse

Method parse

pkg/util/json/parser.go:78–97  ·  view source on GitHub ↗

parse runs the parse loop -- reading next token from the stream, and decoding it based on the state machine.

()

Source from the content-addressed store, hash-verified

76// parse runs the parse loop -- reading next token from the
77// stream, and decoding it based on the state machine.
78func (p *fastJSONParser) parse() (JSON, error) {
79 for {
80 tok, err := p.decoder.NextToken()
81 if err != nil {
82 return nil, err
83 }
84
85 if len(tok) < 1 {
86 return nil, io.ErrUnexpectedEOF
87 }
88
89 j, err := p.state(p, tok)
90 if err != nil {
91 return nil, err
92 }
93 if j != nil && len(p.kind) == 0 {
94 return j, nil
95 }
96 }
97}
98
99// parseTopValue processes top level JSON value.
100func (p *fastJSONParser) parseTopValue(tok []byte) (JSON, error) {

Callers 1

parseUsingFastParserFunction · 0.95

Calls 1

NextTokenMethod · 0.80

Tested by

no test coverage detected