-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "coq.env.query-extra-dep" external predicate #525
Conversation
6b65ec9
to
4fe9ddc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
There are a few things to improve before merging, see the comments.
You should also add a line to the ChangeLog.md file
tests/test_query_extra_dep.v
Outdated
|
||
Elpi Query lp:{{ coq.env.query-extra-dep "elab" File }}. | ||
|
||
Fail Elpi Query lp:{{ coq.env.query-extra-dep "foo" File }}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the test file to _CoqProject.test.
This file is a good test, but the API returns None instead of raising No_clause
, so this will fail once it runs.
src/coq_elpi_builtins.ml
Outdated
@@ -2325,6 +2325,15 @@ denote the same x as before.|}; | |||
Some (c, np + na))))))), | |||
DocAbove); | |||
|
|||
MLCode(Pred("coq.env.query-extra-dep", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coq.env
is for accessing the logical environment.
Please move this code just before
-- Datatypes conversions --------------------------------------------
maybe in a dedicated section, say -- Extra Dependency ------------------------
.
Also I'd call it coq.extra-dep
Enrico Tassi ***@***.***> writes:
@gares requested changes on this pull request.
Thanks for this PR.
There are a few things to improve before merging, see the comments.
You should also add a line to the ChangeLog.md file
Done.
> @@ -0,0 +1,7 @@
+From elpi Require Import elpi.
+
+From unreleased Extra Dependency "elpi_elaborator.elpi" as elab.
+
+Elpi Query lp:{{ coq.env.query-extra-dep "elab" File }}.
+
+Fail Elpi Query lp:{{ coq.env.query-extra-dep "foo" File }}.
Please add the test file to _CoqProject.test.
This file is a good test, but the API returns None instead of raising
`No_clause`, so this will fail once it runs.
I've replaced it with an example that matches (some _).
> @@ -2325,6 +2325,15 @@ denote the same x as before.|};
Some (c, np + na))))))),
DocAbove);
+ MLCode(Pred("coq.env.query-extra-dep",
`coq.env` is for accessing the logical environment.
Please move this code just before
```
-- Datatypes conversions --------------------------------------------
```
maybe in a dedicated section, say `-- Extra Dependency ------------------------`.
Also I'd call it `coq.extra-dep`
Fine with me, I've also changed this.
|
4fe9ddc
to
c8e9e2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more nits
@@ -3884,6 +3884,15 @@ Supported attributes: | |||
state, !: s, [])), | |||
DocAbove); | |||
|
|||
MLCode(Pred("coq.extra-dep", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an LPDoc line with something like
-- Extra Dependencies -------------
coq-builtin.elpi
Outdated
@@ -901,6 +901,10 @@ external pred coq.env.projections i:inductive, o:list (option constant). | |||
external pred coq.env.primitive-projections i:inductive, | |||
o:list (option (pair projection int)). | |||
|
|||
% [coq.env.query-extra-dep Identifier File Name] Resolve the file name of an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please regenerate this file
c8e9e2c
to
995505a
Compare
Sorry, missed those. |
Do you have a schedule when you are planning to publish a release with these changes? |
Before the end of November |
As discussed on Zulip, this would allow for a predicate to resolve the real path behind a
Extra Dependency
. As seen in the patch, this just amounts to wrappingComExtraDeps.query_extra_dep
in the right way.