1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Only match leaves.

This commit is contained in:
Rob Rix 2015-11-05 16:52:54 -05:00
parent 6327829f6e
commit 8872c67c52

View File

@ -146,8 +146,8 @@ func parserForType(type: String) -> String throws -> Term {
func refineLeafReplacement(diff: Diff, aString: String, bString: String) -> Diff {
switch diff {
case let .Pure(.Replace(a, b)):
return .Roll((a.extract, b.extract), .Indexed([]))
case let .Pure(.Replace(.Unroll(aExtract, .Leaf), .Unroll(bExtract, .Leaf))):
return .Roll((aExtract, bExtract), .Indexed([]))
default:
return diff
}