]> 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 d46f9a1bfbefd5b059623adabfa65dbab046cfbd..325e290a74f4636d231d136b2b2f2995808cc597 100644 (file)
@@ -28,8 +28,9 @@ open Printf
 open MatitaTypes
 
 exception Ambiguous_input
+(* the integer is an offset to be added to each location *)
 exception DisambiguationError of
- (Token.flocation option * string Lazy.t) list list
int * (Token.flocation option * string Lazy.t) list list
 
 type choose_uris_callback =
   id:string -> UriManager.uri list -> UriManager.uri list
@@ -110,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