((s, end), scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR)
| 270 | return pairs, end |
| 271 | |
| 272 | def JSONArray((s, end), scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR): |
| 273 | values = [] |
| 274 | nextchar = s[end:end + 1] |
| 275 | if nextchar in _ws: |
| 276 | end = _w(s, end + 1).end() |
| 277 | nextchar = s[end:end + 1] |
| 278 | # Look-ahead for trivial empty array |
| 279 | if nextchar == ']': |
| 280 | return values, end + 1 |
| 281 | _append = values.append |
| 282 | while True: |
| 283 | try: |
| 284 | value, end = scan_once(s, end) |
| 285 | except StopIteration: |
| 286 | raise JSONDecodeError("Expecting object", s, end) |
| 287 | _append(value) |
| 288 | nextchar = s[end:end + 1] |
| 289 | if nextchar in _ws: |
| 290 | end = _w(s, end + 1).end() |
| 291 | nextchar = s[end:end + 1] |
| 292 | end += 1 |
| 293 | if nextchar == ']': |
| 294 | break |
| 295 | elif nextchar != ',': |
| 296 | raise JSONDecodeError("Expecting , delimiter", s, end) |
| 297 | |
| 298 | try: |
| 299 | if s[end] in _ws: |
| 300 | end += 1 |
| 301 | if s[end] in _ws: |
| 302 | end = _w(s, end + 1).end() |
| 303 | except IndexError: |
| 304 | pass |
| 305 | |
| 306 | return values, end |
| 307 | |
| 308 | class JSONDecoder(object): |
| 309 | """Simple JSON <http://json.org> decoder |
nothing calls this directly
no test coverage detected