1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Partial application.

This commit is contained in:
Rob Rix 2015-11-05 17:26:06 -05:00
parent e4db8a5f14
commit 82b40bd043

View File

@ -151,7 +151,7 @@ extension ForwardIndexType {
}
}
func refineLeafReplacement(patch: Patch<Term>, aString: String, bString: String) -> Diff {
func refineLeafReplacement(aString: String, _ bString: String)(_ patch: Patch<Term>) -> Diff {
switch patch {
case let .Replace(.Unroll(aExtract, .Leaf), .Unroll(bExtract, .Leaf)):
let a = aString.utf16[aExtract.range].enumerate().map { Term(Info(range: (aExtract.range.startIndex + 0).range, categories: aExtract.categories), .Leaf(String($1))) }