aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Arnaud Spiwack <arnaud@spiwack.net>2014-09-02 18:02:26 +0200
committerGravatar Arnaud Spiwack <arnaud@spiwack.net>2014-09-04 10:25:54 +0200
commitac2fdfb222083faa9c3893194e020bed38555ddb (patch)
treedf170292bb8d960469a3653d8f7481b42599fbf9 /tools
parentc907f31fd8f4b12bf2d7df2078603dbe804475a2 (diff)
Add a [Variant] declaration which allows to write non-recursive variant types.
Just like the [Record] keyword allows only non-recursive records.
Diffstat (limited to 'tools')
-rw-r--r--tools/coqdoc/cpretty.mll1
-rw-r--r--tools/coqdoc/output.ml1
-rw-r--r--tools/gallina-syntax.el5
3 files changed, 7 insertions, 0 deletions
diff --git a/tools/coqdoc/cpretty.mll b/tools/coqdoc/cpretty.mll
index 73c313252..d6eb68882 100644
--- a/tools/coqdoc/cpretty.mll
+++ b/tools/coqdoc/cpretty.mll
@@ -313,6 +313,7 @@ let def_token =
| "Boxed"
| "CoFixpoint"
| "Record"
+ | "Variant"
| "Structure"
| "Scheme"
| "Inductive"
diff --git a/tools/coqdoc/output.ml b/tools/coqdoc/output.ml
index 28480d4bd..0561d9a08 100644
--- a/tools/coqdoc/output.ml
+++ b/tools/coqdoc/output.ml
@@ -50,6 +50,7 @@ let is_keyword =
"subgoal"; "subgoals"; "vm_compute";
"Opaque"; "Transparent"; "Time";
"Extraction"; "Extract";
+ "Variant";
(* Program *)
"Program Definition"; "Program Example"; "Program Fixpoint"; "Program Lemma";
"Obligation"; "Obligations"; "Solve"; "using"; "Next Obligation"; "Next";
diff --git a/tools/gallina-syntax.el b/tools/gallina-syntax.el
index cbf4433be..c25abece1 100644
--- a/tools/gallina-syntax.el
+++ b/tools/gallina-syntax.el
@@ -360,6 +360,11 @@
("Inductive (3 args)" "indv3" "Inductive # : # :=\n| # : #\n| # : #\n| # : #." t )
("Inductive (4 args)" "indv4" "Inductive # : # :=\n| # : #\n| # : #\n| # : #\n| # : #." t )
("Inductive (5 args)" "indv5" "Inductive # : # :=\n| # : #\n| # : #\n| # : #\n| # : #\n| # : #." t )
+ ("Variant" "indv" "Variant # : # := # : #." t "Variant")
+ ("Variant (2 args)" "indv2" "Variant # : # :=\n| # : #\n| # : #." t )
+ ("Variant (3 args)" "indv3" "Variant # : # :=\n| # : #\n| # : #\n| # : #." t )
+ ("Variant (4 args)" "indv4" "Variant # : # :=\n| # : #\n| # : #\n| # : #\n| # : #." t )
+ ("Variant (5 args)" "indv5" "Variant # : # :=\n| # : #\n| # : #\n| # : #\n| # : #\n| # : #." t )
("Let" "Let" "Let # : # := #." t "Let")
("Ltac" "ltac" "Ltac # := #" t "Ltac")
("Module :=" "mo" "Module # : # := #." t ) ; careful