| EGoalDefn of loc * goal
| ETacticDefn of loc * tactic
| ECallGoal of loc * id * expr list
- | ETacticConstructor of loc * id * expr list
+ | ETacticCtor of loc * id * expr list
| EVar of loc * id
| EList of loc * expr list
| ESubsts of loc * substs
failwithf "%a: cannot use goal ‘%s’ in constant expression"
string_loc loc name
- | ETacticConstructor (loc, name, _) ->
+ | ETacticCtor (loc, name, _) ->
failwithf "%a: cannot use tactic ‘%s’ in constant expression"
string_loc loc name
string_loc loc name
(* Tactics expand to the first parameter. *)
- | ETacticConstructor (loc, _, []) -> Filename.quote ""
- | ETacticConstructor (loc, _, (arg :: _)) -> expr_to_shell_string env arg
+ | ETacticCtor (loc, _, []) -> Filename.quote ""
+ | ETacticCtor (loc, _, (arg :: _)) -> expr_to_shell_string env arg
| EGoalDefn (loc, _) ->
failwithf "%a: cannot use goal in shell expansion"
| ECallGoal (loc, name, params) ->
sprintf "%s (%s)"
name (String.concat ", " (List.map (string_expr ()) params))
- | ETacticConstructor (loc, name, params) ->
+ | ETacticCtor (loc, name, params) ->
sprintf "%s (%s)"
name (String.concat ", " (List.map (string_expr ()) params))
| EVar (loc, var) -> var
(** call goalname (params) etc. *)
| ECallGoal of loc * id * expr list
(** call *tactic (params) etc. *)
- | ETacticConstructor of loc * id * expr list
+ | ETacticCtor of loc * id * expr list
(** variable, or goal call with no parameters *)
| EVar of loc * id
(** list *)
failwithf "%a: cannot use goal ‘%s’ in constant expression"
Ast.string_loc loc name
- | ETacticConstructor (loc, name, _) ->
+ | ETacticCtor (loc, name, _) ->
failwithf "%a: cannot use tactic ‘%s’ in constant expression"
Ast.string_loc loc name
Ast.string_loc loc name
(* Tactics expand to the first parameter. *)
- | ETacticConstructor (loc, _, []) -> Filename.quote ""
- | ETacticConstructor (loc, _, (arg :: _)) -> expr_to_shell_string env arg
+ | ETacticCtor (loc, _, []) -> Filename.quote ""
+ | ETacticCtor (loc, _, (arg :: _)) -> expr_to_shell_string env arg
| EGoalDefn (loc, _) ->
failwithf "%a: cannot use goal in shell expansion"
| EList (loc, exprs) ->
Ast.EList (loc, List.map (evaluate_goal_arg env) exprs)
- | ETacticConstructor (loc, name, exprs) ->
- Ast.ETacticConstructor (loc, name, List.map (evaluate_goal_arg env) exprs)
+ | ETacticCtor (loc, name, exprs) ->
+ Ast.ETacticCtor (loc, name, List.map (evaluate_goal_arg env) exprs)
| ECallGoal (loc, name, _) ->
(* Goals don't return anything so they cannot be used in
expr:
| ID params { Ast.ECallGoal ($loc, $1, $2) }
| ID { Ast.EVar ($loc, $1) }
- | TACTIC params { Ast.ETacticConstructor ($loc, $1, $2) }
+ | TACTIC params { Ast.ETacticCtor ($loc, $1, $2) }
| STRING { Ast.ESubsts ($loc, $1) }
| LEFT_ARRAY barelist RIGHT_ARRAY { Ast.EList ($loc, $2) }
;
run_goal env loc name args goal
(* Call a tactic. *)
- | Ast.ETacticConstructor (loc, name, args) ->
+ | Ast.ETacticCtor (loc, name, args) ->
(* All parameters of tactics must be simple constant expressions
* (strings, in future booleans, numbers, etc).
*)
let expr_of_substs s = Ast.ESubsts (Ast.noloc, s) in
let expr_of_pattern = function
| Ast.PTactic (loc, tactic, targs) ->
- Ast.ETacticConstructor (loc, tactic, List.map expr_of_substs targs)
+ Ast.ETacticCtor (loc, tactic, List.map expr_of_substs targs)
in
let pexprs = List.map expr_of_pattern patterns in
let env = Ast.Env.add "@" (Ast.EList (Ast.noloc, pexprs)) env in
let targs = List.map (function Ast.CString s -> [Ast.SString s]) cargs in
let p = Ast.PTactic (loc, tactic, targs) in
if needs_rebuild env loc [] p then (
- let t = Ast.ETacticConstructor (loc, tactic,
+ let t = Ast.ETacticCtor (loc, tactic,
List.map (fun c -> Ast.EConstant (loc, c))
cargs) in
failwithf "%a: don't know how to build %a"