diff options
author | 2000-01-13 22:45:42 +0000 | |
---|---|---|
committer | 2000-01-13 22:45:42 +0000 | |
commit | 4689ba338247d4753a4cd873eb16ff3f1bd201d8 (patch) | |
tree | 5f886f59798951c17aa390bf2c6094c9073850c3 /toplevel/vernacentries.ml | |
parent | f5327ac32923f58f6e3efad5bf4d3537673dbdb3 (diff) |
Nettoyage des fichiers de parsing
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@277 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel/vernacentries.ml')
-rw-r--r-- | toplevel/vernacentries.ml | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 54629fe2d..e69d537a1 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -724,13 +724,14 @@ let _ = let _ = add "DEFINITION" (function - | (VARG_STRING kind :: VARG_IDENTIFIER id :: VARG_CONSTR c ::optred) -> - let red_option = match optred with - | [] -> None - | [VARG_TACTIC_ARG (Redexp(r1,r2))] -> - let env = Global.env() in - let redexp = redexp_of_ast Evd.empty env (r1,r2) in - Some redexp + | (VARG_STRING kind :: VARG_IDENTIFIER id :: VARG_CONSTR c :: rest) -> + let typ_opt,red_option = match rest with + | [] -> None, None + | [VARG_CONSTR t] -> Some t, None + | [VARG_TACTIC_ARG (Redexp(r1,r2))] -> + None, Some (redexp_of_ast Evd.empty (Global.env()) (r1,r2)) + | [VARG_CONSTR t; VARG_TACTIC_ARG (Redexp(r1,r2))] -> + Some t, Some (redexp_of_ast Evd.empty (Global.env()) (r1,r2)) | _ -> bad_vernac_args "DEFINITION" in let stre,coe,objdef,idcoe = match kind with @@ -748,7 +749,7 @@ let _ = | _ -> anomaly "Unexpected string" in fun () -> - definition_body_red id stre c red_option; + definition_body_red id stre c typ_opt red_option; if coe then begin Class.try_add_new_coercion id stre; message ((string_of_id id) ^ " is now a coercion") |