Debian Codegraph @

plugins/derive/g_derive.mlg

raw
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 {
12
13 open Stdarg
14
15 }
16
17 DECLARE PLUGIN "rocq-runtime.plugins.derive"
18
19 {
20
21 let classify_derive_command _ = Vernacextend.(VtStartProof (Doesn'tGuaranteeOpacity,[]))
22
23 let () =
24 Mltop.add_init_function "rocq-runtime.plugins.derive" (fun () ->
25 Procq.modify_keyword_state (fun kw -> CLexer.add_keyword_tok kw (Tok.PKEYWORD "SuchThat")))
26
27 let warn_deprecated_derive_suchthat =
28 CWarnings.create ~name:"deprecated-derive-suchthat" ~category:Deprecation.Version.v9_0
29 (fun () -> Pp.strbrk "Use of \"SuchThat\" and \"As\" in \"Derive\" is deprecated; replace them respectively by \"in\" and \"as\".")
30
31 }
32
33 VERNAC COMMAND EXTEND Derive CLASSIFIED BY { classify_derive_command } STATE open_proof
34 | #[ atts = Vernacentries.DefAttributes.def_attributes; ]
35 [ "Derive" open_binders(bl) "SuchThat" constr(suchthat) "As" identref(lemma) ] ->
36 { warn_deprecated_derive_suchthat ();
37 Derive.start_deriving ~atts bl suchthat lemma }
38 | #[ atts = Vernacentries.DefAttributes.def_attributes; ]
39 [ "Derive" open_binders(bl) "in" constr(suchthat) "as" identref(lemma) ] ->
40 { Derive.start_deriving ~atts bl suchthat lemma }
41 END