Success<R> class Null safety

An immutable parse result in case of a successful parse.

Inheritance

Constructors

Success(String buffer, int position, R value)
const

Properties

buffer String
The buffer we are working on.
final, inherited
hashCode int
The hash code for this object.
read-only, inherited
isFailure bool
Returns true if this result indicates a parse failure.
read-only, inherited
isSuccess bool
Returns true if this result indicates a parse success.
read-only, override
message String
Returns the error message of this result, or throws an UnsupportedError if this is a parse success.
read-only, override
position int
The current position in the buffer.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value → R
Returns the parsed value of this result, or throws a ParserException if this is a parse failure.
final

Methods

failure<R>(String message, [int? position]) Failure<R>
Returns a result indicating a parse failure.
@inlineJs, @inlineVm, inherited
map<T>(T callback(R element)) Result<T>
Transforms the result with a callback.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
success<R>(R result, [int? position]) Success<R>
Returns a result indicating a parse success.
@inlineJs, @inlineVm, inherited
toPositionString() String
Returns the current line:column position in the buffer.
inherited
toString() String
A string representation of this object.
override

Operators

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