mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Coalesce inline and normal alias headers
Unifies `As` annotations and `Alias` defs to use a common struct for defining alias header information, i.e. the name and type variables of the alias.
This commit is contained in:
parent
597a1cef3b
commit
966198a6e7
11 changed files with 61 additions and 27 deletions
|
@ -2,7 +2,7 @@ use crate::annotation::{Formattable, Newlines, Parens};
|
|||
use crate::pattern::fmt_pattern;
|
||||
use crate::spaces::{fmt_spaces, INDENT};
|
||||
use crate::Buf;
|
||||
use roc_parse::ast::{Def, Expr, Pattern};
|
||||
use roc_parse::ast::{AliasHeader, Def, Expr, Pattern};
|
||||
use roc_region::all::Loc;
|
||||
|
||||
/// A Located formattable value is also formattable
|
||||
|
@ -55,7 +55,10 @@ impl<'a> Formattable for Def<'a> {
|
|||
);
|
||||
}
|
||||
}
|
||||
Alias { name, vars, ann } => {
|
||||
Alias {
|
||||
header: AliasHeader { name, vars },
|
||||
ann,
|
||||
} => {
|
||||
buf.indent(indent);
|
||||
buf.push_str(name.value);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue