Commit Graph

41 Commits

Author SHA1 Message Date
Florian Hahn
1e62bd2754 Allow bare semicolon in grammar doc, closes #28157 2015-10-24 00:45:18 +02:00
Kyle Robinson Young
a6aa6456ee doc: fixing typos 2015-10-10 09:15:55 -07:00
bors
d0cae14f66 Auto merge of #28900 - cristicbz:typos, r=alexcrichton
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-08 22:40:50 +00:00
Cristi Cobzarenco
4b308b44e1 typos: fix a grabbag of typos all over the place 2015-10-08 19:49:31 +01:00
Tshepang Lekhonkhobe
88506c2261 reference: fix typos 2015-10-08 07:34:58 +02:00
Tshepang Lekhonkhobe
7077075372 doc: "familiarity" does not need to be repeated here 2015-09-24 08:04:55 +02:00
Steve Klabnik
79ea0eed5b Rollup merge of #28215 - matklad:grammar-extern-block-item, r=steveklabnik
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-03 20:10:09 -04:00
Steve Klabnik
ff7f5cd0c6 Rollup merge of #28208 - matklad:grammar-whitespace-cleanup, r=steveklabnik 2015-09-03 20:10:08 -04:00
Steve Klabnik
54279e0ced Rollup merge of #28205 - matklad:grammar-remove-proc, r=alexcrichton
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-03 20:10:07 -04:00
Steve Klabnik
35019737cc Rollup merge of #28204 - matklad:grammar-duplicate-else-tail, r=steveklabnik
The rule `else_tail` was duplicated in `if` and `if_let` sections. I guess that this is a mistake.

r? @steveklabnik
2015-09-03 20:10:07 -04:00
Aleksey Kladov
73a6199248 reference grammar: fix item definition
extern_block should extern_block_item
2015-09-04 00:29:47 +03:00
Aleksey Kladov
f7d5c25b3d reference grammar: whitespace cleanup 2015-09-03 23:42:33 +03:00
Aleksey Kladov
59f2343bdb reference grammar: remove procedure_type 2015-09-03 22:25:47 +03:00
Aleksey Kladov
000fe00726 reference grammar: remove duplicate else_tail rule 2015-09-03 22:19:56 +03:00
Aleksey Kladov
83aee74fce reference grammar: loop label should be optional
This adds missing `?` marks to productions for loops and break/continue.

It also adds missing option label to while let loop
2015-09-03 22:13:50 +03:00
Steve Klabnik
6bddfc9650 Fix up macro grammar
Fixes #25623
2015-06-09 15:26:51 -04:00
Carol Nichols
218d38fb94 Overwrite grammar sections with what was removed from the reference
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-10 22:47:39 -04:00
Carol Nichols
53cd0bc772 Add literal semicolon to the grammar of view_item
Both external crate declarations and use declarations need to end with a
semicolon.
2015-05-10 22:47:39 -04:00
Carol Nichols
c3156a8ff4 Remove operator precedence section covered in the reference 2015-05-10 22:47:39 -04:00
Carol Nichols
e607d76564 Fill in more parts of the grammar for Expressions 2015-05-10 22:47:31 -04:00
Carol Nichols
ab913c881c Fill in grammar for Statements
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-10 22:37:31 -04:00
Carol Nichols
a5c651cfdf Point to the use declaration section from the re-exporting section
The syntax for re-exporting privacy is covered in the use declaration
item.
2015-05-10 22:27:10 -04:00
Carol Nichols
c9c8ff1762 Add visibility section of the grammar
Namely an optional "pub" before any item. The "pub" in the Use
declaration section should use this too.
2015-05-10 22:26:45 -04:00
Manish Goregaokar
ac478ecb50 Rollup merge of #25216 - barosl:no-more-task, r=Manishearth
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-09 18:40:19 +05:30
Carol Nichols
bf06163ea7 Remove references to deprecated extern crate "foo" as bar syntax
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-08 20:48:54 -04:00
Barosl Lee
ff332b6467 Squeeze the last bits of tasks in documentation in favor of thread
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-05-09 02:24:18 +09:00
Carol Nichols
0ddee94cfe Move explanation that references lexical grammar to the grammar
Reword so that the references to things above/below are up to date and a
bit more specific.
2015-04-28 22:02:53 -04:00
Carol (Nichols || Goulding)
3e521bfd96 Add boolean literal to the grammar
To make this rule match the definition of Lit_ in
https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs
2015-04-28 21:46:49 -04:00
Carol (Nichols || Goulding)
d715409736 Make item sections match item EBNF
`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-27 22:02:16 -04:00
Robin Kruppe
85ee89ae70 Redo PR #24811 properly
Transplant the grammar-related changes to grammar.md,
and remove all grammar talk from reference.md
2015-04-25 22:56:00 +02:00
mdinger
9ecfdada2b Updates to grammar 2015-04-24 16:50:23 -04:00
Graydon Hoare
7f2f09f1b4 Eliminate the obsolete term 'slot'. 2015-04-17 19:52:29 -07:00
Graydon Hoare
ca14b8121c Trim malformed sentence. 2015-04-17 19:22:19 -07:00
Tamir Duberstein
f5765793b6 Strip trailing whitespace 2015-03-15 11:25:43 -07:00
Alan Cutter
9b873faef5 Fix missed doc grammar rule rename from vec_elems to array_elems 2015-03-01 15:37:40 +11:00
Manish Goregaokar
cea2bbfe27 Fix grammar 2015-02-16 03:56:52 +05:30
Steve Klabnik
1a99315c51 Fix issue with generation 2015-02-14 20:50:08 -05:00
Andrea Canciani
8f7c2d518d Replace be with become
As per rust-lang/rfcs#601, replace `be` with `become` as reserved
keyword for tail call optimization.
2015-02-04 01:25:24 +01:00
Nick Sarten
b796c1d614 Updated unicode escape documentation to match current implementation.
Unicode escapes were changed in [this
RFC](28aeb3c391/text/0446-es6-unicode-escapes.md)
to use the ES6 \u{00FFFF} syntax with a variable number of digits from
1-6, eliminating the need for two different syntaxes for unicode
literals.
2015-02-01 16:42:22 +13:00
Ignacio Corderi
ab24ffe21a Copied all the grammar productions from reference.md to grammar.md 2014-11-26 16:52:36 -08:00
Ignacio Corderi
ffc5f1ccd8 Added src/doc/grammar.md to hold Rust grammar 2014-11-26 16:40:56 -08:00