aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-03-30 21:42:58 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-03-30 21:42:58 +0000
commit90e5407fcfc59dce5ea592aeae6195183a2b4ad2 (patch)
treea30c7aebc8d840b87d702b972fbbff16714e4b6d /toplevel
parent0b6924f05ef6beb775345f3fb2ad21a009ab3baa (diff)
Ajout d'abbréviations/notations paramétriques
Example: "Notation reflexive R := (forall x, R x x)." git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10730 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/command.ml6
-rw-r--r--toplevel/command.mli3
-rw-r--r--toplevel/metasyntax.ml4
-rw-r--r--toplevel/vernacexpr.ml4
4 files changed, 9 insertions, 8 deletions
diff --git a/toplevel/command.ml b/toplevel/command.ml
index 4f26cd1eb..fbba7a4ee 100644
--- a/toplevel/command.ml
+++ b/toplevel/command.ml
@@ -163,9 +163,9 @@ let declare_definition ident (local,boxed,dok) bl red_option c typopt hook =
declare_global_definition ident ce' local imps in
hook local r
-let syntax_definition ident c local onlyparse =
- let c = snd (interp_aconstr [] [] c) in
- Syntax_def.declare_syntactic_definition local ident onlyparse c
+let syntax_definition ident (vars,c) local onlyparse =
+ let pat = interp_aconstr [] vars c in
+ Syntax_def.declare_syntactic_definition local ident onlyparse pat
(* 2| Variable/Hypothesis/Parameter/Axiom declarations *)
diff --git a/toplevel/command.mli b/toplevel/command.mli
index 31420d189..942fd2c31 100644
--- a/toplevel/command.mli
+++ b/toplevel/command.mli
@@ -39,7 +39,8 @@ val declare_definition : identifier -> definition_kind ->
local_binder list -> red_expr option -> constr_expr ->
constr_expr option -> declaration_hook -> unit
-val syntax_definition : identifier -> constr_expr -> bool -> bool -> unit
+val syntax_definition : identifier -> identifier list * constr_expr ->
+ bool -> bool -> unit
val declare_one_assumption : coercion_flag -> assumption_kind -> Term.types ->
Impargs.manual_explicitation list -> bool -> Names.variable located -> unit
diff --git a/toplevel/metasyntax.ml b/toplevel/metasyntax.ml
index d9a82a413..f8f8c9ad2 100644
--- a/toplevel/metasyntax.ml
+++ b/toplevel/metasyntax.ml
@@ -854,8 +854,8 @@ let cache_notation o =
load_notation 1 o;
open_notation 1 o
-let subst_notation (_,subst,(lc,scope,(metas,pat),b,ndf)) =
- (lc,scope,(metas,subst_aconstr subst (List.map fst metas) pat),b,ndf)
+let subst_notation (_,subst,(lc,scope,pat,b,ndf)) =
+ (lc,scope,subst_interpretation subst pat,b,ndf)
let classify_notation (_,(local,_,_,_,_ as o)) =
if local then Dispose else Substitute o
diff --git a/toplevel/vernacexpr.ml b/toplevel/vernacexpr.ml
index 4579d43a6..839f3ee46 100644
--- a/toplevel/vernacexpr.ml
+++ b/toplevel/vernacexpr.ml
@@ -287,8 +287,8 @@ type vernac_expr =
| VernacDeclareTacticDefinition of
rec_flag * (lident * bool * raw_tactic_expr) list
| VernacHints of locality_flag * lstring list * hints
- | VernacSyntacticDefinition of identifier * constr_expr * locality_flag *
- onlyparsing_flag
+ | VernacSyntacticDefinition of identifier * (identifier list * constr_expr) *
+ locality_flag * onlyparsing_flag
| VernacDeclareImplicits of locality_flag * lreference * bool *
(explicitation * bool * bool) list option
| VernacReserve of lident list * constr_expr