Skip to content

Commit bc879d5

Browse files
committed
Address general comment
Address the comments in the general review comment on #1026: - I did continue to use the *logical_pattern* production. We use that term in the text, and it's a good shorthand so readers don't need to snake through the grammar of *disjunctive_pattern*, *conjunctive_pattern* and *negated_pattern*. - I haven't addressed or created issues for the open questions in the proposal yet.
1 parent e6d573a commit bc879d5

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

standard/patterns.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,24 @@ A pattern may have one of the following forms:
2121

2222
```ANTLR
2323
pattern
24-
: '(' pattern ')'
24+
: logical_pattern
25+
;
26+
27+
primary_pattern
28+
: parenthesized_pattern
2529
| declaration_pattern
2630
| constant_pattern
2731
| var_pattern
2832
| positional_pattern
2933
| property_pattern
3034
| discard_pattern
35+
| parenthesized_pattern
3136
| type_pattern
3237
| relational_pattern
33-
| logical_pattern
38+
;
39+
40+
parenthesized_pattern
41+
: '(' pattern ')'
3442
;
3543
```
3644

@@ -430,10 +438,10 @@ A *relational_pattern* is used to relationally test the pattern input value ([§
430438

431439
```ANTLR
432440
relational_pattern
433-
: '<' constant_expression
434-
| '<=' constant_expression
435-
| '>' constant_expression
436-
| '>=' constant_expression
441+
: '<' relational_expression
442+
| '<=' relational_expression
443+
| '>' relational_expression
444+
| '>=' relational_expression
437445
;
438446
```
439447

@@ -491,7 +499,7 @@ conjunctive_pattern
491499
492500
negated_pattern
493501
: 'not' negated_pattern
494-
| pattern
502+
| primary_pattern
495503
;
496504
```
497505

0 commit comments

Comments
 (0)