Skip to content

Commit 08a71cd

Browse files
committed
Update if-let to use term Scrutinee explicitly in grammar snippet
1 parent 09323d7 commit 08a71cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/expressions/if-expr.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ assert_eq!(y, "Bigger");
4141

4242
> **<sup>Syntax</sup>**\
4343
> _IfLetExpression_ :\
44-
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` [_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
44+
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` Scrutinee
4545
> [_BlockExpression_]\
4646
> &nbsp;&nbsp; (`else` (
4747
> [_BlockExpression_]
4848
> | _IfExpression_
4949
> | _IfLetExpression_ ) )<sup>\?</sup>
50+
>
51+
> _Scrutinee_:
52+
> &nbsp;&nbsp; [_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
5053
5154
An `if let` expression is semantically similar to an `if` expression but in place of a condition operand it expects the keyword `let` followed by a pattern, an `=` and a [scrutinee] operand.
5255
If the value of the scrutinee matches the pattern, the corresponding block will execute.

0 commit comments

Comments
 (0)