aboutsummaryrefslogtreecommitdiff
path: root/toplevel/coqloop.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2018-04-01 01:15:22 +0200
committerEmilio Jesus Gallego Arias2018-04-01 01:23:50 +0200
commit8b15eee6125f7f8596f17e9c982fb944a5e3f9be (patch)
tree925e8278a09b12a38108332f4872c1d434080110 /toplevel/coqloop.ml
parent2d2d16430822f1768ce4f3c62ef0750b94e4747f (diff)
[stm] Move VernacBacktrack to the toplevel.
This command is legacy, equivalent to `EditAt` and only used by Emacs. We move it to the toplevel so we can kill some legacy code and in particular the `part_of_script` hack.
Diffstat (limited to 'toplevel/coqloop.ml')
-rw-r--r--toplevel/coqloop.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/toplevel/coqloop.ml b/toplevel/coqloop.ml
index 64d839f18b..371be20d25 100644
--- a/toplevel/coqloop.ml
+++ b/toplevel/coqloop.ml
@@ -338,6 +338,13 @@ let rec vernac_loop ~state =
try
let input = top_buffer.tokens in
match read_sentence ~state input with
+ | {v=VernacBacktrack(bid,_,_)} ->
+ let bid = Stateid.of_int bid in
+ let doc, res = Stm.edit_at ~doc:state.doc bid in
+ assert (res = `NewTip);
+ let state = { state with doc; sid = bid } in
+ vernac_loop ~state
+
| {v=VernacQuit} ->
exit 0
| {v=VernacDrop} ->