(
src: str,
pos: Pos,
expect: str,
*,
error_on: frozenset[str],
error_on_eof: bool,
)
| 313 | |
| 314 | |
| 315 | def skip_until( |
| 316 | src: str, |
| 317 | pos: Pos, |
| 318 | expect: str, |
| 319 | *, |
| 320 | error_on: frozenset[str], |
| 321 | error_on_eof: bool, |
| 322 | ) -> Pos: |
| 323 | try: |
| 324 | new_pos = src.index(expect, pos) |
| 325 | except ValueError: |
| 326 | new_pos = len(src) |
| 327 | if error_on_eof: |
| 328 | raise TOMLDecodeError(f"Expected {expect!r}", src, new_pos) from None |
| 329 | |
| 330 | if not error_on.isdisjoint(src[pos:new_pos]): |
| 331 | while src[pos] not in error_on: |
| 332 | pos += 1 |
| 333 | raise TOMLDecodeError(f"Found invalid character {src[pos]!r}", src, pos) |
| 334 | return new_pos |
| 335 | |
| 336 | |
| 337 | def skip_comment(src: str, pos: Pos) -> Pos: |
no test coverage detected
searching dependent graphs…