mirror of
https://github.com/github/semantic.git
synced 2024-11-29 11:02:26 +03:00
Add a little API for diffs.
This commit is contained in:
parent
5a86df7a8d
commit
0d8c080f35
@ -33,6 +33,18 @@ final class DiffTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
private func insert(term: Term) -> Diff {
|
||||
return Diff.Pure(.Insert(term))
|
||||
}
|
||||
|
||||
private func delete(term: Term) -> Diff {
|
||||
return Diff.Pure(.Delete(term))
|
||||
}
|
||||
|
||||
private func copy(term: Term) -> Diff {
|
||||
return Diff.Roll(term.out.map(copy))
|
||||
}
|
||||
|
||||
private typealias Term = Fix<Info>
|
||||
private typealias Diff = Free<Info, Patch<Info>>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user