X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fcic_transformations%2FcicAst.ml;h=ca48567863aa8d9c88ebf6eba9aa986db55c1fae;hb=2026624f827b29c35d54aa67b301250123ea7311;hp=3991813726766008222b5e08a33227a36117dd99;hpb=29d132244b797aaaa79319d81e0be4edf05ba7ae;p=helm.git diff --git a/helm/ocaml/cic_transformations/cicAst.ml b/helm/ocaml/cic_transformations/cicAst.ml index 399181372..ca4856786 100644 --- a/helm/ocaml/cic_transformations/cicAst.ml +++ b/helm/ocaml/cic_transformations/cicAst.ml @@ -23,8 +23,19 @@ * http://helm.cs.unibo.it/ *) +open Printf + type location = Lexing.position * Lexing.position +let pp_location (loc_begin, loc_end) = + let c_begin = loc_begin.Lexing.pos_cnum - loc_begin.Lexing.pos_bol in + let c_end = loc_end.Lexing.pos_cnum - loc_end.Lexing.pos_bol in + if loc_begin.Lexing.pos_lnum = -1 || loc_end.Lexing.pos_lnum = -1 then + sprintf "%d-%d" c_begin c_end + else + sprintf "(%d,%d)-(%d,%d)" loc_begin.Lexing.pos_lnum c_begin + loc_end.Lexing.pos_lnum c_end + let floc_of_loc (loc_begin, loc_end) = let floc_begin = { Lexing.pos_fname = ""; Lexing.pos_lnum = -1; Lexing.pos_bol = -1;