start building pattern parser

This commit is contained in:
Folkert 2021-02-20 00:35:03 +01:00
parent 22b2ab499e
commit 70b5e18c21
3 changed files with 112 additions and 13 deletions

View file

@ -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),