let _ =
(* disambiguator callbacks *)
- Disambiguate.set_choose_uris_callback
+ (* Disambiguate.set_choose_uris_callback
(fun ~selection_mode ?ok ?(enable_button_for_non_vars=false) ~title ~msg ->
interactive_uri_choice ~selection_mode ?ok_label:ok ~title ~msg ());
Disambiguate.set_choose_interp_callback (interactive_interp_choice ());
- Disambiguate.set_choose_disamb_callback (interactive_ast_choice ());
+ Disambiguate.set_choose_disamb_callback (interactive_ast_choice ());*)
(* gtk initialization *)
GtkMain.Rc.add_default_file BuildTimeConf.gtkrc_file; (* loads gtk rc *)
ignore (GMain.Main.init ())
let marked = Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false
() (html_of_matita marked) in
raise (Emphasized_error marked)
+ | GrafiteDisambiguate.Ambiguous_input (loc,choices) ->
+ let strchoices =
+ String.concat "\n" (List.map
+ GrafiteAst.description_of_alias choices)
+ in
+ let x,y = HExtlib.loc_of_floc loc in
+ prerr_endline (Printf.sprintf
+ "@@@ Ambiguous input at (%d,%d). Possible choices:\n\n%s\n\n@@@ End."
+ x y strchoices);
+ let pre = Netconversion.ustring_sub `Enc_utf8 0 x text in
+ let err = Netconversion.ustring_sub `Enc_utf8 x (y-x) text in
+ let post = Netconversion.ustring_sub `Enc_utf8 y
+ (Netconversion.ustring_length `Enc_utf8 text - y) text in
+ let title = "Disambiguation Error" in
+ (* let title = "" in *)
+ let marked =
+ pre ^ "\005span class=\"error\" title=\"" ^ title ^ "\"\006" ^ err ^ "\005/span\006" ^ post in
+ let marked = Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false
+ () (html_of_matita marked) in
+ raise (Emphasized_error marked)
(* | End_of_file -> ... *)
- in
+ in
let stringbuf = Ulexing.from_utf8_string new_statements in
let interpr = GrafiteDisambiguate.get_interpr st#disambiguate_db in
let outstr = ref "" in
// but google chrome's innerText is, in a sense, "write only"
// what should we do?
// logarea.innerText = txt + "\n" + logarea.innerText;
- logtxt = logtxt + "\n" + txt;
+ logtxt = /* logtxt + "\n" +*/ txt;
}
function showLog() {