Package

cats

parse

Permalink

package parse

Visibility
  1. Public
  2. All

Type Members

  1. trait Accumulator[-A, +B] extends AnyRef

    Permalink

    Creates an appender given the first item to be added This is used to build the result in Parser.repAs

  2. trait Accumulator0[-A, +B] extends Accumulator[A, B]

    Permalink

    Creates an appender This is used to build the result in Parser.repAs0

  3. trait Appender[-A, +B] extends AnyRef

    Permalink

    A limited Builder-like value we use for portability

  4. case class Caret(line: Int, col: Int, offset: Int) extends Product with Serializable

    Permalink

    This is a pointer to a zero based line, column, and total offset.

  5. class LocationMap extends AnyRef

    Permalink

    This is a class to convert linear offset in a string into lines, or the column and line numbers.

    This is a class to convert linear offset in a string into lines, or the column and line numbers.

    This is useful for display to humans who in text editors think in terms of line and column numbers

  6. sealed abstract class Parser[+A] extends Parser0[A]

    Permalink

    Parser[A] is a Parser0[A] that will always consume one-or-more characters on a successful parse.

    Parser[A] is a Parser0[A] that will always consume one-or-more characters on a successful parse.

    Since Parser is guaranteed to consume input it provides additional methods which would be unsafe when used on parsers that succeed without consuming input, such as rep0.

    When a Parser is composed with a Parser0 the result is usually a Parser. Parser overrides many of Parser0's methods to refine the return type. In other cases, callers may need to use the with1 helper method to refine the type of their expressions.

    Parser doesn't provide any additional guarantees over Parser0 on what kind of parsing failures it can return.

  7. sealed abstract class Parser0[+A] extends AnyRef

    Permalink

    Parser0[A] attempts to extract an A value from the given input, potentially moving its offset forward in the process.

    Parser0[A] attempts to extract an A value from the given input, potentially moving its offset forward in the process.

    When calling parse, one of three outcomes occurs:

    • Success: The parser consumes zero-or-more characters of input and successfully extracts a value. The input offset will be moved forward by the number of characters consumed.
    • Epsilon failure: The parser fails to extract a value without consuming any characters of input. The input offset will not be changed.
    • Arresting failure: The parser fails to extract a value but does consume one-or-more characters of input. The input offset will be moved forward by the number of characters consumed and all parsing will stop (unless a higher-level parser backtracks).

    Operations such as x.orElse(y) will only consider parser y if x returns an epsilon failure; these methods cannot recover from an arresting failure. Arresting failures can be "rewound" using methods such as x.backtrack (which converts arresting failures from x into epsilon failures), or softProduct(x, y) (which can rewind successful parses by x that are followed by epsilon failures for y).

    Rewinding tends to make error reporting more difficult and can lead to exponential parser behavior it is not the default behavior.

Value Members

  1. object Accumulator extends Priority0Accumulator

    Permalink
  2. object Accumulator0

    Permalink
  3. object Appender

    Permalink
  4. object BitSetUtil

    Permalink
  5. object Caret extends Serializable

    Permalink
  6. object LocationMap

    Permalink
  7. object Numbers

    Permalink
  8. object Parser

    Permalink
  9. object Parser0

    Permalink
  10. object Rfc5234

    Permalink

    Parsers for the common rules of RFC5234.

    Parsers for the common rules of RFC5234. These rules are referenced by several RFCs.

    See also

    https://tools.ietf.org/html/rfc5234

  11. object SemVer

    Permalink

    SemVer 2.0.0 Parser based on https://semver.org

Ungrouped