• Home
  • Raw
  • Download

Lines Matching +full:end +full:- +full:to +full:- +full:end

17 NegInf = float('-inf')
26 lineno: The line corresponding to pos
27 colno: The column corresponding to pos
33 colno = pos - doc.rfind('\n', 0, pos)
47 '-Infinity': NegInf,
53 STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS)
69 def py_scanstring(s, end, strict=True, argument
71 """Scan the string s for a JSON string. End is the index of the
74 on attempt to decode an invalid string. If strict is False then literal
78 after the end quote."""
81 begin = end - 1
83 chunk = _m(s, end)
86 end = chunk.end()
91 # Terminator is the end of string, a literal control character,
99 raise JSONDecodeError(msg, s, end)
104 esc = s[end]
114 raise JSONDecodeError(msg, s, end)
115 end += 1
117 uni = _decode_uXXXX(s, end)
118 end += 5
119 if 0xd800 <= uni <= 0xdbff and s[end:end + 2] == '\\u':
120 uni2 = _decode_uXXXX(s, end + 1)
122 uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00))
123 end += 6
126 return ''.join(chunks), end
138 s, end = s_and_end
145 # Use a slice to prevent IndexError from being raised, the following
147 nextchar = s[end:end + 1]
151 end = _w(s, end).end()
152 nextchar = s[end:end + 1]
157 return result, end + 1
161 return pairs, end + 1
164 "Expecting property name enclosed in double quotes", s, end)
165 end += 1
167 key, end = scanstring(s, end, strict)
169 # To skip some function call overhead we optimize the fast paths where
171 if s[end:end + 1] != ':':
172 end = _w(s, end).end()
173 if s[end:end + 1] != ':':
174 raise JSONDecodeError("Expecting ':' delimiter", s, end)
175 end += 1
178 if s[end] in _ws:
179 end += 1
180 if s[end] in _ws:
181 end = _w(s, end + 1).end()
186 value, end = scan_once(s, end)
191 nextchar = s[end]
193 end = _w(s, end + 1).end()
194 nextchar = s[end]
197 end += 1
202 raise JSONDecodeError("Expecting ',' delimiter", s, end - 1)
203 end = _w(s, end).end()
204 nextchar = s[end:end + 1]
205 end += 1
208 "Expecting property name enclosed in double quotes", s, end - 1)
211 return result, end
215 return pairs, end
218 s, end = s_and_end
220 nextchar = s[end:end + 1]
222 end = _w(s, end + 1).end()
223 nextchar = s[end:end + 1]
224 # Look-ahead for trivial empty array
226 return values, end + 1
230 value, end = scan_once(s, end)
234 nextchar = s[end:end + 1]
236 end = _w(s, end + 1).end()
237 nextchar = s[end:end + 1]
238 end += 1
242 raise JSONDecodeError("Expecting ',' delimiter", s, end - 1)
244 if s[end] in _ws:
245 end += 1
246 if s[end] in _ws:
247 end = _w(s, end + 1).end()
251 return values, end
259 +---------------+-------------------+
263 +---------------+-------------------+
265 +---------------+-------------------+
267 +---------------+-------------------+
269 +---------------+-------------------+
271 +---------------+-------------------+
273 +---------------+-------------------+
275 +---------------+-------------------+
277 +---------------+-------------------+
279 It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
289 place of the given ``dict``. This can be used to provide custom
290 deserializations (e.g. to support JSON-RPC class hinting).
295 This feature can be used to implement custom decoders.
300 of every JSON float to be decoded. By default this is equivalent to
301 float(num_str). This can be used to use another datatype or parser
305 of every JSON int to be decoded. By default this is equivalent to
306 int(num_str). This can be used to use another datatype or parser
310 following strings: -Infinity, Infinity, NaN.
311 This can be used to raise an exception if invalid JSON numbers
316 this context are those with character codes in the 0-31 range,
337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):
340 raise JSONDecodeError("Extra data", s, end)
345 a JSON document) and return a 2-tuple of the Python
348 This can be used to decode a JSON document from a string that may
349 have extraneous data at the end.
353 obj, end = self.scan_once(s, idx)
356 return obj, end