diff --git a/src/expressions/loop-expr.md b/src/expressions/loop-expr.md
index 37ba2f21b..4b296f3b3 100644
--- a/src/expressions/loop-expr.md
+++ b/src/expressions/loop-expr.md
@@ -1,10 +1,25 @@
# Loops
+> **Syntax**
+> _LoopExpression_ :
+> [_LoopLabel_]? (
+> [_InfiniteLoopExpression_]
+> | [_PredicateLoopExpression_]
+> | [_PredicatePatternLoopExpression_]
+> | [_IteratorLoopExpression_]
+> )
+
+[_LoopLabel_]: #loop-labels
+[_InfiniteLoopExpression_]: #infinite-loops
+[_PredicateLoopExpression_]: #predicate-loops
+[_PredicatePatternLoopExpression_]: #predicate-pattern-loops
+[_IteratorLoopExpression_]: #iterator-loops
+
Rust supports four loop expressions:
* A [`loop` expression](#infinite-loops) denotes an infinite loop.
* A [`while` expression](#predicate-loops) loops until a predicate is false.
-* A [`while let` expression](#while-let-loops) tests a refutable pattern.
+* A [`while let` expression](#predicate-pattern-loops) tests a refutable pattern.
* A [`for` expression](#iterator-loops) extracts values from an iterator,
looping until the iterator is empty.
@@ -14,6 +29,10 @@ Only `loop` supports [evaluation to non-trivial values](#break-and-loop-values).
## Infinite loops
+> **Syntax**
+> _InfiniteLoopExpression_ :
+> `loop` [_BlockExpression_]
+
A `loop` expression repeats execution of its body continuously:
`loop { println!("I live."); }`.
@@ -26,6 +45,10 @@ expression(s).
## Predicate loops
+> **Syntax**
+> _PredicateLoopExpression_ :
+> `while` [_Expression_]except struct expression [_BlockExpression_]
+
A `while` loop begins by evaluating the boolean loop conditional expression. If
the loop conditional expression evaluates to `true`, the loop body block
executes, then control returns to the loop conditional expression. If the loop
@@ -42,12 +65,17 @@ while i < 10 {
}
```
-## `while let` loops
+## Predicate pattern loops
+
+> **Syntax**
+> [_PredicatePatternLoopExpression_] :
+> `while` `let` _Pattern_ `=` [_Expression_]except struct expression
+> [_BlockExpression_]
A `while let` loop is semantically similar to a `while` loop but in place of a
condition expression it expects the keyword `let` followed by a refutable
-pattern, an `=` and an expression. If the value of the expression on the right
-hand side of the `=` matches the pattern, the loop body block executes then
+pattern, an `=`, an expression and a block expression. If the value of the expression on
+the right hand side of the `=` matches the pattern, the loop body block executes then
control returns to the pattern matching statement. Otherwise, the while
expression completes.
@@ -61,6 +89,11 @@ while let Some(y) = x.pop() {
## Iterator loops
+> **Syntax**
+> _IteratorLoopExpression_ :
+> `for` _Pattern_ `in` [_Expression_]except struct expression
+> [_BlockExpression_]
+
A `for` expression is a syntactic construct for looping over elements provided
by an implementation of `std::iter::IntoIterator`. If the iterator yields a
value, that value is given the specified name and the body of the loop is
@@ -89,6 +122,10 @@ assert_eq!(sum, 55);
## Loop labels
+> **Syntax**
+> _LoopLabel_ :
+> [LIFETIME_OR_LABEL] `:`
+
A loop expression may optionally have a _label_. The label is written as
a lifetime preceding the loop expression, as in `'foo: loop { break 'foo; }`,
`'bar: while false {}`, `'humbug: for _ in 0..0 {}`.
@@ -99,6 +136,10 @@ expressions](#continue-expressions).
## `break` expressions
+> **Syntax**
+> _BreakExpression_ :
+> `break` [LIFETIME_OR_LABEL]? [_Expression_]?
+
When `break` is encountered, execution of the associated loop body is
immediately terminated, for example:
@@ -131,6 +172,10 @@ the forms `break`, `break 'label` or ([see below](#break-and-loop-values))
## `continue` expressions
+> **Syntax**
+> _ContinueExpression_ :
+> `continue` [LIFETIME_OR_LABEL]?
+
When `continue` is encountered, the current iteration of the associated loop
body is immediately terminated, returning control to the loop *head*. In
the case of a `while` loop, the head is the conditional expression controlling
@@ -165,3 +210,10 @@ In the case a `loop` has an associated `break`, it is not considered diverging,
and the `loop` must have a type compatible with each `break` expression.
`break` without an expression is considered identical to `break` with
expression `()`.
+
+[IDENTIFIER]: identifiers.html
+
+[_Expression_]: expressions.html
+[_BlockExpression_]: expressions/block-expr.html
+
+[LIFETIME_OR_LABEL]: tokens.html#symbols