aboutsummaryrefslogtreecommitdiff
path: root/parsing/g_vernac.ml4
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/g_vernac.ml4')
-rw-r--r--parsing/g_vernac.ml425
1 files changed, 21 insertions, 4 deletions
diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4
index 1288e2e79c..502b6b8ea3 100644
--- a/parsing/g_vernac.ml4
+++ b/parsing/g_vernac.ml4
@@ -109,8 +109,14 @@ GEXTEND Gram
noedit_mode:
[ [ c = subgoal_command -> c None] ]
;
+
+ selector:
+ [ [ n=natural; ":" -> SelectNth n
+ | IDENT "all" ; ":" -> SelectAll ] ]
+ ;
+
tactic_mode:
- [ [ gln = OPT[n=natural; ":" -> n];
+ [ [ gln = OPT selector;
tac = subgoal_command -> tac gln ] ]
;
@@ -127,11 +133,22 @@ GEXTEND Gram
subgoal_command:
- [ [ c = check_command; "." -> fun g -> c g
+ [ [ c = check_command; "." ->
+ begin function
+ | Some (SelectNth g) -> c (Some g)
+ | None -> c None
+ | _ ->
+ (* arnaud: the error is raised bizarely:
+ "all:Check 0." doesn't do anything, then
+ inputing anything that ends with a period
+ (including " .") raises the error. *)
+ error "Typing and evaluation commands, cannot be used with the \"all:\" selector."
+ end
| tac = Tactic.tactic;
use_dft_tac = [ "." -> false | "..." -> true ] ->
- (fun g ->
- let g = Option.default 1 g in
+ (fun g ->
+ (* arnaud: attention à choisir le bon défaut. *)
+ let g = Option.default (SelectNth 1) g in
VernacSolve(g,tac,use_dft_tac)) ] ]
;
located_vernac: