aboutsummaryrefslogtreecommitdiff
path: root/toplevel/vernac.ml
diff options
context:
space:
mode:
Diffstat (limited to 'toplevel/vernac.ml')
-rw-r--r--toplevel/vernac.ml13
1 files changed, 9 insertions, 4 deletions
diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml
index 1269ddfe31..5da98da625 100644
--- a/toplevel/vernac.ml
+++ b/toplevel/vernac.ml
@@ -140,16 +140,21 @@ let rec vernac_com interpfun (loc,com) =
Options.v7_only := true;
if !translate_file then msgnl (pr_comments !comments)
| _ ->
- let f = match com with (* Pour gérer les implicites *)
- | VernacInductive _ -> States.with_heavy_rollback
+ let protect = match com with (* Pour gérer les implicites *)
+ | VernacFixpoint _ | VernacInductive _ ->
+ fun f x ->
+ (let fs = States.freeze () in
+ try let e = f x in States.unfreeze fs; e
+ with e -> States.unfreeze fs; raise e)
| _ -> fun f -> f in
if !translate_file then
msgnl
- (pr_comments !comments ++ hov 0 (f pr_vernac com) ++ sep_end)
+ (pr_comments !comments ++ hov 0 (protect pr_vernac com) ++
+ sep_end)
else
msgnl
(hov 4 (str"New Syntax:" ++ fnl() ++ pr_comments !comments ++
- f pr_vernac com ++ sep_end)));
+ protect pr_vernac com ++ sep_end)));
comments := None;
Format.set_formatter_out_channel stdout);
interp com;