Skip to content

Commit d194a44

Browse files
committed
loc: add compare function
1 parent 5ba8897 commit d194a44

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/elpi_API.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module Ast : sig
3636
val pp : Format.formatter -> t -> unit
3737
val show : t -> string
3838
val equal : t -> t -> bool
39+
val compare : t -> t -> int
3940

4041
val initial : string -> t
4142
end

src/elpi_util.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module Loc = struct
9595
line: int;
9696
line_starts_at: int;
9797
}
98-
[@@deriving eq]
98+
[@@deriving eq, ord]
9999

100100
let to_string {
101101
source_name;

src/elpi_util.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ module Loc : sig
7373
val show : t -> string
7474
val pp : Format.formatter -> t -> unit
7575
val equal : t -> t -> bool
76+
val compare : t -> t -> int
7677
val initial : string -> t
7778
end
7879

0 commit comments

Comments
 (0)