Scan a four digit hex number from s[end:end + 4]
(s, end, _m=re.compile(r'^[0-9a-fA-F]{4}$').match)
| 54 | |
| 55 | |
| 56 | def scan_four_digit_hex(s, end, _m=re.compile(r'^[0-9a-fA-F]{4}$').match): |
| 57 | """Scan a four digit hex number from s[end:end + 4] |
| 58 | """ |
| 59 | msg = "Invalid \\uXXXX escape sequence" |
| 60 | esc = s[end:end + 4] |
| 61 | if not _m(esc): |
| 62 | raise JSONDecodeError(msg, s, end - 2) |
| 63 | try: |
| 64 | return int(esc, 16), end + 4 |
| 65 | except ValueError: |
| 66 | raise JSONDecodeError(msg, s, end - 2) |
| 67 | |
| 68 | def py_scanstring(s, end, encoding=None, strict=True, |
| 69 | _b=BACKSLASH, _m=STRINGCHUNK.match, _join=u''.join, |
nothing calls this directly
no test coverage detected
searching dependent graphs…