Parser

zio.parser.Parser
See theParser companion trait
object Parser

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Parser.type

Members list

Type members

Classlikes

final case class Backtrack[Err, In, Result](parser: Parser[Err, In, Result]) extends Parser[Err, In, Result]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class CaptureString[Err, Err2](parser: Parser[Err, Char, Any]) extends Parser[Err2, Char, String]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, Char, String]
trait VersionSpecificParser[Err2, Char, String]
class Object
trait Matchable
class Any
Show all
case object End extends Parser[Nothing, Any, Unit]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, Any, Unit]
trait VersionSpecificParser[Nothing, Any, Unit]
class Object
trait Matchable
class Any
Show all
Self type
End.type
final case class Fail[+Err](failure: Err) extends Parser[Err, Any, Any]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Any, Any]
trait VersionSpecificParser[Err, Any, Any]
class Object
trait Matchable
class Any
Show all
final case class Failed[+Err](failure: ParserError[Err]) extends Parser[Err, Any, Nothing]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Any, Nothing]
trait VersionSpecificParser[Err, Any, Nothing]
class Object
trait Matchable
class Any
Show all
final case class FlatMap[Err, Err2, In, In2 <: In, Result, Result2](parser: Parser[Err, In, Result], f: Result => Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Result2]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result2]
trait VersionSpecificParser[Err2, In2, Result2]
class Object
trait Matchable
class Any
Show all
final case class Ignore[Err, Err2, In, Result, Result2](parser: Parser[Err, In, Result], to: Result2) extends Parser[Err2, In, Result2]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result2]
trait VersionSpecificParser[Err2, In, Result2]
class Object
trait Matchable
class Any
Show all
case object Index extends Parser[Nothing, Any, Int]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, Any, Int]
trait VersionSpecificParser[Nothing, Any, Int]
class Object
trait Matchable
class Any
Show all
Self type
Index.type
final case class Lazy[+Err, -In, +Result](inner: () => Parser[Err, In, Result]) extends Parser[Err, In, Result]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class MapError[Err, Err2, In, Result](parser: Parser[Err, In, Result], mapParserErr: (ParserError[Err]) => ParserError[Err2]) extends Parser[Err2, In, Result]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result]
trait VersionSpecificParser[Err2, In, Result]
class Object
trait Matchable
class Any
Show all
final case class Named[Err, In, Result](parser: Parser[Err, In, Result], name: String) extends Parser[Err, In, Result]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class Not[Err, In](parser: Parser[Err, In, Any], failure: Err) extends Parser[Err, In, Unit]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Unit]
trait VersionSpecificParser[Err, In, Unit]
class Object
trait Matchable
class Any
Show all
final case class Optional[Err, In, Result](parser: Parser[Err, In, Result]) extends Parser[Err, In, Option[Result]]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Option[Result]]
trait VersionSpecificParser[Err, In, Option[Result]]
class Object
trait Matchable
class Any
Show all
final case class OrElse[Err, Err2, In, In2 <: In, Result, Result2](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Result2]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result2]
trait VersionSpecificParser[Err2, In2, Result2]
class Object
trait Matchable
class Any
Show all
final case class OrElseEither[Err, Err2, In, In2 <: In, Result, Result2](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Either[Result, Result2]]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Either[Result, Result2]]
trait VersionSpecificParser[Err2, In2, Either[Result, Result2]]
class Object
trait Matchable
class Any
Show all
final case class ParseRegex[Err](regex: Regex, onFailure: Option[Err]) extends Parser[Err, Char, Chunk[Char]]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Char, Chunk[Char]]
trait VersionSpecificParser[Err, Char, Chunk[Char]]
class Object
trait Matchable
class Any
Show all
final case class ParseRegexLastChar[Err](regex: Regex, onFailure: Option[Err]) extends Parser[Err, Char, Char]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Char, Char]
trait VersionSpecificParser[Err, Char, Char]
class Object
trait Matchable
class Any
Show all
object ParserError

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ParserError[+Err]

Type representing a parser error

