mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
start building pattern parser
This commit is contained in:
parent
22b2ab499e
commit
70b5e18c21
3 changed files with 112 additions and 13 deletions
|
@ -321,6 +321,7 @@ pub enum SyntaxError<'a> {
|
|||
NotYetImplemented(String),
|
||||
TODO,
|
||||
Type(Type<'a>),
|
||||
Pattern(EPattern<'a>),
|
||||
Space(BadInputError),
|
||||
}
|
||||
|
||||
|
@ -368,6 +369,26 @@ impl<'a> SyntaxError<'a> {
|
|||
pub type Row = u32;
|
||||
pub type Col = u16;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum EPattern<'a> {
|
||||
Record(PRecord<'a>, Row, Col),
|
||||
Underscore(Row, Col),
|
||||
|
||||
Start(Row, Col),
|
||||
End(Row, Col),
|
||||
Space(BadInputError, Row, Col),
|
||||
FunctionArgument(Row, Col),
|
||||
|
||||
IndentStart(Row, Col),
|
||||
IndentEnd(Row, Col),
|
||||
AsIndentStart(Row, Col),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum PRecord<'a> {
|
||||
EPattern(&'a Type<'a>, Row, Col),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Type<'a> {
|
||||
TRecord(TRecord<'a>, Row, Col),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue