Skip to content

Commit 123649a

Browse files
committed
binding vs. precedence in the is statement.
1 parent 6085efe commit 123649a

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
@@ -486,7 +486,7 @@ When the input value has a type for which a suitable built-in binary relational
486486
487487
### §logical-pattern-new-clause Logical pattern
488488
489-
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.
489+
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`).
490490
491491
```ANTLR
492492
logical_pattern
@@ -531,7 +531,7 @@ In a *conjunctive_pattern*, the *input type* of the second pattern is narrowed b
531531

532532
> *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*
533533
534-
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.
534+
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.
535535

536536
> *Example*:
537537
>

0 commit comments

Comments
 (0)