@@ -27,7 +27,7 @@ let btwn loc1 loc2 = { source = loc1.source; start = loc1.start; _end = loc2._en
27
27
(* Returns the position immediately before the start of the given loc. If the
28
28
given loc is at the beginning of a line, return the position of the first
29
29
char on the same line. *)
30
- let char_before loc =
30
+ (* let char_before loc =
31
31
let start =
32
32
let { line; column } = loc.start in
33
33
let column =
@@ -39,14 +39,14 @@ let char_before loc =
39
39
{ line; column }
40
40
in
41
41
let _end = loc.start in
42
- { loc with start; _end }
42
+ { loc with start; _end } *)
43
43
44
44
(* Returns the location of the first character in the given loc. Not accurate if the
45
45
* first line is a newline character, but is still consistent with loc orderings. *)
46
- let first_char loc =
46
+ (* let first_char loc =
47
47
let start = loc.start in
48
48
let _end = { start with column = start.column + 1 } in
49
- { loc with _end }
49
+ { loc with _end } *)
50
50
51
51
let pos_cmp a b =
52
52
let k = a.line - b.line in
@@ -60,7 +60,7 @@ let pos_cmp a b =
60
60
* If `b` starts before `a` (even if it ends inside), returns < 0.
61
61
* If `b` ends after `a` (even if it starts inside), returns > 0.
62
62
*)
63
- let span_compare a b =
63
+ (* let span_compare a b =
64
64
let k = File_key.compare_opt a.source b.source in
65
65
if k = 0 then
66
66
let k = pos_cmp a.start b.start in
@@ -73,15 +73,15 @@ let span_compare a b =
73
73
else
74
74
1
75
75
else
76
- k
76
+ k *)
77
77
78
78
(* Returns true if loc1 entirely overlaps loc2 *)
79
- let contains loc1 loc2 = span_compare loc1 loc2 = 0
79
+ (* let contains loc1 loc2 = span_compare loc1 loc2 = 0 *)
80
80
81
81
(* Returns true if loc1 intersects loc2 at all *)
82
- let lines_intersect loc1 loc2 =
82
+ (* let lines_intersect loc1 loc2 =
83
83
File_key.compare_opt loc1.source loc2.source = 0
84
- && not (loc1._end.line < loc2.start.line || loc1.start.line > loc2._end.line)
84
+ && not (loc1._end.line < loc2.start.line || loc1.start.line > loc2._end.line) *)
85
85
86
86
let compare loc1 loc2 =
87
87
let k = File_key. compare_opt loc1.source loc2.source in
@@ -94,13 +94,13 @@ let compare loc1 loc2 =
94
94
else
95
95
k
96
96
97
- let equal loc1 loc2 = compare loc1 loc2 = 0
97
+ (* let equal loc1 loc2 = compare loc1 loc2 = 0 *)
98
98
99
99
(* *
100
100
* This is mostly useful for debugging purposes.
101
101
* Please don't dead-code delete this!
102
102
*)
103
- let debug_to_string ?(include_source = false ) loc =
103
+ (* let debug_to_string ?(include_source = false) loc =
104
104
let source =
105
105
if include_source then
106
106
Printf.sprintf
@@ -119,9 +119,9 @@ let debug_to_string ?(include_source = false) loc =
119
119
loc._end.line
120
120
loc._end.column
121
121
in
122
- source ^ pos
122
+ source ^ pos *)
123
123
124
- let to_string_no_source loc =
124
+ (* let to_string_no_source loc =
125
125
let line = loc.start.line in
126
126
let start = loc.start.column + 1 in
127
127
let end_ = loc._end.column in
@@ -141,4 +141,4 @@ let make file line col =
141
141
142
142
let start_loc loc = { loc with _end = loc.start }
143
143
144
- let end_loc loc = { loc with start = loc._end }
144
+ let end_loc loc = { loc with start = loc._end } *)
0 commit comments