Extended lib_utils/pos.ml{i}. First import of Ligodity. (No "simplify" yet.)

This commit is contained in:
Georges Dupéron 2019-05-15 16:04:09 +02:00
parent 3a7d2a85f1
commit b69e838bec
2 changed files with 7 additions and 1 deletions

View File

@ -119,6 +119,11 @@ let make ~byte ~point_num ~point_bol =
(if offsets then self#offset mode else self#column mode) (if offsets then self#offset mode else self#column mode)
end end
let from_byte byte =
let point_num = byte.Lexing.pos_cnum
and point_bol = byte.Lexing.pos_bol
in make ~byte ~point_num ~point_bol
let ghost = make ~byte:Lexing.dummy_pos ~point_num:(-1) ~point_bol:(-1) let ghost = make ~byte:Lexing.dummy_pos ~point_num:(-1) ~point_bol:(-1)
let min = let min =

View File

@ -94,7 +94,8 @@ type pos = t
(* Constructors *) (* Constructors *)
val make : byte:Lexing.position -> point_num:int -> point_bol:int -> t val make : byte:Lexing.position -> point_num:int -> point_bol:int -> t
val from_byte : Lexing.position -> t
(* Special positions *) (* Special positions *)