MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / coord_repr

Function coord_repr

tools/python-3.11.9-amd64/Lib/tomllib/_parser.py:656–664  ·  view source on GitHub ↗
(src: str, pos: Pos)

Source from the content-addressed store, hash-verified

654 coordinates in source."""
655
656 def coord_repr(src: str, pos: Pos) -> str:
657 if pos >= len(src):
658 return "end of document"
659 line = src.count("\n", 0, pos) + 1
660 if line == 1:
661 column = pos + 1
662 else:
663 column = pos - src.rindex("\n", 0, pos)
664 return f"line {line}, column {column}"
665
666 return TOMLDecodeError(f"{msg} (at {coord_repr(src, pos)})")
667

Callers 1

suffixed_errFunction · 0.70

Calls 2

rindexMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected