about summary refs log tree commit diff
path: root/src/doc/grammar.md
AgeCommit message (Collapse)AuthorLines
2019-09-30Remove legacy grammarErin Power-809/+4
2018-05-17Rollup merge of #50791 - bstrie:null, r=QuietMisdreavusMark Simulacrum-3/+3
Fix null exclusions in grammar docs The grammar documentation incorrectly says that comments, character literals, and string literals may not include null.
2018-05-16Null exclusions in grammar docsbstrie-3/+3
The grammar documentation incorrectly says that comments, character literals, and string literals may not include null.
2018-05-16Fix grammar documentation wrt Unicode identifiersbstrie-11/+6
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_]*
2017-06-17Add `_` to the list of keywordsubsan-13/+13
also, make sure the keyword table is correctly spaced
2017-04-21Fix issue with single question mark or parenVadim Petrochenkov-2/+3
2017-04-13Address the PR reviewalexey zabelin-2/+1
2017-04-12Fix old docsalexey zabelin-0/+8
#41158
2017-02-21Get linkchecker cleanSteve Klabnik-1/+1
This affects the book, some missed things in the reference, the grammar, and the standard library. Whew!
2017-01-10Update struct_expr grammar for field init shorthand.theduke-2/+3
2016-08-20Add docs for "!" empty Never type (rfc 1216)Stefan Schindler-0/+7
2016-08-15A disclaimer about keywords.Steve Klabnik-0/+5
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.
2016-02-03Remove redundant semicolon from "block_expr" in grammar referenceMatt Brubeck-1/+1
"stmt" already includes the terminating semicolon.
2015-10-24Allow bare semicolon in grammar doc, closes #28157Florian Hahn-1/+1
2015-10-10doc: fixing typosKyle Robinson Young-1/+1
2015-10-08Auto merge of #28900 - cristicbz:typos, r=alexcrichtonbors-1/+1
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.
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-10-08reference: fix typosTshepang Lekhonkhobe-1/+1
2015-09-24doc: "familiarity" does not need to be repeated hereTshepang Lekhonkhobe-1/+1
2015-09-03Rollup merge of #28215 - matklad:grammar-extern-block-item, r=steveklabnikSteve Klabnik-1/+1
extern_block should be extern_block_item. extern_block_item is `extern { bunch of fns }`, extern_block is just `bunch of fns` r? @steveklabnik
2015-09-03Rollup merge of #28208 - matklad:grammar-whitespace-cleanup, r=steveklabnikSteve Klabnik-1/+1
2015-09-03Rollup merge of #28205 - matklad:grammar-remove-proc, r=alexcrichtonSteve Klabnik-2/+0
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
2015-09-03Rollup merge of #28204 - matklad:grammar-duplicate-else-tail, r=steveklabnikSteve Klabnik-1/+0
The rule `else_tail` was duplicated in `if` and `if_let` sections. I guess that this is a mistake. r? @steveklabnik
2015-09-04reference grammar: fix item definitionAleksey Kladov-1/+1
extern_block should extern_block_item
2015-09-03reference grammar: whitespace cleanupAleksey Kladov-1/+1
2015-09-03reference grammar: remove procedure_typeAleksey Kladov-2/+0
2015-09-03reference grammar: remove duplicate else_tail ruleAleksey Kladov-1/+0
2015-09-03reference grammar: loop label should be optionalAleksey Kladov-6/+6
This adds missing `?` marks to productions for loops and break/continue. It also adds missing option label to while let loop
2015-06-09Fix up macro grammarSteve Klabnik-1/+2
Fixes #25623
2015-05-10Overwrite grammar sections with what was removed from the referenceCarol Nichols-6/+5
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.
2015-05-10Add literal semicolon to the grammar of view_itemCarol Nichols-1/+1
Both external crate declarations and use declarations need to end with a semicolon.
2015-05-10Remove operator precedence section covered in the referenceCarol Nichols-24/+0
2015-05-10Fill in more parts of the grammar for ExpressionsCarol Nichols-14/+45
2015-05-10Fill in grammar for StatementsCarol Nichols-15/+10
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.
2015-05-10Point to the use declaration section from the re-exporting sectionCarol Nichols-1/+1
The syntax for re-exporting privacy is covered in the use declaration item.
2015-05-10Add visibility section of the grammarCarol Nichols-5/+6
Namely an optional "pub" before any item. The "pub" in the Use declaration section should use this too.
2015-05-09Rollup merge of #25216 - barosl:no-more-task, r=ManishearthManish Goregaokar-3/+3
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`.
2015-05-08Remove references to deprecated `extern crate "foo" as bar` syntaxCarol Nichols-1/+1
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.
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-3/+3
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.
2015-04-28Move explanation that references lexical grammar to the grammarCarol Nichols-0/+6
Reword so that the references to things above/below are up to date and a bit more specific.
2015-04-28Add boolean literal to the grammarCarol (Nichols || Goulding)-2/+4
To make this rule match the definition of Lit_ in https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs
2015-04-27Make item sections match item EBNFCarol (Nichols || Goulding)-1/+5
`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.
2015-04-25Redo PR #24811 properlyRobin Kruppe-5/+7
Transplant the grammar-related changes to grammar.md, and remove all grammar talk from reference.md
2015-04-24Updates to grammarmdinger-15/+24
2015-04-17Eliminate the obsolete term 'slot'.Graydon Hoare-3/+3
2015-04-17Trim malformed sentence.Graydon Hoare-2/+1
2015-03-15Strip trailing whitespaceTamir Duberstein-49/+49
2015-03-01Fix missed doc grammar rule rename from vec_elems to array_elemsAlan Cutter-1/+1
2015-02-16Fix grammarManish Goregaokar-1/+1
2015-02-14Fix issue with generationSteve Klabnik-3/+1