mirror of
https://github.com/github/semantic.git
synced 2024-12-01 00:33:59 +03:00
Use the context-printing function for indexed syntax.
This commit is contained in:
parent
d015f972ae
commit
523d7a441e
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user