Source file Pos.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
type t = {
  row: int;
  column: int;
}

let zero = { row = 0; column = 0 }

let equal a b = a.row = b.row && a.column = b.column

let compare a b =
  let c = Int.compare a.row b.row in
  if c <> 0 then c
  else Int.compare a.column b.column