Result<R> class

An immutable parse result.

Inheritance
Implementers

Constructors

Result(String buffer, int position)
const

Properties

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

Methods

map<T>(T callback(R element)) Result<T>
Transform the result with a callback.
failure<R>(String message, [int position]) Result<R>
Returns a result indicating a parse failure.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
success<R>(R result, [int position]) Result<R>
Returns a result indicating a parse success.
inherited
toPositionString() String
Returns the line:column if the input is a string, otherwise the position.
inherited
toString() String
Returns a human readable string of the current context.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited