Daniel Lyons' Notes

swift-parsing

Name Use Case Input type Output type
Alphanumerics A parser that consumes one or more alphanumeric characters. String Substring
Always Documentation A parser that always succeeds with a given value without consuming input. Input Output
Bool A parser that consumes a Boolean value from the beginning of a string. String Bool
CharacterSet A parser that consumes characters matching a character set. String Character
Conditional Documentation A parser that conditionally applies one of two parsers based on a predicate.

Use if syntax with ResultBuilder
Any Conditional output
Digits A parser that consumes one or more digit characters. String Substring
Double A parser that parses floating-point numbers from string input. String Double
End A parser that succeeds only if the input is at the end (empty). Collection Void
Fail Documentation A parser that always fails with an optional error message. Any Never
Float A parser that parses single-precision floating-point numbers from string input. String Float
Int A parser that parses signed integers from string input. String Int
Lazy A parser that defers the creation of another parser until parse time. Any Other parser's output
Letters A parser that consumes one or more letter characters. String Substring
Literal A parser that matches and consumes a specific literal string or sequence. Collection Void
Many Docs A parser that applies another parser zero or more times. Any [Element]
Not A parser that succeeds only if another parser fails, without consuming input. Any Void
OneOf A parser that tries multiple parsers in order until one succeeds. Any First successful parser's output
Peek Documentation A parser that runs another parser without consuming input. Any Other parser's output
PrefixThrough A parser that consumes a subsequence from the beginning of its input through a given sequence of elements. Collection Input.Subsequence
PrefixUpTo Docs A parser that consumes a subsequence from the beginning of its input up to a given sequence of elements. Collection Input.Subsequence
PrefixWhile A parser that consumes a subsequence from the beginning of its input while elements satisfy a predicate. Collection Input.Subsequence
Rest A parser that consumes all remaining input. Collection Input.Subsequence
Skip A parser that consumes and discards elements without producing output. Collection Void
SkipWhile A parser that consumes and discards elements while they satisfy a predicate. Collection Void
StartsWith A parser that succeeds if the input starts with a given sequence, consuming it. Collection Void
Take A parser that consumes a fixed number of elements from the beginning of its input. Collection Input.Subsequence
TakeUntil A parser that consumes elements from the beginning of its input until encountering a specified element or subsequence. Collection Input.Subsequence
TakeWhile A parser that consumes elements from the beginning of its input while they satisfy a predicate. Collection Input.Subsequence
UInt A parser that parses unsigned integers from string input. String UInt
UUID A parser that parses UUID strings into UUID objects. String UUID
Whitespace A parser that consumes whitespace characters. String Void
swift-parsing
Interactive graph