spacepaste

ppatteries.ml

  1.  
  2. module Sparse = struct
  3. exception Parse_error of string * (int * int) * (int * int)
  4. let () =
  5. Printexc.register_printer
  6. (function
  7. | Parse_error (msg, (l1, c1), (l2, c2)) ->
  8. Some (Printf.sprintf "%s between %d:%d and %d:%d" msg l1 c1 l2 c2)
  9. | _ -> None)
  10. (* ... *)
  11. end
  12.  

output.txt

  1.  
  2. Fatal error: exception Ppatteries.Sparse.Parse_error("syntax error lexing", _, _)
  3. Raised at file "parsing.ml", line 179, characters 14-17
  4. Called from file "str.ml", line 0, characters 0-0
  5. Called from file "src/batList.ml", line 103, characters 17-20
  6. Called from file "src/batStd.ml", line 226, characters 17-20
  7.