]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaDisambiguator.ml
DisambiguationError exceptions (that have locations inside) are now relocated
[helm.git] / helm / matita / matitaDisambiguator.ml
index 0f4dc67db6b9fafc977d414b3f7e85f5a79b729e..325e290a74f4636d231d136b2b2f2995808cc597 100644 (file)
@@ -28,7 +28,9 @@ open Printf
 open MatitaTypes
 
 exception Ambiguous_input
-exception DisambiguationError of string Lazy.t list list
+(* the integer is an offset to be added to each location *)
+exception DisambiguationError of
+ int * (Token.flocation option * string Lazy.t) list list
 
 type choose_uris_callback =
   id:string -> UriManager.uri list -> UriManager.uri list
@@ -109,12 +111,12 @@ let disambiguate_thing ~aliases ~universe
     | [ pass ] ->
         (try
           set_aliases pass (try_pass pass)
-         with Disambiguate.NoWellTypedInterpretation newerrors ->
-          raise (DisambiguationError (errors @ [newerrors])))
+         with Disambiguate.NoWellTypedInterpretation (offset,newerrors) ->
+          raise (DisambiguationError (offset, errors @ [newerrors])))
     | hd :: tl ->
         (try
           set_aliases hd (try_pass hd)
-        with Disambiguate.NoWellTypedInterpretation newerrors ->
+        with Disambiguate.NoWellTypedInterpretation (_offset,newerrors) ->
          aux (errors @ [newerrors]) tl)
     | [] -> assert false
   in