diff --git a/guide/src/reference.md b/guide/src/reference.md index 2421b81..1d7dc93 100644 --- a/guide/src/reference.md +++ b/guide/src/reference.md @@ -147,9 +147,10 @@ MatchBody: ( (',' )*)?; MatchPattern: '=>' ; GuardedPattern: ('if' )?; Pattern: ('|' )*; -PatternKind: ; +PatternKind: ; IdentifierPattern: '_' | '...' | ; ListPattern: '[' ( (',' )*)? ']'; +ExpressionPattern: ('<=' | '>=' | '<' | '>' | '=' | '!=') ; MapPattern: '{' ( (',' )*)? ','? '}'; EntryPattern: ':' ; diff --git a/guide/src/reference/pattern-matching.md b/guide/src/reference/pattern-matching.md index 9587b27..47840c5 100644 --- a/guide/src/reference/pattern-matching.md +++ b/guide/src/reference/pattern-matching.md @@ -6,9 +6,10 @@ MatchBody: ( (',' )*)?; MatchPattern: '=>' ; GuardedPattern: ('if' )?; Pattern: ('|' )*; -PatternKind: ; +PatternKind: ; IdentifierPattern: '_' | '...' | ; ListPattern: '[' ( (',' )*)? ']'; +ExpressionPattern: ('<=' | '>=' | '<' | '>' | '=' | '!=') ; MapPattern: '{' ( (',' )*)? ','? '}'; EntryPattern: ':' ; @@ -38,11 +39,12 @@ pattern is considered a match. ## Pattern -A pattern can one one of four kinds: +A pattern can one one of these kinds: - Wildcard: `_` will match any value. - Named wildcard: Any identifier - Remaining Wildcard: `...` will match all remaining elements in a collection/ +- An expression comparison: A comparison operator followed by an expression. - Tuple pattern: A comma separated list of patterns enclosed in parentheses. - List pattern: A comma separated list of patterns enclosed in square brackets.