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
Adding support for an "only parsing" modifier in "where"-based notation #11602
Adding support for an "only parsing" modifier in "where"-based notation #11602
Conversation
vernac/vernacexpr.ml
Outdated
@@ -130,7 +130,7 @@ type definition_expr = | |||
| DefineBody of local_binder_expr list * Genredexpr.raw_red_expr option * constr_expr | |||
* constr_expr option | |||
|
|||
type decl_notation = lstring * constr_expr * scope_name option | |||
type decl_notation = lstring * constr_expr * bool * scope_name option |
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.
Probably the right time to turn this into a record.
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.
Yes, this is what I thought too... Maybe tonight or tomorrow (or even later if not urgent)?
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.
I experimenting using a record. It is much more verbose, but certainly also more self-explanatory. Any suggestions in passing on how formatting records?
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.
You mean, the type declaration? I subscribe to the
type foo = {
foo_bla : Tbla;
foo_bar : Tbar;
...
}
syntax, but I am not sure that's what your asking.
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.
but I am not sure that's what your asking.
Yes, that was part of my question. In practice, I used:
type decl_notation =
{ decl_ntn_string : lstring
; decl_ntn_interp : constr_expr
; decl_ntn_only_parsing : bool
; decl_ntn_scope : scope_name option
}
because that's the style which was already used nearby in vernacexpr.ml
(even if other part of vernacexpr.ml
use the style that you're mentioning.
On the other side, in metasyntax.ml
, I used the style:
let open Vernacexpr in
let
{ decl_ntn_string = {CAst.loc;v=ntn};
decl_ntn_interp = c;
decl_ntn_only_parsing = onlyparsing;
decl_ntn_scope = scopt } = decl_ntn in
3826b15
to
6372aaf
Compare
I made the same change myself (not yet merged). Changes made in .mlg files are easy to notice and to then make rst adjustments. In the .rsts, the
which looks like this in the HTML: |
6372aaf
to
0cf7e03
Compare
Nice.
OK, so, if I understand correctly, for this PR, I do nothing special more at the moment. |
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.
The ML code is fine with me.
91a4c03
to
b13ac5b
Compare
b13ac5b
to
ce0b076
Compare
This error is everywhere indeed. |
@herbelin can you rebase to get a clean CI just in case? |
ce0b076
to
dfc5795
Compare
dfc5795
to
b31767a
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.
LGTM
@herbelin The Equations overlay looks like it also needs to be rebased. |
…ons. Co-Authored-By: Théo Zimmermann <theo.zimmi@gmail.com>
Done. |
b31767a
to
eb9d633
Compare
Kind: enhancement
To be merged synchronously with overlay for Equations (mattam82/Coq-Equations#261).
Since
Reserved Notation
does not support theonly parsing
modifier, there was no way to tell that a notation declared using awhere
clause isonly parsing
. For consistency of the picture, this PR adds this support.While updating the refman, I fixed what seems typos but I hope I did not introduce problems in the meantime. For instance, I renamed
decl_notation
intodecl_notations
andone_decl_notation
intodecl_notation
and I hope this is consistent with the naming policies for the reference manual (cc @jfehrle).