diff options
| author | Enrico Tassi | 2018-04-04 10:09:29 +0200 |
|---|---|---|
| committer | Enrico Tassi | 2018-04-04 10:09:29 +0200 |
| commit | 630cdb53a6ba180f4d67cb1e848978239a0d09ea (patch) | |
| tree | 1c6d3d939391e69476f6a818f78199029b3fb02f /toplevel | |
| parent | 9354d282d2b2be59c323778a3e7132a622f07a5d (diff) | |
| parent | 8b15eee6125f7f8596f17e9c982fb944a5e3f9be (diff) | |
Merge PR #7138: [stm] Move VernacBacktrack to the toplevel.
Diffstat (limited to 'toplevel')
| -rw-r--r-- | toplevel/coqloop.ml | 7 | ||||
| -rw-r--r-- | toplevel/g_toplevel.ml4 | 4 |
2 files changed, 11 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} -> diff --git a/toplevel/g_toplevel.ml4 b/toplevel/g_toplevel.ml4 index 7526f3071a..d5d558b9bf 100644 --- a/toplevel/g_toplevel.ml4 +++ b/toplevel/g_toplevel.ml4 @@ -9,10 +9,12 @@ (************************************************************************) open Pcoq +open Pcoq.Prim open Vernacexpr (* Vernaculars specific to the toplevel *) type vernac_toplevel = + | VernacBacktrack of int * int * int | VernacDrop | VernacQuit | VernacControl of vernac_control @@ -31,6 +33,8 @@ GEXTEND Gram vernac_toplevel: FIRST [ [ IDENT "Drop"; "." -> CAst.make VernacDrop | IDENT "Quit"; "." -> CAst.make VernacQuit + | IDENT "Backtrack"; n = natural ; m = natural ; p = natural; "." -> + CAst.make (VernacBacktrack (n,m,p)) | cmd = main_entry -> match cmd with | None -> raise Stm.End_of_input |
