aboutsummaryrefslogtreecommitdiffhomepage
path: root/stm/vernac_classifier.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-09-12 17:26:53 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-11-29 16:12:14 +0100
commitae5944b360c1e181fa162d7d6dced7e671c6fbe6 (patch)
treeca5f2c680d0cd33028e75a579d5ffca31e83d6b0 /stm/vernac_classifier.ml
parentb23df225c7df7883af6ecfa921986cfb6fd3cd7c (diff)
Remove "obsolete_locality" and fix STM vernac classification.
We remove deprecated syntax "Coercion Local" and such, and seize the opportunity to refactor some code around vernac_expr. We also do a small fix on the STM classification, which didn't know about Let Fixpoint and Let CoFixpoint. This is a preliminary step for the work on attributes.
Diffstat (limited to 'stm/vernac_classifier.ml')
-rw-r--r--stm/vernac_classifier.ml21
1 files changed, 15 insertions, 6 deletions
diff --git a/stm/vernac_classifier.ml b/stm/vernac_classifier.ml
index 3aa2cd707..1ca572a36 100644
--- a/stm/vernac_classifier.ml
+++ b/stm/vernac_classifier.ml
@@ -103,8 +103,7 @@ let rec classify_vernac e =
| VernacUnsetOption (["Default";"Proof";"Using"])
| VernacSetOption (["Default";"Proof";"Using"],_) -> VtSideff [], VtNow
(* StartProof *)
- | VernacDefinition (
- (Some Decl_kinds.Discharge,Decl_kinds.Definition),((_,i),_),ProveBody _) ->
+ | VernacDefinition ((Decl_kinds.DoDischarge,_),((_,i),_),ProveBody _) ->
VtStartProof(default_proof_mode (),Doesn'tGuaranteeOpacity,[i]), VtLater
| VernacDefinition (_,((_,i),_),ProveBody _) ->
VtStartProof(default_proof_mode (),GuaranteesOpacity,[i]), VtLater
@@ -113,19 +112,29 @@ let rec classify_vernac e =
CList.map_filter (function (Some ((_,i),pl), _) -> Some i | _ -> None) l in
VtStartProof (default_proof_mode (),GuaranteesOpacity,ids), VtLater
| VernacGoal _ -> VtStartProof (default_proof_mode (),GuaranteesOpacity,[]), VtLater
- | VernacFixpoint (_,l) ->
+ | VernacFixpoint (discharge,l) ->
+ let guarantee =
+ match discharge with
+ | Decl_kinds.NoDischarge -> GuaranteesOpacity
+ | Decl_kinds.DoDischarge -> Doesn'tGuaranteeOpacity
+ in
let ids, open_proof =
List.fold_left (fun (l,b) ((((_,id),_),_,_,_,p),_) ->
id::l, b || p = None) ([],false) l in
if open_proof
- then VtStartProof (default_proof_mode (),GuaranteesOpacity,ids), VtLater
+ then VtStartProof (default_proof_mode (),guarantee,ids), VtLater
else VtSideff ids, VtLater
- | VernacCoFixpoint (_,l) ->
+ | VernacCoFixpoint (discharge,l) ->
+ let guarantee =
+ match discharge with
+ | Decl_kinds.NoDischarge -> GuaranteesOpacity
+ | Decl_kinds.DoDischarge -> Doesn'tGuaranteeOpacity
+ in
let ids, open_proof =
List.fold_left (fun (l,b) ((((_,id),_),_,_,p),_) ->
id::l, b || p = None) ([],false) l in
if open_proof
- then VtStartProof (default_proof_mode (),GuaranteesOpacity,ids), VtLater
+ then VtStartProof (default_proof_mode (),guarantee,ids), VtLater
else VtSideff ids, VtLater
(* Sideff: apply to all open branches. usually run on master only *)
| VernacAssumption (_,_,l) ->