()
| 180 | } |
| 181 | |
| 182 | func (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 | |
| 209 | func (d *Decoder) stateArrayValue() ([]byte, error) { |
| 210 | tok := d.scanner.Next() |
nothing calls this directly
no test coverage detected