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 11(* All modules from [Stdune] should be in the struct below. The modules are
22 listed alphabetically. Try to keep the order. *)
33
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+
412include struct
513 open Stdune
614 module Code_error = Code_error
715 module Comparable = Comparable
816 module Exn_with_backtrace = Exn_with_backtrace
917 module Int = Int
1018 module Table = Table
11- module Tuple = Tuple
1219 module Unix_env = Env
1320 module Io = Io
1421 module Map = Map
1522 module Monoid = Monoid
1623 module Pid = Pid
17- module Poly = Poly
18-
19- let sprintf = sprintf
2024end
2125
2226include struct
Original file line number Diff line number Diff line change @@ -37,10 +37,7 @@ let ( - ) ({ line; character } : t) (t : t) : t =
3737;;
3838
3939let 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
4441
4542let compare_inclusion (t : t ) (r : Lsp.Types.Range.t ) =
4643 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) =
2222let compare_size (x : t ) (y : t ) =
2323 let dx = Position. (x.end_ - x.start) in
2424 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)
2626;;
2727
2828let first_line =
You can’t perform that action at this time.
0 commit comments