File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
branches/snap-stage3/src/doc Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 13e00e4a3d18802ca6407e59935be9f2c33ec061
4
+ refs/heads/snap-stage3: e53f4a6b94623076a912df0c770c591d710c5de0
5
5
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -3231,7 +3231,7 @@ for i in range(0u, 256) {
3231
3231
if_expr : "if" no_struct_literal_expr '{' block '}'
3232
3232
else_tail ? ;
3233
3233
3234
- else_tail : "else" [ if_expr
3234
+ else_tail : "else" [ if_expr | if_let_expr
3235
3235
| '{' block '}' ] ;
3236
3236
```
3237
3237
@@ -3436,6 +3436,19 @@ let message = match maybe_digit {
3436
3436
};
3437
3437
```
3438
3438
3439
+ ### If let expressions
3440
+
3441
+ ``` {.ebnf .gram}
3442
+ if_let_expr : "if" "let" pat '=' expr '{' block '}'
3443
+ else_tail ? ;
3444
+ else_tail : "else" [ if_expr | if_let_expr | '{' block '}' ] ;
3445
+ ```
3446
+
3447
+ An ` if let ` expression is semantically identical to an ` if ` expression but in place
3448
+ of a condition expression it expects a refutable let statement. If the value of the
3449
+ expression on the right hand side of the let statement matches the pattern, the corresponding
3450
+ block will execute, otherwise flow proceeds to the first ` else ` block that follows.
3451
+
3439
3452
### Return expressions
3440
3453
3441
3454
``` {.ebnf .gram}
You can’t perform that action at this time.
0 commit comments