Skip to content

Commit 48a6eff

Browse files
committed
binding vs. precedence in the is statement.
1 parent 48009bd commit 48a6eff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

standard/patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ When the input value has a type for which a suitable built-in binary relational
526526
527527
### §logical-pattern-new-clause Logical pattern
528528
529-
A *logical_pattern* is used to negate the result of matching a pattern input value ([§11.1](patterns.md#111-general)) or to combine that match result with a pattern using a Boolean operator.
529+
A *logical_pattern* is used to negate the result of a pattern match, or to combine the results of multiple pattern matches using conjunction (`and`) or disjunction (`or`).
530530
531531
```ANTLR
532532
logical_pattern
@@ -571,7 +571,7 @@ In a *conjunctive_pattern*, the *input type* of the second pattern is narrowed b
571571

572572
> *Note*: As indicated by the grammar, `not` has precedence over `and`, which has precedence over `or`. This can be explicitly indicated or overridden by using parentheses. *end note*
573573
574-
When a *pattern* is used with `is`, any pattern operators in that *pattern* have higher precedence than their logical operator counterparts. Otherwise, those pattern operators have lower precedence.
574+
When a *pattern* appears on the right-hand-side of `is`, the extent of the pattern is determined by the grammar; as a result, the pattern operators `and`, `or`, and `not` within the pattern bind more tightly than the logical operators `&&`, `||`, and `!` outside the pattern.
575575

576576
> *Example*:
577577
>

0 commit comments

Comments
 (0)