Result

enum Result[Token, +A]

Result of a parsing operation.

This is essentially a very specialised version of Either (and can, in fact, be turned into one through toEither).

A result keeps track of whether or not any data has been consumed when producing it. This is used to decide whether or not to try alternative parsers in a Parser.| call.

Results also store an error message even if they're successful. This might seem a little odd, but is necessary to be able to provide good error messages for combinators such as Parser.filter where we might turn a success into a failure after the fact.

Companion:
object
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case Error[Token]

Type members

Enum entries

case Error[Token](consumed: Boolean, message: Message) extends Result[Token, Nothing]
case Ok[Token, +A](consumed: Boolean, value: Parsed[A], state: State[Token], message: Message)