Skip to content

Commit 6b98188

Browse files
authored
Merge pull request #583 from LPCIC/fix-synter-impargs
Fix synter impargs
2 parents 46f23b6 + 9e888e7 commit 6b98188

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

src/coq_elpi_utils.ml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ module EC = EConstr
7171

7272
let safe_destApp sigma t = match EC.kind sigma t with C.App (hd, args) -> (EC.kind sigma hd, args) | x -> (x, [||])
7373
let mkGHole = DAst.make Glob_term.(GHole GInternalHole)
74-
let mkGSort = DAst.make Glob_term.(GSort (UAnonymous { rigid = UState.univ_flexible_alg }))
7574

7675
let mkApp ~depth t l =
7776
match l with
@@ -212,14 +211,6 @@ let rec list_map_acc f acc = function
212211
let acc, xs = list_map_acc f acc xs in
213212
(acc, x :: xs)
214213

215-
let rec dest_globLam g =
216-
match DAst.get g with
217-
| Glob_term.GLambda (name, _, _, bo) ->
218-
let names, bo = dest_globLam bo in
219-
(name :: names, bo)
220-
| _ -> ([], g)
221-
222-
let is_unknown_constructor x = Names.GlobRef.ConstructRef x = Coqlib.lib_ref "elpi.unknown_constructor"
223214
let rec fix_detype x = match DAst.get x with Glob_term.GEvar _ -> mkGHole | _ -> Glob_ops.map_glob_constr fix_detype x
224215

225216
let detype_qvar sigma q =

src/coq_elpi_vernacular.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,7 @@ module Interp = struct
567567
match syndata with
568568
| None -> [], fun ~target:_ ~depth -> Stdlib.Result.Ok ET.mkDiscard
569569
| Some (relocate_term,log) -> log, relocate_term in
570-
let initial_synterp_state =
571-
match synterplog with
572-
| [] -> Vernacstate.Synterp.freeze ()
573-
| x :: _ -> Coq_elpi_builtins_synterp.SynterpAction.synterp_state_after x in
570+
let initial_synterp_state = Vernacstate.Synterp.freeze () in
574571
let query ~depth state =
575572
let state, args, gls = EU.map_acc
576573
(Coq_elpi_arg_HOAS.in_elpi_cmd ~depth ~raw:raw_args Coq_elpi_HOAS.(mk_coq_context ~options:(default_options ()) state))

tests/test_synterp.v

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,22 @@ Elpi Accumulate Db db1.
156156
Elpi Accumulate lp:{{ main _. }}.
157157
#[synterp] Elpi Accumulate lp:{{ main _. }}.
158158

159-
Elpi Typecheck.
159+
Elpi Typecheck.
160+
161+
(* ********************************************* *)
162+
163+
Set Implicit Arguments.
164+
Elpi Command foo3.
165+
Elpi Accumulate lp:{{
166+
main _ :-
167+
D = (record "foo" {{ Type }} "mkfoo" (field [] "f" {{ Type }} _\end-record)),
168+
coq.typecheck-indt-decl D ok,
169+
coq.env.add-indt D I, coq.env.begin-module "x" none, coq.env.end-module _.
170+
}}.
171+
#[synterp] Elpi Accumulate lp:{{
172+
main _ :- coq.env.begin-module "x" none, coq.env.end-module _.
173+
}}.
174+
Elpi foo3.
175+
176+
177+

0 commit comments

Comments
 (0)