mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +03:00
UnannotatedTerm is Comparable.
This commit is contained in:
parent
df0ba4c10e
commit
6e376d9d51
@ -1,4 +1,4 @@
|
||||
struct UnannotatedTerm: Equatable {
|
||||
struct UnannotatedTerm: Comparable {
|
||||
typealias Term = Cofree<String, ()>
|
||||
let term: Term
|
||||
|
||||
@ -71,6 +71,10 @@ func == (left: UnannotatedTerm, right: UnannotatedTerm) -> Bool {
|
||||
return UnannotatedTerm.Term.equals(annotation: const(true), leaf: ==)(left.term, right.term)
|
||||
}
|
||||
|
||||
func < (left: UnannotatedTerm, right: UnannotatedTerm) -> Bool {
|
||||
return left.term.size < right.term.size
|
||||
}
|
||||
|
||||
|
||||
extension UnannotatedTerm: Arbitrary {
|
||||
static func arbitrary(k: Int) -> Gen<UnannotatedTerm> {
|
||||
|
Loading…
Reference in New Issue
Block a user