This is a constructor, it's not 'calling' anything.
| EGoalDefn of loc * goal
| ETacticDefn of loc * tactic
| ECallGoal of loc * id * expr list
- | ECallTactic of loc * id * expr list
+ | ETacticConstructor 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
- | ECallTactic (loc, name, _) ->
+ | ETacticConstructor (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. *)
- | ECallTactic (loc, _, []) -> Filename.quote ""
- | ECallTactic (loc, _, (arg :: _)) -> expr_to_shell_string env arg
+ | ETacticConstructor (loc, _, []) -> Filename.quote ""
+ | ETacticConstructor (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))
- | ECallTactic (loc, name, params) ->
+ | ETacticConstructor (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. *)
- | ECallTactic of loc * id * expr list
+ | ETacticConstructor of loc * id * expr list
(** variable, or goal call with no parameters *)
| EVar of loc * id
(** list *)
run_goal env loc name args goal
(* Call a tactic. *)
- | Ast.ECallTactic (loc, name, args) ->
+ | Ast.ETacticConstructor (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.ECallTactic (loc, tactic, List.map expr_of_substs targs)
+ Ast.ETacticConstructor (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.ECallTactic (loc, tactic,
+ let t = Ast.ETacticConstructor (loc, tactic,
List.map (fun c -> Ast.EConstant (loc, c))
cargs) in
failwithf "%a: don't know how to build %a"
expr:
| ID params { Ast.ECallGoal ($loc, $1, $2) }
| ID { Ast.EVar ($loc, $1) }
- | TACTIC params { Ast.ECallTactic ($loc, $1, $2) }
+ | TACTIC params { Ast.ETacticConstructor ($loc, $1, $2) }
| STRING { Ast.ESubsts ($loc, $1) }
| LEFT_ARRAY barelist RIGHT_ARRAY { Ast.EList ($loc, $2) }
;