aboutsummaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2015-07-29 12:12:35 +0200
committerPierre-Marie Pédrot2015-07-29 12:12:35 +0200
commite76ab0ec81040cbe99f616e8457bdc26cc6dceb6 (patch)
tree5bcdbed2dac27feeb27caf840e8cad24e7483a9a /toplevel
parentaff5a1aaeb9b50c60ff32b7d5336a44fd18428ee (diff)
parent0dac9618c695a345f82ee302b205217fff29be29 (diff)
Merge branch 'v8.5'
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/auto_ind_decl.ml3
-rw-r--r--toplevel/auto_ind_decl.mli1
-rw-r--r--toplevel/indschemes.ml8
-rw-r--r--toplevel/vernac.ml13
-rw-r--r--toplevel/vernacentries.ml10
5 files changed, 8 insertions, 27 deletions
diff --git a/toplevel/auto_ind_decl.ml b/toplevel/auto_ind_decl.ml
index f905080905..d1452fca21 100644
--- a/toplevel/auto_ind_decl.ml
+++ b/toplevel/auto_ind_decl.ml
@@ -55,6 +55,7 @@ exception InductiveWithProduct
exception InductiveWithSort
exception ParameterWithoutEquality of constant
exception NonSingletonProp of inductive
+exception DecidabilityMutualNotSupported
let dl = Loc.ghost
@@ -921,7 +922,7 @@ let compute_dec_tact ind lnamesparrec nparrec =
let make_eq_decidability mind =
let mib = Global.lookup_mind mind in
if not (Int.equal (Array.length mib.mind_packets) 1) then
- anomaly (Pp.str "Decidability lemma for mutual inductive types not supported");
+ raise DecidabilityMutualNotSupported;
let ind = (mind,0) in
let nparams = mib.mind_nparams in
let nparrec = mib.mind_nparams_rec in
diff --git a/toplevel/auto_ind_decl.mli b/toplevel/auto_ind_decl.mli
index 807872988b..20a3d5d74f 100644
--- a/toplevel/auto_ind_decl.mli
+++ b/toplevel/auto_ind_decl.mli
@@ -23,6 +23,7 @@ exception InductiveWithProduct
exception InductiveWithSort
exception ParameterWithoutEquality of constant
exception NonSingletonProp of inductive
+exception DecidabilityMutualNotSupported
val beq_scheme_kind : mutual scheme_kind
val build_beq_scheme : mutual_scheme_object_function
diff --git a/toplevel/indschemes.ml b/toplevel/indschemes.ml
index fbc45b4ae3..286d164c42 100644
--- a/toplevel/indschemes.ml
+++ b/toplevel/indschemes.ml
@@ -180,10 +180,12 @@ let try_declare_scheme what f internal names kn =
(strbrk "Required constant " ++ str s ++ str " undefined.")
| AlreadyDeclared msg ->
alarm what internal (msg ++ str ".")
+ | DecidabilityMutualNotSupported ->
+ alarm what internal
+ (str "Decidability lemma for mutual inductive types not supported.")
| e when Errors.noncritical e ->
- alarm what internal
- (str "Unknown exception during scheme creation: "++
- str (Printexc.to_string e))
+ alarm what internal
+ (str "Unexpected error during scheme creation: " ++ Errors.print e)
let beq_scheme_msg mind =
let mib = Global.lookup_mind mind in
diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml
index 966b952016..266d8f9b4f 100644
--- a/toplevel/vernac.ml
+++ b/toplevel/vernac.ml
@@ -92,19 +92,6 @@ let disable_drop = function
let user_error loc s = Errors.user_err_loc (loc,"_",str s)
-(* Open an utf-8 encoded file and skip the byte-order mark if any *)
-
-let open_utf8_file_in fname =
- let is_bom s =
- Int.equal (Char.code s.[0]) 0xEF &&
- Int.equal (Char.code s.[1]) 0xBB &&
- Int.equal (Char.code s.[2]) 0xBF
- in
- let in_chan = open_in fname in
- let s = " " in
- if input in_chan s 0 3 < 3 || not (is_bom s) then seek_in in_chan 0;
- in_chan
-
(* Opening and closing a channel. Open it twice when verbose: the first
channel is used to read the commands, and the second one to print them.
Note: we could use only one thanks to seek_in, but seeking on and on in
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml
index 6c5f10c20a..cfbdaccec4 100644
--- a/toplevel/vernacentries.ml
+++ b/toplevel/vernacentries.ml
@@ -1841,16 +1841,6 @@ let vernac_load interp fname =
match Pcoq.Gram.entry_parse Pcoq.main_entry po with
| Some x -> x
| None -> raise End_of_input) in
- let open_utf8_file_in fname =
- let is_bom s =
- Int.equal (Char.code s.[0]) 0xEF &&
- Int.equal (Char.code s.[1]) 0xBB &&
- Int.equal (Char.code s.[2]) 0xBF
- in
- let in_chan = open_in fname in
- let s = " " in
- if input in_chan s 0 3 < 3 || not (is_bom s) then seek_in in_chan 0;
- in_chan in
let fname =
Envars.expand_path_macros ~warn:(fun x -> msg_warning (str x)) fname in
let fname = CUnix.make_suffix fname ".v" in