mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-18 19:10:18 +00:00
Parse list patterns
This commit is contained in:
parent
02a76bb8bd
commit
4d35ab9957
10 changed files with 305 additions and 7 deletions
|
@ -107,7 +107,8 @@ impl_space_problem! {
|
|||
EWhen<'a>,
|
||||
EAbility<'a>,
|
||||
PInParens<'a>,
|
||||
PRecord<'a>
|
||||
PRecord<'a>,
|
||||
PList<'a>
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
|
@ -519,6 +520,7 @@ pub enum EExpect<'a> {
|
|||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum EPattern<'a> {
|
||||
Record(PRecord<'a>, Position),
|
||||
List(PList<'a>, Position),
|
||||
Underscore(Position),
|
||||
|
||||
Start(Position),
|
||||
|
@ -553,6 +555,22 @@ pub enum PRecord<'a> {
|
|||
IndentEnd(Position),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum PList<'a> {
|
||||
End(Position),
|
||||
Open(Position),
|
||||
|
||||
Rest(Position),
|
||||
Pattern(&'a EPattern<'a>, Position),
|
||||
|
||||
Space(BadInputError, Position),
|
||||
|
||||
IndentOpen(Position),
|
||||
IndentColon(Position),
|
||||
IndentOptional(Position),
|
||||
IndentEnd(Position),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum PInParens<'a> {
|
||||
End(Position),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue