Transform

zio.parser.Parser.Transform
final case class Transform[Err, Err2, In, Result, Result2](parser: Parser[Err, In, Result], to: Result => Result2) extends Parser[Err2, In, Result2]

Attributes

Graph
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

Members list

Value members

Inherited methods

final def *: Parser[Err2, In, Chunk[Result2]]

Symbolic alias for repeat0

Symbolic alias for repeat0

Attributes

Inherited from:
Parser
final def +: Parser[Err2, In, Chunk[Result2]]

Symbolic alias for repeat

Symbolic alias for repeat

Attributes

Inherited from:
Parser
final def <+>[Err2 >: Err2, In2 <: In, Result2](that: => Parser[Err2, In2, Result2]): Parser[Err2, In2, Either[Result2, Result2]]

Symbolic alias for orElseEither

Symbolic alias for orElseEither

Attributes

Inherited from:
Parser
final def <>[Err2 >: Err2, In2 <: In, Result2 >: Result2](that: => Parser[Err2, In2, Result2]): Parser[Err2, In2, Result2]

Symbolic alias for orElse

Symbolic alias for orElse

Attributes

Inherited from:
Parser
final def <~[Err2 >: Err2, In2 <: In, Result2](that: => Parser[Err2, In2, Unit]): Parser[Err2, In2, Result2]

Symbolic alias for zipLeft

Symbolic alias for zipLeft

Attributes

Inherited from:
Parser
final def ?: Parser[Err2, In, Option[Result2]]

Symbolic alias for optional

Symbolic alias for optional

Attributes

Inherited from:
Parser
final def ??(name: String): Parser[Err2, In, Result2]

Symbolic alias for named

Symbolic alias for named

Attributes

Inherited from:
Parser
final def as[Result2](result: Result2): Parser[Err2, In, Result2]

Ignores the parser's successful result and result in 'result' instead

Ignores the parser's successful result and result in 'result' instead

Attributes

Inherited from:
Parser
final def atLeast(min: Int): Parser[Err2, In, Chunk[Result2]]

Repeats this parser at least 'min' times.

Repeats this parser at least 'min' times.

The result is all the parsed elements until the first failure. The failure that stops the repetition gets swallowed and in case auto-backtracking is on, the parser backtracks to the end of the last successful item.

Attributes

Inherited from:
Parser
final def autoBacktracking: Parser[Err2, In, Result2]

Enables auto-backtracking for this parser

Enables auto-backtracking for this parser

Attributes

Inherited from:
Parser
final def backtrack: Parser[Err2, In, Result2]

Parser that resets the parsing position in case it fails.

Parser that resets the parsing position in case it fails.

By default backtracking points are automatically inserted. This behavior can be changed with the autoBacktracking, manualBacktracking and setAutoBacktracking combinators.

Attributes

Inherited from:
Parser
final def between[Err2 >: Err2, In2 <: In](left: Parser[Err2, In2, Any], right: Parser[Err2, In2, Any]): Parser[Err2, In2, Result2]

Concatenates the parsers 'left', then this, then 'right'.

Concatenates the parsers 'left', then this, then 'right'.

All three must succeed. The result is this parser's result.

Attributes

Inherited from:
Parser
final def exactly(n: Int): Parser[Err2, In, Chunk[Result2]]

Repeats this parser exactly N times

Repeats this parser exactly N times

Attributes

Inherited from:
Parser
final def filter[Result2, Err2 >: Err2](condition: Result2 => Boolean, failure: Err2)(implicit ev: Result2 <:< Result2): Parser[Err2, In, Result2]

Checks the result of this parser with the given function. If the 'condition' is false, fails with the given failure 'failure', otherwise results in the this parser's result.

Checks the result of this parser with the given function. If the 'condition' is false, fails with the given failure 'failure', otherwise results in the this parser's result.

Attributes

Inherited from:
Parser
final def flatMap[Err2 >: Err2, In2 <: In, Result2](that: Result2 => Parser[Err2, In2, Result2]): Parser[Err2, In2, Result2]

Determines the continuation of the parser by the result of this parser, expressed by the function 'that'

Determines the continuation of the parser by the result of this parser, expressed by the function 'that'

Attributes

Inherited from:
Parser
final def flatten(implicit ev2: Result2 <:< Chunk[String]): Parser[Err2, In, String]

Flattens a result of parsed strings to a single string

Flattens a result of parsed strings to a single string

Attributes

Inherited from:
Parser
final def manualBacktracking: Parser[Err2, In, Result2]

Turns off auto-backtracking for this parser

Turns off auto-backtracking for this parser

Attributes

Inherited from:
Parser
final def map[Result2](to: Result2 => Result2): Parser[Err2, In, Result2]

Maps the parser's successful result with the given function 'to'

Maps the parser's successful result with the given function 'to'

Attributes

Inherited from:
Parser
final def mapError[Err2](f: Err2 => Err2): Parser[Err2, In, Result2]

Maps the error with the given function 'f'

Maps the error with the given function 'f'

Attributes

Inherited from:
Parser
final def named(name: String): Parser[Err2, In, Result2]

Associates a name with this parser. The chain of named parsers are reported in case of failure to help debugging parser issues.

Associates a name with this parser. The chain of named parsers are reported in case of failure to help debugging parser issues.

Attributes

Inherited from:
Parser
final def not[Err2 >: Err2](failure: => Err2): Parser[Err2, In, Unit]

Parser that fails with the given 'failure' if this parser succeeds

Parser that fails with the given 'failure' if this parser succeeds

Attributes

Inherited from:
Parser
final def optional: Parser[Err2, In, Option[Result2]]

Make this parser optional.

Make this parser optional.

Failure of this parser will be ignored. In case auto-backtracking is enabled, backtracking is performed on it.

Attributes

Inherited from:
Parser
final def orElse[Err2 >: Err2, In2 <: In, Result2 >: Result2](that: => Parser[Err2, In2, Result2]): Parser[Err2, In2, Result2]

Assigns 'that' parser as a fallback of this. First this parser gets evaluated. In case it succeeds, the result is this parser's result. In case it fails, the result is 'that' parser's result.

Assigns 'that' parser as a fallback of this. First this parser gets evaluated. In case it succeeds, the result is this parser's result. In case it fails, the result is 'that' parser's result.

If auto-backtracking is on, this parser will backtrack before trying 'that' parser.

Attributes

Inherited from:
Parser
final def orElseEither[Err2 >: Err2, In2 <: In, Result2](that: => Parser[Err2, In2, Result2]): Parser[Err2, In2, Either[Result2, Result2]]

Assigns 'that' parser as a fallback of this. First this parser gets evaluated. In case it succeeds, the result is this parser's result wrapped in 'Left'. In case it fails, the result is 'that' parser's result, wrapped in 'Right'.

Assigns 'that' parser as a fallback of this. First this parser gets evaluated. In case it succeeds, the result is this parser's result wrapped in 'Left'. In case it fails, the result is 'that' parser's result, wrapped in 'Right'.

Compared to orElse, this version allows the two parsers to have different result types.

If auto-backtracking is on, this parser will backtrack before trying 'that' parser.

Attributes

Inherited from:
Parser
final def orElseU[Err2 >: Err2, In2 <: In, Result2](that: => Parser[Err2, In2, Result2]): Parser[Err2, In2, Result2 | Result2]

Assigns 'that' parser as a fallback of this. First this parser gets evaluated. In case it succeeds, the result is this parser's result. In case it fails, the result is 'that' parser's result.

Assigns 'that' parser as a fallback of this. First this parser gets evaluated. In case it succeeds, the result is this parser's result. In case it fails, the result is 'that' parser's result.

If auto-backtracking is on, this parser will backtrack before trying 'that' parser.

Attributes

Inherited from:
VersionSpecificParser
final def parseChars(input: Chunk[Char], parserImplementation: ParserImplementation)(implicit ev: Char <:< In): Either[StringParserError[Err2], Result2]

Run this parser on the given 'input' chunk of characters using a specific parser implementation

Run this parser on the given 'input' chunk of characters using a specific parser implementation

Attributes

Inherited from:
Parser
final def parseChars(input: Chunk[Char])(implicit ev: Char <:< In): Either[StringParserError[Err2], Result2]

Run this parser on the given 'input' chunk of characters

Run this parser on the given 'input' chunk of characters

Attributes

Inherited from:
Parser
final def parseChunk[In0 <: In](input: Chunk[In0])(implicit stateSelector: StateSelector[In0]): Either[ParserError[Err2], Result2]

Run this parser on the given 'input' chunk

Run this parser on the given 'input' chunk

Attributes

Inherited from:
Parser
final def parseString(input: String, parserImplementation: ParserImplementation)(implicit ev: Char <:< In): Either[StringParserError[Err2], Result2]

Run this parser on the given 'input' string using a specific parser implementation

Run this parser on the given 'input' string using a specific parser implementation

Attributes

Inherited from:
Parser
final def parseString(input: String)(implicit ev: Char <:< In): Either[StringParserError[Err2], Result2]

Run this parser on the given 'input' string

Run this parser on the given 'input' string

Attributes

Inherited from:
Parser
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def repeat: Parser[Err2, In, Chunk[Result2]]

Repeats this parser at least once.

Repeats this parser at least once.

The result is all the parsed elements until the first failure. The failure that stops the repetition gets swallowed and in case auto-backtracking is on, the parser backtracks to the end of the last successful item.

Attributes

Inherited from:
Parser
final def repeat0: Parser[Err2, In, Chunk[Result2]]

Repeats this parser zero or more times.

Repeats this parser zero or more times.

The result is all the parsed elements until the first failure. The failure that stops the repetition gets swallowed and in case auto-backtracking is on, the parser backtracks to the end of the last successful item.

Attributes

Inherited from:
Parser
final def repeatUntil[Err2 >: Err2, In2 <: In](stopCondition: Parser[Err2, In2, Any]): Parser[Err2, In2, Chunk[Result2]]

Repeats this parser until the given stopCondition parser succeeds.

Repeats this parser until the given stopCondition parser succeeds.

Attributes

Inherited from:
Parser
final def repeatWithSep[Err2 >: Err2, In2 <: In](sep: Parser[Err2, In2, Unit]): Parser[Err2, In2, Chunk[Result2]]

Repeats this parser at least once and requires that between each element, the 'sep' parser succeeds

Repeats this parser at least once and requires that between each element, the 'sep' parser succeeds

Attributes

Inherited from:
Parser
final def repeatWithSep0[Err2 >: Err2, In2 <: In](sep: Parser[Err2, In2, Unit]): Parser[Err2, In2, Chunk[Result2]]

Repeats this parser zero or more times and requires that between each element, the 'sep' parser succeeds

Repeats this parser zero or more times and requires that between each element, the 'sep' parser succeeds

Attributes

Inherited from:
Parser
final def setAutoBacktracking(enabled: Boolean): Parser[Err2, In, Result2]

Enables or disables auto-backtracking for this parser

Enables or disables auto-backtracking for this parser

Attributes

Inherited from:
Parser
final def string(implicit ev: Char <:< In): Parser[Err2, Char, String]

Ignores this parser's result and instead capture the parsed string fragment

Ignores this parser's result and instead capture the parsed string fragment

Attributes

Inherited from:
Parser
def strip: Parser[Err2, In, Result2]

Strips all the name information from this parser to improve performance but reduces the failure message's verbosity.

Strips all the name information from this parser to improve performance but reduces the failure message's verbosity.

Attributes

Inherited from:
Parser
final def surroundedBy[Err2 >: Err2, In2 <: In](other: Parser[Err2, In2, Any]): Parser[Err2, In2, Result2]

Surrounds this parser with the 'other' parser. The result is this parser's result.

Surrounds this parser with the 'other' parser. The result is this parser's result.

Attributes

Inherited from:
Parser
final def transformEither[Err2, Result2](to: Result2 => Either[Err2, Result2]): Parser[Err2, In, Result2]

Maps the parser's successful result with the given function 'to' that either fails or produces a new result value.

Maps the parser's successful result with the given function 'to' that either fails or produces a new result value.

Attributes

Inherited from:
Parser
final def transformOption[Result2](to: Result2 => Option[Result2]): Parser[Option[Err2], In, Result2]

Maps the parser's successful result with the given function 'to' that either produces a new result value or the failure is indicated in the error channel by the value None.

Maps the parser's successful result with the given function 'to' that either produces a new result value or the failure is indicated in the error channel by the value None.

Attributes

Inherited from:
Parser
final def unit: Parser[Err2, In, Unit]

Parser that does not consume any input and produces the unit value

Parser that does not consume any input and produces the unit value

Attributes

Inherited from:
Parser
final def zip[Err2 >: Err2, In2 <: In, Result2, ZippedResult](that: => Parser[Err2, In2, Result2])(implicit zippable: Out[Result2, Result2, ZippedResult]): Parser[Err2, In2, ZippedResult]

Concatenates this parser with 'that' parser. In case both parser succeeds, the result is a pair of the results.

Concatenates this parser with 'that' parser. In case both parser succeeds, the result is a pair of the results.

Attributes

Inherited from:
Parser
final def zipLeft[Err2 >: Err2, In2 <: In, Result2](that: => Parser[Err2, In2, Any]): Parser[Err2, In2, Result2]

Concatenates this parser with 'that' parser. In case both parser succeeds, the result is the result of this parser. Otherwise the parser fails.

Concatenates this parser with 'that' parser. In case both parser succeeds, the result is the result of this parser. Otherwise the parser fails.

Attributes

Inherited from:
Parser
final def |[Err2 >: Err2, In2 <: In, Result2 >: Result2](that: => Parser[Err2, In2, Result2]): Parser[Err2, In2, Result2]

Symbolic alias for orElse

Symbolic alias for orElse

Attributes

Inherited from:
Parser
final def ~[Err2 >: Err2, In2 <: In, Result2, ZippedResult](that: => Parser[Err2, In2, Result2])(implicit zippable: Out[Result2, Result2, ZippedResult]): Parser[Err2, In2, ZippedResult]

Symbolic alias for zip

Symbolic alias for zip

Attributes

Inherited from:
Parser

Inherited fields

Attributes

Inherited from:
Parser

Attributes

Inherited from:
Parser
lazy val optimized: Parser[Err2, In, Result2]

The optimized parser tree used by the parser implementations

The optimized parser tree used by the parser implementations

Attributes

Inherited from:
Parser