File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
(* All modules from [Stdune] should be in the struct below. The modules are
2
2
listed alphabetically. Try to keep the order. *)
3
3
4
+ module Poly = struct
5
+ let equal = ( = )
6
+ let compare x y = Ordering. of_int (compare x y)
7
+ let hash x = Hashtbl. hash x
8
+ end
9
+
10
+ let sprintf = Printf. sprintf
11
+
4
12
include struct
5
13
open Stdune
6
14
module Code_error = Code_error
7
15
module Comparable = Comparable
8
16
module Exn_with_backtrace = Exn_with_backtrace
9
17
module Int = Int
10
18
module Table = Table
11
- module Tuple = Tuple
12
19
module Unix_env = Env
13
20
module Io = Io
14
21
module Map = Map
15
22
module Monoid = Monoid
16
23
module Pid = Pid
17
- module Poly = Poly
18
-
19
- let sprintf = sprintf
20
24
end
21
25
22
26
include struct
Original file line number Diff line number Diff line change @@ -37,10 +37,7 @@ let ( - ) ({ line; character } : t) (t : t) : t =
37
37
;;
38
38
39
39
let abs ({ line; character } : t ) : t = { line = abs line; character = abs character }
40
-
41
- let compare ({ line; character } : t ) (t : t ) : Ordering.t =
42
- Stdune.Tuple.T2. compare Int. compare Int. compare (line, character) (t.line, t.character)
43
- ;;
40
+ let compare (x : t ) (t : t ) : Ordering.t = Poly. compare x t
44
41
45
42
let compare_inclusion (t : t ) (r : Lsp.Types.Range.t ) =
46
43
match compare t r.start, compare t r.end_ with
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ let contains (x : t) (y : t) =
22
22
let compare_size (x : t ) (y : t ) =
23
23
let dx = Position. (x.end_ - x.start) in
24
24
let dy = Position. (y.end_ - y.start) in
25
- Tuple.T2. compare Int. compare Int . compare (dx.line, dy.line) (dx.character, dy.character)
25
+ Poly . compare (dx.line, dy.line) (dx.character, dy.character)
26
26
;;
27
27
28
28
let first_line =
You can’t perform that action at this time.
0 commit comments