aboutsummaryrefslogtreecommitdiff
path: root/plugins/syntax/g_numeral.mlg
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-10-12 09:22:56 +0200
committerPierre-Marie Pédrot2018-10-15 22:55:55 +0200
commit4da233a9685cd193a84def037ec18a27c9225dce (patch)
treee4ba7de73cc815d9f4ead92a83dc18c28883d316 /plugins/syntax/g_numeral.mlg
parent8e7131b65894e9e549422cb47aab5a3a357a6352 (diff)
Port remaining EXTEND ml4 files to coqpp.
Almost all of ml4 were removed in the process. The only remaining files are in the test-suite and probably need a bit of fiddling with coq_makefile, and there only two really remaning ml4 files containing code.
Diffstat (limited to 'plugins/syntax/g_numeral.mlg')
-rw-r--r--plugins/syntax/g_numeral.mlg42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/syntax/g_numeral.mlg b/plugins/syntax/g_numeral.mlg
new file mode 100644
index 0000000000..5dbc9eea7a
--- /dev/null
+++ b/plugins/syntax/g_numeral.mlg
@@ -0,0 +1,42 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+DECLARE PLUGIN "numeral_notation_plugin"
+
+{
+
+open Notation
+open Numeral
+open Pp
+open Names
+open Vernacinterp
+open Ltac_plugin
+open Stdarg
+open Pcoq.Prim
+
+let pr_numnot_option _ _ _ = function
+ | Nop -> mt ()
+ | Warning n -> str "(warning after " ++ str n ++ str ")"
+ | Abstract n -> str "(abstract after " ++ str n ++ str ")"
+
+}
+
+ARGUMENT EXTEND numnotoption
+ PRINTED BY { pr_numnot_option }
+| [ ] -> { Nop }
+| [ "(" "warning" "after" bigint(waft) ")" ] -> { Warning waft }
+| [ "(" "abstract" "after" bigint(n) ")" ] -> { Abstract n }
+END
+
+VERNAC COMMAND EXTEND NumeralNotation CLASSIFIED AS SIDEFF
+ | [ "Numeral" "Notation" reference(ty) reference(f) reference(g) ":"
+ ident(sc) numnotoption(o) ] ->
+ { vernac_numeral_notation (Locality.make_module_locality atts.locality) ty f g (Id.to_string sc) o }
+END