buildArray builds top array value, and adjusts stack appropriately.
()
| 212 | |
| 213 | // buildArray builds top array value, and adjusts stack appropriately. |
| 214 | func (p *fastJSONParser) buildArray() (JSON, error) { |
| 215 | if len(p.kind) == 0 || p.kind[len(p.kind)-1] != kindArray { |
| 216 | return nil, errUnexpectedState |
| 217 | } |
| 218 | j := p.arr[len(p.arr)-1].Build() |
| 219 | p.pop() |
| 220 | return p.stackReturn(j) |
| 221 | } |
| 222 | |
| 223 | // pushObject adds object builder and transitions state to read object. |
| 224 | func (p *fastJSONParser) pushObject() { |
no test coverage detected