better messages for types in parens and applied types

This commit is contained in:
Folkert 2021-02-11 21:48:19 +01:00
parent f6d3b4ed93
commit c339f96244
4 changed files with 549 additions and 25 deletions

View file

@ -371,6 +371,7 @@ pub enum Type<'a> {
TRecord(TRecord<'a>, Row, Col),
TTagUnion(TTagUnion<'a>, Row, Col),
TInParens(TInParens<'a>, Row, Col),
TApply(TApply<'a>, Row, Col),
///
TStart(Row, Col),
TSpace(Row, Col),
@ -434,6 +435,22 @@ pub enum TInParens<'a> {
IndentEnd(Row, Col),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum TApply<'a> {
Type(&'a Type<'a>, Row, Col),
// TODO REMOVE in favor of Type
Syntax(&'a SyntaxError<'a>, Row, Col),
///
Space(BadInputError, Row, Col),
///
DoubleDot(Row, Col),
TrailingDot(Row, Col),
StartIsNumber(Row, Col),
StartNotUppercase(Row, Col),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ContextStack<'a> {
Cons(ContextItem, &'a ContextStack<'a>),