Type representing a parser error

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AllBranchesFailed[Err]
class Failure[Err]
class NotConsumedAll[Err]
Self type
final case class Passthrough[-D1, +D2]() extends Parser[Nothing, D1, D2]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, D1, D2]
trait VersionSpecificParser[Nothing, D1, D2]
class Object
trait Matchable
class Any
Show all
final case class Repeat[Err, In, Result](parser: Parser[Err, In, Result], min: Int, max: Option[Int]) extends Parser[Err, In, Chunk[Result]]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Chunk[Result]]
trait VersionSpecificParser[Err, In, Chunk[Result]]
class Object
trait Matchable
class Any
Show all
final case class SetAutoBacktrack[Err, In, Result](parser: Parser[Err, In, Result], enabled: Boolean) extends Parser[Err, In, Result]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class SkipRegex[Err](regex: Regex, onFailure: Option[Err]) extends Parser[Err, Char, Unit]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Char, Unit]
trait VersionSpecificParser[Err, Char, Unit]
class Object
trait Matchable
class Any
Show all
final case class Succeed[+Result](value: Result) extends Parser[Nothing, Any, Result]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, Any, Result]
trait VersionSpecificParser[Nothing, Any, Result]
class Object
trait Matchable
class Any
Show all
final case class Transform[Err, Err2, In, Result, Result2](parser: Parser[Err, In, Result], to: Result => Result2) extends Parser[Err2, In, Result2]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result2]
trait VersionSpecificParser[Err2, In, Result2]
class Object
trait Matchable
class Any
Show all
final case class TransformEither[Err, Err2, In, Result, Result2](parser: Parser[Err, In, Result], to: Result => Either[Err2, Result2]) extends Parser[Err2, In, Result2]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result2]
trait VersionSpecificParser[Err2, In, Result2]
class Object
trait Matchable
class Any
Show all
final case class Zip[Err, Err2, In, In2 <: In, Result, Result2, ZippedResult](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2], zip: (Result, Result2) => ZippedResult) extends Parser[Err2, In2, ZippedResult]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, ZippedResult]
trait VersionSpecificParser[Err2, In2, ZippedResult]
class Object
trait Matchable
class Any
Show all
final case class ZipLeft[Err, Err2, In, In2 <: In, Result](left: Parser[Err, In, Result], right: Parser[Err2, In2, Any]) extends Parser[Err2, In2, Result]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result]
trait VersionSpecificParser[Err2, In2, Result]
class Object
trait Matchable
class Any
Show all
final case class ZipRight[Err, Err2, In, In2 <: In, Result, Result2](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Result2]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result2]
trait VersionSpecificParser[Err2, In2, Result2]
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def any[T]: Parser[Nothing, T, T]
def char(value: Char): Parser[String, Char, Unit]

Parser that consumes the exact character 'value' or fails if it did not match, and results in the unit value.

Parser that consumes the exact character 'value' or fails if it did not match, and results in the unit value.

Attributes

def char[Err](value: Char, failure: Err): Parser[Err, Char, Unit]

Parser that consumes the exact character 'value' or fails with 'failure' if it did not match, and results in the unit value

Parser that consumes the exact character 'value' or fails with 'failure' if it did not match, and results in the unit value

Attributes

def charIn(chars: Char*): Parser[String, Char, Char]

Parser that consumes a single character and succeeds with it if it is one of the provided 'chars'

Parser that consumes a single character and succeeds with it if it is one of the provided 'chars'

Attributes

def charNotIn(chars: Char*): Parser[String, Char, Char]

Parser that consumes a single character and succeeds with it if it is NOT one of the provided 'chars'

Parser that consumes a single character and succeeds with it if it is NOT one of the provided 'chars'

Attributes

def fail[Err](failure: Err): Parser[Err, Any, Nothing]

Parser that always fails with 'failure'

Parser that always fails with 'failure'

Attributes

def notChar(value: Char): Parser[String, Char, Char]

Parser that consumes a single character, fails if it is 'value', otherwise results with it

Parser that consumes a single character, fails if it is 'value', otherwise results with it

