Parsing Documentation

Classes

Lazy

A parser that waits for a call to its parse(_:) method before running the given closure to create a parser for the given input.

Structures

Always

A parser that always succeeds by returning the provided value, but does not consume any of its input.

Any​Parser

A type-erased parser of Output from Input.

Parsers.​Bool​Parser

A parser that consumes a Boolean value from the beginning of a collection of UTF-8 code units.

Parsers.​Substring​Bool​Parser

A parser that consumes a Boolean value from the beginning of a substring.

Parsers.​Compact​Map

A parser that outputs the non-nil results of calling the given transformation with the output of its upstream parser.

Parsers.​Double​Parser

A parser that consumes a double from the beginning of a collection of UTF-8 code units.

Parsers.​Substring​Double​Parser

A parser that consumes a double from the beginning of a substring.

Parsers.​Float​Parser

A parser that consumes a float from the beginning of a collection of UTF-8 code units.

Parsers.​Substring​Float​Parser

A parser that consumes a float from the beginning of a substring.

Parsers.​Float80Parser

A parser that consumes a float from the beginning of a collection of UTF-8 code units.

Parsers.​Substring​Float80Parser

A parser that consumes a float from the beginning of a substring.

End

A parser that succeeds if the input is empty, and fails otherwise.

Fail

A parser that always fails, no matter the input.

Parsers.​Filter

A parser that filters the output of an upstream parser when it does not satisfy a predicate.

First

A parser that consumes the first element from a collection.

First​Where
Parsers.​Flat​Map

A parser that transforms the output of another parser into a new parser.

Parsers.​Int​Parser

A parser that consumes an integer (with an optional leading + or - sign) from the beginning of a collection of UTF8 code units.

Parsers.​Substring​Int​Parser

A parser that consumes an integer (with an optional leading + or - sign) from the beginning of a substring using a UTF-8 parser.

Many

A parser that attempts to run another parser as many times as specified, accumulating the result of the outputs.

Parsers.​Map

A parser that transforms the output of another parser with a given closure.

Newline

A parser that consumes a single newline from the beginning of the input.

One​OfMany

A parser that attempts to run a number of parsers till one succeeds.

Parsers.​One​Of

A parser that runs the first parser and, if it fails, runs the second parser.

Parsers.​Optional​Parser

A parser that parses nil when its upstream parser fails.

Parsers.​Pipe

A parser that runs this parser, pipes its output into the given parser, and returns the output of the given parser.

Prefix

A parser that consumes a subsequence from the beginning of its input.

Prefix​Through

A parser that consumes a subsequence from the beginning of its input through a given sequence of elements.

Prefix​UpTo

A parser that consumes a subsequence from the beginning of its input up to a given sequence of elements.

Parsers.​Pullback

Transforms the Input of a downstream parser.

Rest

A parser that consumes everything to the end of the collection and returns it as its output.

Skip

A parser that discards the output of another parser.

Parsers.​Skip​First

A parser that runs two parsers, one after the other, taking only the output of the second parser.

Parsers.​Skip​Second

A parser that runs two parsers, one after the other, taking only the output of the first parser.

Starts​With

A parser that parses a sequence of elements from its input.

Parsers.​Stream

A parser that can parse streams of input.

Parsers.​Take2

A parser that runs two parsers, one after the other, and returns both outputs in a tuple.

Parsers.​Take3

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Take4

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Take5

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.\

Parsers.​Take6

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Take7

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Take8

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Take9

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Take10

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Take11

A parser that runs a parser of a tuple of outputs and another parser, one after the other, and returns a flattened tuple of the first parser's outputs and the second parser's output.

Parsers.​Substring​ToUTF8View

A parser that transforms a parser on Substring into a parser on Substring.UTF8View.

Parsers.​Unicode​Scalar​View​ToUTF8View

A parser that transforms a parser on Substring.UnicodeScalarView into a parser on Substring.UTF8View.

Parsers.​Substring​ToUnicode​Scalars

A parser that transforms a parser on Substring into a parser on Substring.UnicodeScalarView.

Whitespace

A parser that consumes all ASCII whitespace from the beginning of the input.

Enumerations

Conditional

A parser that can parse output from two types of parsers.

Parsers

A namespace for types that serve as parsers.

Protocols

Parser

Declares a type that can parse an Input value into an Output value.

Extensions

Bool
Double
FixedWidthInteger
Float
Optional
Parsers.StartsWith