]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/matitaExcPp.ml
more work
[helm.git] / helm / software / matita / matitaExcPp.ml
index 03f0be3dc7ffba31016c88831c34bb3f45a7f56e..312a9a4f8a6ebc475ab1ab736818688978d79687 100644 (file)
@@ -117,10 +117,6 @@ let rec to_string =
       let _,msg = to_string exn in
       let (x, y) = HExtlib.loc_of_floc floc in
        Some floc, sprintf "Error at %d-%d: %s" x y msg
-  | GrafiteTypes.Option_error ("baseuri", "not found" ) -> 
-      None,
-      "Baseuri not set for this script. "
-      ^ "Use 'set \"baseuri\" \"<uri>\".' to set it."
   | GrafiteTypes.Command_error msg -> None, "Error: " ^ msg
   | CicNotationParser.Parse_error err ->
       None, sprintf "Parse error: %s" err
@@ -151,7 +147,36 @@ let rec to_string =
      None, "Already defined: " ^ UriManager.string_of_uri s
   | CoercDb.EqCarrNotImplemented msg ->
      None, ("EqCarrNotImplemented: " ^ Lazy.force msg)
+  | DisambiguateChoices.Choice_not_found msg ->
+     None, ("Disambiguation choice not found: " ^ Lazy.force msg)
+  | MatitaEngine.EnrichedWithLexiconStatus (exn,_) ->
+     None, "EnrichedWithLexiconStatus "^snd(to_string exn)
   | GrafiteDisambiguator.DisambiguationError (offset,errorll) ->
+     let loc =
+      match errorll with
+         ((_,_,Some floc,_,_)::_)::_ ->
+          let (x, y) = HExtlib.loc_of_floc floc in
+          let x = x + offset in
+          let y = y + offset in
+          let floc = HExtlib.floc_of_loc (x,y) in
+           Some floc
+       | _ -> None in
+     let annotated_errorll =
+      List.rev
+       (snd
+         (List.fold_left (fun (pass,res) item -> pass+1,(pass+1,item)::res)
+           (0,[]) errorll)) in
+     let choices = compact_disambiguation_errors true annotated_errorll in
+     let errorll =
+      (List.map
+       (function (loffset,l) ->
+         List.map
+          (function
+            passes,envs_and_diffs,msg,significant ->
+             let _,env,diff = List.hd envs_and_diffs in
+              passes,env,diff,loffset,msg,significant
+          ) l
+        ) choices) in
      let rec aux =
       function
          [] -> []
@@ -170,15 +195,6 @@ let rec to_string =
              passes) phase)
           in
            msg@aux tl in
-     let loc =
-      match errorll with
-         ((_,_,Some floc,_,_)::_)::_ ->
-          let (x, y) = HExtlib.loc_of_floc floc in
-          let x = x + offset in
-          let y = y + offset in
-          let floc = HExtlib.floc_of_loc (x,y) in
-           Some floc
-       | _ -> None in
      let rec explain =
       function
          [] -> ""
@@ -189,26 +205,6 @@ let rec to_string =
             String.concat "," (List.map string_of_int phases) ^": *****\n"^
             msg ^ "\n\n"
      in
-  (* --- *)
-  let annotated_errorll =
-   List.rev
-    (snd
-      (List.fold_left (fun (pass,res) item -> pass+1,(pass+1,item)::res) (0,[])
-        errorll)) in
-  let choices = compact_disambiguation_errors true annotated_errorll in
-  (* --- *)
-  let errorll =
-   (List.map
-    (function (loffset,l) ->
-      List.map
-       (function
-         passes,envs_and_diffs,msg,significant ->
-          let _,env,diff = List.hd envs_and_diffs in
-           passes,env,diff,loffset,msg,significant
-       ) l
-     ) choices) in
-  (* --- *)
-
       loc,
        "********** DISAMBIGUATION ERRORS: **********\n" ^
         explain (aux errorll)