aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2017-08-04 15:48:07 +0200
committerPierre-Marie Pédrot2017-08-04 15:51:03 +0200
commit2e01ea9e1ab0f9e8d90dd4e4ac598bc1691b9272 (patch)
tree73edd9be901385c861cf004876fb862adf771496 /src
parentfce4a1a9cbb57a636155181898ae4ecece5af59d (diff)
More precise type for quoted structures.
Diffstat (limited to 'src')
-rw-r--r--src/g_ltac2.ml47
-rw-r--r--src/tac2qexpr.mli4
-rw-r--r--src/tac2quote.ml6
3 files changed, 9 insertions, 8 deletions
diff --git a/src/g_ltac2.ml4 b/src/g_ltac2.ml4
index 8c7db71a47..bfef4fab8d 100644
--- a/src/g_ltac2.ml4
+++ b/src/g_ltac2.ml4
@@ -316,18 +316,17 @@ GEXTEND Gram
;
simple_binding:
[ [ "("; "$"; id = Prim.ident; ":="; c = Constr.lconstr; ")" ->
- Loc.tag ~loc:!@loc (QAnti (Loc.tag ~loc:!@loc id), Tac2quote.of_open_constr ~loc:!@loc c)
+ Loc.tag ~loc:!@loc (QAnti (Loc.tag ~loc:!@loc id), c)
| "("; n = Prim.natural; ":="; c = Constr.lconstr; ")" ->
- Loc.tag ~loc:!@loc (QExpr (AnonHyp n), Tac2quote.of_open_constr ~loc:!@loc c)
+ Loc.tag ~loc:!@loc (QExpr (AnonHyp n), c)
| "("; id = Prim.ident; ":="; c = Constr.lconstr; ")" ->
- Loc.tag ~loc:!@loc (QExpr (NamedHyp id), Tac2quote.of_open_constr ~loc:!@loc c)
+ Loc.tag ~loc:!@loc (QExpr (NamedHyp id), c)
] ]
;
bindings:
[ [ test_lpar_idnum_coloneq; bl = LIST1 simple_binding ->
QExplicitBindings bl
| bl = LIST1 Constr.constr ->
- let bl = List.map (fun c -> Tac2quote.of_open_constr ~loc:!@loc c) bl in
QImplicitBindings bl
] ]
;
diff --git a/src/tac2qexpr.mli b/src/tac2qexpr.mli
index 5075f2d7d4..8a61590a1d 100644
--- a/src/tac2qexpr.mli
+++ b/src/tac2qexpr.mli
@@ -19,8 +19,8 @@ type 'a or_anti =
| QAnti of Id.t located
type bindings =
-| QImplicitBindings of raw_tacexpr list
-| QExplicitBindings of (Misctypes.quantified_hypothesis or_anti * raw_tacexpr) Loc.located list
+| QImplicitBindings of Constrexpr.constr_expr list
+| QExplicitBindings of (Misctypes.quantified_hypothesis or_anti * Constrexpr.constr_expr) Loc.located list
| QNoBindings
type intro_pattern =
diff --git a/src/tac2quote.ml b/src/tac2quote.ml
index 9858f611fe..a053bd799f 100644
--- a/src/tac2quote.ml
+++ b/src/tac2quote.ml
@@ -98,9 +98,11 @@ let of_bindings ?loc = function
| QNoBindings ->
std_constructor ?loc "NoBindings" []
| QImplicitBindings tl ->
+ let tl = List.map (fun c -> of_open_constr ?loc c) tl in
std_constructor ?loc "ImplicitBindings" [of_list ?loc tl]
| QExplicitBindings tl ->
- let tl = List.map (fun (loc, (qhyp, e)) -> of_pair ?loc (of_anti ?loc of_qhyp qhyp, e)) tl in
+ let map (loc, (qhyp, e)) = of_pair ?loc (of_anti ?loc of_qhyp qhyp, of_open_constr ?loc e) in
+ let tl = List.map map tl in
std_constructor ?loc "ExplicitBindings" [of_list ?loc tl]
let rec of_intro_pattern ?loc = function
@@ -174,7 +176,7 @@ let of_clause ?loc cl =
let of_destruction_arg ?loc = function
| QElimOnConstr (c, bnd) ->
- let c = of_constr ?loc c in
+ let c = of_open_constr ?loc c in
let bnd = of_bindings ?loc bnd in
let arg = thunk (of_pair ?loc (c, bnd)) in
std_constructor ?loc "ElimOnConstr" [arg]