1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Add a property computing a single-element range from an index.

This commit is contained in:
Rob Rix 2015-11-05 17:10:41 -05:00
parent ead261d459
commit c6ec6fa311

View File

@ -144,6 +144,13 @@ func parserForType(type: String) -> String throws -> Term {
}
}
extension ForwardIndexType {
/// The range encompassing a single index.
var range: Range<Self> {
return self..<self.successor()
}
}
func refineLeafReplacement(diff: Diff, aString: String, bString: String) -> Diff {
switch diff {
case let .Pure(.Replace(.Unroll(aExtract, .Leaf), .Unroll(bExtract, .Leaf))):