1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 17:59:10 +03:00

Stub diffing in the middle of the graph.

This commit is contained in:
Rob Rix 2015-10-06 11:40:54 -04:00
parent 1d993bb65b
commit 03c5f0b644

View File

@ -121,7 +121,15 @@ public enum FreeAlgorithm<A, B> {
matrix = Matrix(width: a.count, height: b.count) { i, j in
let right = matrix[i + 1, j]
let down = matrix[i, j + 1]
let diagonal = matrix[i + 1, j + 1]
let here = Diff.Pure(Patch.Replace(a[i], b[j]))
if let right = right, down = down, diagonal = diagonal {
// nominate the best edge to continue along
return Stream.Cons(here, Memo(evaluated: .Nil))
}
// right extent of the edit graph; can only move down
if let down = down {
return Stream.Cons(here, down)