1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Use the context-printing function for indexed syntax.

This commit is contained in:
Rob Rix 2015-11-02 16:15:34 -05:00
parent d015f972ae
commit 523d7a441e

View File

@ -26,16 +26,7 @@ func unified(diff: Diff, before: String, after: String) -> String {
case .Leaf:
return (String(after.utf16[info.1.range]), info.1.range)
case let .Indexed(i):
var previous = info.1.range.startIndex
var out: String = ""
for (string, range) in i {
if let range = range {
out += String(after.utf16[previous..<range.startIndex])
previous = range.endIndex
}
out += string
}
return (out + String(after.utf16[previous..<info.1.range.endIndex]), info.1.range)
return (unified(info.1.range, children: i, source: after), info.1.range)
case let .Fixed(f):
return (unified(info.1.range, children: f, source: after), info.1.range)
case let .Keyed(k):