MCPcopy Index your code
hub / github.com/python/cpython / parse_literal_str

Function parse_literal_str

Lib/tomllib/_parser.py:596–602  ·  view source on GitHub ↗
(src: str, pos: Pos)

Source from the content-addressed store, hash-verified

594
595
596def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]:
597 pos += 1 # Skip starting apostrophe
598 start_pos = pos
599 pos = skip_until(
600 src, pos, "'", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True
601 )
602 return pos + 1, src[start_pos:pos] # Skip ending apostrophe
603
604
605def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]:

Callers 2

parse_key_partFunction · 0.85
parse_valueFunction · 0.85

Calls 1

skip_untilFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…