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

Method stateObjectComma

pkg/util/json/tokenizer/decoder.go:182–207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180}
181
182func (d *Decoder) stateObjectComma() (_ []byte, err error) {
183 tok := d.scanner.Next()
184 if len(tok) < 1 {
185 return nil, io.ErrUnexpectedEOF
186 }
187 switch tok[0] {
188 case '}':
189 inObj := d.pop()
190 switch {
191 case d.len() == 0:
192 d.state = (*Decoder).stateEnd
193 case inObj:
194 d.state = (*Decoder).stateObjectComma
195 case !inObj:
196 d.state = (*Decoder).stateArrayComma
197 }
198 return tok, nil
199 case Comma:
200 d.mustHaveValue = true
201 tok, err = d.stateObjectString()
202 d.mustHaveValue = false
203 return tok, err
204 default:
205 return tok, fmt.Errorf("stateObjectComma: expecting comma")
206 }
207}
208
209func (d *Decoder) stateArrayValue() ([]byte, error) {
210 tok := d.scanner.Next()

Callers

nothing calls this directly

Calls 5

stateObjectStringMethod · 0.95
ErrorfMethod · 0.80
NextMethod · 0.65
lenMethod · 0.65
popMethod · 0.45

Tested by

no test coverage detected