Skip to content

Use backslash instead of whitespace for hard breaks. #365

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

Merged
merged 1 commit into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions src/attributes.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Attributes

> **<sup>Syntax</sup>**
> _Attribute_ :
> &nbsp;&nbsp; _InnerAttribute_ | _OuterAttribute_
>
> _InnerAttribute_ :
> &nbsp;&nbsp; `#![` MetaItem `]`
>
> _OuterAttribute_ :
> &nbsp;&nbsp; `#[` MetaItem `]`
>
> _MetaItem_ :
> &nbsp;&nbsp; &nbsp;&nbsp; IDENTIFIER
> &nbsp;&nbsp; | IDENTIFIER `=` LITERAL
> &nbsp;&nbsp; | IDENTIFIER `(` LITERAL `)`
> &nbsp;&nbsp; | IDENTIFIER `(` _MetaSeq_ `)`
>
> _MetaSeq_ :
> &nbsp;&nbsp; &nbsp;&nbsp; EMPTY
> &nbsp;&nbsp; | _MetaItem_
> **<sup>Syntax</sup>**\
> _Attribute_ :\
> &nbsp;&nbsp; _InnerAttribute_ | _OuterAttribute_
>
> _InnerAttribute_ :\
> &nbsp;&nbsp; `#![` MetaItem `]`
>
> _OuterAttribute_ :\
> &nbsp;&nbsp; `#[` MetaItem `]`
>
> _MetaItem_ :\
> &nbsp;&nbsp; &nbsp;&nbsp; IDENTIFIER\
> &nbsp;&nbsp; | IDENTIFIER `=` LITERAL\
> &nbsp;&nbsp; | IDENTIFIER `(` LITERAL `)`\
> &nbsp;&nbsp; | IDENTIFIER `(` _MetaSeq_ `)`
>
> _MetaSeq_ :\
> &nbsp;&nbsp; &nbsp;&nbsp; EMPTY\
> &nbsp;&nbsp; | _MetaItem_\
> &nbsp;&nbsp; | _MetaItem_ `,` _MetaSeq_

Any [item declaration] or [generic lifetime or type parameter][generics] may
Expand Down Expand Up @@ -116,7 +116,7 @@ On an `extern` block, the following attributes are interpreted:
declarations in this block to be linked correctly. `link` supports an optional
`kind` key with three possible values: `dylib`, `static`, and `framework`. See
[external blocks](items/external-blocks.html) for more about external blocks.
Two examples: `#[link(name = "readline")]` and
Two examples: `#[link(name = "readline")]` and
`#[link(name = "CoreFoundation", kind = "framework")]`.
- `linked_from` - indicates what native library this block of FFI items is
coming from. This attribute is of the form `#[linked_from = "foo"]` where
Expand Down Expand Up @@ -450,7 +450,7 @@ When used on a function in an implementation, the attribute does nothing.
> { five() };
> if true { five() } else { 0i32 };
> match true {
> _ => five()
> _ => five()
> };
> }
> ```
Expand Down
62 changes: 31 additions & 31 deletions src/comments.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# Comments

> **<sup>Lexer</sup>**
> LINE_COMMENT :
> &nbsp;&nbsp; &nbsp;&nbsp; `//` (~[`/` `!`] | `//`) ~`\n`<sup>\*</sup>
> **<sup>Lexer</sup>**\
> LINE_COMMENT :\
> &nbsp;&nbsp; &nbsp;&nbsp; `//` (~[`/` `!`] | `//`) ~`\n`<sup>\*</sup>\
> &nbsp;&nbsp; | `//`
>
> BLOCK_COMMENT :
>
> BLOCK_COMMENT :\
> &nbsp;&nbsp; &nbsp;&nbsp; `/*` (~[`*` `!`] | `**` | _BlockCommentOrDoc_)
> (_BlockCommentOrDoc_ | ~`*/`)<sup>\*</sup> `*/`
> &nbsp;&nbsp; | `/**/`
> &nbsp;&nbsp; | `/***/`
>
> INNER_LINE_DOC :
> &nbsp;&nbsp; `//!` ~[`\n` _IsolatedCR_]<sup>\*</sup>
>
> INNER_BLOCK_DOC :
> &nbsp;&nbsp; `/*!` ( _BlockCommentOrDoc_ | ~[`*/` _IsolatedCR_] )<sup>\*</sup> `*/`
>
> OUTER_LINE_DOC :
> &nbsp;&nbsp; `///` (~`/` ~[`\n` _IsolatedCR_]<sup>\*</sup>)<sup>?</sup>
>
> OUTER_BLOCK_DOC :
> (_BlockCommentOrDoc_ | ~`*/`)<sup>\*</sup> `*/`\
> &nbsp;&nbsp; | `/**/`\
> &nbsp;&nbsp; | `/***/`
>
> INNER_LINE_DOC :\
> &nbsp;&nbsp; `//!` ~[`\n` _IsolatedCR_]<sup>\*</sup>
>
> INNER_BLOCK_DOC :\
> &nbsp;&nbsp; `/*!` ( _BlockCommentOrDoc_ | ~[`*/` _IsolatedCR_] )<sup>\*</sup> `*/`
>
> OUTER_LINE_DOC :\
> &nbsp;&nbsp; `///` (~`/` ~[`\n` _IsolatedCR_]<sup>\*</sup>)<sup>?</sup>
>
> OUTER_BLOCK_DOC :\
> &nbsp;&nbsp; `/**` (~`*` | _BlockCommentOrDoc_ )
> (_BlockCommentOrDoc_ | ~[`*/` _IsolatedCR_])<sup>\*</sup> `*/`
>
> _BlockCommentOrDoc_ :
> &nbsp;&nbsp; &nbsp;&nbsp; BLOCK_COMMENT
> &nbsp;&nbsp; | OUTER_BLOCK_DOC
> &nbsp;&nbsp; | INNER_BLOCK_DOC
>
> _IsolatedCR_ :
> &nbsp;&nbsp; _A `\r` not followed by a `\n`_
> (_BlockCommentOrDoc_ | ~[`*/` _IsolatedCR_])<sup>\*</sup> `*/`
>
> _BlockCommentOrDoc_ :\
> &nbsp;&nbsp; &nbsp;&nbsp; BLOCK_COMMENT\
> &nbsp;&nbsp; | OUTER_BLOCK_DOC\
> &nbsp;&nbsp; | INNER_BLOCK_DOC
>
> _IsolatedCR_ :\
> &nbsp;&nbsp; _A `\r` not followed by a `\n`_

