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
@@ -9,15 +17,11 @@ include struct
9
17
module Fpath = Path
10
18
module Int = Int
11
19
module Table = Table
12
- module Tuple = Tuple
13
20
module Unix_env = Env
14
21
module Io = Io
15
22
module Map = Map
16
23
module Monoid = Monoid
17
24
module Pid = Pid
18
- module Poly = Poly
19
-
20
- let sprintf = sprintf
21
25
end
22
26
23
27
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