struct Info: Categorizable, CustomJSONConvertible, Equatable { init(range: Range, line: Line, column: Column, categories: Set) { self.range = range self.line = line self.column = column self.categories = categories } init(range: Range, line: Line, column: Column, categories: Set) { // FIXME: this is terrible. see also https://github.com/github/semantic-diff/issues/136 self.range = Int(String(range.startIndex))!.. let line: Line let column: Column // MARK: Categorizable let categories: Set // MARK: CustomJSONConvertible var JSON: Doubt.JSON { return [ "range": range.JSON, "line": line.JSON, "column": column.JSON, "categories": Array(categories).JSON ] } } func == (left: Info, right: Info) -> Bool { return left.range == right.range && left.categories == right.categories } import Madness import Doubt