Pull out alias header as its own struct

This commit is contained in:
ayazhafiz 2021-12-26 09:03:05 -06:00
parent dae94f4aaa
commit 11da888c07
5 changed files with 53 additions and 28 deletions

View file

@ -225,6 +225,12 @@ pub struct PrecedenceConflict<'a> {
pub expr: &'a Loc<Expr<'a>>,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AliasHeader<'a> {
pub name: &'a str,
pub vars: &'a [Loc<&'a str>],
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Def<'a> {
// TODO in canonicalization, validate the pattern; only certain patterns
@ -280,7 +286,7 @@ pub enum TypeAnnotation<'a> {
As(
&'a Loc<TypeAnnotation<'a>>,
&'a [CommentOrNewline<'a>],
(&'a str, &'a [Loc<&'a str>]),
AliasHeader<'a>,
),
Record {