diff options
| author | Maxime Dénès | 2016-06-20 15:41:16 +0200 |
|---|---|---|
| committer | Maxime Dénès | 2016-06-20 15:41:16 +0200 |
| commit | 6c34cc04f5bf58973bfa1f5626b8f989a42da97c (patch) | |
| tree | 55a99c3353a3ef2f0898307b51325098e4ee5b54 /lib | |
| parent | bef8d3ec1c1ea37b6867519fa7c9da80ccd6b3f6 (diff) | |
| parent | 058209a96579c73d786a3ceb8a7445cd5b7a8962 (diff) | |
Merge remote-tracking branch 'github/pr/212' into trunk
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/loc.ml | 5 | ||||
| -rw-r--r-- | lib/loc.mli | 17 |
2 files changed, 12 insertions, 10 deletions
diff --git a/lib/loc.ml b/lib/loc.ml index afdab928c4..0f9864a9ac 100644 --- a/lib/loc.ml +++ b/lib/loc.ml @@ -8,7 +8,6 @@ (* Locations management *) - type t = { fname : string; (** filename *) line_nb : int; (** start line number *) @@ -19,7 +18,7 @@ type t = { ep : int; (** end position *) } -let create fname line_nb bol_pos (bp, ep) = { +let create fname line_nb bol_pos bp ep = { fname = fname; line_nb = line_nb; bol_pos = bol_pos; line_nb_last = line_nb; bol_pos_last = bol_pos; bp = bp; ep = ep; } @@ -54,8 +53,6 @@ let merge loc1 loc2 = let unloc loc = (loc.bp, loc.ep) -let represent loc = (loc.fname, loc.line_nb, loc.bol_pos, loc.bp, loc.ep) - let dummy_loc = ghost let join_loc = merge diff --git a/lib/loc.mli b/lib/loc.mli index f39cd2670b..c08e097a87 100644 --- a/lib/loc.mli +++ b/lib/loc.mli @@ -8,7 +8,15 @@ (** {5 Basic types} *) -type t +type t = { + fname : string; (** filename *) + line_nb : int; (** start line number *) + bol_pos : int; (** position of the beginning of start line *) + line_nb_last : int; (** end line number *) + bol_pos_last : int; (** position of the beginning of end line *) + bp : int; (** start position *) + ep : int; (** end position *) +} type 'a located = t * 'a (** Embed a location in a type *) @@ -17,9 +25,9 @@ type 'a located = t * 'a (** This is inherited from CAMPL4/5. *) -val create : string -> int -> int -> (int * int) -> t +val create : string -> int -> int -> int -> int -> t (** Create a location from a filename, a line number, a position of the - beginning of the line and a pair of start and end position *) + beginning of the line, a start and end position *) val unloc : t -> int * int (** Return the start and end position of a location *) @@ -35,9 +43,6 @@ val is_ghost : t -> bool val merge : t -> t -> t -val represent : t -> (string * int * int * int * int) -(** Return the arguments given in [create] *) - (** {5 Located exceptions} *) val add_loc : Exninfo.info -> t -> Exninfo.info |
