class ParseError(ValueError, TOMLKitError): """
This error occurs when the parser encounters a syntax error in the TOML being parsed. The error references the line and
location within the line where the error was encountered. """
def __init__(self, line: int, col: int, message: str | None = None) -> None:
self._line = line
self._col = col
if message isNone:
message = "TOML parse error"
super().__init__(f"{message} at line {self._line} col {self._col}")
@property def line(self): return self._line
@property def col(self): return self._col
class MixedArrayTypesError(ParseError): """
An array was found that had two or more element types. """
def __init__(self, line: int, col: int) -> None:
message = "Mixed types found in array"
super().__init__(line, col, message=message)
class InvalidNumberError(ParseError): """
A numeric field was improperly specified. """
message = ( "Control characters (codes less than 0x1f and 0x7f)"
f" are not allowed in {type}, "
f"use {display_code} instead"
)
super().__init__(line, col, message=message)
class InvalidStringError(ValueError, TOMLKitError): def __init__(self, value: str, invalid_sequences: Collection[str], delimiter: str):
repr_ = repr(value)[1:-1]
super().__init__(
f"Invalid string: {delimiter}{repr_}{delimiter}. "
f"The character sequences {invalid_sequences} are invalid."
)
class ConvertError(TypeError, ValueError, TOMLKitError): """Raised when item() fails to convert a value.
It should be a TypeError, but due to historical reasons
it needs to subclass ValueError as well. """
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.