@@ -233,7 +233,7 @@ let univpoly_of ~poly ~cumulative =
233233
234234 let of_coq_inductive_definition id =
235235 let open Vernacentries.Preprocessed_Mind_decl in
236- let { flags; typing_flags; private_ind; uniform; inductives } = id in
236+ let { flags; udecl; typing_flags; private_ind; uniform; inductives } = id in
237237 if List. length inductives != 1 then nYI " mutual inductives" ;
238238 let inductive = List. hd inductives in
239239 let (((name),(parameters,non_uniform_parameters),arity,constructors),notations) = inductive in
@@ -243,7 +243,7 @@ let univpoly_of ~poly ~cumulative =
243243 List. map (function (Vernacexpr. (_ ,NoCoercion,NoInstance),c ) -> c
244244 | _ -> CErrors. user_err Pp. (str " coercion and instance flags not supported" ))
245245 constructors in
246- let { template; udecl ; cumulative; poly; finite } = flags in
246+ let { ComInductive. template; cumulative; poly; finite } = flags in
247247 if template <> None then nYI " raw template polymorphic inductives" ;
248248 if udecl <> None then nYI " raw universe polymorphic inductives with universe declaration" ;
249249 {
@@ -257,7 +257,7 @@ let univpoly_of ~poly ~cumulative =
257257 }
258258 let of_coq_record_definition id =
259259 let open Vernacentries.Preprocessed_Mind_decl in
260- let { flags; primitive_proj; kind; records; } : record = id in
260+ let { flags; udecl; primitive_proj; kind; records; } : record = id in
261261 if List. length records != 1 then nYI " mutual inductives" ;
262262 let open Record.Ast in
263263 let { name; is_coercion; binders : Constrexpr .local_binder_expr list ; cfs; idbuild; sort; default_inhabitant_id : Names.Id .t option ; } = List. hd records in
@@ -267,7 +267,7 @@ let univpoly_of ~poly ~cumulative =
267267 match sort.CAst. v with
268268 | Constrexpr. CSort s -> s
269269 | _ -> CErrors. user_err ?loc:sort.CAst. loc Pp. (str " only explicits sorts are supported" )) in
270- let { template; udecl ; cumulative; poly; finite } = flags in
270+ let { ComInductive. template; cumulative; poly; finite } = flags in
271271 if template <> None then nYI " raw template polymorphic inductives" ;
272272 if udecl <> None then nYI " raw universe polymorphic inductives with universe declaration" ;
273273 {
@@ -996,6 +996,9 @@ let handle_template_polymorphism = function
996996 | Some false -> Some false
997997 | Some true -> err Pp. (str " #[universes(template)] is not supported" )
998998
999+ let handle_template_polymorphism flags =
1000+ { flags with ComInductive. template = handle_template_polymorphism flags.ComInductive. template }
1001+
9991002let in_elpi_cmd_synterp ~depth ?calldepth state (x : Cmd.raw ) =
10001003 let open Cmd in
10011004 match x with
@@ -1033,11 +1036,11 @@ let in_elpi_cmd ~depth ?calldepth coq_ctx state ~raw (x : Cmd.top) =
10331036 state, t, []
10341037 | RecordDecl (_ist ,(glob_sign ,raw_rdecl )) ->
10351038 let open Vernacentries.Preprocessed_Mind_decl in
1036- let { flags = { template; poly; cumulative; udecl; finite } ; primitive_proj; kind; records } = raw_rdecl in
1037- let template = handle_template_polymorphism template in
1039+ let { flags; udecl; primitive_proj; kind; records } = raw_rdecl in
1040+ let flags = handle_template_polymorphism flags in
10381041 (* Definitional type classes cannot be interpreted using this function (why?) *)
10391042 let kind = if kind = Vernacexpr. Class true then Vernacexpr. Class false else kind in
1040- let e = Record. interp_structure ~template udecl kind ~cumulative ~poly ~ primitive_proj finite records in
1043+ let e = Record. interp_structure ~flags udecl kind ~primitive_proj records in
10411044 record_entry2lp ~depth coq_ctx E. no_constraints state ~loose_udecl: (udecl = None ) e
10421045 | IndtDecl (_ist ,(glob_sign ,raw_indt )) when raw ->
10431046 let raw_indt = of_coq_inductive_definition raw_indt in
@@ -1047,14 +1050,14 @@ let in_elpi_cmd ~depth ?calldepth coq_ctx state ~raw (x : Cmd.top) =
10471050 state, t, []
10481051 | IndtDecl (_ist ,(glob_sign ,raw_indt )) ->
10491052 let open Vernacentries.Preprocessed_Mind_decl in
1050- let { flags = { template; poly; cumulative; udecl; finite } ; typing_flags; uniform; private_ind; inductives } = raw_indt in
1051- let template = handle_template_polymorphism template in
1053+ let { flags; udecl; typing_flags; uniform; private_ind; inductives } = raw_indt in
1054+ let flags = handle_template_polymorphism flags in
10521055 let e =
10531056 match inductives with
10541057 | [mind_w_not] ->
10551058 ComInductive. interp_mutual_inductive ~env: coq_ctx.env
1056- ~template ~cumulative ~poly ~uniform ~private_ind ?typing_flags
1057- udecl [mind_w_not] finite
1059+ ~flags ~uniform ~private_ind ?typing_flags
1060+ udecl [mind_w_not]
10581061 | _ -> nYI " (HOAS) mutual inductives"
10591062 in
10601063 inductive_entry2lp ~depth coq_ctx E. no_constraints state ~loose_udecl: (udecl = None ) e
0 commit comments