Opt

class Opt[E, T](val p: Parsec[E, T], val otherwise: T) extends Parsec[E, T]

Opt x p tries to apply parser p. If p fails without consuming input, it returns the value x, otherwise the value returned by p.

Opt x p tries to apply parser p. If p fails without consuming input, it returns the value x, otherwise the value returned by p.

Authors

Mars Liu

Version

1.0.0

Companion
object
trait Parsec[E, T]
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(s: State[E]): Try[T]

Inherited methods

def !(state: State[E]): T
Inherited from
Parsec
def <|>[R >: T](p: Parsec[E, R]): Parsec[E, R]
Inherited from
Parsec
def ?(state: State[E]): Try[T]
Inherited from
Parsec
def attempt: Parsec[E, T]
Inherited from
Parsec
def iterate[R >: T](state: State[E]): Iterator[E, R]
Inherited from
Parsec

Concrete fields

val otherwise: T
val p: Parsec[E, T]
lazy val psc: Attempt[E, T]