| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Fix null exclusions in grammar docs
The grammar documentation incorrectly says that comments, character literals,
and string literals may not include null.
|
|
The grammar documentation incorrectly says that comments, character literals,
and string literals may not include null.
|
|
The grammar defines identifiers in terms of XID_start and XID_continue,
but this is referring to the unstable non_ascii_idents feature.
The documentation implies that non_ascii_idents is forthcoming, but this
is left over from pre-1.0 documentation; in reality, non_ascii_idents
has been without even an RFC for several years now, and will not be
stabilized anytime soon. Furthermore, according to the tracking issue at
https://github.com/rust-lang/rust/issues/28979 , it's highly
questionable whether or not this feature will use XID_start or
XID_continue even when or if non_ascii_idents is stabilized.
This commit fixes this by respecifying identifiers as the usual
[a-zA-Z_][a-zA-Z0-9_]*
|
|
also, make sure the keyword table is correctly spaced
|
|
|
|
|
|
#41158
|
|
This affects the book, some missed things in the reference, the grammar,
and the standard library. Whew!
|
|
|
|
|
|
Some people cite this list as "zomg Rust has so many keywords," so make
it clear that these aren't all used by the language today.
|
|
"stmt" already includes the terminating semicolon.
|
|
|
|
|
|
I found these automatically, but fixed them manually to ensure the semantics are correct. I know things like these are hardly important, since they only marginally improve clarity. But at least for me typos and simple grammatical errors trigger an---unjustified---sense of unprofessionalism, despite the fact that I make them all the time and I understand that they're the sort of thing that is bound to slip through review.
Anyway, to find most of these I used:
* `ag '.*//.*(\b[A-Za-z]{2,}\b) \1\b'` for repeated words
* `ag '\b(the|this|those|these|a|it) (a|the|this|those|these|it)\b'` to find constructs like 'the this' etc. many false positives, but not too hard to scroll through them to actually find the mistakes.
* `cat ../../typos.txt | paste -d'|' - - - - - - - - - - - - - - - - - - - - - - | tr '\n' '\0' | xargs -0 -P4 -n1 ag`. Hacky way to find misspellings, but it works ok. I got `typos.txt` from [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines)
* `ag '.*//.* a ([ae][a-z]|(o[^n])|(i[a-rt-z]))'` to find places where 'a' was followed by a vowel (requiring 'an' instead).
I also used a handful more one off regexes that are too boring to reproduce here.
|
|
|
|
|
|
|
|
extern_block should be extern_block_item.
extern_block_item is `extern { bunch of fns }`, extern_block is just `bunch of fns`
r? @steveklabnik
|
|
|
|
As I understand, there are no proc closures in Rust any more. So this pr removes `procedure_type` production. It isn't used anywhere. The `proc` is still a keyword.
r? @steveklabnik
@bors: r+ rollup
|
|
The rule `else_tail` was duplicated in `if` and `if_let` sections. I guess that this is a mistake.
r? @steveklabnik
|
|
extern_block should extern_block_item
|
|
|
|
|
|
|
|
This adds missing `?` marks to productions for loops and break/continue.
It also adds missing option label to while let loop
|
|
Fixes #25623
|
|
Between ffc5f1c, when grammar.md was created by copying parts of the
reference, and 8cf2552, when all EBNF was removed from reference.md,
there were parts of the grammar that were updated in reference.md but
not grammar.md, and then they weren't copied over because they existed
already, but they were slightly out of date.
Example: the `path_item : ident | "self" ;` rule in Use declarations was
changed from "mod" to "self" in the reference in 195fd9a but wasn't
updated in the grammar.
|
|
Both external crate declarations and use declarations need to end with a
semicolon.
|
|
|
|
|
|
Some of this text is duplicated in the reference (and belongs there) so
remove it. It says item grammar is the same, so point to that grammar
section.
|
|
The syntax for re-exporting privacy is covered in the use declaration
item.
|
|
Namely an optional "pub" before any item. The "pub" in the Use
declaration section should use this too.
|
|
I've found that there are still huge amounts of occurrences of `task`s in the documentation. This PR tries to eliminate all of them in favor of `thread`.
|
|
This syntax was removed in b24a3b8 but references remained in the
grammar, the reference, rustdoc generation, and some auxiliary test
files that don't seem to have been used since 812637e.
|
|
An automated script was run against the `.rs` and `.md` files,
subsituting every occurrence of `task` with `thread`. In the `.rs`
files, only the texts in the comment blocks were affected.
|
|
Reword so that the references to things above/below are up to date and a
bit more specific.
|
|
To make this rule match the definition of Lit_ in
https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs
|
|
`enum_item` appeared in the `item` list but did not have an associated section;
`const_item` had a section but did not appear in the list.
|
|
Transplant the grammar-related changes to grammar.md,
and remove all grammar talk from reference.md
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|