Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/swift-parsing-benchmark/JSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ let jsonSuite = BenchmarkSuite(name: "JSON") { suite in
struct JSONObject: ParserPrinter {
var body: some ParserPrinter<Substring.UTF8View, [String: JSONValue.Output]> {
"{".utf8
Many(into: [String: JSONValue.Output]()) { object, pair in
Many(into: [String: JSONValue.Output]()) { (
object: inout [String: JSONValue.Output],
pair: (String, JSONValue.Output)
) in
let (name, value) = pair
object[name] = value
} decumulator: { object in
Expand Down
5 changes: 4 additions & 1 deletion Tests/ParsingTests/OneOfTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ final class OneOfTests: XCTestCase {
struct JSONObject: ParserPrinter {
var body: some ParserPrinter<Substring.UTF8View, [String: JSONValue.Output]> {
"{".utf8
Many(into: [String: JSONValue.Output]()) { object, pair in
Many(into: [String: JSONValue.Output]()) { (
object: inout [String: JSONValue.Output],
pair: (String, JSONValue.Output)
) in
let (name, value) = pair
object[name] = value
} decumulator: { object in
Expand Down