-
Notifications
You must be signed in to change notification settings - Fork 632
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
[notations] Warn about incompatible prefixes #19049
[notations] Warn about incompatible prefixes #19049
Conversation
@herbelin this is the first step toward the |
Maybe the warning should explain what the consequences of incompatible prefixes are (I don't know myself) |
e51214c
to
4c25ad7
Compare
Indeed, done, as well as the documentation. |
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.
wording and other suggestions
doc/changelog/03-notations/19049-warn_notation_incompatible_prefix.rst
Outdated
Show resolved
Hide resolved
@SkySkimmer > Maybe the warning should explain what the consequences of incompatible prefixes are (I don't know myself) IIUC the parser would only recognize one of the notations (and report syntax errors on the others), depending on the order in which the parser processes the rules defined for each notation (first one wins). Our parser really doesn't do lookahead--it looks at only the next symbol to make a parsing decision. Once the first token of a rule is accepted, the parser is unable to switch to a different rule. Not like LALR(k) parsers such as yacc and bison. (There is a hard coded exception to this behavior for command names.) |
4c25ad7
to
63eb074
Compare
@jfehrle please don't guess
is certainly not true so I don't trust the rest of your post. |
@coqbot run full ci |
@SkySkimmer The exceptional code is |
63eb074
to
2f4b54e
Compare
2f4b54e
to
02b7903
Compare
Going to merge, after rebase and clean CI. |
02b7903
to
c30fca0
Compare
For instance Reserved Notation "#0 coq#1" (at level 30). Reserved Notation "#0 coq#1 coq#2" (at level 40). (* Warning: Notations "#0 coq#1" defined at level 30 and "#0 coq#1 coq#2" defined at level 40 have incompatible prefixes. [prefix-incompatible-level,parsing,default] *) Reserved Notation "coq#20 coq#21 x coq#3 y" (x at level 30, at level 50). Reserved Notation "coq#20 coq#21 x coq#34" (x at level 40, at level 50). (* Warning: Notations "coq#20 coq#21 _ coq#3 _" defined at level 50 with arguments constr at level 30 and "coq#20 coq#21 _ coq#34" defined at level 50 with arguments constr at level 40 have incompatible prefixes. [prefix-incompatible-level,parsing,default] *)
c30fca0
to
bd48bda
Compare
@herbelin rebased, CI green |
@coqbot merge now |
1 similar comment
@coqbot merge now |
Add a warning for notations with incompatible common prefixes, for instance
Updated documented syntax by runningmake doc_gram_rsts
.Opened overlay pull requests.