Skip to content

Commit c817f3b

Browse files
committed
Update while-let to use term Scrutinee explicitly in grammar snippet
1 parent 08a71cd commit c817f3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/expressions/loop-expr.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ while i < 10 {
6262

6363
> **<sup>Syntax</sup>**\
6464
> [_PredicatePatternLoopExpression_] :\
65-
> &nbsp;&nbsp; `while` `let` [_Pattern_] `=` [_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
65+
> &nbsp;&nbsp; `while` `let` [_Pattern_] `=` Scrutinee
6666
> [_BlockExpression_]
67+
>
68+
> _Scrutinee_:
69+
> &nbsp;&nbsp; [_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
70+
6771

6872
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 pattern, an `=`, a [scrutinee] expression and a block expression.
6973
If the value of the scrutinee matches the pattern, the loop body block executes then control returns to the pattern matching statement.

0 commit comments

Comments
 (0)