- aux (n+1) tl ^
- "***** Errors obtained during phase " ^ string_of_int n ^": *****\n"^
- String.concat "\n\n"
- (List.map (fun (floc,msg) ->
- let loc_descr =
- match floc with
- None -> ""
- | Some floc ->
- let (x, y) = HExtlib.loc_of_floc floc in
- sprintf " at %d-%d" (x+offset) (y+offset)
- in
- "*Error" ^ loc_descr ^ ": " ^ Lazy.force msg) phase) ^
- "\n\n\n" in
+ let msg =
+ String.concat "\n\n\n"
+ (List.map (fun (floc,msg) ->
+ let loc_descr =
+ match floc with
+ None -> ""
+ | Some floc ->
+ let (x, y) = HExtlib.loc_of_floc floc in
+ sprintf " at %d-%d" (x+offset) (y+offset)
+ in
+ "*Error" ^ loc_descr ^ ": " ^ Lazy.force msg) phase)
+ in
+ if msg = prev_msg then
+ aux (n+1) (msg,phases@[n]) tl
+ else
+ (if not dummy then [prev_msg,phases] else []) @
+ (aux (n+1) (msg,[n]) tl) in