aboutsummaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorherbelin2003-03-31 21:12:51 +0000
committerherbelin2003-03-31 21:12:51 +0000
commitcfadf920f60ae2977bd1f3c2bf0137f607c76467 (patch)
tree6888a225c88fcddb510b99247556a01be8d1f338 /toplevel
parent24b97a16a839d896af0cbb291c12c70f9bcab448 (diff)
Ajout d'un choix 'onlyparse'
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3822 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/command.ml3
-rw-r--r--toplevel/metasyntax.ml6
2 files changed, 6 insertions, 3 deletions
diff --git a/toplevel/command.ml b/toplevel/command.ml
index 8279c14527..63c7cce93c 100644
--- a/toplevel/command.ml
+++ b/toplevel/command.ml
@@ -121,7 +121,8 @@ let declare_definition ident local bl red_option c typopt =
let syntax_definition ident c =
let c = snd (interp_aconstr [] c) in
- Syntax_def.declare_syntactic_definition ident c;
+ let onlyparse = !Options.v7_only in
+ Syntax_def.declare_syntactic_definition ident onlyparse c;
if_verbose message ((string_of_id ident) ^ " is now a syntax macro")
diff --git a/toplevel/metasyntax.ml b/toplevel/metasyntax.ml
index 36734041ab..af9de6b434 100644
--- a/toplevel/metasyntax.ml
+++ b/toplevel/metasyntax.ml
@@ -681,11 +681,13 @@ let add_notation_in_scope df c (assoc,n,etyps,onlyparse) omodv8 sc toks =
let add_notation df a modifiers mv8 sc =
let toks = split df in
match toks with
- | [String x] when quote(strip x) = x & modifiers = [] ->
+ | [String x] when quote(strip x) = x
+ & (modifiers = [] or modifiers = [SetOnlyParsing]) ->
(* Means a Syntactic Definition *)
let ident = id_of_string (strip x) in
let c = snd (interp_aconstr [] a) in
- Syntax_def.declare_syntactic_definition ident c
+ let onlyparse = !Options.v7_only or modifiers = [SetOnlyParsing] in
+ Syntax_def.declare_syntactic_definition ident onlyparse c
| _ ->
add_notation_in_scope
df a (interp_notation_modifiers modifiers)