aboutsummaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-03-03 10:53:00 +0100
committerPierre-Marie Pédrot2020-03-03 10:53:00 +0100
commit18aa9ca60ec9b3d1712276ec0c615dfe54c1a251 (patch)
tree4858ae67d49347ee4d48fc9b1fa32e72372c72ce /toplevel
parent650b98cc6dcdeef1090320cc8dfb027894788e82 (diff)
parent7ebcbc1cecca87619aa4b01606021c29c5d1f0a2 (diff)
Merge PR #11695: Refactor lookaheads
Reviewed-by: herbelin Reviewed-by: ppedrot
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/g_toplevel.mlg17
1 files changed, 4 insertions, 13 deletions
diff --git a/toplevel/g_toplevel.mlg b/toplevel/g_toplevel.mlg
index 56fda58a25..d3768eb1e3 100644
--- a/toplevel/g_toplevel.mlg
+++ b/toplevel/g_toplevel.mlg
@@ -11,8 +11,6 @@
{
open Pcoq
open Pcoq.Prim
-open Tok
-open Util
open Vernacexpr
(* Vernaculars specific to the toplevel *)
@@ -36,17 +34,10 @@ open Toplevel_
let err () = raise Stream.Failure
let test_show_goal =
- Pcoq.Entry.of_parser "test_show_goal"
- (fun _ strm ->
- match stream_nth 0 strm with
- | IDENT "Show" ->
- (match stream_nth 1 strm with
- | IDENT "Goal" ->
- (match stream_nth 2 strm with
- | NUMERAL _ -> ()
- | _ -> err ())
- | _ -> err ())
- | _ -> err ())
+ let open Pcoq.Lookahead in
+ to_entry "test_show_goal" begin
+ lk_kw "Show" >> lk_kw "Goal" >> lk_nat
+ end
}