ParseResult

sealed abstract class ParseResult[+T]

A base class for parser results. A result is either successful or not (failure may be fatal, i.e., an Error, or not, i.e., a Failure). On success, provides a result of type T which consists of some result (and the rest of the input).

A base class for parser results. A result is either successful or not (failure may be fatal, i.e., an Error, or not, i.e., a Failure). On success, provides a result of type T which consists of some result (and the rest of the input).

class Object
trait Matchable
class Any
class Success[T]
class NoSuccess
class Failure
class Error

Value members

Abstract methods

def append[U >: T](a: => ParseResult[U]): ParseResult[U]
def filterWithError(p: T => Boolean, error: T => String, position: Input): ParseResult[T]
def flatMapWithNext[U](f: T => Input => ParseResult[U]): ParseResult[U]
def get: T

Returns the embedded result.

Returns the embedded result.

def map[U](f: T => U): ParseResult[U]

Functional composition of ParseResults.

Functional composition of ParseResults.

Value Params
f

the function to be lifted over this result

Returns

f applied to the result of this ParseResult, packaged up as a new ParseResult

def mapPartial[U](f: PartialFunction[T, U], error: T => String): ParseResult[U]

Partial functional composition of ParseResults.

Partial functional composition of ParseResults.

Value Params
error

a function that takes the same argument as f and produces an error message to explain why f wasn't applicable (it is called when this is the case)

f

the partial function to be lifted over this result

Returns

if f f is defined at the result in this ParseResult, f applied to the result of this ParseResult, packaged up as a new ParseResult. If f is not defined, Failure.

Concrete methods

def getOrElse[B >: T](default: => B): B
def isEmpty: Boolean

Abstract fields

val next: Input
val successful: Boolean