MCPcopy Index your code
hub / github.com/pyload/pyload / JSONArray

Function JSONArray

module/lib/simplejson/decoder.py:272–306  ·  view source on GitHub ↗
((s, end), scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR)

Source from the content-addressed store, hash-verified

270 return pairs, end
271
272def 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
308class JSONDecoder(object):
309 """Simple JSON <http://json.org> decoder

Callers

nothing calls this directly

Calls 2

scan_onceFunction · 0.85
JSONDecodeErrorClass · 0.85

Tested by

no test coverage detected