-class disambiguator () =
- let _chooseUris = ref mono_uris_callback in
- let _chooseInterp = ref mono_interp_callback in
- let disambiguate_term =
- let module Callbacks =
- struct
- let interactive_user_uri_choice
- ~selection_mode ?ok ?(enable_button_for_non_vars = true) ~title ~msg
- ~id uris
- =
- !_chooseUris ~selection_mode ~title ~msg
- ~nonvars_button:enable_button_for_non_vars uris
-
- let interactive_interpretation_choice interp = !_chooseInterp interp
-
- let input_or_locate_uri ~(title:string) ?id =
- (* Zack: I try to avoid using this callback. I therefore assume that
- * the presence of an identifier that can't be resolved via "locate"
- * query is a syntax error *)
- let msg = match id with Some id -> id | _ -> "_" in
- raise (Unbound_identifier msg)
- end
- in
- let module Disambiguator = Disambiguate.Make (Callbacks) in
- Disambiguator.disambiguate_term
- in
- object (self)
- val mutable _env = DisambiguateTypes.Environment.empty
- method env = _env
- method setEnv e = _env <- e