mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
Clean up the range
function.
This commit is contained in:
parent
5d6e10e25a
commit
04a782b5d0
@ -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 = [
|
||||
|
Loading…
Reference in New Issue
Block a user