It is used only when the user press the More button or when he selects
the library from the Debug (?????) menu!
Moreover, using the library or not using it has now a different behaviour:
1. when the library is NOT used, symbols with no preferences are no
longer automatically looked for in the library
2. when the library IS used, only passes 5 and 6 are tried.
CONS:
1. the Debug menu voice is now necessary: move it elsewhere? always open the
disambiguation window making it non-modal? put an hyperlink in the error
message window?
2. when the library is used, all previous preferences are completely ignored
for all symbols. This makes the system much more stupid than what it used
to be.
PROS:
disambiguation is now much faster in case of error
| item -> item
in
Environment.find item e
| item -> item
in
Environment.find item e
- with Not_found ->
- lookup_in_library
- interactive_user_uri_choice
- input_or_locate_uri item)
(* implement module's API *)
let only_one_pass = ref false;;
(* implement module's API *)
let only_one_pass = ref false;;
+let use_library = ref false;;
let passes () = (* <fresh_instances?, aliases, coercions?> *)
if !only_one_pass then
[ (true, `Mono, false) ]
let passes () = (* <fresh_instances?, aliases, coercions?> *)
if !only_one_pass then
[ (true, `Mono, false) ]
+ else if !use_library then
+ [ (true, `Library, false);
+ (* for demo to reduce the number of interpretations *)
+ (true, `Library, true);
+ ]
else
[ (true, `Mono, false);
(true, `Multi, false);
(true, `Mono, true);
(true, `Multi, true);
else
[ (true, `Mono, false);
(true, `Multi, false);
(true, `Mono, true);
(true, `Multi, true);
- (true, `Library, false);
- (* for demo to reduce the number of interpretations *)
- (true, `Library, true);
(** initially false; for debugging only (???) *)
val only_one_pass: bool ref
(** initially false; for debugging only (???) *)
val only_one_pass: bool ref
+val use_library: bool ref
val passes : unit -> (bool * [> `Library | `Mono | `Multi ] * bool) list
val passes : unit -> (bool * [> `Library | `Mono | `Multi ] * bool) list
tree_store#get ~row:iter ~column:interp_no_col
end
tree_store#get ~row:iter ~column:interp_no_col
end
let rec interactive_error_interp ~all_passes
(source_buffer:GSourceView.source_buffer) notify_exn offset errorll filename
let rec interactive_error_interp ~all_passes
(source_buffer:GSourceView.source_buffer) notify_exn offset errorll filename
return ()
);
connect_button dialog#disambiguationErrorsMoreErrors
return ()
);
connect_button dialog#disambiguationErrorsMoreErrors
- (fun _ -> return () ;
- interactive_error_interp ~all_passes:true source_buffer
- notify_exn offset errorll filename);
+ (fun _ -> return () ; raise UseLibrary);
connect_button dialog#disambiguationErrorsCancelButton fail;
dialog#disambiguationErrors#show ();
GtkThread.main ()
connect_button dialog#disambiguationErrorsCancelButton fail;
dialog#disambiguationErrors#show ();
GtkThread.main ()
let thread_main =
fun () ->
lock_world ();
let thread_main =
fun () ->
lock_world ();
+ let saved_use_library= !MultiPassDisambiguator.use_library in
+ MultiPassDisambiguator.use_library := !all_disambiguation_passes;
+ MultiPassDisambiguator.use_library := saved_use_library;
unlock_world ()
with
| MultiPassDisambiguator.DisambiguationError (offset,errorll) ->
unlock_world ()
with
| MultiPassDisambiguator.DisambiguationError (offset,errorll) ->
~all_passes:!all_disambiguation_passes source_buffer
notify_exn offset errorll (s())#filename
with
~all_passes:!all_disambiguation_passes source_buffer
notify_exn offset errorll (s())#filename
with
- exc -> notify_exn exc);
+ | UseLibrary ->
+ MultiPassDisambiguator.use_library := true;
+ (try f ()
+ with
+ | MultiPassDisambiguator.DisambiguationError (offset,errorll) ->
+ interactive_error_interp ~all_passes:true source_buffer
+ notify_exn offset errorll (s())#filename
+ | exc ->
+ notify_exn exc);
+ | exc -> notify_exn exc);
+ MultiPassDisambiguator.use_library := saved_use_library;
unlock_world ()
| exc ->
notify_exn exc;
unlock_world ()
| exc ->
notify_exn exc;