Attributes

def notChar[Err](value: Char, failure: Err): Parser[Err, Char, Char]

Parser that consumes a single character, fails with 'failure' if it is 'value', otherwise results with it

Parser that consumes a single character, fails with 'failure' if it is 'value', otherwise results with it

Attributes

def regex[Err](regex: Regex, failure: Err): ParseRegex[Err]

Parser that executes a regular expression on the input and results in the chunk of the parsed characters, or fails with 'failure'.

Parser that executes a regular expression on the input and results in the chunk of the parsed characters, or fails with 'failure'.

Attributes

def regexChar[Err](regex: Regex, failure: Err): ParseRegexLastChar[Err]

Parser that executes a regular expression on the input and results in the last parsed character, or fails with 'failure'. Useful for regexes that are known to parse a single character.

Parser that executes a regular expression on the input and results in the last parsed character, or fails with 'failure'. Useful for regexes that are known to parse a single character.

Attributes

def regexDiscard[Err](regex: Regex, failure: Err): Parser[Err, Char, Unit]

Parser that executes a regular expression on the input but discards its result, and fails with 'failure' if the regex fails

Parser that executes a regular expression on the input but discards its result, and fails with 'failure' if the regex fails

Attributes

def string[Result](str: String, value: Result): Parser[String, Char, Result]

Parser that requires a given string 'str' and in case it could read it, results in 'value'

Parser that requires a given string 'str' and in case it could read it, results in 'value'

Attributes

def succeed[Result](value: Result): Parser[Nothing, Any, Result]

Parser that does not consume any input and succeeds with 'value'

Parser that does not consume any input and succeeds with 'value'

Attributes

def unsafeRegex(regex: Regex): ParseRegex[Nothing]

Parser that executes a regular expression on the input and results in the chunk of the parsed characters. The regex is supposed to never fail.

Parser that executes a regular expression on the input and results in the chunk of the parsed characters. The regex is supposed to never fail.

Attributes

Parser that executes a regular expression on the input and results in the last parsed character. The regex is supposed to never fail. Useful for regexes that are known to parse a single character.

Parser that executes a regular expression on the input and results in the last parsed character. The regex is supposed to never fail. Useful for regexes that are known to parse a single character.

Attributes

def unsafeRegexDiscard(regex: Regex): Parser[Nothing, Char, Unit]

Parser that executes a regular expression on the input but discards its result. The regex is supposed to never fail.

Parser that executes a regular expression on the input but discards its result. The regex is supposed to never fail.

Attributes

Concrete fields

lazy val alphaNumeric: Parser[String, Char, Char]

Parser of a single alpha-numeric character

Parser of a single alpha-numeric character

Attributes

val anyChar: Parser[Nothing, Char, Char]

Parser that consumes a single character and returns it

Parser that consumes a single character and returns it

Attributes

val anyString: Parser[Nothing, Char, String]

Parser that consumes the whole input and captures it as a string

Parser that consumes the whole input and captures it as a string

Attributes

lazy val digit: Parser[String, Char, Char]

Parser of a single digit

Parser of a single digit

Attributes

lazy val end: Parser[Nothing, Any, Unit]

Parser that only succeeds if the input stream has been consumed fully.

Parser that only succeeds if the input stream has been consumed fully.

This can be used to require that a parser consumes the full input.

Attributes

lazy val ignoreRest: Parser[Nothing, Char, Unit]

Parser that consumes and discards all the remaining input

Parser that consumes and discards all the remaining input

Attributes

lazy val index: Parser[Nothing, Any, Int]

Parser that results in the current input stream position

Parser that results in the current input stream position

Attributes

lazy val letter: Parser[String, Char, Char]

Parser of a single letter

Parser of a single letter

Attributes

lazy val unit: Parser[Nothing, Any, Unit]

Parser that does not consume the input and results in unit

Parser that does not consume the input and results in unit

Attributes

lazy val whitespace: Parser[String, Char, Char]

Parser of a single whitespace character

Parser of a single whitespace character

Attributes