Result<R> class sealed

An immutable parse result that is either a Success or a Failure.

Inheritance
Implementers

Constructors

Result(String buffer, int position)
const

Properties

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

Methods

failure(String message, [int? position]) Failure
Returns a result indicating a parse failure.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
success<R>(R result, [int? position]) Success<R>
Returns a result indicating a parse success.
inherited
toPositionString() String
Returns the current line:column position in the buffer.
inherited
toString() String
A string representation of this object.
inherited

Operators

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