c

fastparse

EagerOps

implicit final class EagerOps[T] extends AnyVal

Provides EagerOps extension methods on P]

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EagerOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EagerOps(parse0: P[T])

Value Members

  1. macro def !(implicit ctx: P[Any]): P[String]

    Capture operator; makes the parser return the span of input it parsed as a String, which can then be processed further using ~, map or flatMapX

  2. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  3. final def ##(): Int
    Definition Classes
    Any
  4. macro def /(implicit ctx: P[_]): P[T]

    Plain cut operator.

    Plain cut operator. Runs the parser, and if it succeeds, backtracking past that point is now prohibited

  5. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  6. macro def ?[V](implicit optioner: Optioner[T, V], ctx: P[Any]): P[V]

    Optional operator.

    Optional operator. Parses the given input to wrap it in a Some, but if parsing fails backtracks and returns None

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. macro def filter(f: (T) ⇒ Boolean)(implicit ctx: P[Any]): P[T]

    Tests the output of the parser with a given predicate, failing the parse if the predicate returns false.

    Tests the output of the parser with a given predicate, failing the parse if the predicate returns false. Useful for doing local validation on bits and pieces of your parsed output

  9. macro def flatMap[V](f: (T) ⇒ P[V])(implicit whitespace: (P[Any]) ⇒ P[Unit]): P[V]

    Transforms the result of this parser using the given function into a new parser which is applied (after whitespace).

    Transforms the result of this parser using the given function into a new parser which is applied (after whitespace). Useful for doing dependent parsing, e.g. when parsing JSON you may first parse a character to see if it's a [, {, or ", and then deciding whether you next want to parse an array, dictionary or string.

  10. macro def flatMapX[V](f: (T) ⇒ P[V]): P[V]

    Transforms the result of this parser using the given function into a new parser which is applied (without consuming whitespace).

    Transforms the result of this parser using the given function into a new parser which is applied (without consuming whitespace). Useful for doing dependent parsing, e.g. when parsing JSON you may first parse a character to see if it's a [, {, or ", and then deciding whether you next want to parse an array, dictionary or string.

  11. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. macro def map[V](f: (T) ⇒ V): P[V]

    Transforms the result of this parser using the given function.

    Transforms the result of this parser using the given function. Useful for turning the Strings captured by ! and the tuples built by ~ into your own case classes or data structure

  14. val parse0: P[T]
  15. def toString(): String
    Definition Classes
    Any
  16. macro def |[V >: T](other: P[V])(implicit ctx: P[Any]): P[V]

    Either-or operator: tries to parse the left-hand-side, and if that fails it backtracks and tries to pass the right-hand-side.

    Either-or operator: tries to parse the left-hand-side, and if that fails it backtracks and tries to pass the right-hand-side. Can be chained more than once to parse larger numbers of alternatives.

  17. macro def ~[V, R](other: P[V])(implicit s: Sequencer[T, V, R], whitespace: (P[Any]) ⇒ P[Unit], ctx: P[_]): P[R]

    Sequence operator.

    Sequence operator. Runs two parsers one after the other, with optional whitespace in between.If both parsers return a value, this returns a tuple.

  18. macro def ~/[V, R](other: P[V])(implicit s: Sequencer[T, V, R], whitespace: (P[Any]) ⇒ P[Unit], ctx: P[_]): P[R]

    Sequence-with-cut operator.

    Sequence-with-cut operator. Runs two parsers one after the other, with optional whitespace in between. If the first parser completes successfully, backtracking is now prohibited. If both parsers return a value, this returns a tuple.

  19. macro def ~~[V, R](other: P[V])(implicit s: Sequencer[T, V, R], ctx: P[_]): P[R]

    Raw sequence operator.

    Raw sequence operator. Runs two parsers one after the other, *without* whitespace in between. If both parsers return a value, this returns a tuple.

  20. macro def ~~/[V, R](other: P[V])(implicit s: Sequencer[T, V, R], ctx: P[_]): P[R]

    Raw sequence-with-cut operator.

    Raw sequence-with-cut operator. Runs two parsers one after the other, *without* whitespace in between. If the first parser completes successfully, backtracking is no longer prohibited. If both parsers return a value, this returns a tuple.

Inherited from AnyVal

Inherited from Any

Ungrouped