cats.parse

package cats.parse

Members list

Packages

Type members

Classlikes

trait Accumulator[-A, +B]

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

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

Attributes

Companion
object
Source
Accumulator.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Accumulator0[A, B]
object Accumulator

Attributes

Companion
trait
Source
Accumulator.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait Accumulator0[-A, +B] extends Accumulator[A, B]

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

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

Attributes

Companion
object
Source
Accumulator.scala
Supertypes
trait Accumulator[A, B]
class Object
trait Matchable
class Any
object Accumulator0

Attributes

Companion
trait
Source
Accumulator.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait Appender[-A, +B]

A limited Builder-like value we use for portability

A limited Builder-like value we use for portability

Attributes

Companion
object
Source
Accumulator.scala
Supertypes
class Object
trait Matchable
class Any
object Appender

Attributes

Companion
trait
Source
Accumulator.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Appender.type
object BitSetUtil

Attributes

Source
BitSet.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BitSetUtil.type
case class Caret(line: Int, col: Int, offset: Int)

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

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

Attributes

Companion
object
Source
Caret.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Caret

Attributes

Companion
class
Source
Caret.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Caret.type
class LocationMap(val input: String)

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

Attributes

Companion
object
Source
LocationMap.scala
Supertypes
class Object
trait Matchable
class Any
object LocationMap

Attributes

Companion
class
Source
LocationMap.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Numbers

Attributes

Source
Numbers.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Numbers.type
sealed abstract class Parser[+A] extends Parser0[A]

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.

Attributes

Companion
object
Source
Parser.scala
Supertypes
class Parser0[A]
class Object
trait Matchable
class Any
Self type
object Parser

Attributes

Companion
class
Source
Parser.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Parser.type
sealed abstract class Parser0[+A]

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.

Attributes

Companion
object
Source
Parser.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Parser[A]
Self type
object Parser0

Attributes

Companion
class
Source
Parser.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Parser0.type
object Rfc5234

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

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

Attributes

See also
Source
Rfc5234.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Rfc5234.type
object SemVer

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

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

Attributes

Source
SemVer.scala
Supertypes
class Object
trait Matchable
class Any
Self type
SemVer.type
trait StringCodec[+P <: (Parser0), A]

Attributes

Source
StringCodec.scala
Supertypes
class Object
trait Matchable
class Any