aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2016-04-10 17:04:44 +0200
committerHugo Herbelin2016-04-27 21:55:45 +0200
commitf2192b492ca5407e740cf9d9d8696da89c978b93 (patch)
treedd8f5dc0f0b084657da0a0b04bc396090ebb7a00
parent9e9620b99f68622ebaf44c43e9945580f6cc6d98 (diff)
Protect the beautifier from change in the lexer state (typically by
calling Pcoq.parse_string, what some plugins such as coretactics, are doing, thus breaking the beautification of "Declare ML Module").
-rw-r--r--toplevel/vernac.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml
index 89bc31d0ac..d92f02ddd6 100644
--- a/toplevel/vernac.ml
+++ b/toplevel/vernac.ml
@@ -229,7 +229,9 @@ let rec vernac_com verbose checknav (loc,com) =
if do_beautify () then pr_new_syntax loc (Some com);
if !Flags.time then display_cmd_header loc com;
let com = if !Flags.time then VernacTime (loc,com) else com in
- interp com
+ let a = Lexer.com_state () in
+ interp com;
+ Lexer.restore_com_state a
with reraise ->
let (reraise, info) = Errors.push reraise in
Format.set_formatter_out_channel stdout;