Failure

laika.parse.Failure
See theFailure companion object
case class Failure(msgProvider: Message, next: SourceCursor, maxOffset: Int) extends Parsed[Nothing]

The failure case of Parsed containing an error message and the remaining input.

Implementation note: The message property is of type Message, to allow for lazy message creation. The former SDK parser combinators which this API is partially inspired by contained a lot of unnecessary string concatenations for messages which were then never read. This implementation avoids this extra cost and the result is measurable (about 15% performance gain for a typical Markdown document for example).

Value parameters

maxOffset

The offset position the parser could successfully read to before failing

msgProvider

A provider that produces an error message for this failure based on its SourceCursor

next

The unconsumed input at the point where the failing parser started

Attributes

Companion
object
Source
Parsed.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Parsed[Nothing]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def map[U](f: Nothing => U): Failure

Builds a new Parsed instance by applying the specified function to the result of this instance.

Builds a new Parsed instance by applying the specified function to the result of this instance.

Attributes

Source
Parsed.scala
def orElse[U](default: => Parsed[U]): Parsed[U]

Returns this Parsed instance if the parser succeeded or otherwise the specified fallback instance.

Returns this Parsed instance if the parser succeeded or otherwise the specified fallback instance.

Attributes

Source
Parsed.scala
def toEither: Either[String, Nothing]

The result as an Either, a Left in case of failure.

The result as an Either, a Left in case of failure.

Attributes

Source
Parsed.scala
def toOption: Option[Nothing]

The result as an Option, empty in case of failure.

The result as an Option, empty in case of failure.

Attributes

Source
Parsed.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Parsed.scala

Inherited methods

def getOrElse[B](default: => B): B

Returns the result value from the parser invocation if the parser succeeded or otherwise the specified fallback value.

Returns the result value from the parser invocation if the parser succeeded or otherwise the specified fallback value.

Attributes

Inherited from:
Parsed
Source
Parsed.scala

Indicates whether this results represents an unsuccessful parser invocation.

Indicates whether this results represents an unsuccessful parser invocation.

Attributes

Inherited from:
Parsed
Source
Parsed.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

Indicates whether this results represents a successful parser invocation.

Indicates whether this results represents a successful parser invocation.

Attributes

Source
Parsed.scala
lazy val message: String

The message specifying the cause of the failure.

The message specifying the cause of the failure.

Attributes

Source
Parsed.scala