mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
correctly format multiline record type annotation
This commit is contained in:
parent
f9666d6efe
commit
c692319fb9
5 changed files with 68 additions and 54 deletions
|
@ -895,7 +895,7 @@ macro_rules! collection_trailing_sep {
|
|||
$delimiter,
|
||||
$crate::blankspace::space0_around($elem, $min_indent)
|
||||
),
|
||||
$crate::blankspace::spaces0($min_indent)
|
||||
$crate::blankspace::space0($min_indent)
|
||||
),
|
||||
$closing_brace
|
||||
)
|
||||
|
@ -1157,7 +1157,7 @@ macro_rules! record_field {
|
|||
#[macro_export]
|
||||
macro_rules! record_without_update {
|
||||
($val_parser:expr, $min_indent:expr) => {
|
||||
collection!(
|
||||
collection_trailing_sep!(
|
||||
ascii_char(b'{'),
|
||||
loc!(record_field!($val_parser, $min_indent)),
|
||||
ascii_char(b','),
|
||||
|
|
|
@ -165,12 +165,17 @@ fn record_type<'a>(min_indent: u16) -> impl Parser<'a, TypeAnnotation<'a>> {
|
|||
move |arena, state| allocated(term(min_indent)).parse(arena, state)
|
||||
)
|
||||
),
|
||||
|(fields, ext): (
|
||||
Vec<'a, Located<AssignedField<'a, TypeAnnotation<'a>>>>,
|
||||
|((fields, final_comments), ext): (
|
||||
(
|
||||
Vec<'a, Located<AssignedField<'a, TypeAnnotation<'a>>>>,
|
||||
&[CommentOrNewline<'a>]
|
||||
),
|
||||
Option<&'a Located<TypeAnnotation<'a>>>,
|
||||
)| Record {
|
||||
fields: fields.into_bump_slice(),
|
||||
ext
|
||||
)| {
|
||||
Record {
|
||||
fields: fields.into_bump_slice(),
|
||||
ext,
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue