@@ -16,7 +16,7 @@ let () = Mltop.add_known_plugin (fun () ->
16
16
17
17
(* Defining grammar rules with "xx" in it automatically declares keywords too,
18
18
* we thus save the lexer to restore it at the end of the file *)
19
- let frozen_lexer = CLexer. freeze () ;;
19
+ let frozen_lexer = CLexer. get_keyword_state () ;;
20
20
21
21
(* i camlp4use: "pa_extend.cmo" i*)
22
22
(* i camlp4deps: "grammar/grammar.cma" i*)
@@ -70,7 +70,6 @@ open Notation_ops
70
70
open Locus
71
71
open Locusops
72
72
73
- open Compat
74
73
open Tok
75
74
76
75
open Ssrmatching_plugin
@@ -514,18 +513,18 @@ let _ =
514
513
(* * Primitive parsing to avoid syntax conflicts with basic tactics. *)
515
514
516
515
let accept_before_syms syms strm =
517
- match Compat. get_tok ( stream_nth 1 strm) with
516
+ match stream_nth 1 strm with
518
517
| Tok. KEYWORD sym when List. mem sym syms -> ()
519
518
| _ -> raise Stream. Failure
520
519
521
520
let accept_before_syms_or_any_id syms strm =
522
- match Compat. get_tok ( stream_nth 1 strm) with
521
+ match stream_nth 1 strm with
523
522
| Tok. KEYWORD sym when List. mem sym syms -> ()
524
523
| Tok. IDENT _ -> ()
525
524
| _ -> raise Stream. Failure
526
525
527
526
let accept_before_syms_or_ids syms ids strm =
528
- match Compat. get_tok ( stream_nth 1 strm) with
527
+ match stream_nth 1 strm with
529
528
| Tok. KEYWORD sym when List. mem sym syms -> ()
530
529
| Tok. IDENT id when List. mem id ids -> ()
531
530
| _ -> raise Stream. Failure
@@ -660,7 +659,7 @@ let ssr_id_of_string loc s =
660
659
661
660
let ssr_null_entry = Gram.Entry. of_parser " ssr_null" (fun _ -> () )
662
661
663
- let (! @ ) = Compat . to_coqloc
662
+ let (! @ ) = Pcoq . to_coqloc
664
663
665
664
GEXTEND Gram
666
665
GLOBAL : Prim. ident;
@@ -1853,7 +1852,7 @@ END
1853
1852
1854
1853
type ssrtermkind = char (* print flag *)
1855
1854
1856
- let input_ssrtermkind strm = match Compat. get_tok ( stream_nth 0 strm) with
1855
+ let input_ssrtermkind strm = match stream_nth 0 strm with
1857
1856
| Tok. KEYWORD "(" -> '('
1858
1857
| Tok. KEYWORD "@" -> '@'
1859
1858
| _ -> ' '
@@ -2664,9 +2663,9 @@ ARGUMENT EXTEND ssriorpat TYPED AS ssripat list PRINTED BY pr_ssriorpat
2664
2663
END
2665
2664
2666
2665
let reject_ssrhid strm =
2667
- match Compat. get_tok ( stream_nth 0 strm) with
2666
+ match stream_nth 0 strm with
2668
2667
| Tok. KEYWORD "[" ->
2669
- (match Compat. get_tok ( stream_nth 1 strm) with
2668
+ (match stream_nth 1 strm with
2670
2669
| Tok. KEYWORD ":" -> raise Stream. Failure
2671
2670
| _ -> () )
2672
2671
| _ -> ()
@@ -2786,7 +2785,7 @@ let equality_inj l b id c gl =
2786
2785
let msg = ref " " in
2787
2786
try Proofview.V82. of_tactic (Equality. inj l b None c) gl
2788
2787
with
2789
- | Compat. Exc_located (_,CErrors. UserError (_,s))
2788
+ | Ploc. Exc (_,CErrors. UserError (_,s))
2790
2789
| CErrors. UserError (_,s)
2791
2790
when msg := Pp. string_of_ppcmds s;
2792
2791
! msg = " Not a projectable equality but a discriminable one." ||
@@ -3091,8 +3090,8 @@ let tclDO n tac =
3091
3090
let _, info = CErrors. push e in
3092
3091
let e' = CErrors. UserError (l, prefix i ++ s) in
3093
3092
Util. iraise (e', info)
3094
- | Compat. Exc_located (loc , CErrors. UserError (l , s )) ->
3095
- raise (Compat. Exc_located (loc, CErrors. UserError (l, prefix i ++ s))) in
3093
+ | Ploc. Exc (loc , CErrors. UserError (l , s )) ->
3094
+ raise (Ploc. Exc (loc, CErrors. UserError (l, prefix i ++ s))) in
3096
3095
let rec loop i gl =
3097
3096
if i = n then tac_err_at i gl else
3098
3097
(tclTHEN (tac_err_at i) (loop (i + 1 ))) gl in
@@ -3177,7 +3176,7 @@ let sq_brace_tacnames =
3177
3176
[" first" ; " solve" ; " do" ; " rewrite" ; " have" ; " suffices" ; " wlog" ]
3178
3177
(* "by" is a keyword *)
3179
3178
let accept_ssrseqvar strm =
3180
- match Compat. get_tok ( stream_nth 0 strm) with
3179
+ match stream_nth 0 strm with
3181
3180
| Tok. IDENT id when not (List. mem id sq_brace_tacnames) ->
3182
3181
accept_before_syms_or_ids [" [" ] [" first" ;" last" ] strm
3183
3182
| _ -> raise Stream. Failure
@@ -3611,7 +3610,7 @@ ARGUMENT EXTEND ssreqid TYPED AS ssripatrep option PRINTED BY pr_ssreqid
3611
3610
END
3612
3611
3613
3612
let accept_ssreqid strm =
3614
- match Compat. get_tok ( Util. stream_nth 0 strm) with
3613
+ match Util. stream_nth 0 strm with
3615
3614
| Tok. IDENT _ -> accept_before_syms [" :" ] strm
3616
3615
| Tok. KEYWORD ":" -> ()
3617
3616
| Tok. KEYWORD pat when List. mem pat [" _" ; " ?" ; " ->" ; " <-" ] ->
@@ -5183,7 +5182,7 @@ let test_ssr_rw_syntax =
5183
5182
let test strm =
5184
5183
if not ! ssr_rw_syntax then raise Stream. Failure else
5185
5184
if is_ssr_loaded () then () else
5186
- match Compat. get_tok ( Util. stream_nth 0 strm) with
5185
+ match Util. stream_nth 0 strm with
5187
5186
| Tok. KEYWORD key when List. mem key.[0 ] ['{' ; '[' ; '/' ] -> ()
5188
5187
| _ -> raise Stream. Failure in
5189
5188
Gram.Entry. of_parser " test_ssr_rw_syntax" test
@@ -5259,7 +5258,7 @@ ARGUMENT EXTEND ssrfwdid TYPED AS ident PRINTED BY pr_ssrfwdid
5259
5258
END
5260
5259
5261
5260
let accept_ssrfwdid strm =
5262
- match Compat. get_tok ( stream_nth 0 strm) with
5261
+ match stream_nth 0 strm with
5263
5262
| Tok. IDENT id -> accept_before_syms_or_any_id [" :" ; " :=" ; " (" ] strm
5264
5263
| _ -> raise Stream. Failure
5265
5264
@@ -6151,7 +6150,7 @@ ARGUMENT EXTEND ssr_idcomma TYPED AS ident option option PRINTED BY pr_idcomma
6151
6150
END
6152
6151
6153
6152
let accept_idcomma strm =
6154
- match Compat. get_tok ( stream_nth 0 strm) with
6153
+ match stream_nth 0 strm with
6155
6154
| Tok. IDENT _ | Tok. KEYWORD "_" -> accept_before_syms [" ," ] strm
6156
6155
| _ -> raise Stream. Failure
6157
6156
@@ -6244,6 +6243,6 @@ END
6244
6243
(* The user is supposed to Require Import ssreflect or Require ssreflect *)
6245
6244
(* and Import ssreflect.SsrSyntax to obtain these keywords and as a *)
6246
6245
(* consequence the extended ssreflect grammar. *)
6247
- let () = CLexer. unfreeze frozen_lexer ;;
6246
+ let () = CLexer. set_keyword_state frozen_lexer ;;
6248
6247
6249
6248
(* vim: set filetype=ocaml foldmethod=marker: *)
0 commit comments