X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matitaB%2Fmatita%2FmatitaGui.ml;h=759ffa5ff2c3290671e88e6f5a10d3ecab28e35a;hb=db020b4218272e2e35641ce3bc3b0a9b3afda899;hp=fbf9247e210f3e509fdb588f51f1577cf9869fcd;hpb=a2412e41cda18a25d780ae631ee02d6ae05c52b1;p=helm.git diff --git a/matitaB/matita/matitaGui.ml b/matitaB/matita/matitaGui.ml index fbf9247e2..759ffa5ff 100644 --- a/matitaB/matita/matitaGui.ml +++ b/matitaB/matita/matitaGui.ml @@ -377,16 +377,16 @@ let interactive_error_interp ~all_passes (fun k,desc -> let alias = match k with - | DisambiguateTypes.Id (id,_opturi) -> + | DisambiguateTypes.Id id -> (* XXX we don't have an uri to put into Ident_alias! * then we use the description?? * what does this code mean?? *) (* FIXME we are not using info from the domain_item to * fill in the alias_spec *) GrafiteAst.Ident_alias (id, desc) - | DisambiguateTypes.Symbol (symb, _)-> + | DisambiguateTypes.Symbol symb-> GrafiteAst.Symbol_alias (symb, None, desc) - | DisambiguateTypes.Num _ -> + | DisambiguateTypes.Num -> GrafiteAst.Number_alias (None,desc) in GrafiteAstPp.pp_alias alias) @@ -1255,12 +1255,29 @@ let interactive_interp_choice () text prefix_len choices = in classify example_interp [] enumerated_choices +let interactive_ast_choice () ts = + let choice = + interactive_string_choice + "" 0 ~title:"Ambiguous input" + ~msg:("Choose an interpretation") () ~id:"" [] ts + in + let choice = match choice with + | [c] -> c + | _ -> assert false + in + let rec posn x = function + | [] -> assert false + | he::tl -> if he = x then 0 else 1 + posn x tl + in + posn choice ts + 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 ());*) (* gtk initialization *) GtkMain.Rc.add_default_file BuildTimeConf.gtkrc_file; (* loads gtk rc *) ignore (GMain.Main.init ())