with Not_found -> assert false
in
let trailer = (* trailing comment with machine parseable error location *)
- let preamble_len = String.length matches.(1) in
- sprintf "\n(*\nerror-at: %d-%d\n*)\n" (preamble_len + start_pos)
- (preamble_len + start_pos + error_token_len) in
+ let preamble_len = Glib.Utf8.length matches.(1) in
+ sprintf "\n(*\nerror-at: %d-%d\n*)\n"
+ (preamble_len + Stdpp.first_pos target_pos)
+ (preamble_len + Stdpp.first_pos target_pos + error_token_len) in
let script' = sprintf "%s%s%s%s" matches.(1) statement' matches.(3) trailer in
let md5 = Digest.to_hex (Digest.string script') in
HExtlib.output_file
eprintf "Error at %d-%d: %s\n%!" loc_begin loc_end (Printexc.to_string exn)
let _ =
- Random.init 17;
+ Random.self_init ();
handle_localized_exns grep ()