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

Clean up the range function.

This commit is contained in:
Rob Rix 2015-10-28 14:32:59 -04:00
parent 5d6e10e25a
commit 04a782b5d0

View File

@ -90,11 +90,9 @@ if let aString = arguments[1].flatMap(readFile), bString = arguments[2].flatMap(
if let a = termWithInput(aString), b = termWithInput(bString) {
let diff = Interpreter<Term>(equal: Term.equals(annotation: const(true), leaf: ==), comparable: const(true), cost: Free.sum(Patch.difference)).run(a, b)
let range: Range<Int> -> Doubt.JSON = {
let start = $0.startIndex
let end = $0.endIndex
return [
.Number(Double(start)),
.Number(Double(end - start)),
[
$0.startIndex.JSON,
($0.endIndex - $0.startIndex).JSON,
]
}
let JSON: Doubt.JSON = [