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
Clarifying the logic of levels in custom and constr entry rules #13025
Clarifying the logic of levels in custom and constr entry rules #13025
Conversation
…no level). There is now a new specific type "notation_subentry_level" for remembering the level or absence of explicit level of the variables of a grammar rule. The type "notation_entry_level" still exists but is only for characterizing the level (and custom entry name) in which a rule lives.
9334617
to
f713a54
Compare
I just ran into the same issue as #13018. I tested your branch, but it seems that there has been a regression. The following prints nicely in 8.12, but does not in master and this branch:
And now that I am here, there is another printing problem (let me know if I should open a separate issue):
Two problems here:
|
I'd bet you're using CoqIDE! The first problem is related to option The second issue is known: there is no support for bigint and numeral simultaneously, sorry (this should eventually be addressed by #11561). Thanks for your feedback. |
Ah, I see, that explains it. I'll change my settings. Thanks. |
cc @maximedenes as I understand he's familiar with the code. Would be good not to delay this a bit as otherwise |
This comment has been minimized.
This comment has been minimized.
f713a54
to
edd94e1
Compare
edd94e1
to
ec56e36
Compare
ec56e36
to
86ffca5
Compare
86ffca5
to
5a7572b
Compare
f88feec
to
078d6d1
Compare
…notations). There is now a new specific type "notation_subentry_level" for remembering the level or absence of explicit level of the variables of a grammar rule. The type "notation_entry_level" still exists but is only for characterizing the level (and custom entry name) in which a rule lives.
I updated the title and the header to adjust to the new status of this PR. It is now going out of the list of PRs suspended for a while, that were needing an update and an extra rebase. |
IIUC this is just missing review/assignee. |
informations about the subentries: we remember whether we are at any level, at the next level or at the self level. Incidentally, we also take into account option Printing Parentheses in custom entries. This is a more principled fix to coq#12775/coq#13018 than coq#13073 (printing bugs in custom entry rules with no explicit level).
This insists on the syntactic structure of the type rather than on its semantic origin, since, after all, subentries are promoted as entries in the recursive printing loop.
terminology already in used).
We hard-wire a coercion in constr from level 0 to the top level.
078d6d1
to
e396bc1
Compare
…notations). There is now a new specific type "notation_subentry_level" for remembering the level or absence of explicit level of the variables of a grammar rule. The type "notation_entry_level" still exists but is only for characterizing the level (and custom entry name) in which a rule lives.
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
This PR was not rebased after 30 days despite the warning, it is now closed. |
…notations). There is now a new specific type "notation_subentry_level" for remembering the level or absence of explicit level of the variables of a grammar rule. The type "notation_entry_level" still exists but is only for characterizing the level (and custom entry name) in which a rule lives.
Reopened in #17117. |
…entry rules (reopening of #13025) Reviewed-by: proux01 Ack-by: SkySkimmer Co-authored-by: proux01 <proux01@users.noreply.github.com>
Kind: cleanup + small enhancements
Note: This PR was originally to fix #13018 and #12775 but those were finally fixed by #13073. This PR is thus now about small enhancements and a more principled code. The header has been updated.
Synchronous overlay for elpi at LPCIC/coq-elpi#184
We introduce a type
notation_subentry_level
to preserve more informations about the subentries: we remember whether we are at any level, at the next level or at the self level.We take into account option
Printing Parentheses
in custom entriesWe provide a more principled fix to custom entry without explicit level prints as constr instead #13018 and Parens not printing right in custom grammar #12775 which subsumes the quicker fix done in A temporary fix of #13018 and #12775 for branch 8.12 (bis) #13073 (the loss of the
any level
information was the cause of the bug; A temporary fix of #13018 and #12775 for branch 8.12 (bis) #13073 hackily fixed it by usingmax_int
as the default possible highest level in a custom entry)We warn about coercions not used for printing
Added / updated test-suite
Documented API change