]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/grafite_parser/grafiteDisambiguator.ml
basic support for imposed flavour in procedural object rendering
[helm.git] / helm / software / components / grafite_parser / grafiteDisambiguator.ml
index 76d44421c62452edb280d6e0bad8b7e9f7c2f496..8827e709b42328072edcb01591e9422ef73ba9e1 100644 (file)
 
 open Printf
 
+let debug = false;;
+let debug_print s =
+ if debug then prerr_endline (Lazy.force s);;
+
 exception Ambiguous_input
 (* the integer is an offset to be added to each location *)
 exception DisambiguationError of
- int * (Token.flocation option * string Lazy.t) list list
+ int *
+ ((Stdpp.location list * string * string) list *
+  (DisambiguateTypes.domain_item * DisambiguateTypes.codomain_item) list *
+  Stdpp.location option * string Lazy.t * bool) list list
   (** parameters are: option name, error message *)
 exception Unbound_identifier of string
 
@@ -39,7 +46,7 @@ type choose_uris_callback =
 
 type choose_interp_callback = 
   string -> int -> 
-    (Token.flocation list * string * string) list list -> int list
+    (Stdpp.location list * string * string) list list -> int list
 
 let mono_uris_callback ~id =
  if Helm_registry.get_opt_default Helm_registry.get_bool ~default:true
@@ -108,15 +115,15 @@ let disambiguate_thing ~aliases ~universe
     f ~fresh_instances ~aliases ~universe thing
   in
   let set_aliases (instances,(use_mono_aliases,_,_),_) (_, user_asked as res) =
-   if use_mono_aliases && not instances then
-    drop_aliases res
+   if use_mono_aliases then
+    drop_aliases ~minimize_instances:true res (* one shot aliases *)
    else if user_asked then
     drop_aliases ~minimize_instances:true res (* one shot aliases *)
    else
     drop_aliases_and_clear_diff res
   in
   let rec aux i errors passes =
-(*prerr_endline ("Pass: " ^ string_of_int i);*)
+  debug_print (lazy ("Pass: " ^ string_of_int i));
    match passes with
       [ pass ] ->
         (try