-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Corrected EBNF grammar in the manual #14277
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
Conversation
use_decl : "pub" ? "use" ident [ '=' path | ||
| "::" path_glob ] ; | ||
use_decl : "pub" ? "use" [ ident '=' path | ||
| path_glob ] ; |
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.
Um… what? These changes would make use;
valid, which it is certainly not. A use
statement must be followed by an identifier.
The grammar already existing appears to me to be correct.
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 take back what I said about the grammar existing being correct—I’ve been reading other grammar rules too much recently (the IETF RFC ones in particular) and was thinking […]
meant optional. There is a problem with the current grammar, but the new one is wrong also. I think that just tacking a question mark after the OK, OK, that responsibility got shifted to the ]
on the existing grammar would be correct?path_glob
rule… not doing well today, am I?
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.
My line of thought is that a single identifier is also a path. path_glob
can match multiple paths.
// Valid declarations
use ident = simple::path;
use simple::path;
use {many, idents}; // doesn't start with an ident!
// Invalid
use simple::path = another::path;
use *;
use;
I think @chris-morgan is right about the |
The grammar for use declarations was outdated.
Alright, it's done. |
The grammar for use declarations was outdated. Corrected some other mistakes.
…ang#14279) fixes rust-lang#14277 changelog: [`incompatible_msrv`]: add config option [`check-incompatible-msrv-in-tests`] to enable in `#[test]` and `#[cfg(test)]` code.
The grammar for use declarations was outdated. Corrected some other mistakes.