diff --git a/.gitignore b/.gitignore index 95c4320919..6cb6e6ff5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store /.build +/.swiftpm /Packages /*.xcodeproj xcuserdata/ diff --git a/.spi.yml b/.spi.yml deleted file mode 100644 index 58f0d26ea5..0000000000 --- a/.spi.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 1 -builder: - configs: - - platform: ios - scheme: Parsing - - platform: tvos - scheme: Parsing - - platform: watchos - scheme: Parsing_watchOS - - documentation_targets: [Parsing] diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Parsing_watchOS.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Parsing_watchOS.xcscheme deleted file mode 100644 index 6624070913..0000000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Parsing_watchOS.xcscheme +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/_URLRouting.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/_URLRouting.xcscheme deleted file mode 100644 index 86974d59fc..0000000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/_URLRouting.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/swift-parsing-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/swift-parsing-Package.xcscheme deleted file mode 100644 index 36a060625a..0000000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/swift-parsing-Package.xcscheme +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Makefile b/Makefile index de78917f12..2fe6249454 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,15 @@ benchmarks: test: xcodebuild test \ + -workspace Parsing.xcworkspace \ -scheme Parsing \ -destination platform="$(PLATFORM_IOS)" xcodebuild test \ + -workspace Parsing.xcworkspace \ -scheme Parsing \ -destination platform="$(PLATFORM_MACOS)" xcodebuild test \ + -workspace Parsing.xcworkspace \ -scheme Parsing \ -destination platform="$(PLATFORM_TVOS)" diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/Parsing.xcworkspace/contents.xcworkspacedata similarity index 80% rename from .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata rename to Parsing.xcworkspace/contents.xcworkspacedata index 919434a625..ca3329e1a1 100644 --- a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ b/Parsing.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "group:"> diff --git a/Parsing.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Parsing.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/Parsing.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Parsing.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Parsing.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000000..d762563a8f --- /dev/null +++ b/Parsing.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,52 @@ +{ + "object": { + "pins": [ + { + "package": "swift-argument-parser", + "repositoryURL": "https://github.com/apple/swift-argument-parser", + "state": { + "branch": null, + "revision": "6b2aa2748a7881eebb9f84fb10c01293e15b52ca", + "version": "0.5.0" + } + }, + { + "package": "Benchmark", + "repositoryURL": "https://github.com/google/swift-benchmark", + "state": { + "branch": null, + "revision": "a0564bf88df5f94eec81348a2f089494c6b28d80", + "version": "0.1.1" + } + }, + { + "package": "swift-case-paths", + "repositoryURL": "https://github.com/pointfreeco/swift-case-paths", + "state": { + "branch": null, + "revision": "bb436421f57269fbcfe7360735985321585a86e5", + "version": "0.10.1" + } + }, + { + "package": "SwiftDocCPlugin", + "repositoryURL": "https://github.com/apple/swift-docc-plugin", + "state": { + "branch": null, + "revision": "3303b164430d9a7055ba484c8ead67a52f7b74f6", + "version": "1.0.0" + } + }, + { + "package": "xctest-dynamic-overlay", + "repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state": { + "branch": null, + "revision": "5a5457a744239896e9b0b03a8e1a5069c3e7b91f", + "version": "0.6.0" + } + } + ] + }, + "version": 1 +} diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Parsing.xcscheme b/Parsing.xcworkspace/xcshareddata/xcschemes/Parsing.xcscheme similarity index 98% rename from .swiftpm/xcode/xcshareddata/xcschemes/Parsing.xcscheme rename to Parsing.xcworkspace/xcshareddata/xcschemes/Parsing.xcscheme index 395a3a0696..0d5cab33dc 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Parsing.xcscheme +++ b/Parsing.xcworkspace/xcshareddata/xcschemes/Parsing.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - + allowLocationSimulation = "YES" + viewDebuggingEnabled = "No"> - - - - + allowLocationSimulation = "YES" + viewDebuggingEnabled = "No"> (_ 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. /// @@ -110,6 +117,40 @@ public enum OneOfBuilder { .init(wrapped: parser) } + @inlinable + public static func buildPartialBlock(first: P0) -> P0 { + first + } + + @inlinable + public static func buildPartialBlock(accumulated: P0, next: P1) -> OneOf2 { + .init(accumulated, next) + } + + public struct OneOf2: Parser + where P0.Input == P1.Input, P0.Output == P1.Output { + 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 { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + throw ParsingError.manyFailed( + [e0, e1], at: input + ) + } + } + } + } + /// A parser that parses output from an optional parser. /// /// You won't typically construct this parser directly, but instead will use standard `if` @@ -145,6 +186,23 @@ public enum OneOfBuilder { } } +extension OneOfBuilder.OneOf2: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { + let original = input + do { try self.p1.print(output, into: &input) } catch let e1 { + do { + input = original + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e1, e0], at: input + ) + } + } + } +} + extension OneOfBuilder.OptionalOneOf: ParserPrinter where Wrapped: ParserPrinter { @inlinable public func print(_ output: Wrapped.Output, into input: inout Wrapped.Input) throws { diff --git a/Sources/Parsing/Builders/ParserBuilder.swift b/Sources/Parsing/Builders/ParserBuilder.swift index b351e1ad26..8ec25cfbf6 100644 --- a/Sources/Parsing/Builders/ParserBuilder.swift +++ b/Sources/Parsing/Builders/ParserBuilder.swift @@ -14,7 +14,6 @@ /// ``` @resultBuilder public enum ParserBuilder { - /// Provides support for specifying a parser in ``ParserBuilder`` blocks. @inlinable public static func buildBlock(_ parser: P) -> P { parser @@ -100,4 +99,404 @@ public enum ParserBuilder { public static func buildLimitedAvailability

(_ parser: P?) -> Parsers.OptionalVoid

{ .init(wrapped: parser) } + + @inlinable + public static func buildPartialBlock(first: P) -> P { + first + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock(accumulated: P0, next: P1) -> SkipFirst { + .init(accumulated, next) + } + + @inlinable + public static func buildPartialBlock(accumulated: P0, next: P1) -> SkipSecond { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock(accumulated: P0, next: P1) -> Take2 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take3 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take4 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take5 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take6 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take7 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take8 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take9 { + .init(accumulated, next) + } + + @_disfavoredOverload + @inlinable + public static func buildPartialBlock( + accumulated: P0, next: P1 + ) -> Take10 { + .init(accumulated, next) + } + + public struct SkipFirst: Parser + where P0.Input == P1.Input, P0.Output == Void { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output { + do { + try self.p0.parse(&input) + return try self.p1.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct SkipSecond: Parser + where P0.Input == P1.Input, P1.Output == Void { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline 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 self.p0.parse(&input) + try self.p1.parse(&input) + return o0 + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take2: Parser + where + P0.Input == P1.Input + { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline 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 { + return try ( + self.p0.parse(&input), + self.p1.parse(&input) + ) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take3: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> (O0, O1, P1.Output) { + do { + let (o0, o1) = try self.p0.parse(&input) + return try (o0, o1, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take4: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1, O2) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> (O0, O1, O2, P1.Output) { + do { + let (o0, o1, o2) = try self.p0.parse(&input) + return try (o0, o1, o2, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take5: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1, O2, O3) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> (O0, O1, O2, O3, P1.Output) { + do { + let (o0, o1, o2, o3) = try self.p0.parse(&input) + return try (o0, o1, o2, o3, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take6: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1, O2, O3, O4) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + O0, O1, O2, O3, O4, P1.Output + ) { + do { + let (o0, o1, o2, o3, o4) = try self.p0.parse(&input) + return try (o0, o1, o2, o3, o4, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take7: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1, O2, O3, O4, O5) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + O0, O1, O2, O3, O4, O5, P1.Output + ) { + do { + let (o0, o1, o2, o3, o4, o5) = try self.p0.parse(&input) + return try (o0, o1, o2, o3, o4, o5, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take8: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1, O2, O3, O4, O5, O6) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + O0, O1, O2, O3, O4, O5, O6, P1.Output + ) { + do { + let (o0, o1, o2, o3, o4, o5, o6) = try self.p0.parse(&input) + return try (o0, o1, o2, o3, o4, o5, o6, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take9: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1, O2, O3, O4, O5, O6, O7) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + O0, O1, O2, O3, O4, O5, O6, O7, P1.Output + ) { + do { + let (o0, o1, o2, o3, o4, o5, o6, o7) = try self.p0.parse(&input) + return try (o0, o1, o2, o3, o4, o5, o6, o7, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + + public struct Take10: Parser + where P0.Input == P1.Input, P0.Output == (O0, O1, O2, O3, O4, O5, O6, O7, O8) { + @usableFromInline let p0: P0, p1: P1 + + @usableFromInline init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + O0, O1, O2, O3, O4, O5, O6, O7, O8, P1.Output + ) { + do { + let (o0, o1, o2, o3, o4, o5, o6, o7, o8) = try self.p0.parse(&input) + return try (o0, o1, o2, o3, o4, o5, o6, o7, o8, self.p1.parse(&input)) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder.SkipFirst: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print(_ output: P1.Output, into input: inout P0.Input) rethrows { + try self.p1.print(output, into: &input) + try self.p0.print(into: &input) + } +} + +extension ParserBuilder.SkipSecond: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { + try self.p1.print(into: &input) + try self.p0.print(output, into: &input) + } +} + +extension ParserBuilder.Take2: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print(_ output: (P0.Output, P1.Output), into input: inout P0.Input) rethrows { + try self.p1.print(output.1, into: &input) + try self.p0.print(output.0, into: &input) + } +} + +extension ParserBuilder.Take3: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print(_ output: (O0, O1, P1.Output), into input: inout P0.Input) rethrows { + try self.p1.print(output.2, into: &input) + try self.p0.print((output.0, output.1), into: &input) + } +} + +extension ParserBuilder.Take4: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print(_ output: (O0, O1, O2, P1.Output), into input: inout P0.Input) rethrows { + try self.p1.print(output.3, into: &input) + try self.p0.print((output.0, output.1, output.2), into: &input) + } +} + +extension ParserBuilder.Take5: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print(_ output: (O0, O1, O2, O3, P1.Output), into input: inout P0.Input) rethrows { + try self.p1.print(output.4, into: &input) + try self.p0.print((output.0, output.1, output.2, output.3), into: &input) + } +} + +extension ParserBuilder.Take6: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print( + _ output: (O0, O1, O2, O3, O4, P1.Output), + into input: inout P0.Input + ) rethrows { + try self.p1.print(output.5, into: &input) + try self.p0.print((output.0, output.1, output.2, output.3, output.4), into: &input) + } +} + +extension ParserBuilder.Take7: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print( + _ output: (O0, O1, O2, O3, O4, O5, P1.Output), + into input: inout P0.Input + ) rethrows { + try self.p1.print(output.6, into: &input) + try self.p0.print((output.0, output.1, output.2, output.3, output.4, output.5), into: &input) + } +} + +extension ParserBuilder.Take8: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print( + _ output: (O0, O1, O2, O3, O4, O5, O6, P1.Output), + into input: inout P0.Input + ) rethrows { + try self.p1.print(output.7, into: &input) + try self.p0.print( + (output.0, output.1, output.2, output.3, output.4, output.5, output.6), + into: &input + ) + } +} + +extension ParserBuilder.Take9: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print( + _ output: (O0, O1, O2, O3, O4, O5, O6, O7, P1.Output), + into input: inout P0.Input + ) rethrows { + try self.p1.print(output.8, into: &input) + try self.p0.print( + (output.0, output.1, output.2, output.3, output.4, output.5, output.6, output.7), + into: &input + ) + } +} + +extension ParserBuilder.Take10: ParserPrinter where P0: ParserPrinter, P1: ParserPrinter { + @inlinable + public func print( + _ output: (O0, O1, O2, O3, O4, O5, O6, O7, O8, P1.Output), + into input: inout P0.Input + ) rethrows { + try self.p1.print(output.9, into: &input) + try self.p0.print( + (output.0, output.1, output.2, output.3, output.4, output.5, output.6, output.7, output.8), + into: &input + ) + } } diff --git a/Sources/Parsing/Builders/Variadics.swift b/Sources/Parsing/Builders/Variadics.swift index 4f5cb7d576..b3e883b4fe 100644 --- a/Sources/Parsing/Builders/Variadics.swift +++ b/Sources/Parsing/Builders/Variadics.swift @@ -1,1127 +1,1163 @@ // BEGIN AUTO-GENERATED CONTENT -extension ParserBuilder { - public struct ZipOO: Parser +#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 { - public let p0: P0, p1: P1 - - @inlinable public init(_ p0: P0, _ p1: P1) { - self.p0 = p0 - self.p1 = p1 + @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) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipOO { + ParserBuilder.ZipOO(p0, p1) } } -} -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 { + 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 + } -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1 - ) -> ParserBuilder.ZipOO { - ParserBuilder.ZipOO(p0, 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 { - public struct ZipOV: Parser + extension ParserBuilder.ZipOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, 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 print( + _ output: P0.Output, + into input: inout P0.Input + ) rethrows { + try p1.print(into: &input) + try p0.print(output, into: &input) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipOV { + ParserBuilder.ZipOV(p0, p1) } } -} -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 { + 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 + } -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1 - ) -> ParserBuilder.ZipOV { - ParserBuilder.ZipOV(p0, 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 { - public struct ZipVO: Parser + extension ParserBuilder.ZipVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, 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 print( + _ output: P1.Output, + into input: inout P0.Input + ) rethrows { + try p1.print(output, into: &input) + try p0.print(into: &input) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipVO { + ParserBuilder.ZipVO(p0, p1) } } -} -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 { + public struct ZipVV: Parser + where + P0.Input == P1.Input, + P0.Output == Void, + P1.Output == Void + { + public let p0: P0, p1: P1 -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1 - ) -> ParserBuilder.ZipVO { - ParserBuilder.ZipVO(p0, 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 { - public struct ZipVV: Parser + extension ParserBuilder.ZipVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, 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 print( + _ output: Void, + into input: inout P0.Input + ) rethrows { + try p1.print(into: &input) + try p0.print(into: &input) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipVV { + ParserBuilder.ZipVV(p0, p1) } } -} -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 { + public struct ZipOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input + { + public let p0: P0, p1: P1, p2: P2 -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1 - ) -> ParserBuilder.ZipVV { - ParserBuilder.ZipVV(p0, p1) + @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 { - public struct ZipOOO: Parser + extension ParserBuilder.ZipOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, 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 + @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 { - 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 + @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 { - 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 + @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 { - 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 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) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipOVV { + ParserBuilder.ZipOVV(p0, p1, p2) } } -} -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 { + public struct ZipVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P0.Output == Void + { + public let p0: P0, p1: P1, p2: P2 -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2 - ) -> ParserBuilder.ZipOVV { - ParserBuilder.ZipOVV(p0, p1, 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 { - public struct ZipVOO: Parser + extension ParserBuilder.ZipVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, 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 + @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 { - 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 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) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipVOV { + ParserBuilder.ZipVOV(p0, p1, p2) } } -} -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 { + 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 -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2 - ) -> ParserBuilder.ZipVOV { - ParserBuilder.ZipVOV(p0, p1, 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 { - public struct ZipVVO: Parser + 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 { - 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 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) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipVVO { + ParserBuilder.ZipVVO(p0, p1, p2) } } -} -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 { + 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 -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2 - ) -> ParserBuilder.ZipVVO { - ParserBuilder.ZipVVO(p0, p1, 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 { - public struct ZipVVV: Parser + 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 { - 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 print( + _ output: Void, + into input: inout P0.Input + ) rethrows { + try p2.print(into: &input) + try p1.print(into: &input) + try p0.print(into: &input) } + } - @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 { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipVVV { + ParserBuilder.ZipVVV(p0, p1, p2) } } -} -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 { + 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 + } -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2 - ) -> ParserBuilder.ZipVVV { - ParserBuilder.ZipVVV(p0, p1, p2) + @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 { - public struct ZipOOOO: Parser + 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 { - 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 + @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 { - 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 + @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 { - 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 + @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 { - 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 + @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 { - 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 + @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 { - 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 + @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 { - 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 + @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, @@ -1129,263 +1165,263 @@ extension ParserBuilder { 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 + @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 { - 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 + @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 { - 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 + @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 { - 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 + @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, @@ -1393,129 +1429,129 @@ extension ParserBuilder { 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 + @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 { - 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 + @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, @@ -1523,62 +1559,62 @@ extension ParserBuilder { 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 + @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, @@ -1586,62 +1622,62 @@ extension ParserBuilder { 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 + @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, @@ -1650,287 +1686,294 @@ extension ParserBuilder { 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 + @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 { - 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 + @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 { - 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 + @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 { - 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 + @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, @@ -1938,149 +1981,149 @@ extension ParserBuilder { 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 + @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 { - 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 + @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, @@ -2088,74 +2131,74 @@ extension ParserBuilder { 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 + @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, @@ -2163,74 +2206,74 @@ extension ParserBuilder { 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 + @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, @@ -2239,148 +2282,148 @@ extension ParserBuilder { 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 + @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 { - 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 + @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, @@ -2388,74 +2431,74 @@ extension ParserBuilder { 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 + @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, @@ -2463,74 +2506,74 @@ extension ParserBuilder { 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 + @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, @@ -2539,73 +2582,73 @@ extension ParserBuilder { 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 + @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, @@ -2613,74 +2656,74 @@ extension ParserBuilder { 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 + @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, @@ -2689,73 +2732,73 @@ extension ParserBuilder { 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 + @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, @@ -2764,73 +2807,71 @@ extension ParserBuilder { 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 + @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, @@ -2840,143 +2881,145 @@ extension ParserBuilder { 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 + @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 { - 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 + @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, @@ -2984,74 +3027,74 @@ extension ParserBuilder { 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 + @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, @@ -3059,74 +3102,74 @@ extension ParserBuilder { 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 + @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, @@ -3135,73 +3178,73 @@ extension ParserBuilder { 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 + @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, @@ -3209,74 +3252,74 @@ extension ParserBuilder { 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 + @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, @@ -3285,73 +3328,73 @@ extension ParserBuilder { 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 + @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, @@ -3360,73 +3403,71 @@ extension ParserBuilder { 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 + @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, @@ -3436,68 +3477,70 @@ extension ParserBuilder { 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 + @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, @@ -3505,74 +3548,74 @@ extension ParserBuilder { 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 + @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, @@ -3581,73 +3624,73 @@ extension ParserBuilder { 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 + @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, @@ -3656,73 +3699,71 @@ extension ParserBuilder { 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 + @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, @@ -3732,68 +3773,70 @@ extension ParserBuilder { 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 + @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, @@ -3802,73 +3845,71 @@ extension ParserBuilder { 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 + @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, @@ -3878,68 +3919,68 @@ extension ParserBuilder { 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 + @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, @@ -3949,68 +3990,68 @@ extension ParserBuilder { 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( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 - ) -> ParserBuilder.ZipVVVVO { - ParserBuilder.ZipVVVVO(p0, p1, p2, p3, p4) - } -} - -extension ParserBuilder { - public struct ZipVVVVV: Parser + @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( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVVVO { + ParserBuilder.ZipVVVVO(p0, p1, p2, p3, p4) + } + } + + extension ParserBuilder { + public struct ZipVVVVV: 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, + 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 { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4021,153 +4062,160 @@ extension ParserBuilder { 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 { - do { - try p0.parse(&input) - try p1.parse(&input) - try p2.parse(&input) - try p3.parse(&input) - try p4.parse(&input) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVVV: 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, - P4.Output == Void -{ - @inlinable public func print( - _ output: Void, - 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(into: &input) - } -} - -extension ParserBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 - ) -> ParserBuilder.ZipVVVVV { - ParserBuilder.ZipVVVVV(p0, p1, p2, p3, p4) - } -} - -extension ParserBuilder { - public struct ZipOOOOOO: - Parser + @inlinable public func print( + _ output: Void, + 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(into: &input) + } + } + + extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVVVV { + ParserBuilder.ZipVVVVV(p0, p1, p2, p3, p4) + } + } + + extension ParserBuilder { + public struct ZipOOOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, P3.Input == P4.Input, P4.Input == P5.Input { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P2.Output, - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o2, o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output, - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.5, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOOOO { - ParserBuilder.ZipOOOOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOOOOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.5, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOOOO { + ParserBuilder.ZipOOOOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4175,83 +4223,83 @@ extension ParserBuilder { P4.Input == P5.Input, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1, o2, o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output, - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOOOV { - ParserBuilder.ZipOOOOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOOOVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOOOV { + ParserBuilder.ZipOOOOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4259,83 +4307,83 @@ extension ParserBuilder { P4.Input == P5.Input, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P2.Output, - P3.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o2, o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output, - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.4, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOOVO { - ParserBuilder.ZipOOOOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOOOVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.4, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOOVO { + ParserBuilder.ZipOOOOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4344,82 +4392,82 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1, o2, o3) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output, - P3.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOOVV { - ParserBuilder.ZipOOOOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOOVOO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output, + P3.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOOVV { + ParserBuilder.ZipOOOOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4427,83 +4475,83 @@ extension ParserBuilder { P4.Input == P5.Input, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P2.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o2, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.4, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOVOO { - ParserBuilder.ZipOOOVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOOVOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.4, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOVOO { + ParserBuilder.ZipOOOVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4512,82 +4560,82 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1, o2, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOVOV { - ParserBuilder.ZipOOOVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOOVVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOVOV { + ParserBuilder.ZipOOOVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4596,82 +4644,82 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P2.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o2, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOVVO { - ParserBuilder.ZipOOOVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOOVVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOVVO { + ParserBuilder.ZipOOOVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOOVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4681,81 +4729,81 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1, o2) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOOVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P2.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOOVVV { - ParserBuilder.ZipOOOVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVOOO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P2.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOOVVV { + ParserBuilder.ZipOOOVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4763,83 +4811,83 @@ extension ParserBuilder { P4.Input == P5.Input, P2.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.4, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVOOO { - ParserBuilder.ZipOOVOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVOOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.4, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVOOO { + ParserBuilder.ZipOOVOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4848,82 +4896,82 @@ extension ParserBuilder { P2.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1, o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVOOV { - ParserBuilder.ZipOOVOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVOVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVOOV { + ParserBuilder.ZipOOVOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -4932,82 +4980,82 @@ extension ParserBuilder { P2.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P3.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVOVO { - ParserBuilder.ZipOOVOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVOVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVOVO { + ParserBuilder.ZipOOVOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5017,81 +5065,81 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1, o3) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P3.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVOVV { - ParserBuilder.ZipOOVOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVVOO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P3.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVOVV { + ParserBuilder.ZipOOVOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5100,82 +5148,82 @@ extension ParserBuilder { P2.Output == Void, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVVOO { - ParserBuilder.ZipOOVVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVVOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVVOO { + ParserBuilder.ZipOOVVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5185,81 +5233,81 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVVOV { - ParserBuilder.ZipOOVVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVVVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVVOV { + ParserBuilder.ZipOOVVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o1, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5269,81 +5317,81 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P1.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o1, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVVVO { - ParserBuilder.ZipOOVVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOOVVVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVVVO { + ParserBuilder.ZipOOVVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOOVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o1) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOOVVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5354,80 +5402,80 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o1) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOOVVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P1.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOOVVVV { - ParserBuilder.ZipOOVVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOOOO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P1.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOOVVVV { + ParserBuilder.ZipOOVVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5435,83 +5483,83 @@ extension ParserBuilder { P4.Input == P5.Input, P1.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P2.Output, - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o2, o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output, - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.4, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOOOO { - ParserBuilder.ZipOVOOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOOOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output, + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.4, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOOOO { + ParserBuilder.ZipOVOOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5520,82 +5568,82 @@ extension ParserBuilder { P1.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o2, o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output, - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOOOV { - ParserBuilder.ZipOVOOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOOVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output, + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOOOV { + ParserBuilder.ZipOVOOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5604,82 +5652,82 @@ extension ParserBuilder { P1.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P2.Output, - P3.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o2, o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output, - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOOVO { - ParserBuilder.ZipOVOOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOOVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output, + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOOVO { + ParserBuilder.ZipOVOOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5689,81 +5737,81 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o2, o3) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output, - P3.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOOVV { - ParserBuilder.ZipOVOOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOVOO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output, + P3.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOOVV { + ParserBuilder.ZipOVOOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5772,82 +5820,82 @@ extension ParserBuilder { P1.Output == Void, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P2.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o2, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOVOO { - ParserBuilder.ZipOVOVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOVOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOVOO { + ParserBuilder.ZipOVOVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5857,81 +5905,81 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o2, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOVOV { - ParserBuilder.ZipOVOVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOVVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOVOV { + ParserBuilder.ZipOVOVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -5941,81 +5989,81 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P2.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o2, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOVVO { - ParserBuilder.ZipOVOVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVOVVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOVVO { + ParserBuilder.ZipOVOVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVOVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6026,80 +6074,80 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o2) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVOVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P2.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVOVVV { - ParserBuilder.ZipOVOVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVOOO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P2.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVOVVV { + ParserBuilder.ZipOVOVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6108,82 +6156,82 @@ extension ParserBuilder { P1.Output == Void, P2.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVVOOO { - ParserBuilder.ZipOVVOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVOOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVVOOO { + ParserBuilder.ZipOVVOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6193,81 +6241,81 @@ extension ParserBuilder { P2.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVVOOV { - ParserBuilder.ZipOVVOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVOVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVVOOV { + ParserBuilder.ZipOVVOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6277,81 +6325,81 @@ extension ParserBuilder { P2.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P3.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVVOVO { - ParserBuilder.ZipOVVOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVOVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVVOVO { + ParserBuilder.ZipOVVOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6362,80 +6410,80 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o3) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P3.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVVOVV { - ParserBuilder.ZipOVVOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVVOO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P3.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVVOVV { + ParserBuilder.ZipOVVOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o0, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6445,81 +6493,81 @@ extension ParserBuilder { P2.Output == Void, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o0, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVVVOO { - ParserBuilder.ZipOVVVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVVOV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVVVOO { + ParserBuilder.ZipOVVVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o0, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6530,80 +6578,80 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o0, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVVVOV { - ParserBuilder.ZipOVVVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVVVO: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVVVOV { + ParserBuilder.ZipOVVVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.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, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6614,80 +6662,78 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P0.Output, - P5.Output - ) { - do { - let o0 = try p0.parse(&input) - try p1.parse(&input) - try p2.parse(&input) - try p3.parse(&input) - try p4.parse(&input) - let o5 = try p5.parse(&input) - return (o0, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P0.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.1, into: &input) - try p4.print(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, _ p5: P5 - ) -> ParserBuilder.ZipOVVVVO { - ParserBuilder.ZipOVVVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipOVVVVV: - Parser + @inlinable public func print( + _ output: ( + P0.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.1, into: &input) + try p4.print(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, _ p5: P5 + ) -> ParserBuilder.ZipOVVVVO { + ParserBuilder.ZipOVVVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipOVVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return o0 + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipOVVVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6699,75 +6745,77 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return o0 - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipOVVVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: P0.Output, - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipOVVVVV { - ParserBuilder.ZipOVVVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOOOO: - Parser + @inlinable public func print( + _ output: P0.Output, + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipOVVVVV { + ParserBuilder.ZipOVVVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o1, o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6775,83 +6823,83 @@ extension ParserBuilder { P4.Input == P5.Input, P0.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P2.Output, - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o1, o2, o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output, - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.4, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOOOO { - ParserBuilder.ZipVOOOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOOOV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output, + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.4, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOOOO { + ParserBuilder.ZipVOOOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o1, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6860,82 +6908,82 @@ extension ParserBuilder { P0.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o1, o2, o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output, - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOOOV { - ParserBuilder.ZipVOOOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOOVO: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output, + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOOOV { + ParserBuilder.ZipVOOOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o1, o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -6944,82 +6992,82 @@ extension ParserBuilder { P0.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P2.Output, - P3.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o1, o2, o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output, - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOOVO { - ParserBuilder.ZipVOOOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOOVV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output, + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOOVO { + ParserBuilder.ZipVOOOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7029,81 +7077,81 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o1, o2, o3) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output, - P3.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOOVV { - ParserBuilder.ZipVOOOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOVOO: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output, + P3.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOOVV { + ParserBuilder.ZipVOOOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o1, o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7112,82 +7160,82 @@ extension ParserBuilder { P0.Output == Void, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P2.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o1, o2, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOVOO { - ParserBuilder.ZipVOOVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOVOV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOVOO { + ParserBuilder.ZipVOOVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o1, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7197,81 +7245,81 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o1, o2, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOVOV { - ParserBuilder.ZipVOOVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOVVO: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOVOV { + ParserBuilder.ZipVOOVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o1, o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7281,81 +7329,81 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P2.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o1, o2, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOVVO { - ParserBuilder.ZipVOOVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOOVVV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOVVO { + ParserBuilder.ZipVOOVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOOVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7366,80 +7414,80 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o1, o2) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOOVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P2.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOOVVV { - ParserBuilder.ZipVOOVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVOOO: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P2.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOOVVV { + ParserBuilder.ZipVOOVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o1, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7448,82 +7496,82 @@ extension ParserBuilder { P0.Output == Void, P2.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o1, o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOVOOO { - ParserBuilder.ZipVOVOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVOOV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOVOOO { + ParserBuilder.ZipVOVOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o1, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7533,81 +7581,81 @@ extension ParserBuilder { P2.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o1, o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOVOOV { - ParserBuilder.ZipVOVOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVOVO: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOVOOV { + ParserBuilder.ZipVOVOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o1, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7617,81 +7665,81 @@ extension ParserBuilder { P2.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P3.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o1, o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOVOVO { - ParserBuilder.ZipVOVOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVOVV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOVOVO { + ParserBuilder.ZipVOVOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7702,80 +7750,80 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o1, o3) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P3.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOVOVV { - ParserBuilder.ZipVOVOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVVOO: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P3.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOVOVV { + ParserBuilder.ZipVOVOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o1, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7785,81 +7833,81 @@ extension ParserBuilder { P2.Output == Void, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o1, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOVVOO { - ParserBuilder.ZipVOVVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVVOV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOVVOO { + ParserBuilder.ZipVOVVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o1, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7870,80 +7918,80 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o1, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOVVOV { - ParserBuilder.ZipVOVVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVVVO: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOVVOV { + ParserBuilder.ZipVOVVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.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, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -7954,80 +8002,78 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P1.Output, - P5.Output - ) { - do { - try p0.parse(&input) - let o1 = try p1.parse(&input) - try p2.parse(&input) - try p3.parse(&input) - try p4.parse(&input) - let o5 = try p5.parse(&input) - return (o1, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P1.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.1, into: &input) - try p4.print(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, _ p5: P5 - ) -> ParserBuilder.ZipVOVVVO { - ParserBuilder.ZipVOVVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVOVVVV: - Parser + @inlinable public func print( + _ output: ( + P1.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.1, into: &input) + try p4.print(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, _ p5: P5 + ) -> ParserBuilder.ZipVOVVVO { + ParserBuilder.ZipVOVVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVOVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return o1 + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVOVVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8039,75 +8085,77 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return o1 - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVOVVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: P1.Output, - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVOVVVV { - ParserBuilder.ZipVOVVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOOOO: - Parser + @inlinable public func print( + _ output: P1.Output, + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVOVVVV { + ParserBuilder.ZipVOVVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8116,82 +8164,82 @@ extension ParserBuilder { P0.Output == Void, P1.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P2.Output, - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o2, o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void -{ - @inlinable public func print( - _ output: ( - P2.Output, - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.3, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVOOOO { - ParserBuilder.ZipVVOOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOOOV: - Parser + @inlinable public func print( + _ output: ( + P2.Output, + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.3, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVOOOO { + ParserBuilder.ZipVVOOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8201,81 +8249,81 @@ extension ParserBuilder { P1.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o2, o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P2.Output, - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVOOOV { - ParserBuilder.ZipVVOOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOOVO: - Parser + @inlinable public func print( + _ output: ( + P2.Output, + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVOOOV { + ParserBuilder.ZipVVOOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8285,81 +8333,81 @@ extension ParserBuilder { P1.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P2.Output, - P3.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o2, o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P2.Output, - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVOOVO { - ParserBuilder.ZipVVOOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOOVV: - Parser + @inlinable public func print( + _ output: ( + P2.Output, + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVOOVO { + ParserBuilder.ZipVVOOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8370,80 +8418,80 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o2, o3) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P2.Output, - P3.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVOOVV { - ParserBuilder.ZipVVOOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOVOO: - Parser + @inlinable public func print( + _ output: ( + P2.Output, + P3.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVOOVV { + ParserBuilder.ZipVVOOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8453,81 +8501,81 @@ extension ParserBuilder { P1.Output == Void, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P2.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o2, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P2.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVOVOO { - ParserBuilder.ZipVVOVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOVOV: - Parser + @inlinable public func print( + _ output: ( + P2.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVOVOO { + ParserBuilder.ZipVVOVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8538,80 +8586,80 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o2, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P2.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVOVOV { - ParserBuilder.ZipVVOVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOVVO: - Parser + @inlinable public func print( + _ output: ( + P2.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVOVOV { + ParserBuilder.ZipVVOVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.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, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8622,80 +8670,78 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P2.Output, - P5.Output - ) { - do { - try p0.parse(&input) - try p1.parse(&input) - let o2 = try p2.parse(&input) - try p3.parse(&input) - try p4.parse(&input) - let o5 = try p5.parse(&input) - return (o2, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P2.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.1, into: &input) - try p4.print(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, _ p5: P5 - ) -> ParserBuilder.ZipVVOVVO { - ParserBuilder.ZipVVOVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVOVVV: - Parser + @inlinable public func print( + _ output: ( + P2.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.1, into: &input) + try p4.print(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, _ p5: P5 + ) -> ParserBuilder.ZipVVOVVO { + ParserBuilder.ZipVVOVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return o2 + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVOVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8707,75 +8753,77 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return o2 - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVOVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: P2.Output, - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVOVVV { - ParserBuilder.ZipVVOVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVOOO: - Parser + @inlinable public func print( + _ output: P2.Output, + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVOVVV { + ParserBuilder.ZipVVOVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P3.Output, + P4.Output, + P5.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) + let o5 = try p5.parse(&input) + return (o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVOOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8785,81 +8833,81 @@ extension ParserBuilder { P1.Output == Void, P2.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P3.Output, - P4.Output, - P5.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) - let o5 = try p5.parse(&input) - return (o3, o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVOOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void -{ - @inlinable public func print( - _ output: ( - P3.Output, - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.2, into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVVOOO { - ParserBuilder.ZipVVVOOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVOOV: - Parser + @inlinable public func print( + _ output: ( + P3.Output, + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.2, into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVVOOO { + ParserBuilder.ZipVVVOOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return (o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVOOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8870,80 +8918,80 @@ extension ParserBuilder { P2.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return (o3, o4) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVOOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: ( - P3.Output, - P4.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVVOOV { - ParserBuilder.ZipVVVOOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVOVO: - Parser + @inlinable public func print( + _ output: ( + P3.Output, + P4.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVVOOV { + ParserBuilder.ZipVVVOOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.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, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P3.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVOVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -8954,80 +9002,78 @@ extension ParserBuilder { P2.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P3.Output, - P5.Output - ) { - do { - try p0.parse(&input) - try p1.parse(&input) - try p2.parse(&input) - let o3 = try p3.parse(&input) - try p4.parse(&input) - let o5 = try p5.parse(&input) - return (o3, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVOVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: ( - P3.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.1, into: &input) - try p4.print(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, _ p5: P5 - ) -> ParserBuilder.ZipVVVOVO { - ParserBuilder.ZipVVVOVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVOVV: - Parser + @inlinable public func print( + _ output: ( + P3.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.1, into: &input) + try p4.print(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, _ p5: P5 + ) -> ParserBuilder.ZipVVVOVO { + ParserBuilder.ZipVVVOVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return o3 + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVOVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9039,75 +9085,77 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return o3 - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVOVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: P3.Output, - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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, _ p5: P5 - ) -> ParserBuilder.ZipVVVOVV { - ParserBuilder.ZipVVVOVV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVVOO: - Parser + @inlinable public func print( + _ output: P3.Output, + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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, _ p5: P5 + ) -> ParserBuilder.ZipVVVOVV { + ParserBuilder.ZipVVVOVV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.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, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVVOO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9118,80 +9166,78 @@ extension ParserBuilder { P2.Output == Void, P3.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( - P4.Output, - P5.Output - ) { - do { - try p0.parse(&input) - try p1.parse(&input) - try p2.parse(&input) - try p3.parse(&input) - let o4 = try p4.parse(&input) - let o5 = try p5.parse(&input) - return (o4, o5) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVVOO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void -{ - @inlinable public func print( - _ output: ( - P4.Output, - P5.Output - ), - into input: inout P0.Input - ) rethrows { - try p5.print(output.1, into: &input) - try p4.print(output.0, 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( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 - ) -> ParserBuilder.ZipVVVVOO { - ParserBuilder.ZipVVVVOO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVVOV: - Parser + @inlinable public func print( + _ output: ( + P4.Output, + P5.Output + ), + into input: inout P0.Input + ) rethrows { + try p5.print(output.1, into: &input) + try p4.print(output.0, 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( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVOO { + ParserBuilder.ZipVVVVOO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p5.parse(&input) + return o4 + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVVOV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9203,75 +9249,75 @@ extension ParserBuilder { P3.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p5.parse(&input) - return o4 - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVVOV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: P4.Output, - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - 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( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 - ) -> ParserBuilder.ZipVVVVOV { - ParserBuilder.ZipVVVVOV(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVVVO: - Parser + @inlinable public func print( + _ output: P4.Output, + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + 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( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVOV { + ParserBuilder.ZipVVVVOV(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P5.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return o5 + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVVVO: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9283,75 +9329,75 @@ extension ParserBuilder { P3.Output == Void, P4.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> P5.Output { - do { - try p0.parse(&input) - try p1.parse(&input) - try p2.parse(&input) - try p3.parse(&input) - try p4.parse(&input) - let o5 = try p5.parse(&input) - return o5 - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVVVO: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void -{ - @inlinable public func print( - _ output: P5.Output, - into input: inout P0.Input - ) rethrows { - try p5.print(output, into: &input) - try p4.print(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( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 - ) -> ParserBuilder.ZipVVVVVO { - ParserBuilder.ZipVVVVVO(p0, p1, p2, p3, p4, p5) - } -} - -extension ParserBuilder { - public struct ZipVVVVVV: - Parser + @inlinable public func print( + _ output: P5.Output, + into input: inout P0.Input + ) rethrows { + try p5.print(output, into: &input) + try p4.print(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( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVVO { + ParserBuilder.ZipVVVVVO(p0, p1, p2, p3, p4, p5) + } + } + + extension ParserBuilder { + public struct ZipVVVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @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) + try p4.parse(&input) + try p5.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } + } + + extension ParserBuilder.ZipVVVVVV: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9364,208 +9410,153 @@ extension ParserBuilder { P4.Output == Void, P5.Output == Void { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @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) - try p4.parse(&input) - try p5.parse(&input) - } catch { throw ParsingError.wrap(error, at: input) } - } - } -} - -extension ParserBuilder.ZipVVVVVV: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == Void, - P1.Output == Void, - P2.Output == Void, - P3.Output == Void, - P4.Output == Void, - P5.Output == Void -{ - @inlinable public func print( - _ output: Void, - into input: inout P0.Input - ) rethrows { - try p5.print(into: &input) - try p4.print(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( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 - ) -> ParserBuilder.ZipVVVVVV { - ParserBuilder.ZipVVVVVV(p0, p1, p2, p3, p4, p5) - } -} - -extension OneOfBuilder { - public struct OneOf2: Parser - where - P0.Input == P1.Input, - P0.Output == P1.Output - { - 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 { - let original = input - do { return try self.p0.parse(&input) } catch let e0 { - do { - input = original - return try self.p1.parse(&input) - } catch let e1 { - throw ParsingError.manyFailed( - [e0, e1], at: input - ) - } + @inlinable public func print( + _ output: Void, + into input: inout P0.Input + ) rethrows { + try p5.print(into: &input) + try p4.print(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( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVVV { + ParserBuilder.ZipVVVVVV(p0, p1, p2, p3, p4, p5) + } + } + + extension OneOfBuilder { + public struct OneOf3: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P0.Output == P1.Output, + P1.Output == P2.Output + { + 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 } - } - } -} -extension OneOfBuilder.OneOf2: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P0.Input == P1.Input, - P0.Output == P1.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p1.print(output, into: &input) } catch let e1 { - do { - input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e1, e0], at: input - ) + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + throw ParsingError.manyFailed( + [e0, e1, e2], at: input + ) + } + } + } } } } -} - -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1 - ) -> OneOfBuilder.OneOf2 { - OneOfBuilder.OneOf2(p0, p1) - } -} -extension OneOfBuilder { - public struct OneOf3: Parser + extension OneOfBuilder.OneOf3: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P0.Output == P1.Output, P1.Output == P2.Output { - 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 { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p2.print(output, into: &input) } catch let e2 { do { input = original - return try self.p1.parse(&input) + try self.p1.print(output, into: &input) } catch let e1 { do { input = original - return try self.p2.parse(&input) - } catch let e2 { - throw ParsingError.manyFailed( - [e0, e1, e2], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e2, e1, e0], at: input ) } } } } } -} -extension OneOfBuilder.OneOf3: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P0.Output == P1.Output, - P1.Output == P2.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p2.print(output, into: &input) } catch let e2 { - do { - input = original - try self.p1.print(output, into: &input) - } catch let e1 { - do { - input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e2, e1, e0], at: input - ) - } - } + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> OneOfBuilder.OneOf3 { + OneOfBuilder.OneOf3(p0, p1, p2) } } -} -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2 - ) -> OneOfBuilder.OneOf3 { - OneOfBuilder.OneOf3(p0, p1, p2) + extension OneOfBuilder { + public struct OneOf4: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output + { + 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 { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3], at: input + ) + } + } + } + } + } + } } -} -extension OneOfBuilder { - public struct OneOf4: Parser + extension OneOfBuilder.OneOf4: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9573,32 +9564,23 @@ extension OneOfBuilder { P1.Output == P2.Output, P2.Output == P3.Output { - 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 { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p3.print(output, into: &input) } catch let e3 { do { input = original - return try self.p1.parse(&input) - } catch let e1 { + try self.p2.print(output, into: &input) + } catch let e2 { do { input = original - return try self.p2.parse(&input) - } catch let e2 { + try self.p1.print(output, into: &input) + } catch let e1 { do { input = original - return try self.p3.parse(&input) - } catch let e3 { - throw ParsingError.manyFailed( - [e0, e1, e2, e3], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e3, e2, e1, e0], at: input ) } } @@ -9606,57 +9588,75 @@ extension OneOfBuilder { } } } -} - -extension OneOfBuilder.OneOf4: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P0.Output == P1.Output, - P1.Output == P2.Output, - P2.Output == P3.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p3.print(output, into: &input) } catch let e3 { - do { - input = original - try self.p2.print(output, into: &input) - } catch let e2 { - do { - input = original - try self.p1.print(output, into: &input) - } catch let e1 { + + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> OneOfBuilder.OneOf4 { + OneOfBuilder.OneOf4(p0, p1, p2, p3) + } + } + + extension OneOfBuilder { + public struct OneOf5: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output + { + 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 { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { do { input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e3, e2, e1, e0], at: input - ) + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4], at: input + ) + } + } + } } } } } } -} - -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 - ) -> OneOfBuilder.OneOf4 { - OneOfBuilder.OneOf4(p0, p1, p2, p3) - } -} -extension OneOfBuilder { - public struct OneOf5: Parser + extension OneOfBuilder.OneOf5: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9666,37 +9666,27 @@ extension OneOfBuilder { P2.Output == P3.Output, P3.Output == P4.Output { - 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 { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p4.print(output, into: &input) } catch let e4 { do { input = original - return try self.p1.parse(&input) - } catch let e1 { + try self.p3.print(output, into: &input) + } catch let e3 { do { input = original - return try self.p2.parse(&input) + try self.p2.print(output, into: &input) } catch let e2 { do { input = original - return try self.p3.parse(&input) - } catch let e3 { + try self.p1.print(output, into: &input) + } catch let e1 { do { input = original - return try self.p4.parse(&input) - } catch let e4 { - throw ParsingError.manyFailed( - [e0, e1, e2, e3, e4], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e4, e3, e2, e1, e0], at: input ) } } @@ -9705,66 +9695,85 @@ extension OneOfBuilder { } } } -} - -extension OneOfBuilder.OneOf5: 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 == P1.Output, - P1.Output == P2.Output, - P2.Output == P3.Output, - P3.Output == P4.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p4.print(output, into: &input) } catch let e4 { - do { - input = original - try self.p3.print(output, into: &input) - } catch let e3 { - do { - input = original - try self.p2.print(output, into: &input) - } catch let e2 { + + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> OneOfBuilder.OneOf5 { + OneOfBuilder.OneOf5(p0, p1, p2, p3, p4) + } + } + + extension OneOfBuilder { + public struct OneOf6: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { do { input = original - try self.p1.print(output, into: &input) + return try self.p1.parse(&input) } catch let e1 { do { input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e4, e3, e2, e1, e0], at: input - ) + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5], at: input + ) + } + } + } } } } } } } -} -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 - ) -> OneOfBuilder.OneOf5 { - OneOfBuilder.OneOf5(p0, p1, p2, p3, p4) - } -} - -extension OneOfBuilder { - public struct OneOf6: - Parser + extension OneOfBuilder.OneOf6: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9776,42 +9785,31 @@ extension OneOfBuilder { P3.Output == P4.Output, P4.Output == P5.Output { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p5.print(output, into: &input) } catch let e5 { do { input = original - return try self.p1.parse(&input) - } catch let e1 { + try self.p4.print(output, into: &input) + } catch let e4 { do { input = original - return try self.p2.parse(&input) - } catch let e2 { + try self.p3.print(output, into: &input) + } catch let e3 { do { input = original - return try self.p3.parse(&input) - } catch let e3 { + try self.p2.print(output, into: &input) + } catch let e2 { do { input = original - return try self.p4.parse(&input) - } catch let e4 { + try self.p1.print(output, into: &input) + } catch let e1 { do { input = original - return try self.p5.parse(&input) - } catch let e5 { - throw ParsingError.manyFailed( - [e0, e1, e2, e3, e4, e5], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e5, e4, e3, e2, e1, e0], at: input ) } } @@ -9821,53 +9819,78 @@ extension OneOfBuilder { } } } -} - -extension OneOfBuilder.OneOf6: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P0.Output == P1.Output, - P1.Output == P2.Output, - P2.Output == P3.Output, - P3.Output == P4.Output, - P4.Output == P5.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p5.print(output, into: &input) } catch let e5 { - do { - input = original - try self.p4.print(output, into: &input) - } catch let e4 { - do { - input = original - try self.p3.print(output, into: &input) - } catch let e3 { + + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> OneOfBuilder.OneOf6 { + OneOfBuilder.OneOf6(p0, p1, p2, p3, p4, p5) + } + } + + extension OneOfBuilder { + public struct OneOf7< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { do { input = original - try self.p2.print(output, into: &input) - } catch let e2 { + return try self.p1.parse(&input) + } catch let e1 { do { input = original - try self.p1.print(output, into: &input) - } catch let e1 { + return try self.p2.parse(&input) + } catch let e2 { do { input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e5, e4, e3, e2, e1, e0], at: input - ) + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + do { + input = original + return try self.p6.parse(&input) + } catch let e6 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6], at: input + ) + } + } + } } } } @@ -9875,21 +9898,16 @@ where } } } -} - -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 - ) -> OneOfBuilder.OneOf6 { - OneOfBuilder.OneOf6(p0, p1, p2, p3, p4, p5) - } -} -extension OneOfBuilder { - public struct OneOf7< - P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser - >: Parser + extension OneOfBuilder.OneOf7: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, + P6: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -9903,47 +9921,35 @@ extension OneOfBuilder { P4.Output == P5.Output, P5.Output == P6.Output { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6 - - @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - self.p6 = p6 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p6.print(output, into: &input) } catch let e6 { do { input = original - return try self.p1.parse(&input) - } catch let e1 { + try self.p5.print(output, into: &input) + } catch let e5 { do { input = original - return try self.p2.parse(&input) - } catch let e2 { + try self.p4.print(output, into: &input) + } catch let e4 { do { input = original - return try self.p3.parse(&input) + try self.p3.print(output, into: &input) } catch let e3 { do { input = original - return try self.p4.parse(&input) - } catch let e4 { + try self.p2.print(output, into: &input) + } catch let e2 { do { input = original - return try self.p5.parse(&input) - } catch let e5 { + try self.p1.print(output, into: &input) + } catch let e1 { do { input = original - return try self.p6.parse(&input) - } catch let e6 { - throw ParsingError.manyFailed( - [e0, e1, e2, e3, e4, e5, e6], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e6, e5, e4, e3, e2, e1, e0], at: input ) } } @@ -9954,60 +9960,87 @@ extension OneOfBuilder { } } } -} - -extension OneOfBuilder.OneOf7: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P6: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P5.Input == P6.Input, - P0.Output == P1.Output, - P1.Output == P2.Output, - P2.Output == P3.Output, - P3.Output == P4.Output, - P4.Output == P5.Output, - P5.Output == P6.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p6.print(output, into: &input) } catch let e6 { - do { - input = original - try self.p5.print(output, into: &input) - } catch let e5 { - do { - input = original - try self.p4.print(output, into: &input) - } catch let e4 { + + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6 + ) -> OneOfBuilder.OneOf7 { + OneOfBuilder.OneOf7(p0, p1, p2, p3, p4, p5, p6) + } + } + + extension OneOfBuilder { + public struct OneOf8< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, P7: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P6.Input == P7.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output, + P6.Output == P7.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7 + + @inlinable public init( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7 + ) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + self.p7 = p7 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { do { input = original - try self.p3.print(output, into: &input) - } catch let e3 { + return try self.p1.parse(&input) + } catch let e1 { do { input = original - try self.p2.print(output, into: &input) + return try self.p2.parse(&input) } catch let e2 { do { input = original - try self.p1.print(output, into: &input) - } catch let e1 { + return try self.p3.parse(&input) + } catch let e3 { do { input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e6, e5, e4, e3, e2, e1, e0], at: input - ) + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + do { + input = original + return try self.p6.parse(&input) + } catch let e6 { + do { + input = original + return try self.p7.parse(&input) + } catch let e7 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6, e7], at: input + ) + } + } + } } } } @@ -10016,21 +10049,17 @@ where } } } -} -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6 - ) -> OneOfBuilder.OneOf7 { - OneOfBuilder.OneOf7(p0, p1, p2, p3, p4, p5, p6) - } -} - -extension OneOfBuilder { - public struct OneOf8< - P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, P7: Parser - >: Parser + extension OneOfBuilder.OneOf8: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, + P6: ParserPrinter, + P7: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -10046,54 +10075,39 @@ extension OneOfBuilder { P5.Output == P6.Output, P6.Output == P7.Output { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7 - - @inlinable public init( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7 - ) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - self.p6 = p6 - self.p7 = p7 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p7.print(output, into: &input) } catch let e7 { do { input = original - return try self.p1.parse(&input) - } catch let e1 { + try self.p6.print(output, into: &input) + } catch let e6 { do { input = original - return try self.p2.parse(&input) - } catch let e2 { + try self.p5.print(output, into: &input) + } catch let e5 { do { input = original - return try self.p3.parse(&input) - } catch let e3 { + try self.p4.print(output, into: &input) + } catch let e4 { do { input = original - return try self.p4.parse(&input) - } catch let e4 { + try self.p3.print(output, into: &input) + } catch let e3 { do { input = original - return try self.p5.parse(&input) - } catch let e5 { + try self.p2.print(output, into: &input) + } catch let e2 { do { input = original - return try self.p6.parse(&input) - } catch let e6 { + try self.p1.print(output, into: &input) + } catch let e1 { do { input = original - return try self.p7.parse(&input) - } catch let e7 { - throw ParsingError.manyFailed( - [e0, e1, e2, e3, e4, e5, e6, e7], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e7, e6, e5, e4, e3, e2, e1, e0], at: input ) } } @@ -10105,67 +10119,95 @@ extension OneOfBuilder { } } } -} - -extension OneOfBuilder.OneOf8: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P6: ParserPrinter, - P7: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P5.Input == P6.Input, - P6.Input == P7.Input, - P0.Output == P1.Output, - P1.Output == P2.Output, - P2.Output == P3.Output, - P3.Output == P4.Output, - P4.Output == P5.Output, - P5.Output == P6.Output, - P6.Output == P7.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p7.print(output, into: &input) } catch let e7 { - do { - input = original - try self.p6.print(output, into: &input) - } catch let e6 { - do { - input = original - try self.p5.print(output, into: &input) - } catch let e5 { + + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7 + ) -> OneOfBuilder.OneOf8 { + OneOfBuilder.OneOf8(p0, p1, p2, p3, p4, p5, p6, p7) + } + } + + extension OneOfBuilder { + public struct OneOf9< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, + P7: Parser, P8: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P6.Input == P7.Input, + P7.Input == P8.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output, + P6.Output == P7.Output, + P7.Output == P8.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8 + + @inlinable public init( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8 + ) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + self.p7 = p7 + self.p8 = p8 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { do { input = original - try self.p4.print(output, into: &input) - } catch let e4 { + return try self.p1.parse(&input) + } catch let e1 { do { input = original - try self.p3.print(output, into: &input) - } catch let e3 { + return try self.p2.parse(&input) + } catch let e2 { do { input = original - try self.p2.print(output, into: &input) - } catch let e2 { + return try self.p3.parse(&input) + } catch let e3 { do { input = original - try self.p1.print(output, into: &input) - } catch let e1 { + return try self.p4.parse(&input) + } catch let e4 { do { input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e7, e6, e5, e4, e3, e2, e1, e0], at: input - ) + return try self.p5.parse(&input) + } catch let e5 { + do { + input = original + return try self.p6.parse(&input) + } catch let e6 { + do { + input = original + return try self.p7.parse(&input) + } catch let e7 { + do { + input = original + return try self.p8.parse(&input) + } catch let e8 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6, e7, e8], at: input + ) + } + } + } } } } @@ -10175,22 +10217,18 @@ where } } } -} - -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7 - ) -> OneOfBuilder.OneOf8 { - OneOfBuilder.OneOf8(p0, p1, p2, p3, p4, p5, p6, p7) - } -} -extension OneOfBuilder { - public struct OneOf9< - P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, P7: Parser, - P8: Parser - >: Parser + extension OneOfBuilder.OneOf9: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, + P6: ParserPrinter, + P7: ParserPrinter, + P8: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -10208,59 +10246,43 @@ extension OneOfBuilder { P6.Output == P7.Output, P7.Output == P8.Output { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8 - - @inlinable public init( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8 - ) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - self.p6 = p6 - self.p7 = p7 - self.p8 = p8 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p8.print(output, into: &input) } catch let e8 { do { input = original - return try self.p1.parse(&input) - } catch let e1 { + try self.p7.print(output, into: &input) + } catch let e7 { do { input = original - return try self.p2.parse(&input) - } catch let e2 { + try self.p6.print(output, into: &input) + } catch let e6 { do { input = original - return try self.p3.parse(&input) - } catch let e3 { + try self.p5.print(output, into: &input) + } catch let e5 { do { input = original - return try self.p4.parse(&input) + try self.p4.print(output, into: &input) } catch let e4 { do { input = original - return try self.p5.parse(&input) - } catch let e5 { + try self.p3.print(output, into: &input) + } catch let e3 { do { input = original - return try self.p6.parse(&input) - } catch let e6 { + try self.p2.print(output, into: &input) + } catch let e2 { do { input = original - return try self.p7.parse(&input) - } catch let e7 { + try self.p1.print(output, into: &input) + } catch let e1 { do { input = original - return try self.p8.parse(&input) - } catch let e8 { - throw ParsingError.manyFailed( - [e0, e1, e2, e3, e4, e5, e6, e7, e8], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e8, e7, e6, e5, e4, e3, e2, e1, e0], at: input ) } } @@ -10273,74 +10295,103 @@ extension OneOfBuilder { } } } -} - -extension OneOfBuilder.OneOf9: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P6: ParserPrinter, - P7: ParserPrinter, - P8: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P5.Input == P6.Input, - P6.Input == P7.Input, - P7.Input == P8.Input, - P0.Output == P1.Output, - P1.Output == P2.Output, - P2.Output == P3.Output, - P3.Output == P4.Output, - P4.Output == P5.Output, - P5.Output == P6.Output, - P6.Output == P7.Output, - P7.Output == P8.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p8.print(output, into: &input) } catch let e8 { - do { - input = original - try self.p7.print(output, into: &input) - } catch let e7 { - do { - input = original - try self.p6.print(output, into: &input) - } catch let e6 { + + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8 + ) -> OneOfBuilder.OneOf9 { + OneOfBuilder.OneOf9(p0, p1, p2, p3, p4, p5, p6, p7, p8) + } + } + + extension OneOfBuilder { + public struct OneOf10< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, + P7: Parser, P8: Parser, P9: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P6.Input == P7.Input, + P7.Input == P8.Input, + P8.Input == P9.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output, + P6.Output == P7.Output, + P7.Output == P8.Output, + P8.Output == P9.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9 + + @inlinable public init( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8, + _ p9: P9 + ) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + self.p7 = p7 + self.p8 = p8 + self.p9 = p9 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { do { input = original - try self.p5.print(output, into: &input) - } catch let e5 { + return try self.p1.parse(&input) + } catch let e1 { do { input = original - try self.p4.print(output, into: &input) - } catch let e4 { + return try self.p2.parse(&input) + } catch let e2 { do { input = original - try self.p3.print(output, into: &input) + return try self.p3.parse(&input) } catch let e3 { do { input = original - try self.p2.print(output, into: &input) - } catch let e2 { + return try self.p4.parse(&input) + } catch let e4 { do { input = original - try self.p1.print(output, into: &input) - } catch let e1 { + return try self.p5.parse(&input) + } catch let e5 { do { input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e8, e7, e6, e5, e4, e3, e2, e1, e0], at: input - ) + return try self.p6.parse(&input) + } catch let e6 { + do { + input = original + return try self.p7.parse(&input) + } catch let e7 { + do { + input = original + return try self.p8.parse(&input) + } catch let e8 { + do { + input = original + return try self.p9.parse(&input) + } catch let e9 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6, e7, e8, e9], at: input + ) + } + } + } } } } @@ -10351,22 +10402,19 @@ where } } } -} - -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8 - ) -> OneOfBuilder.OneOf9 { - OneOfBuilder.OneOf9(p0, p1, p2, p3, p4, p5, p6, p7, p8) - } -} -extension OneOfBuilder { - public struct OneOf10< - P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, P7: Parser, - P8: Parser, P9: Parser - >: Parser + extension OneOfBuilder.OneOf10: ParserPrinter where + P0: ParserPrinter, + P1: ParserPrinter, + P2: ParserPrinter, + P3: ParserPrinter, + P4: ParserPrinter, + P5: ParserPrinter, + P6: ParserPrinter, + P7: ParserPrinter, + P8: ParserPrinter, + P9: ParserPrinter, P0.Input == P1.Input, P1.Input == P2.Input, P2.Input == P3.Input, @@ -10386,65 +10434,47 @@ extension OneOfBuilder { P7.Output == P8.Output, P8.Output == P9.Output { - public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9 - - @inlinable public init( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8, - _ p9: P9 - ) { - self.p0 = p0 - self.p1 = p1 - self.p2 = p2 - self.p3 = p3 - self.p4 = p4 - self.p5 = p5 - self.p6 = p6 - self.p7 = p7 - self.p8 = p8 - self.p9 = p9 - } - - @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { let original = input - do { return try self.p0.parse(&input) } catch let e0 { + do { try self.p9.print(output, into: &input) } catch let e9 { do { input = original - return try self.p1.parse(&input) - } catch let e1 { + try self.p8.print(output, into: &input) + } catch let e8 { do { input = original - return try self.p2.parse(&input) - } catch let e2 { + try self.p7.print(output, into: &input) + } catch let e7 { do { input = original - return try self.p3.parse(&input) - } catch let e3 { + try self.p6.print(output, into: &input) + } catch let e6 { do { input = original - return try self.p4.parse(&input) - } catch let e4 { + try self.p5.print(output, into: &input) + } catch let e5 { do { input = original - return try self.p5.parse(&input) - } catch let e5 { + try self.p4.print(output, into: &input) + } catch let e4 { do { input = original - return try self.p6.parse(&input) - } catch let e6 { + try self.p3.print(output, into: &input) + } catch let e3 { do { input = original - return try self.p7.parse(&input) - } catch let e7 { + try self.p2.print(output, into: &input) + } catch let e2 { do { input = original - return try self.p8.parse(&input) - } catch let e8 { + try self.p1.print(output, into: &input) + } catch let e1 { do { input = original - return try self.p9.parse(&input) - } catch let e9 { - throw ParsingError.manyFailed( - [e0, e1, e2, e3, e4, e5, e6, e7, e8, e9], at: input + try self.p0.print(output, into: &input) + } catch let e0 { + throw PrintingError.manyFailed( + [e9, e8, e7, e6, e5, e4, e3, e2, e1, e0], at: input ) } } @@ -10458,101 +10488,16 @@ extension OneOfBuilder { } } } -} - -extension OneOfBuilder.OneOf10: ParserPrinter -where - P0: ParserPrinter, - P1: ParserPrinter, - P2: ParserPrinter, - P3: ParserPrinter, - P4: ParserPrinter, - P5: ParserPrinter, - P6: ParserPrinter, - P7: ParserPrinter, - P8: ParserPrinter, - P9: ParserPrinter, - P0.Input == P1.Input, - P1.Input == P2.Input, - P2.Input == P3.Input, - P3.Input == P4.Input, - P4.Input == P5.Input, - P5.Input == P6.Input, - P6.Input == P7.Input, - P7.Input == P8.Input, - P8.Input == P9.Input, - P0.Output == P1.Output, - P1.Output == P2.Output, - P2.Output == P3.Output, - P3.Output == P4.Output, - P4.Output == P5.Output, - P5.Output == P6.Output, - P6.Output == P7.Output, - P7.Output == P8.Output, - P8.Output == P9.Output -{ - @inlinable public func print(_ output: P0.Output, into input: inout P0.Input) rethrows { - let original = input - do { try self.p9.print(output, into: &input) } catch let e9 { - do { - input = original - try self.p8.print(output, into: &input) - } catch let e8 { - do { - input = original - try self.p7.print(output, into: &input) - } catch let e7 { - do { - input = original - try self.p6.print(output, into: &input) - } catch let e6 { - do { - input = original - try self.p5.print(output, into: &input) - } catch let e5 { - do { - input = original - try self.p4.print(output, into: &input) - } catch let e4 { - do { - input = original - try self.p3.print(output, into: &input) - } catch let e3 { - do { - input = original - try self.p2.print(output, into: &input) - } catch let e2 { - do { - input = original - try self.p1.print(output, into: &input) - } catch let e1 { - do { - input = original - try self.p0.print(output, into: &input) - } catch let e0 { - throw PrintingError.manyFailed( - [e9, e8, e7, e6, e5, e4, e3, e2, e1, e0], at: input - ) - } - } - } - } - } - } - } - } - } + + extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8, + _ p9: P9 + ) -> OneOfBuilder.OneOf10 { + OneOfBuilder.OneOf10(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9) } } -} -extension OneOfBuilder { - @inlinable public static func buildBlock( - _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8, - _ p9: P9 - ) -> OneOfBuilder.OneOf10 { - OneOfBuilder.OneOf10(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9) - } -} +#endif // END AUTO-GENERATED CONTENT diff --git a/Sources/Parsing/Conversion.swift b/Sources/Parsing/Conversion.swift index 310a9ebb15..b6e9c97386 100644 --- a/Sources/Parsing/Conversion.swift +++ b/Sources/Parsing/Conversion.swift @@ -1,28 +1,37 @@ -/// Declares a type that can transform an `Input` value into an `Output` value *and* transform an -/// `Output` value back into an `Input` value. -/// -/// Useful in transforming the output of a parser-printer into some new type while preserving -/// printability via ``Parser/map(_:)-18m9d``. -@rethrows public protocol Conversion { - // The type of values this conversion converts from. - associatedtype Input +#if swift(>=5.7) + /// Declares a type that can transform an `Input` value into an `Output` value *and* transform an + /// `Output` value back into an `Input` value. + /// + /// Useful in transforming the output of a parser-printer into some new type while preserving + /// printability via ``Parser/map(_:)-18m9d``. + @rethrows public protocol Conversion { + // The type of values this conversion converts from. + associatedtype Input - // The type of values this conversion converts to. - associatedtype Output + // The type of values this conversion converts to. + associatedtype Output - /// Attempts to transform an input into an output. - /// - /// See ``Conversion/apply(_:)`` for the reverse process. - /// - /// - Parameter input: An input value. - /// - Returns: A transformed output value. - func apply(_ input: Input) throws -> Output + /// Attempts to transform an input into an output. + /// + /// See ``Conversion/apply(_:)`` for the reverse process. + /// + /// - Parameter input: An input value. + /// - Returns: A transformed output value. + func apply(_ input: Input) throws -> Output - /// Attempts to transform an output back into an input. - /// - /// The reverse process of ``Conversion/apply(_:)``. - /// - /// - Parameter output: An output value. - /// - Returns: An "un"-transformed input value. - func unapply(_ output: Output) throws -> Input -} + /// Attempts to transform an output back into an input. + /// + /// The reverse process of ``Conversion/apply(_:)``. + /// + /// - Parameter output: An output value. + /// - Returns: An "un"-transformed input value. + func unapply(_ output: Output) throws -> Input + } +#else + @rethrows public protocol Conversion { + associatedtype Input + associatedtype Output + func apply(_ input: Input) throws -> Output + func unapply(_ output: Output) throws -> Input + } +#endif diff --git a/Sources/Parsing/Conversions/ParseableFormatStyle.swift b/Sources/Parsing/Conversions/ParseableFormatStyleConversion.swift similarity index 100% rename from Sources/Parsing/Conversions/ParseableFormatStyle.swift rename to Sources/Parsing/Conversions/ParseableFormatStyleConversion.swift diff --git a/Sources/Parsing/Parser.swift b/Sources/Parsing/Parser.swift index 4fd080ee99..41e71a02fd 100644 --- a/Sources/Parsing/Parser.swift +++ b/Sources/Parsing/Parser.swift @@ -1,43 +1,51 @@ -/// Declares a type that can incrementally parse an `Output` value from an `Input` value. -/// -/// A parser attempts to parse a nebulous piece of data, represented by the `Input` associated type, -/// into something more well-structured, represented by the `Output` associated type. The parser -/// implements the ``parse(_:)-76tcw`` method, which is handed an `inout Input`, and its job is to -/// turn this into an `Output` if possible, or throw an error if it cannot. -/// -/// The argument of the ``parse(_:)-76tcw`` function is `inout` because a parser will usually -/// consume some of the input in order to produce an output. For example, we can use an -/// `Int.parser()` parser to extract an integer from the beginning of a substring and consume that -/// portion of the string: -/// -/// ```swift -/// var input: Substring = "123 Hello world" -/// -/// try Int.parser().parse(&input) // 123 -/// input // " Hello world" -/// ``` -/// -/// Note that this parser works on `Substring` rather than `String` because substrings expose -/// efficient ways of removing characters from its beginning. Substrings are "views" into a string, -/// specified by start and end indices. Operations like `removeFirst`, `removeLast` and others can -/// be implemented efficiently on substrings because they simply move the start and end indices, -/// whereas their implementation on strings must make a copy of the string with the characters -/// removed. -@rethrows public protocol Parser { - /// The type of values this parser parses from. - associatedtype Input +#if swift(>=5.7) + /// Declares a type that can incrementally parse an `Output` value from an `Input` value. + /// + /// A parser attempts to parse a nebulous piece of data, represented by the `Input` associated + /// type, into something more well-structured, represented by the `Output` associated type. The + /// parser implements the ``parse(_:)-76tcw`` method, which is handed an `inout Input`, and its + /// job is to turn this into an `Output` if possible, or throw an error if it cannot. + /// + /// The argument of the ``parse(_:)-76tcw`` function is `inout` because a parser will usually + /// consume some of the input in order to produce an output. For example, we can use an + /// `Int.parser()` parser to extract an integer from the beginning of a substring and consume that + /// portion of the string: + /// + /// ```swift + /// var input: Substring = "123 Hello world" + /// + /// try Int.parser().parse(&input) // 123 + /// input // " Hello world" + /// ``` + /// + /// Note that this parser works on `Substring` rather than `String` because substrings expose + /// efficient ways of removing characters from its beginning. Substrings are "views" into a + /// string, specified by start and end indices. Operations like `removeFirst`, `removeLast` and + /// others can be implemented efficiently on substrings because they simply move the start and end + /// indices, whereas their implementation on strings must make a copy of the string with the + /// characters removed. + @rethrows public protocol Parser { + /// The type of values this parser parses from. + associatedtype Input - /// The type of values parsed by this parser. - associatedtype Output + /// The type of values parsed by this parser. + associatedtype Output - /// Attempts to parse a nebulous piece of data into something more well-structured. Typically - /// you only call this from other `Parser` conformances, not when you want to parse a concrete - /// input. - /// - /// - Parameter input: A nebulous, mutable piece of data to be incrementally parsed. - /// - Returns: A more well-structured value parsed from the given input. - func parse(_ input: inout Input) throws -> Output -} + /// Attempts to parse a nebulous piece of data into something more well-structured. Typically + /// you only call this from other `Parser` conformances, not when you want to parse a concrete + /// input. + /// + /// - Parameter input: A nebulous, mutable piece of data to be incrementally parsed. + /// - Returns: A more well-structured value parsed from the given input. + func parse(_ input: inout Input) throws -> Output + } +#else + @rethrows public protocol Parser { + associatedtype Input + associatedtype Output + func parse(_ input: inout Input) throws -> Output + } +#endif extension Parser { /// Parse an input value into an output. This method is more ergonomic to use than diff --git a/Sources/Parsing/ParserPrinter.swift b/Sources/Parsing/ParserPrinter.swift index 2976ccfcb7..3d3a4ae9e5 100644 --- a/Sources/Parsing/ParserPrinter.swift +++ b/Sources/Parsing/ParserPrinter.swift @@ -1,17 +1,23 @@ -/// A ``Parser`` that can incrementally "print" an output value back into an input. -/// -/// > Note: Printing is the reverse operation of parsing, so the `Input` is essentially built up in -/// > reverse. As such, new values should be prepended to the front of the input. This allows -/// > parsers to check that the already-printed values match what is expected for any given -/// > ``Parser``. -@rethrows public protocol ParserPrinter: Parser { - /// Attempts to print a well-structured piece of data into something more nebulous. +#if swift(>=5.7) + /// A ``Parser`` that can incrementally "print" an output value back into an input. /// - /// - Parameters - /// - output: A well-structured value to be printed to the given input. - /// - input: A nebulous, mutable piece of data to be incrementally printed into. - func print(_ output: Output, into input: inout Input) throws -} + /// > Note: Printing is the reverse operation of parsing, so the `Input` is essentially built up + /// > in reverse. As such, new values should be prepended to the front of the input. This allows + /// > parsers to check that the already-printed values match what is expected for any given + /// > ``Parser``. + @rethrows public protocol ParserPrinter: Parser { + /// Attempts to print a well-structured piece of data into something more nebulous. + /// + /// - Parameters + /// - output: A well-structured value to be printed to the given input. + /// - input: A nebulous, mutable piece of data to be incrementally printed into. + func print(_ output: Output, into input: inout Input) throws + } +#else + @rethrows public protocol ParserPrinter: Parser { + func print(_ output: Output, into input: inout Input) throws + } +#endif extension ParserPrinter where Input: _EmptyInitializable { /// Attempts to print a well-structured piece of data to something more nebulous. diff --git a/Sources/Parsing/ParserPrinters/ParseableFormatStyle.swift b/Sources/Parsing/ParserPrinters/ParseableFormatStyle.swift new file mode 100644 index 0000000000..15aedd35e8 --- /dev/null +++ b/Sources/Parsing/ParserPrinters/ParseableFormatStyle.swift @@ -0,0 +1,36 @@ +#if swift(>=5.7) && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS)) + import Foundation + + @available(iOS 16, macOS 13, tvOS 16, watchOS 9, *) + public struct Formatted: ParserPrinter + where + Style.Strategy.ParseInput == String, + Style.Strategy.ParseOutput == Style.RegexOutput + { + @usableFromInline + let style: Style + + @inlinable + public init(_ style: Style) { + self.style = style + } + + @inlinable + public func parse(_ input: inout Substring) throws -> Style.Strategy.ParseOutput { + guard let match = input.prefixMatch(of: self.style.regex) + else { + throw ParsingError.failed( + summary: "failed to process \"\(Output.self)\"", + at: input + ) + } + input.removeFirst(input.distance(from: input.startIndex, to: input.endIndex)) + return match.output + } + + @inlinable + public func print(_ output: Style.FormatInput, into input: inout Substring) { + input.prepend(contentsOf: self.style.format(output)) + } + } +#endif diff --git a/Sources/Parsing/ParserPrinters/Pipe.swift b/Sources/Parsing/ParserPrinters/Pipe.swift index 0724e889ec..13f0f83c2d 100644 --- a/Sources/Parsing/ParserPrinters/Pipe.swift +++ b/Sources/Parsing/ParserPrinters/Pipe.swift @@ -40,13 +40,11 @@ extension Parser { extension Parser where Input: Collection { public func pipe( @ParserBuilder _ build: () -> Downstream - ) -> Parsers.Pipe>>> { + ) -> Parsers.Pipe>> { .init( upstream: self, - downstream: Parse { - build() - Parsers.PipeEnd() - }) + downstream: .init(build(), Parsers.PipeEnd()) + ) } } diff --git a/Sources/Parsing/PrependableCollection.swift b/Sources/Parsing/PrependableCollection.swift index 102051219a..9d9835aaea 100644 --- a/Sources/Parsing/PrependableCollection.swift +++ b/Sources/Parsing/PrependableCollection.swift @@ -1,89 +1,95 @@ import Foundation -/// A collection that supports empty initialization and the ability to prepend a sequence of -/// elements of elements to itself. -/// -/// `PrependableCollection` is a specialized subset of `RangeReplaceableCollection` that is tuned to -/// incremental printing. -/// -/// In fact, any `RangeReplaceableCollection` can get a conformance for free: -/// -/// ```swift -/// extension MyRangeReplaceableCollection: PrependableCollection {} -/// ``` -/// -/// Because it is also less strict than `RangeReplaceableCollection`, it is an appropriate protocol -/// to conform to for types that cannot and should not conform to `RangeReplaceableCollection` -/// directly. -/// -/// For example, `Substring.UTF8View` is a common input for string parsers to parse from, but it -/// does not conform to `RangeReplaceableCollection`. It does, however, conform to -/// `PrependableCollection` by validating and prepending the given UTF-8 bytes to its underlying -/// substring. So in order to write a parser against generic sequences of UTF-8 bytes, you would -/// constrain its input against `PrependableCollection`. -/// -/// For example the following `Digits` parser is generic over an `Collection` of bytes, and its -/// printer conformance further constraints its input to be prependable. -/// -/// ```swift -/// struct Digits: Parser -/// where -/// Input.Element == UTF8.CodeUnit, // Required for working with a collection of bytes (`UInt8`) -/// Input.SubSequence == Input // Required for the parser to consume from input -/// { -/// func parse(_ input: inout Input) throws -> Int { -/// // Collect all bytes between ASCII "0" and "9" -/// let prefix = input.prefix(while: { $0 >= .init(ascii: "0") && $0 <= .init(ascii: "9") }) -/// -/// // Attempt to convert to an `Int` -/// guard let int = Int(prefix) else { -/// struct ParseError: Error {} -/// throw ParseError() -/// } -/// -/// // Incrementally consume bytes from input -/// input.removeFirst(prefix.count) -/// -/// return int -/// } -/// } -/// -/// extension Digits: ParserPrinter where Input: PrependableCollection { -/// func print(_ output: Int, into input: inout Input) { -/// // Convert `Int` to string's underlying bytes -/// let bytes = String(output).utf8 -/// -/// // Prepend bytes using `PrependableCollection` conformance. -/// input.prepend(contentsOf: bytes) -/// } -/// } -/// ``` -/// -/// The `Digits` parser-printer now works on any collection of UTF-8 code units, including -/// `UTF8View` and `ArraySlice`: -/// -/// ```swift -/// var input = "123"[...].utf8 -/// try Digits().parse(&input) // 123 -/// try Digits().print(123, into: &input) -/// Substring(input) // "123" -/// ``` -/// -/// ```swift -/// var input = ArraySlice("123"[...].utf8) -/// try Digits().parse(&input) // 123 -/// try Digits().print(123, into: &input) -/// Substring(decoding: input, as: UTF8.self) // "123" -/// ``` -public protocol PrependableCollection: Collection, _EmptyInitializable { - /// Inserts the elements of a sequence or collection to the beginning of this collection. - /// - /// The collection being prepended to allocates any additional necessary storage to hold the new - /// elements. - /// - /// - Parameter newElements: The elements to append to the collection. - mutating func prepend(contentsOf newElements: S) where S.Element == Element -} +#if swift(>=5.7) + /// A collection that supports empty initialization and the ability to prepend a sequence of + /// elements of elements to itself. + /// + /// `PrependableCollection` is a specialized subset of `RangeReplaceableCollection` that is tuned + /// to incremental printing. + /// + /// In fact, any `RangeReplaceableCollection` can get a conformance for free: + /// + /// ```swift + /// extension MyRangeReplaceableCollection: PrependableCollection {} + /// ``` + /// + /// Because it is also less strict than `RangeReplaceableCollection`, it is an appropriate + /// protocol to conform to for types that cannot and should not conform to + /// `RangeReplaceableCollection` directly. + /// + /// For example, `Substring.UTF8View` is a common input for string parsers to parse from, but it + /// does not conform to `RangeReplaceableCollection`. It does, however, conform to + /// `PrependableCollection` by validating and prepending the given UTF-8 bytes to its underlying + /// substring. So in order to write a parser against generic sequences of UTF-8 bytes, you would + /// constrain its input against `PrependableCollection`. + /// + /// For example the following `Digits` parser is generic over an `Collection` of bytes, and its + /// printer conformance further constraints its input to be prependable. + /// + /// ```swift + /// struct Digits: Parser + /// where + /// Input.Element == UTF8.CodeUnit, // Required for working with a collection of bytes + /// Input.SubSequence == Input // Required for the parser to consume from input + /// { + /// func parse(_ input: inout Input) throws -> Int { + /// // Collect all bytes between ASCII "0" and "9" + /// let prefix = input.prefix(while: { $0 >= .init(ascii: "0") && $0 <= .init(ascii: "9") }) + /// + /// // Attempt to convert to an `Int` + /// guard let int = Int(prefix) else { + /// struct ParseError: Error {} + /// throw ParseError() + /// } + /// + /// // Incrementally consume bytes from input + /// input.removeFirst(prefix.count) + /// + /// return int + /// } + /// } + /// + /// extension Digits: ParserPrinter where Input: PrependableCollection { + /// func print(_ output: Int, into input: inout Input) { + /// // Convert `Int` to string's underlying bytes + /// let bytes = String(output).utf8 + /// + /// // Prepend bytes using `PrependableCollection` conformance. + /// input.prepend(contentsOf: bytes) + /// } + /// } + /// ``` + /// + /// The `Digits` parser-printer now works on any collection of UTF-8 code units, including + /// `UTF8View` and `ArraySlice`: + /// + /// ```swift + /// var input = "123"[...].utf8 + /// try Digits().parse(&input) // 123 + /// try Digits().print(123, into: &input) + /// Substring(input) // "123" + /// ``` + /// + /// ```swift + /// var input = ArraySlice("123"[...].utf8) + /// try Digits().parse(&input) // 123 + /// try Digits().print(123, into: &input) + /// Substring(decoding: input, as: UTF8.self) // "123" + /// ``` + public protocol PrependableCollection: Collection, _EmptyInitializable { + /// Inserts the elements of a sequence or collection to the beginning of this collection. + /// + /// The collection being prepended to allocates any additional necessary storage to hold the new + /// elements. + /// + /// - Parameter newElements: The elements to append to the collection. + mutating func prepend(contentsOf newElements: S) where S.Element == Element + } +#else + public protocol PrependableCollection: Collection, _EmptyInitializable { + mutating func prepend(contentsOf newElements: S) where S.Element == Element + } +#endif extension PrependableCollection { /// Creates a new instance of a collection containing the elements of a sequence. diff --git a/Sources/swift-parsing-benchmark/Date.swift b/Sources/swift-parsing-benchmark/Date.swift index 67927bf2d7..af50857c16 100644 --- a/Sources/swift-parsing-benchmark/Date.swift +++ b/Sources/swift-parsing-benchmark/Date.swift @@ -5,137 +5,137 @@ import Parsing /// This benchmarks implements an [RFC-3339-compliant](https://www.ietf.org/rfc/rfc3339.txt) date /// parser in a relatively naive way and pits it against `DateFormatter` and `ISO8601DateFormatter`. /// -/// Not only is the parser faster than both formatters, it is more flexible and accurate: it will parse -/// parse fractional seconds and time zone offsets automatically, and it will parse to the nanosecond, -/// while the formatters do not parse beyond the millisecond. +/// Not only is the parser faster than both formatters, it is more flexible and accurate: it will +/// parse fractional seconds and time zone offsets automatically, and it will parse to the +/// nanosecond, while the formatters do not parse beyond the millisecond. let dateSuite = BenchmarkSuite(name: "Date") { suite in - let timeDelim = OneOf { - "T".utf8 - "t".utf8 - " ".utf8 - } - - let nanoSecfrac = Prefix(while: (.init(ascii: "0") ... .init(ascii: "9")).contains) - .map { $0.prefix(9) } - - let timeSecfrac = Parse { - ".".utf8 - nanoSecfrac - } - .compactMap { n in - Int(String(decoding: n, as: UTF8.self)) - .map { $0 * Int(pow(10, 9 - Double(n.count))) } - } - - let timeNumoffset = Parse { - OneOf { - "+".utf8.map { 1 } - "-".utf8.map { -1 } + #if swift(>=5.7) + let timeDelim = OneOf { + "T".utf8 + "t".utf8 + " ".utf8 } - Digits(2) - ":".utf8 - Digits(2) - } - - let timeOffset = OneOf { - "Z".utf8.map { ( /*sign: */1, /*minute: */ 0, /*second: */ 0) } - timeNumoffset - } - .compactMap { TimeZone(secondsFromGMT: $0 * ($1 * 60 + $2)) } - - let partialTime = Parse { - Digits(2) - ":".utf8 - Digits(2) - ":".utf8 - Digits(2) - Optionally { - timeSecfrac + + let nanoSecfrac = Prefix(while: (.init(ascii: "0") ... .init(ascii: "9")).contains) + .map { $0.prefix(9) } + + let timeSecfrac = Parse { + ".".utf8 + nanoSecfrac + } + .compactMap { n in + Int(String(decoding: n, as: UTF8.self)) + .map { $0 * Int(pow(10, 9 - Double(n.count))) } + } + + let timeNumoffset = Parse { + OneOf { + "+".utf8.map { 1 } + "-".utf8.map { -1 } + } + Digits(2) + ":".utf8 + Digits(2) + } + + let timeOffset = OneOf { + "Z".utf8.map { ( /*sign: */1, /*minute: */ 0, /*second: */ 0) } + timeNumoffset + } + .compactMap { TimeZone(secondsFromGMT: $0 * ($1 * 60 + $2)) } + + let partialTime = Parse { + Digits(2) + ":".utf8 + Digits(2) + ":".utf8 + Digits(2) + Optionally { + timeSecfrac + } + } + + let fullDate = Parse { + Digits(4) + "-".utf8 + Digits(2) + "-".utf8 + Digits(2) + } + + let offsetDateTime = Parse { + fullDate + timeDelim + partialTime + timeOffset + } + .map { year, month, day, time, timeZone -> DateComponents in + let (hour, minute, second, nanosecond) = time + return DateComponents( + timeZone: timeZone, + year: year, month: month, day: day, + hour: hour, minute: minute, second: second, nanosecond: nanosecond + ) + } + + let localDateTime = Parse { + fullDate + timeDelim + partialTime + } + .map { year, month, day, time -> DateComponents in + let (hour, minute, second, nanosecond) = time + return DateComponents( + year: year, month: month, day: day, + hour: hour, minute: minute, second: second, nanosecond: nanosecond + ) + } + + let localDate = + fullDate + .map { DateComponents(year: $0, month: $1, day: $2) } + + let localTime = + partialTime + .map { DateComponents(hour: $0, minute: $1, second: $2, nanosecond: $3) } + + let dateTime = OneOf { + offsetDateTime + localDateTime + localDate + localTime + } + + let input = "1979-05-27T00:32:00Z" + let expected = Date(timeIntervalSince1970: 296_613_120) + var output: Date! + + let dateTimeParser = dateTime.compactMap(Calendar.current.date(from:)) + suite.benchmark("Parser") { + var input = input[...].utf8 + output = try dateTimeParser.parse(&input) + } tearDown: { + precondition(output == expected) } - } - - let fullDate = Parse { - Digits(4) - "-".utf8 - Digits(2) - "-".utf8 - Digits(2) - } - - let offsetDateTime = Parse { - fullDate - timeDelim - partialTime - timeOffset - } - .map { date, time, timeZone -> DateComponents in - let (year, month, day) = date - let (hour, minute, second, nanosecond) = time - return DateComponents( - timeZone: timeZone, - year: year, month: month, day: day, - hour: hour, minute: minute, second: second, nanosecond: nanosecond - ) - } - - let localDateTime = Parse { - fullDate - timeDelim - partialTime - } - .map { date, time -> DateComponents in - let (year, month, day) = date - let (hour, minute, second, nanosecond) = time - return DateComponents( - year: year, month: month, day: day, - hour: hour, minute: minute, second: second, nanosecond: nanosecond - ) - } - - let localDate = - fullDate - .map { DateComponents(year: $0, month: $1, day: $2) } - - let localTime = - partialTime - .map { DateComponents(hour: $0, minute: $1, second: $2, nanosecond: $3) } - - let dateTime = OneOf { - offsetDateTime - localDateTime - localDate - localTime - } - - let input = "1979-05-27T00:32:00Z" - let expected = Date(timeIntervalSince1970: 296_613_120) - var output: Date! - - let dateTimeParser = dateTime.compactMap(Calendar.current.date(from:)) - suite.benchmark("Parser") { - var input = input[...].utf8 - output = try dateTimeParser.parse(&input) - } tearDown: { - precondition(output == expected) - } - - let dateFormatter = DateFormatter() - dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'" - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)! - suite.benchmark("DateFormatter") { - output = dateFormatter.date(from: input) - } tearDown: { - precondition(output == expected) - } - - if #available(macOS 10.12, *) { - let iso8601DateFormatter = ISO8601DateFormatter() - iso8601DateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - suite.benchmark("ISO8601DateFormatter") { - output = iso8601DateFormatter.date(from: input) + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'" + dateFormatter.locale = Locale(identifier: "en_US_POSIX") + dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)! + suite.benchmark("DateFormatter") { + output = dateFormatter.date(from: input) } tearDown: { precondition(output == expected) } - } + + if #available(macOS 10.12, *) { + let iso8601DateFormatter = ISO8601DateFormatter() + iso8601DateFormatter.timeZone = TimeZone(secondsFromGMT: 0) + suite.benchmark("ISO8601DateFormatter") { + output = iso8601DateFormatter.date(from: input) + } tearDown: { + precondition(output == expected) + } + } + #endif } diff --git a/Sources/variadics-generator/VariadicsGenerator.swift b/Sources/variadics-generator/VariadicsGenerator.swift index 152f54adfc..2366202ed0 100644 --- a/Sources/variadics-generator/VariadicsGenerator.swift +++ b/Sources/variadics-generator/VariadicsGenerator.swift @@ -87,7 +87,15 @@ struct VariadicsGenerator: ParsableCommand { var generateOneOfs = false func run() throws { - output("// BEGIN AUTO-GENERATED CONTENT\n\n") + output( + """ + // BEGIN AUTO-GENERATED CONTENT + + #if swift(<5.7) + + + """ + ) if self.generateZips { for arity in 2...6 { @@ -96,12 +104,19 @@ struct VariadicsGenerator: ParsableCommand { } if self.generateOneOfs { - for arity in 2...10 { + for arity in 3...10 { emitOneOfDeclaration(arity: arity) } } - output("// END AUTO-GENERATED CONTENT\n") + output( + """ + #endif + + // END AUTO-GENERATED CONTENT + + """ + ) } func emitZipDeclarations(arity: Int) { diff --git a/Tests/ParsingTests/ParseableFormatTests.swift b/Tests/ParsingTests/ParseableFormatTests.swift new file mode 100644 index 0000000000..aa75faa7a6 --- /dev/null +++ b/Tests/ParsingTests/ParseableFormatTests.swift @@ -0,0 +1,23 @@ +#if swift(>=5.7) && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS)) + import Parsing + import XCTest + + @available(iOS 16, macOS 13, tvOS 16, watchOS 9, *) + final class ParseableFormatStyleTests: XCTestCase { + func testFormatted() { + let p = ParsePrint { + "TOTAL: " + Formatted(.currency(code: "USD")) + } + + XCTAssertEqual( + try p.parse("TOTAL: $42.42"), + 42.42 + ) + XCTAssertEqual( + try p.print(42.42), + "TOTAL: $42.42" + ) + } + } +#endif