## Non-doc comments

Expand Down Expand Up @@ -94,16 +94,16 @@ pub mod outer_module {
pub mod degenerate_cases {
// empty inner line doc
//!

// empty inner block doc
/*!*/

// empty line comment
//

// empty outer line doc
///

// empty block comment
/**/

Expand Down
20 changes: 10 additions & 10 deletions src/crates-and-source-files.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Crates and source files

> **<sup>Syntax</sup>**
> _Crate_ :
> &nbsp;&nbsp; UTF8BOM<sup>?</sup>
> &nbsp;&nbsp; SHEBANG<sup>?</sup>
> &nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>
> &nbsp;&nbsp; [_Item_]<sup>\*</sup>

> **<sup>Lexer</sup>**
> UTF8BOM : `\uFEFF`
> **<sup>Syntax</sup>**\
> _Crate_ :\
> &nbsp;&nbsp; UTF8BOM<sup>?</sup>\
> &nbsp;&nbsp; SHEBANG<sup>?</sup>\
> &nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>\
> &nbsp;&nbsp; [_Item_]<sup>\*</sup>

> **<sup>Lexer</sup>**\
> UTF8BOM : `\uFEFF`\
> SHEBANG : `#!` ~[`[` `\n`] ~`\n`<sup>*</sup>


Expand Down Expand Up @@ -115,4 +115,4 @@ fn main() {
[function]: items/functions.html
[`Termination`]: ../std/process/trait.Termination.html
[where clause]: items/where-clauses.html
[trait or lifetime bounds]: trait-bounds.html
[trait or lifetime bounds]: trait-bounds.html
50 changes: 25 additions & 25 deletions src/expressions.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Expressions

> **<sup>Syntax</sup>**
> _Expression_ :
> &nbsp;&nbsp; &nbsp;&nbsp; [_LiteralExpression_]
> &nbsp;&nbsp; | [_PathExpression_]
> &nbsp;&nbsp; | [_BlockExpression_]
> &nbsp;&nbsp; | [_OperatorExpression_]
> &nbsp;&nbsp; | [_GroupedExpression_]
> &nbsp;&nbsp; | [_ArrayExpression_]
> &nbsp;&nbsp; | [_IndexExpression_]
> &nbsp;&nbsp; | [_TupleExpression_]
> &nbsp;&nbsp; | [_TupleIndexingExpression_]
> &nbsp;&nbsp; | [_StructExpression_]
> &nbsp;&nbsp; | [_EnumerationVariantExpression_]
> &nbsp;&nbsp; | [_CallExpression_]
> &nbsp;&nbsp; | [_MethodCallExpression_]
> &nbsp;&nbsp; | [_FieldExpression_]
> &nbsp;&nbsp; | [_ClosureExpression_]
> &nbsp;&nbsp; | [_LoopExpression_]
> &nbsp;&nbsp; | [_ContinueExpression_]
> &nbsp;&nbsp; | [_BreakExpression_]
> &nbsp;&nbsp; | [_RangeExpression_]
> &nbsp;&nbsp; | [_IfExpression_]
> &nbsp;&nbsp; | [_IfLetExpression_]
> &nbsp;&nbsp; | [_MatchExpression_]
> &nbsp;&nbsp; | [_ReturnExpression_]
> **<sup>Syntax</sup>**\
> _Expression_ :\
> &nbsp;&nbsp; &nbsp;&nbsp; [_LiteralExpression_]\
> &nbsp;&nbsp; | [_PathExpression_]\
> &nbsp;&nbsp; | [_BlockExpression_]\
> &nbsp;&nbsp; | [_OperatorExpression_]\
> &nbsp;&nbsp; | [_GroupedExpression_]\
> &nbsp;&nbsp; | [_ArrayExpression_]\
> &nbsp;&nbsp; | [_IndexExpression_]\
> &nbsp;&nbsp; | [_TupleExpression_]\
> &nbsp;&nbsp; | [_TupleIndexingExpression_]\
> &nbsp;&nbsp; | [_StructExpression_]\
> &nbsp;&nbsp; | [_EnumerationVariantExpression_]\
> &nbsp;&nbsp; | [_CallExpression_]\
> &nbsp;&nbsp; | [_MethodCallExpression_]\
> &nbsp;&nbsp; | [_FieldExpression_]\
> &nbsp;&nbsp; | [_ClosureExpression_]\
> &nbsp;&nbsp; | [_LoopExpression_]\
> &nbsp;&nbsp; | [_ContinueExpression_]\
> &nbsp;&nbsp; | [_BreakExpression_]\
> &nbsp;&nbsp; | [_RangeExpression_]\
> &nbsp;&nbsp; | [_IfExpression_]\
> &nbsp;&nbsp; | [_IfLetExpression_]\
> &nbsp;&nbsp; | [_MatchExpression_]\
> &nbsp;&nbsp; | [_ReturnExpression_]

An expression may have two roles: it always produces a *value*, and it may have
*effects* (otherwise known as "side effects"). An expression *evaluates to* a
Expand Down
14 changes: 7 additions & 7 deletions src/expressions/array-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Array expressions

> **<sup>Syntax</sup>**
> _ArrayExpression_ :
> &nbsp;&nbsp; &nbsp;&nbsp; `[` `]`
> &nbsp;&nbsp; | `[` [_Expression_] ( `,` [_Expression_] )<sup>\*</sup> `,`<sup>?</sup> `]`
> &nbsp;&nbsp; | `[` [_Expression_] `;` [_Expression_] `]`
> **<sup>Syntax</sup>**\
> _ArrayExpression_ :\
> &nbsp;&nbsp; &nbsp;&nbsp; `[` `]`\
> &nbsp;&nbsp; | `[` [_Expression_] ( `,` [_Expression_] )<sup>\*</sup> `,`<sup>?</sup> `]`\
> &nbsp;&nbsp; | `[` [_Expression_] `;` [_Expression_] `]`

An _[array](types.html#array-and-slice-types) expression_ can be written by
enclosing zero or more comma-separated expressions of uniform type in square
Expand All @@ -32,8 +32,8 @@ greater than 1 then this requires that the type of `a` is

## Array and slice indexing expressions

> **<sup>Syntax</sup>**
> _IndexExpression_ :
> **<sup>Syntax</sup>**\
> _IndexExpression_ :\
> &nbsp;&nbsp; [_Expression_] `[` [_Expression_] `]`

[Array and slice](types.html#array-and-slice-types)-typed expressions can be
Expand Down
22 changes: 11 additions & 11 deletions src/expressions/block-expr.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Block expressions

> **<sup>Syntax</sup>**
> _BlockExpression_ :
> &nbsp;&nbsp; `{`
> &nbsp;&nbsp; &nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>
> &nbsp;&nbsp; &nbsp;&nbsp; [_Statement_]<sup>\*</sup>
> &nbsp;&nbsp; &nbsp;&nbsp; [_Expression_]<sup>?</sup>
> &nbsp;&nbsp; `}`
> **<sup>Syntax</sup>**\
> _BlockExpression_ :\
> &nbsp;&nbsp; `{`\
> &nbsp;&nbsp; &nbsp;&nbsp; [_InnerAttribute_]<sup>\*</sup>\
> &nbsp;&nbsp; &nbsp;&nbsp; [_Statement_]<sup>\*</sup>\
> &nbsp;&nbsp; &nbsp;&nbsp; [_Expression_]<sup>?</sup>\
> &nbsp;&nbsp; `}`

A _block expression_ is similar to a module in terms of the declarations that
are possible, but can also contain [statements] and end with
Expand All @@ -30,14 +30,14 @@ let x: i32 = { println!("Hello."); 5 };
assert_eq!(5, x);
```

Blocks are always [value expressions] and evaluate the last expression in
Blocks are always [value expressions] and evaluate the last expression in
value expression context. This can be used to force moving a value if really
needed.

## `unsafe` blocks

> **<sup>Syntax</sup>**
> _UnsafeBlockExpression_ :
> **<sup>Syntax</sup>**\
> _UnsafeBlockExpression_ :\
> &nbsp;&nbsp; `unsafe` _BlockExpression_

_See [`unsafe` block](unsafe-blocks.html) for more information on when to use `unsafe`_
Expand All @@ -62,4 +62,4 @@ let a = unsafe { f() };
[_Expression_]: expressions.html
[expression]: expressions.html
[statements]: statements.html
[value expressions]: expressions.html#place-expressions-and-value-expressions
[value expressions]: expressions.html#place-expressions-and-value-expressions
12 changes: 6 additions & 6 deletions src/expressions/call-expr.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Call expressions

> **<sup>Syntax</sup>**
> _CallExpression_ :
> &nbsp;&nbsp; [_Expression_] `(` _CallParams_<sup>?</sup> `)`
>
> _CallParams_ :
> &nbsp;&nbsp; [_Expression_]&nbsp;( `,` [_Expression_] )<sup>\*</sup> `,`<sup>?</sup>
> **<sup>Syntax</sup>**\
> _CallExpression_ :\
> &nbsp;&nbsp; [_Expression_] `(` _CallParams_<sup>?</sup> `)`
>
> _CallParams_ :\
> &nbsp;&nbsp; [_Expression_]&nbsp;( `,` [_Expression_] )<sup>\*</sup> `,`<sup>?</sup>

A _call expression_ consists of an expression followed by a parenthesized
expression-list. It invokes a function, providing zero or more input variables.
Expand Down
10 changes: 5 additions & 5 deletions src/expressions/closure-expr.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Closure expressions

> **<sup>Syntax</sup>**
> _ClosureExpression_ :
> &nbsp;&nbsp; `move`<sup>?</sup>
> &nbsp;&nbsp; ( `||` | `|` [_FunctionParameters_]<sup>?</sup> `|` )
> &nbsp;&nbsp; ([_Expression_] | `->` [_TypeNoBounds_]&nbsp;[_BlockExpression_])
> **<sup>Syntax</sup>**\
> _ClosureExpression_ :\
> &nbsp;&nbsp; `move`<sup>?</sup>\
> &nbsp;&nbsp; ( `||` | `|` [_FunctionParameters_]<sup>?</sup> `|` )\
> &nbsp;&nbsp; ([_Expression_] | `->` [_TypeNoBounds_]&nbsp;[_BlockExpression_])

A _closure expression_ defines a closure and denotes it as a value, in a single
expression. A closure expression is a pipe-symbol-delimited (`|`) list of
Expand Down
6 changes: 3 additions & 3 deletions src/expressions/field-expr.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Field access expressions

> **<sup>Syntax</sup>**
> _FieldExpression_ :
> **<sup>Syntax</sup>**\
> _FieldExpression_ :\
> &nbsp;&nbsp; [_Expression_] `.` [IDENTIFIER]

A _field expression_ consists of an expression followed by a single dot and an
Expand Down Expand Up @@ -51,4 +51,4 @@ let d: String = x.f3; // Move out of x.f3
[struct]: items/structs.html
[union]: items/unions.html
[place expression]: expressions.html#place-expressions-and-value-expressions
[mutable]: expressions.html#mutability
[mutable]: expressions.html#mutability
6 changes: 3 additions & 3 deletions src/expressions/grouped-expr.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Grouped expressions

> **<sup>Syntax</sup>**
> _GroupedExpression_ :
> **<sup>Syntax</sup>**\
> _GroupedExpression_ :\
> &nbsp;&nbsp; `(` [_Expression_] `)`

An expression enclosed in parentheses evaluates to the result of the enclosed
Expand Down Expand Up @@ -30,7 +30,7 @@ that is a member of a struct:
# }
# }
# let a = A{f: || "The field f"};
#
#
assert_eq!( a.f (), "The method f");
assert_eq!((a.f)(), "The field f");
```
Expand Down
Loading