(src: str, pos: Pos, hex_len: int)
| 581 | |
| 582 | |
| 583 | def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]: |
| 584 | hex_str = src[pos : pos + hex_len] |
| 585 | if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str): |
| 586 | raise TOMLDecodeError("Invalid hex value", src, pos) |
| 587 | pos += hex_len |
| 588 | hex_int = int(hex_str, 16) |
| 589 | if not is_unicode_scalar_value(hex_int): |
| 590 | raise TOMLDecodeError( |
| 591 | "Escaped character is not a Unicode scalar value", src, pos |
| 592 | ) |
| 593 | return pos, chr(hex_int) |
| 594 | |
| 595 | |
| 596 | def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]: |
no test coverage detected
searching dependent graphs…