File tree 2 files changed +16
-16
lines changed
2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 1
1
# ` match ` expressions
2
2
3
- > ** <sup >Syntax</sup >**
4
- > _ MatchExpression_ :
5
- >   ;  ; ` match ` [ _ Expression_ ] <sub >_ except struct expression_ </sub > ` { `
6
- >   ;  ;   ;  ; [ _ InnerAttribute_ ] <sup >\* </sup >
7
- >   ;  ;   ;  ; _ MatchArms_ <sup >?</sup >
8
- >   ;  ; ` } `
3
+ > ** <sup >Syntax</sup >**
4
+ > _ MatchExpression_ :
5
+ >   ;  ; ` match ` [ _ Expression_ ] <sub >_ except struct expression_ </sub > ` { `
6
+ >   ;  ;   ;  ; [ _ InnerAttribute_ ] <sup >\* </sup >
7
+ >   ;  ;   ;  ; _ MatchArms_ <sup >?</sup >
8
+ >   ;  ; ` } `
9
9
>
10
- > _ MatchArms_ :
10
+ > _ MatchArms_ :
11
11
>   ;  ; ( _ MatchArm_ ` => `
12
12
> ( [ _ BlockExpression_ ] ` , ` <sup >?</sup >
13
13
> | [ _ Expression_ ] ` , ` )
14
- > )<sup >\* </sup >
15
- >   ;  ; _ MatchArm_ ` => ` ( [ _ BlockExpression_ ] | [ _ Expression_ ] ) ` , ` <sup >?</sup >
14
+ > )<sup >\* </sup >
15
+ >   ;  ; _ MatchArm_ ` => ` ( [ _ BlockExpression_ ] | [ _ Expression_ ] ) ` , ` <sup >?</sup >
16
16
>
17
- > _ MatchArm_ :
18
- >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > _ MatchArmPatterns_ _ MatchArmGuard_ <sup >?</sup >
17
+ > _ MatchArm_ :
18
+ >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > _ MatchArmPatterns_ _ MatchArmGuard_ <sup >?</sup >
19
19
>
20
- > _ MatchArmPatterns_ :
21
- >   ;  ; ` | ` <sup >?</sup > _ Pattern_ ( ` | ` _ Pattern_ )<sup >* </sup >
20
+ > _ MatchArmPatterns_ :
21
+ >   ;  ; ` | ` <sup >?</sup > _ Pattern_ ( ` | ` _ Pattern_ )<sup >* </sup >
22
22
>
23
- > _ MatchArmGuard_ :
23
+ > _ MatchArmGuard_ :
24
24
>   ;  ; ` if ` [ _ Expression_ ]
25
25
26
26
A ` match ` expression branches on a * pattern* . The exact form of matching that
Original file line number Diff line number Diff line change @@ -486,11 +486,11 @@ The two values of the boolean type are written `true` and `false`.
486
486
## Lifetimes and loop labels
487
487
488
488
> ** <sup >Lexer</sup >**
489
- > LIFETIME_TOKEN
489
+ > LIFETIME_TOKEN :
490
490
>   ;  ;   ;  ; ` ' ` [ IDENTIFIER_OR_KEYWORD] [ identifier ]
491
491
>   ;  ; | ` '_ `
492
492
>
493
- > LIFETIME_OR_LABEL:
493
+ > LIFETIME_OR_LABEL :
494
494
>   ;  ;   ;  ; ` ' ` [ IDENTIFIER] [ identifier ]
495
495
496
496
Lifetime parameters and [ loop labels] use LIFETIME_OR_LABEL tokens. Any
You can’t perform that action at this time.
0 commit comments