end
-let rec interactive_error_interp ?(all_passes=false) (source_buffer:GSourceView.source_buffer) notify_exn offset errorll
+let rec interactive_error_interp ?(all_passes=false) (source_buffer:GSourceView.source_buffer) notify_exn offset errorll script_fname
=
+ (* hook to save a script for each disambiguation error *)
+ if false then
+ (let text =
+ source_buffer#get_text ~start:source_buffer#start_iter
+ ~stop:source_buffer#end_iter () in
+ let md5 = Digest.to_hex (Digest.string text) in
+ let filename = match script_fname with Some s -> s | None -> "unnamed.ma" in
+ let filename =
+ Filename.chop_extension filename ^ ".error." ^ md5 ^ ".ma" in
+ let ch = open_out filename in
+ output_string ch text;
+ close_out ch
+ );
assert (List.flatten errorll <> []);
let errorll' =
let remove_non_significant =
);
connect_button dialog#disambiguationErrorsMoreErrors
(fun _ -> return () ;
- interactive_error_interp ~all_passes:true source_buffer notify_exn offset
- errorll);
+ interactive_error_interp ~all_passes:true source_buffer notify_exn
+ offset errorll script_fname);
connect_button dialog#disambiguationErrorsCancelButton fail;
dialog#disambiguationErrors#show ();
GtkThread.main ()
| GrafiteDisambiguator.DisambiguationError (offset,errorll) ->
(try
interactive_error_interp source_buffer notify_exn offset
- errorll
+ errorll script_fname
with
exc -> notify_exn exc);
unlock_world ()