ParserSyntaxError class final

ParserSyntaxError

python docstring

The provided source text could not be parsed correctly.

python source

class ParserSyntaxError(Exception):
    """The provided source text could not be parsed correctly."""

    def __init__(
        self,
        message: str,
        *,
        source: str,
        span: Tuple[int, int],
    ) -> None:
        self.span = span
        self.message = message
        self.source = source

        super().__init__()

    def __str__(self) -> str:
        marker = " " * self.span[0] + "~" * (self.span[1] - self.span[0]) + "^"
        return "\n    ".join([self.message, self.source, marker])
Inheritance
  • Object
  • PythonObjectInterface<PythonFfiDelegate<Object?>, Object?>
  • PythonObject
  • PythonClass
  • ParserSyntaxError

Constructors

ParserSyntaxError({required String message, required String source, required Object? span})
factory
ParserSyntaxError.from(PythonClassInterface<PythonFfiDelegate<Object?>, Object?> pythonClass)

Properties

add_note Object?
add_note (getter)
getter/setter pair
args Object?
args (getter)
getter/setter pair
finalizer Finalizer<(PythonFfiDelegate<Object?>, Object?)>
The finalizer for the python object. Gets invoked when the object is no longer accessible to the program.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initializer → Initializer<PythonFfiDelegate<Object?>, Object?>
The initializer for the python object. Gets invoked at the start of the constructor.
finalinherited
message Object?
message (getter)
getter/setter pair
platform → PythonFfiDelegate<Object?>
Gets the platform that this object is associated with.
no setterinherited
reference Object?
Gets the reference to the python object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Object?
source (getter)
getter/setter pair
span Object?
span (getter)
getter/setter pair
with_traceback Object?
with_traceback (getter)
getter/setter pair

Methods

debugDump() → void
Dumps the python object to the console.
inherited
getAttribute<T extends Object?>(String attributeName) → T
Gets the attribute with the given name.
inherited
getAttributeOrNull<T extends Object?>(String attributeName) → T?
Gets the attribute with the given name or null if it does not exist.
inherited
getAttributeRaw<T extends PythonObjectInterface<PythonFfiDelegate<Object?>, Object?>>(String attributeName) → T
Gets the attribute with the given name.
inherited
getFunction(String name) → PythonFunctionInterface<PythonFfiDelegate<Object?>, Object?>
Gets the function with the given name.
inherited
getMethod(String functionName) → PythonFunctionInterface<PythonFfiDelegate<Object?>, Object?>
Gets a method from the class.
inherited
hasAttribute(String attributeName) bool
Checks if the python object has the given attribute.
inherited
noSuchMethod(Invocation invocation) Object?
Invoked when a nonexistent method or property is accessed.
inherited
setAttribute<T extends Object?>(String attributeName, T value) → void
Sets the attribute with the given name.
inherited
setAttributeRaw<T extends PythonObjectInterface<PythonFfiDelegate<Object?>, Object?>>(String attributeName, T value) → void
Sets the attribute with the given name.
inherited
toDartObject() Object?
Converts the python object to a Dart object.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited