diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d86995350b..2d2d1f2be5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -11,16 +11,16 @@ on:
jobs:
macos_tests:
- runs-on: macos-11
+ runs-on: macos-12
strategy:
matrix:
xcode:
- - "13.2.1" # Swift 5.5
+ - "14.2" # Swift 5.7.2
command:
- test
- - benchmarks
+ # - benchmarks
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: System
@@ -31,22 +31,13 @@ jobs:
ubuntu_tests:
strategy:
matrix:
- os: [ubuntu-18.04, ubuntu-20.04]
+ os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Build
run: swift build
- name: Run tests
run: swift test
-
- windows_tests:
- runs-on: windows-2019
-
- steps:
- - uses: actions/checkout@v2
- - uses: MaxDesiatov/swift-windows-action@v1
- with:
- swift-version: "5.5.1"
diff --git a/Makefile b/Makefile
index 2fe6249454..3530a1f596 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro
PLATFORM_MACOS = macOS
-PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p)
+PLATFORM_TVOS = tvOS Simulator,name=Apple TV
default: test
diff --git a/Package.swift b/Package.swift
index acd163bd56..0ec8c0b25c 100644
--- a/Package.swift
+++ b/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version:5.5
+// swift-tools-version:5.7
import PackageDescription
@@ -18,9 +18,10 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.5.0"),
+ .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "0.8.0"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "0.2.1"),
- .package(name: "Benchmark", url: "https://github.com/google/swift-benchmark", from: "0.1.1"),
+ .package(url: "https://github.com/google/swift-benchmark", from: "0.1.1"),
],
targets: [
.target(
@@ -37,19 +38,8 @@ let package = Package(
name: "swift-parsing-benchmark",
dependencies: [
"Parsing",
- .product(name: "Benchmark", package: "Benchmark"),
+ .product(name: "Benchmark", package: "swift-benchmark"),
]
),
- .executableTarget(
- name: "variadics-generator",
- dependencies: [.product(name: "ArgumentParser", package: "swift-argument-parser")]
- ),
]
)
-
-#if swift(>=5.6)
- // Add the documentation compiler plugin if possible
- package.dependencies.append(
- .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
- )
-#endif
diff --git a/README.md b/README.md
index 75988d55d8..171f0e9203 100644
--- a/README.md
+++ b/README.md
@@ -103,22 +103,26 @@ It would be more straightforward and efficient to instead describe how to consum
We can start by describing what it means to parse a single row, first by parsing an integer off the front of the string, and then parsing a comma. We can do this by using the `Parse` type, which acts as an entry point into describing a list of parsers that you want to run one after the other to consume from an input:
```swift
-let user = Parse {
+let user = Parse(input: Substring.self) {
Int.parser()
","
}
```
+Note that this parsing library is quite general, allowing one to parse _any_ kind of input into
+_any_ kind of output. For this reason we sometimes need to specify the exact input type the parser
+can process, in this case substrings.
+
Already this can consume the beginning of the input:
```swift
-try user.parse("1,") // 1
+try user.parse("1,") // 1
```
Next we want to take everything up until the next comma for the user's name, and then consume the comma:
```swift
-let user = Parse {
+let user = Parse(input: Substring.self) {
Int.parser()
","
Prefix { $0 != "," }
@@ -129,7 +133,7 @@ let user = Parse {
And then we want to take the boolean at the end of the row for the user's admin status:
```swift
-let user = Parse {
+let user = Parse(input: Substring.self) {
Int.parser()
","
Prefix { $0 != "," }
@@ -141,7 +145,7 @@ let user = Parse {
Currently this will parse a tuple `(Int, Substring, Bool)` from the input, and we can `.map` on that to turn it into a `User`:
```swift
-let user = Parse {
+let user = Parse(input: Substring.self) {
Int.parser()
","
Prefix { $0 != "," }
@@ -154,7 +158,7 @@ let user = Parse {
To make the data we are parsing to more prominent, we can instead pass the transform closure as the first argument to `Parse`:
```swift
-let user = Parse {
+let user = Parse(input: Substring.self) {
User(id: $0, name: String($1), isAdmin: $2)
} with: {
Int.parser()
@@ -168,7 +172,7 @@ let user = Parse {
Or we can pass the `User` initializer to `Parse` in a point-free style by transforming the `Prefix` parser's output from a `Substring` to ` String` first:
```swift
-let user = Parse(User.init(id:name:isAdmin:)) {
+let user = Parse(input: Substring.self, User.init(id:name:isAdmin:)) {
Int.parser()
","
Prefix { $0 != "," }.map(String.init)
@@ -305,46 +309,47 @@ Apple M1 Pro (10 cores, 8 performance and 2 efficiency)
name time std iterations
----------------------------------------------------------------------------------
-Arithmetic.Parser 8042.000 ns ± 5.91 % 174657
-BinaryData.Parser 42.000 ns ± 56.81 % 1000000
-Bool.Bool.init 41.000 ns ± 60.69 % 1000000
-Bool.Bool.parser 42.000 ns ± 57.28 % 1000000
-Bool.Scanner.scanBool 1041.000 ns ± 25.98 % 1000000
-Color.Parser 209.000 ns ± 13.68 % 1000000
-CSV.Parser 4047750.000 ns ± 1.18 % 349
-CSV.Ad hoc mutating methods 898604.000 ns ± 1.49 % 1596
-Date.Parser 6416.000 ns ± 2.56 % 219218
-Date.DateFormatter 25625.000 ns ± 2.19 % 54110
-Date.ISO8601DateFormatter 35125.000 ns ± 1.71 % 39758
-HTTP.HTTP 9709.000 ns ± 3.81 % 138868
-JSON.Parser 32292.000 ns ± 3.18 % 41890
-JSON.JSONSerialization 1833.000 ns ± 8.58 % 764057
-Numerics.Int.init 41.000 ns ± 84.54 % 1000000
-Numerics.Int.parser 42.000 ns ± 72.17 % 1000000
-Numerics.Scanner.scanInt 125.000 ns ± 20.26 % 1000000
-Numerics.Comma separated: Int.parser 8096459.000 ns ± 0.44 % 173
-Numerics.Comma separated: Scanner.scanInt 49178770.500 ns ± 0.24 % 28
-Numerics.Comma separated: String.split 14922583.500 ns ± 0.67 % 94
-Numerics.Double.init 42.000 ns ± 72.61 % 1000000
-Numerics.Double.parser 125.000 ns ± 58.57 % 1000000
-Numerics.Scanner.scanDouble 167.000 ns ± 18.84 % 1000000
-Numerics.Comma separated: Double.parser 11313395.500 ns ± 0.96 % 124
-Numerics.Comma separated: Scanner.scanDouble 50431521.000 ns ± 0.19 % 28
-Numerics.Comma separated: String.split 18744125.000 ns ± 0.46 % 75
-PrefixUpTo.Parser: Substring 249958.000 ns ± 0.88 % 5595
-PrefixUpTo.Parser: UTF8 13250.000 ns ± 2.96 % 105812
-PrefixUpTo.String.range(of:) 43084.000 ns ± 1.57 % 32439
-PrefixUpTo.Scanner.scanUpToString 47500.000 ns ± 1.27 % 29444
-Race.Parser 34417.000 ns ± 2.73 % 40502
-README Example.Parser: Substring 4000.000 ns ± 3.79 % 347868
-README Example.Parser: UTF8 1125.000 ns ± 7.92 % 1000000
-README Example.Ad hoc 3542.000 ns ± 4.13 % 394248
-README Example.Scanner 14292.000 ns ± 2.82 % 97922
-String Abstractions.Substring 934167.000 ns ± 0.60 % 1505
-String Abstractions.UTF8 158750.000 ns ± 1.36 % 8816
-UUID.UUID.init 209.000 ns ± 15.02 % 1000000
-UUID.UUID.parser 208.000 ns ± 24.17 % 1000000
-Xcode Logs.Parser 3768437.500 ns ± 0.56 % 372
+Arithmetic.Parser 6166.000 ns ± 10.73 % 228888
+BinaryData.Parser 208.000 ns ± 39.64 % 1000000
+Bool.Bool.init 41.000 ns ± 84.71 % 1000000
+Bool.Bool.parser 42.000 ns ± 87.86 % 1000000
+Bool.Scanner.scanBool 916.000 ns ± 30.55 % 1000000
+Color.Parser 208.000 ns ± 28.34 % 1000000
+CSV.Parser 3675250.000 ns ± 1.16 % 380
+CSV.Ad hoc mutating methods 651333.000 ns ± 1.00 % 2143
+Date.Parser 5833.000 ns ± 5.65 % 238924
+Date.DateFormatter 23542.000 ns ± 5.50 % 58766
+Date.ISO8601DateFormatter 29041.000 ns ± 3.31 % 48028
+HTTP.HTTP 10250.000 ns ± 6.24 % 135657
+JSON.Parser 38167.000 ns ± 3.26 % 36423
+JSON.JSONSerialization 1792.000 ns ± 54.14 % 753770
+Numerics.Int.init 0.000 ns ± inf % 1000000
+Numerics.Int.parser 83.000 ns ± 67.28 % 1000000
+Numerics.Scanner.scanInt 125.000 ns ± 38.65 % 1000000
+Numerics.Digits 83.000 ns ± 65.03 % 1000000
+Numerics.Comma separated: Int.parser 15364583.000 ns ± 0.63 % 91
+Numerics.Comma separated: Scanner.scanInt 50654458.500 ns ± 0.30 % 28
+Numerics.Comma separated: String.split 15452542.000 ns ± 1.30 % 90
+Numerics.Double.init 42.000 ns ± 152.57 % 1000000
+Numerics.Double.parser 166.000 ns ± 45.23 % 1000000
+Numerics.Scanner.scanDouble 167.000 ns ± 42.36 % 1000000
+Numerics.Comma separated: Double.parser 18539833.000 ns ± 0.57 % 75
+Numerics.Comma separated: Scanner.scanDouble 55239167.000 ns ± 0.46 % 25
+Numerics.Comma separated: String.split 17636000.000 ns ± 1.34 % 78
+PrefixUpTo.Parser: Substring 182041.000 ns ± 1.78 % 7643
+PrefixUpTo.Parser: UTF8 40417.000 ns ± 2.71 % 34379
+PrefixUpTo.String.range(of:) 49792.000 ns ± 2.70 % 27891
+PrefixUpTo.Scanner.scanUpToString 53959.000 ns ± 3.87 % 25745
+Race.Parser 59583.000 ns ± 2.78 % 23333
+README Example.Parser: Substring 2834.000 ns ± 12.87 % 488264
+README Example.Parser: UTF8 1291.000 ns ± 22.65 % 1000000
+README Example.Ad hoc 2459.000 ns ± 20.61 % 561930
+README Example.Scanner 12084.000 ns ± 5.53 % 115388
+String Abstractions.Substring 472083.500 ns ± 1.38 % 2962
+String Abstractions.UTF8 196041.000 ns ± 3.38 % 7059
+UUID.UUID.init 208.000 ns ± 43.60 % 1000000
+UUID.UUID.parser 167.000 ns ± 42.00 % 1000000
+Xcode Logs.Parser 4511625.500 ns ± 0.58 % 226
```
## Documentation
diff --git a/Sources/Parsing/Builders/OneOfBuilder.swift b/Sources/Parsing/Builders/OneOfBuilder.swift
index 150babbe39..e1f69d9c47 100644
--- a/Sources/Parsing/Builders/OneOfBuilder.swift
+++ b/Sources/Parsing/Builders/OneOfBuilder.swift
@@ -17,7 +17,7 @@
/// try currency.parse("$100") // (.usd, 100)
/// ```
@resultBuilder
-public enum OneOfBuilder {
+public enum OneOfBuilder {
/// Provides support for `for`-`in` loops in ``OneOfBuilder`` blocks.
///
/// Useful for building up a parser from a dynamic source, like for a case-iterable enum:
@@ -36,23 +36,23 @@ public enum OneOfBuilder {
/// }
/// ```
@inlinable
- public static func buildArray
(_ parsers: [P]) -> Parsers.OneOfMany
{
+ public static func buildArray
(_ parsers: [P]) -> Parsers.OneOfMany
+ where P.Input == Input, P.Output == Output {
.init(parsers)
}
+ @inlinable
+ static public func buildBlock() -> Fail {
+ Fail()
+ }
+
/// Provides support for specifying a parser in ``OneOfBuilder`` blocks.
@inlinable
- static public func buildBlock(_ parser: P) -> P {
+ static public func buildBlock(_ parser: P) -> P
+ where P.Input == Input, P.Output == Output {
parser
}
- #if swift(<5.7)
- @inlinable
- static public func buildBlock(_ p0: P0, _ p1: P1) -> OneOf2 {
- OneOf2(p0, p1)
- }
- #endif
-
/// Provides support for `if`-`else` statements in ``OneOfBuilder`` blocks, producing a
/// conditional parser for the `if` branch.
///
@@ -68,7 +68,13 @@ public enum OneOfBuilder {
@inlinable
public static func buildEither(
first parser: TrueParser
- ) -> Parsers.Conditional {
+ ) -> Parsers.Conditional
+ where
+ TrueParser.Input == Input,
+ TrueParser.Output == Output,
+ FalseParser.Input == Input,
+ FalseParser.Output == Output
+ {
.first(parser)
}
@@ -87,10 +93,22 @@ public enum OneOfBuilder {
@inlinable
public static func buildEither(
second parser: FalseParser
- ) -> Parsers.Conditional {
+ ) -> Parsers.Conditional
+ where
+ TrueParser.Input == Input,
+ TrueParser.Output == Output,
+ FalseParser.Input == Input,
+ FalseParser.Output == Output
+ {
.second(parser)
}
+ @inlinable
+ public static func buildExpression(_ parser: P) -> P
+ where P.Input == Input, P.Output == Output {
+ parser
+ }
+
/// Provides support for `if` statements in ``OneOfBuilder`` blocks, producing an optional parser.
///
/// ```swift
@@ -106,24 +124,27 @@ public enum OneOfBuilder {
/// }
/// ```
@inlinable
- public static func buildIf(_ parser: P?) -> OptionalOneOf
{
+ public static func buildIf
(_ parser: P?) -> OptionalOneOf
where P.Input == Input {
.init(wrapped: parser)
}
/// Provides support for `if #available` statements in ``OneOfBuilder`` blocks, producing an
/// optional parser.
@inlinable
- public static func buildLimitedAvailability
(_ parser: P?) -> OptionalOneOf
{
+ public static func buildLimitedAvailability
(_ parser: P?) -> OptionalOneOf
+ where P.Input == Input, P.Output == Output {
.init(wrapped: parser)
}
@inlinable
- public static func buildPartialBlock(first: P0) -> P0 {
+ public static func buildPartialBlock(first: P) -> P
+ where P.Input == Input, P.Output == Output {
first
}
@inlinable
- public static func buildPartialBlock(accumulated: P0, next: P1) -> OneOf2 {
+ public static func buildPartialBlock(accumulated: P0, next: P1) -> OneOf2
+ where P0.Input == Input, P0.Output == Output, P1.Input == Input, P1.Output == Output {
.init(accumulated, next)
}
@@ -211,3 +232,22 @@ extension OneOfBuilder.OptionalOneOf: ParserPrinter where Wrapped: ParserPrinter
try wrapped.print(output, into: &input)
}
}
+
+extension OneOfBuilder where Input == Substring {
+ @_disfavoredOverload
+ public static func buildExpression(_ parser: P)
+ -> From
+ where P.Input == Substring.UTF8View {
+ From(.utf8) {
+ parser
+ }
+ }
+}
+
+extension OneOfBuilder where Input == Substring.UTF8View {
+ @_disfavoredOverload
+ public static func buildExpression(_ parser: P) -> P
+ where P.Input == Substring.UTF8View {
+ parser
+ }
+}
diff --git a/Sources/Parsing/Builders/ParserBuilder.swift b/Sources/Parsing/Builders/ParserBuilder.swift
index 8ec25cfbf6..b97b5289de 100644
--- a/Sources/Parsing/Builders/ParserBuilder.swift
+++ b/Sources/Parsing/Builders/ParserBuilder.swift
@@ -13,9 +13,14 @@
/// .parse("123,456") // (123, 456)
/// ```
@resultBuilder
-public enum ParserBuilder {
+public enum ParserBuilder {
@inlinable
- public static func buildBlock(_ parser: P) -> P {
+ public static func buildBlock() -> Always {
+ Always(())
+ }
+
+ @inlinable
+ public static func buildBlock(_ parser: P) -> P where P.Input == Input {
parser
}
@@ -36,7 +41,8 @@ public enum ParserBuilder {
@inlinable
public static func buildEither(
first parser: TrueParser
- ) -> Parsers.Conditional {
+ ) -> Parsers.Conditional
+ where TrueParser.Input == Input, FalseParser.Input == Input {
.first(parser)
}
@@ -57,14 +63,20 @@ public enum ParserBuilder {
@inlinable
public static func buildEither(
second parser: FalseParser
- ) -> Parsers.Conditional {
+ ) -> Parsers.Conditional
+ where TrueParser.Input == Input, FalseParser.Input == Input {
.second(parser)
}
+ @inlinable
+ public static func buildExpression(_ parser: P) -> P where P.Input == Input {
+ parser
+ }
+
/// Provides support for `if` statements in ``ParserBuilder`` blocks, producing an optional
/// parser.
@inlinable
- public static func buildIf(_ parser: P?) -> P? {
+ public static func buildIf(_ parser: P?) -> P? where P.Input == Input {
parser
}
@@ -82,43 +94,50 @@ public enum ParserBuilder {
/// }
/// ```
@inlinable
- public static func buildIf(_ parser: P?) -> Parsers.OptionalVoid
{
+ public static func buildIf
(_ parser: P?) -> Parsers.OptionalVoid
+ where P.Input == Input {
.init(wrapped: parser)
}
/// Provides support for `if #available` statements in ``ParserBuilder`` blocks, producing an
/// optional parser.
@inlinable
- public static func buildLimitedAvailability(_ parser: P?) -> P? {
+ public static func buildLimitedAvailability(_ parser: P?) -> P?
+ where P.Input == Input {
parser
}
/// Provides support for `if #available` statements in ``ParserBuilder`` blocks, producing a void
/// parser for a given void parser.
@inlinable
- public static func buildLimitedAvailability(_ parser: P?) -> Parsers.OptionalVoid
{
+ public static func buildLimitedAvailability
(_ parser: P?) -> Parsers.OptionalVoid
+ where P.Input == Input {
.init(wrapped: parser)
}
@inlinable
- public static func buildPartialBlock(first: P) -> P {
+ public static func buildPartialBlock(first: P) -> P
+ where P.Input == Input {
first
}
@_disfavoredOverload
@inlinable
- public static func buildPartialBlock(accumulated: P0, next: P1) -> SkipFirst {
+ public static func buildPartialBlock(accumulated: P0, next: P1) -> SkipFirst
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@inlinable
- public static func buildPartialBlock(accumulated: P0, next: P1) -> SkipSecond {
+ public static func buildPartialBlock(accumulated: P0, next: P1) -> SkipSecond
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@_disfavoredOverload
@inlinable
- public static func buildPartialBlock(accumulated: P0, next: P1) -> Take2 {
+ public static func buildPartialBlock(accumulated: P0, next: P1) -> Take2
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -126,7 +145,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take3 {
+ ) -> Take3
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -134,7 +154,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take4 {
+ ) -> Take4
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -142,7 +163,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take5 {
+ ) -> Take5
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -150,7 +172,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take6 {
+ ) -> Take6
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -158,7 +181,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take7 {
+ ) -> Take7
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -166,7 +190,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take8 {
+ ) -> Take8
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -174,7 +199,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take9 {
+ ) -> Take9
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -182,7 +208,8 @@ public enum ParserBuilder {
@inlinable
public static func buildPartialBlock(
accumulated: P0, next: P1
- ) -> Take10 {
+ ) -> Take10
+ where P0.Input == Input, P1.Input == Input {
.init(accumulated, next)
}
@@ -500,3 +527,22 @@ extension ParserBuilder.Take10: ParserPrinter where P0: ParserPrinter, P1: Parse
)
}
}
+
+extension ParserBuilder where Input == Substring {
+ @_disfavoredOverload
+ public static func buildExpression(_ expression: P)
+ -> From
+ where P.Input == Substring.UTF8View {
+ From(.utf8) {
+ expression
+ }
+ }
+}
+
+extension ParserBuilder where Input == Substring.UTF8View {
+ @_disfavoredOverload
+ public static func buildExpression(_ expression: P) -> P
+ where P.Input == Substring.UTF8View {
+ expression
+ }
+}
diff --git a/Sources/Parsing/Builders/Variadics.swift b/Sources/Parsing/Builders/Variadics.swift
deleted file mode 100644
index b3e883b4fe..0000000000
--- a/Sources/Parsing/Builders/Variadics.swift
+++ /dev/null
@@ -1,10503 +0,0 @@
-// BEGIN AUTO-GENERATED CONTENT
-
-#if swift(<5.7)
-
- extension ParserBuilder {
- public struct ZipOO: Parser
- where
- P0.Input == P1.Input
- {
- public let p0: P0, p1: P1
-
- @inlinable public init(_ p0: P0, _ p1: P1) {
- self.p0 = p0
- self.p1 = p1
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- return (o0, o1)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P0.Input == P1.Input
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1
- ) -> ParserBuilder.ZipOO {
- ParserBuilder.ZipOO(p0, p1)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOV: Parser
- where
- P0.Input == P1.Input,
- P1.Output == Void
- {
- public let p0: P0, p1: P1
-
- @inlinable public init(_ p0: P0, _ p1: P1) {
- self.p0 = p0
- self.p1 = p1
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- return o0
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P0.Input == P1.Input,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: P0.Output,
- into input: inout P0.Input
- ) rethrows {
- try p1.print(into: &input)
- try p0.print(output, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1
- ) -> ParserBuilder.ZipOV {
- ParserBuilder.ZipOV(p0, p1)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVO: Parser
- where
- P0.Input == P1.Input,
- P0.Output == Void
- {
- public let p0: P0, p1: P1
-
- @inlinable public init(_ p0: P0, _ p1: P1) {
- self.p0 = p0
- self.p1 = p1
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- return o1
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P0.Input == P1.Input,
- P0.Output == Void
- {
- @inlinable public func print(
- _ output: P1.Output,
- into input: inout P0.Input
- ) rethrows {
- try p1.print(output, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1
- ) -> ParserBuilder.ZipVO {
- ParserBuilder.ZipVO(p0, p1)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVV: Parser
- where
- P0.Input == P1.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- public let p0: P0, p1: P1
-
- @inlinable public init(_ p0: P0, _ p1: P1) {
- self.p0 = p0
- self.p1 = p1
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P0.Input == P1.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: Void,
- into input: inout P0.Input
- ) rethrows {
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1
- ) -> ParserBuilder.ZipVV {
- ParserBuilder.ZipVV(p0, p1)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P2.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- return (o0, o1, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p2.print(output.2, into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipOOO {
- ParserBuilder.ZipOOO(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- return (o0, o1)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p2.print(into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipOOV {
- ParserBuilder.ZipOOV(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P1.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P2.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- return (o0, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p2.print(output.1, into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipOVO {
- ParserBuilder.ZipOVO(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P1.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- return o0
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P1.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: P0.Output,
- into input: inout P0.Input
- ) rethrows {
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(output, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipOVV {
- ParserBuilder.ZipOVV(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P2.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- return (o1, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p2.print(output.1, into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipVOO {
- ParserBuilder.ZipVOO(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- return o1
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: P1.Output,
- into input: inout P0.Input
- ) rethrows {
- try p2.print(into: &input)
- try p1.print(output, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipVOV {
- ParserBuilder.ZipVOV(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P2.Output {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- return o2
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: P2.Output,
- into input: inout P0.Input
- ) rethrows {
- try p2.print(output, into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipVVO {
- ParserBuilder.ZipVVO(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: Void,
- into input: inout P0.Input
- ) rethrows {
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2
- ) -> ParserBuilder.ZipVVV {
- ParserBuilder.ZipVVV(p0, p1, p2)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P2.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return (o0, o1, o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output.3, into: &input)
- try p2.print(output.2, into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOOOO {
- ParserBuilder.ZipOOOO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P2.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- return (o0, o1, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(output.2, into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOOOV {
- ParserBuilder.ZipOOOV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return (o0, o1, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output.2, into: &input)
- try p2.print(into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOOVO {
- ParserBuilder.ZipOOVO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- return (o0, o1)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOOVV {
- ParserBuilder.ZipOOVV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P2.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return (o0, o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output.2, into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOVOO {
- ParserBuilder.ZipOVOO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P2.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- return (o0, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOVOV {
- ParserBuilder.ZipOVOV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return (o0, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output.1, into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOVVO {
- ParserBuilder.ZipOVVO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- return o0
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: P0.Output,
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(output, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipOVVV {
- ParserBuilder.ZipOVVV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P2.Output,
- P3.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return (o1, o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output.2, into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVOOO {
- ParserBuilder.ZipVOOO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P2.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- return (o1, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVOOV {
- ParserBuilder.ZipVOOV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P3.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return (o1, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output.1, into: &input)
- try p2.print(into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVOVO {
- ParserBuilder.ZipVOVO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- return o1
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: P1.Output,
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(output, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVOVV {
- ParserBuilder.ZipVOVV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P2.Output,
- P3.Output
- ) {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return (o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output.1, into: &input)
- try p2.print(output.0, into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVVOO {
- ParserBuilder.ZipVVOO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P2.Output {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- return o2
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: P2.Output,
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(output, into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVVOV {
- ParserBuilder.ZipVVOV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P3.Output {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- return o3
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: P3.Output,
- into input: inout P0.Input
- ) rethrows {
- try p3.print(output, into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVVVO {
- ParserBuilder.ZipVVVO(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: Void,
- into input: inout P0.Input
- ) rethrows {
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3
- ) -> ParserBuilder.ZipVVVV {
- ParserBuilder.ZipVVVV(p0, p1, p2, p3)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOOOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P2.Output,
- P3.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o1, o2, o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOOOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P2.Output,
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.4, into: &input)
- try p3.print(output.3, into: &input)
- try p2.print(output.2, into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOOOO {
- ParserBuilder.ZipOOOOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOOOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P2.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return (o0, o1, o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOOOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output.3, into: &input)
- try p2.print(output.2, into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOOOV {
- ParserBuilder.ZipOOOOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOOVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P2.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o1, o2, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOOVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P2.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.3, into: &input)
- try p3.print(into: &input)
- try p2.print(output.2, into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOOVO {
- ParserBuilder.ZipOOOVO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOOVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P3.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P2.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- try p4.parse(&input)
- return (o0, o1, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOOVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P3.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(into: &input)
- try p2.print(output.2, into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOOVV {
- ParserBuilder.ZipOOOVV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOVOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P3.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o1, o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOVOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.3, into: &input)
- try p3.print(output.2, into: &input)
- try p2.print(into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOVOO {
- ParserBuilder.ZipOOVOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOVOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return (o0, o1, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOVOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output.2, into: &input)
- try p2.print(into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOVOV {
- ParserBuilder.ZipOOVOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOVVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o1, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOVVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.2, into: &input)
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOVVO {
- ParserBuilder.ZipOOVVO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOOVVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P1.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- try p4.parse(&input)
- return (o0, o1)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOOVVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P2.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P1.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(output.1, into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOOVVV {
- ParserBuilder.ZipOOVVV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVOOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P2.Output,
- P3.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o2, o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVOOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P2.Output,
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.3, into: &input)
- try p3.print(output.2, into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVOOO {
- ParserBuilder.ZipOVOOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVOOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P2.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return (o0, o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVOOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output.2, into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVOOV {
- ParserBuilder.ZipOVOOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVOVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P2.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o2, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVOVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P2.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.2, into: &input)
- try p3.print(into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVOVO {
- ParserBuilder.ZipOVOVO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVOVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P2.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- try p4.parse(&input)
- return (o0, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVOVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVOVV {
- ParserBuilder.ZipOVOVV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVVOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P3.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVVOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.2, into: &input)
- try p3.print(output.1, into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVVOO {
- ParserBuilder.ZipOVVOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVVOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P3.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return (o0, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVVOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output.1, into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVVOV {
- ParserBuilder.ZipOVVOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVVVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P0.Output,
- P4.Output
- ) {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o0, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVVVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P0.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.1, into: &input)
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(output.0, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVVVO {
- ParserBuilder.ZipOVVVO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipOVVVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output {
- do {
- let o0 = try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- try p4.parse(&input)
- return o0
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipOVVVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: P0.Output,
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(output, into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipOVVVV {
- ParserBuilder.ZipOVVVV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOOOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P2.Output,
- P3.Output,
- P4.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o1, o2, o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOOOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P2.Output,
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.3, into: &input)
- try p3.print(output.2, into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOOOO {
- ParserBuilder.ZipVOOOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOOOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P2.Output,
- P3.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return (o1, o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOOOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output.2, into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOOOV {
- ParserBuilder.ZipVOOOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOOVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P2.Output,
- P4.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o1, o2, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOOVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P2.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.2, into: &input)
- try p3.print(into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOOVO {
- ParserBuilder.ZipVOOVO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOOVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P2.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- try p4.parse(&input)
- return (o1, o2)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOOVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P2.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(into: &input)
- try p2.print(output.1, into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOOVV {
- ParserBuilder.ZipVOOVV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOVOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P3.Output,
- P4.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o1, o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOVOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.2, into: &input)
- try p3.print(output.1, into: &input)
- try p2.print(into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOVOO {
- ParserBuilder.ZipVOVOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOVOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P3.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return (o1, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOVOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output.1, into: &input)
- try p2.print(into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOVOV {
- ParserBuilder.ZipVOVOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOVVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P1.Output,
- P4.Output
- ) {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o1, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOVVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P1.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.1, into: &input)
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(output.0, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOVVO {
- ParserBuilder.ZipVOVVO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVOVVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output {
- do {
- try p0.parse(&input)
- let o1 = try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- try p4.parse(&input)
- return o1
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVOVVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P2.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: P1.Output,
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(output, into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVOVVV {
- ParserBuilder.ZipVOVVV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVOOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P2.Output,
- P3.Output,
- P4.Output
- ) {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o2, o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVOOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P2.Output,
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.2, into: &input)
- try p3.print(output.1, into: &input)
- try p2.print(output.0, into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVVOOO {
- ParserBuilder.ZipVVOOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVOOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P2.Output,
- P3.Output
- ) {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return (o2, o3)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVOOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P2.Output,
- P3.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output.1, into: &input)
- try p2.print(output.0, into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVVOOV {
- ParserBuilder.ZipVVOOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVOVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P2.Output,
- P4.Output
- ) {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o2, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVOVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P2.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.1, into: &input)
- try p3.print(into: &input)
- try p2.print(output.0, into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVVOVO {
- ParserBuilder.ZipVVOVO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVOVV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P2.Output {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- let o2 = try p2.parse(&input)
- try p3.parse(&input)
- try p4.parse(&input)
- return o2
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVOVV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P3.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: P2.Output,
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(into: &input)
- try p2.print(output, into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVVOVV {
- ParserBuilder.ZipVVOVV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVVOO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> (
- P3.Output,
- P4.Output
- ) {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return (o3, o4)
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVVOO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void
- {
- @inlinable public func print(
- _ output: (
- P3.Output,
- P4.Output
- ),
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output.1, into: &input)
- try p3.print(output.0, into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVVVOO {
- ParserBuilder.ZipVVVOO(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVVOV: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void,
- P4.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P3.Output {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- let o3 = try p3.parse(&input)
- try p4.parse(&input)
- return o3
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVVOV: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void,
- P4.Output == Void
- {
- @inlinable public func print(
- _ output: P3.Output,
- into input: inout P0.Input
- ) rethrows {
- try p4.print(into: &input)
- try p3.print(output, into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock(
- _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4
- ) -> ParserBuilder.ZipVVVOV {
- ParserBuilder.ZipVVVOV(p0, p1, p2, p3, p4)
- }
- }
-
- extension ParserBuilder {
- public struct ZipVVVVO: Parser
- where
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4
-
- @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) {
- self.p0 = p0
- self.p1 = p1
- self.p2 = p2
- self.p3 = p3
- self.p4 = p4
- }
-
- @inlinable public func parse(_ input: inout P0.Input) rethrows -> P4.Output {
- do {
- try p0.parse(&input)
- try p1.parse(&input)
- try p2.parse(&input)
- try p3.parse(&input)
- let o4 = try p4.parse(&input)
- return o4
- } catch { throw ParsingError.wrap(error, at: input) }
- }
- }
- }
-
- extension ParserBuilder.ZipVVVVO: ParserPrinter
- where
- P0: ParserPrinter,
- P1: ParserPrinter,
- P2: ParserPrinter,
- P3: ParserPrinter,
- P4: ParserPrinter,
- P0.Input == P1.Input,
- P1.Input == P2.Input,
- P2.Input == P3.Input,
- P3.Input == P4.Input,
- P0.Output == Void,
- P1.Output == Void,
- P2.Output == Void,
- P3.Output == Void
- {
- @inlinable public func print(
- _ output: P4.Output,
- into input: inout P0.Input
- ) rethrows {
- try p4.print(output, into: &input)
- try p3.print(into: &input)
- try p2.print(into: &input)
- try p1.print(into: &input)
- try p0.print(into: &input)
- }
- }
-
- extension ParserBuilder {
- @inlinable public static func buildBlock