diff options
| author | Maxime Dénès | 2020-02-27 11:15:02 +0100 |
|---|---|---|
| committer | Maxime Dénès | 2020-03-01 20:33:27 +0100 |
| commit | 38e57715c086183250dd6176f9eaad01bfcde4c5 (patch) | |
| tree | bb6d61b021082fdd17fbcc6c625d4a29550c0b4a /toplevel | |
| parent | fd38386b2aa19edf2df05f7b935d2273d9de8b00 (diff) | |
Refactor lookaheads using DSL
Diffstat (limited to 'toplevel')
| -rw-r--r-- | toplevel/g_toplevel.mlg | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/toplevel/g_toplevel.mlg b/toplevel/g_toplevel.mlg index 56fda58a25..09fc954fac 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_int + end } |
