package rocq-runtime

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file g_derive.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

# 11 "plugins/derive/g_derive.mlg"
 

open Stdarg



let _ = Mltop.add_known_module "rocq-runtime.plugins.derive"

# 19 "plugins/derive/g_derive.mlg"
 

let classify_derive_command _ = Vernacextend.(VtStartProof (Doesn'tGuaranteeOpacity,[]))

let () =
   Mltop.add_init_function "rocq-runtime.plugins.derive" (fun () ->
     Procq.(set_keyword_state (CLexer.add_keyword_tok (get_keyword_state ()) (Tok.PKEYWORD "SuchThat"))))

let warn_deprecated_derive_suchthat =
   CWarnings.create ~name:"deprecated-derive-suchthat" ~category:Deprecation.Version.v9_0
  (fun () -> Pp.strbrk "Use of \"SuchThat\" and \"As\" in \"Derive\" is deprecated; replace them respectively by \"in\" and \"as\".")



let () = Vernacextend.static_vernac_extend ~plugin:(Some "rocq-runtime.plugins.derive") ~command:"Derive" ~classifier:( classify_derive_command ) ?entry:None 
         [(Vernacextend.TyML
         (false,
          Vernacextend.TyTerminal
          ("Derive",
           Vernacextend.TyNonTerminal (Extend.TUentry (Genarg.get_arg_tag wit_open_binders),
           Vernacextend.TyTerminal
           ("SuchThat",
            Vernacextend.TyNonTerminal (Extend.TUentry (Genarg.get_arg_tag wit_constr),
            Vernacextend.TyTerminal
            ("As",
             Vernacextend.TyNonTerminal (Extend.TUentry (Genarg.get_arg_tag wit_identref),
             Vernacextend.TyNil)))))),
          (let coqpp_body bl suchthat lemma atts =
            Vernactypes.vtopenproof (fun () -> (
# 36 "plugins/derive/g_derive.mlg"
    warn_deprecated_derive_suchthat ();
    Derive.start_deriving ~atts bl suchthat lemma.CAst.v 
            )) in fun bl suchthat lemma ?loc ~atts () ->
            coqpp_body bl suchthat lemma (Attributes.parse 
# 34 "plugins/derive/g_derive.mlg"
             Vernacentries.DefAttributes.def_attributes
               atts)),
          None));
         (Vernacextend.TyML
         (false,
          Vernacextend.TyTerminal
          ("Derive",
           Vernacextend.TyNonTerminal (Extend.TUentry (Genarg.get_arg_tag wit_open_binders),
           Vernacextend.TyTerminal
           ("in",
            Vernacextend.TyNonTerminal (Extend.TUentry (Genarg.get_arg_tag wit_constr),
            Vernacextend.TyTerminal
            ("as",
             Vernacextend.TyNonTerminal (Extend.TUentry (Genarg.get_arg_tag wit_identref),
             Vernacextend.TyNil)))))),
          (let coqpp_body bl suchthat lemma atts =
            Vernactypes.vtopenproof (fun () -> (
# 40 "plugins/derive/g_derive.mlg"
    Derive.start_deriving ~atts bl suchthat lemma.CAst.v 
            )) in fun bl suchthat lemma ?loc ~atts () ->
            coqpp_body bl suchthat lemma (Attributes.parse 
# 38 "plugins/derive/g_derive.mlg"
             Vernacentries.DefAttributes.def_attributes
               atts)),
          None))]

OCaml

Innovation. Community. Security.