1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 16:33:03 +03:00

Indicate which string failed.

This commit is contained in:
Rob Rix 2015-10-20 12:09:38 -04:00
parent aebb69c852
commit a5b1b3d91d

View File

@ -23,12 +23,12 @@ print(parse(json, input: dictWithArray))
func diffAndSerialize(a aString: String, b bString: String) -> String? {
let aParsed = curry(parse)(json)(aString)
guard let a = aParsed.right else {
_ = aParsed.left.map { print($0) }
_ = aParsed.left.map { print("error parsing a: ", $0) }
return nil
}
let bParsed = curry(parse)(json)(bString)
guard let b = bParsed.right else {
_ = bParsed.left.map { print($0) }
_ = bParsed.left.map { print("error parsing b: ", $0) }
return nil
}