2015-09-23 23:37:22 +03:00
|
|
|
import Doubt
|
|
|
|
import SourceKittenFramework
|
|
|
|
|
2015-09-23 23:34:07 +03:00
|
|
|
let arguments = BoundsCheckedArray(array: Process.arguments)
|
|
|
|
|
2015-09-23 23:37:22 +03:00
|
|
|
extension Term {
|
|
|
|
init?(path: String) {
|
|
|
|
guard let term = File(path: path)
|
|
|
|
.map(Structure.init)
|
|
|
|
.map({ $0.dictionary })
|
|
|
|
.map(toAnyObject)
|
|
|
|
.flatMap({ JSON(object: $0).map { Term(path: path, JSON: $0) } }) else { return nil }
|
|
|
|
self = term
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-23 23:39:30 +03:00
|
|
|
if let a = arguments[1].flatMap(Term.init), b = arguments[2].flatMap(Term.init) {
|
|
|
|
print(Diff(a, b))
|
2015-09-23 23:37:22 +03:00
|
|
|
}
|