mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Parse list patterns
This commit is contained in:
parent
02a76bb8bd
commit
4d35ab9957
10 changed files with 305 additions and 7 deletions
|
@ -653,6 +653,13 @@ pub enum Pattern<'a> {
|
|||
Underscore(&'a str),
|
||||
SingleQuote(&'a str),
|
||||
|
||||
/// A list pattern like [_, x, ..]
|
||||
List(Collection<'a, Loc<Pattern<'a>>>),
|
||||
|
||||
/// A list-rest pattern ".."
|
||||
/// Can only occur inside of a [Pattern::List]
|
||||
ListRest,
|
||||
|
||||
// Space
|
||||
SpaceBefore(&'a Pattern<'a>, &'a [CommentOrNewline<'a>]),
|
||||
SpaceAfter(&'a Pattern<'a>, &'a [CommentOrNewline<'a>]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue