mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +00:00
lift to spaces in ann_lift_to_node default case
This commit is contained in:
parent
d3426ebce1
commit
f233c5328d
5 changed files with 79 additions and 6 deletions
|
@ -427,7 +427,6 @@ fn lower<'a, 'b: 'a>(
|
|||
|
||||
fn fmt_ty_collection(
|
||||
buf: &mut Buf<'_>,
|
||||
|
||||
indent: u16,
|
||||
braces: Braces,
|
||||
items: Collection<'_, Loc<TypeAnnotation<'_>>>,
|
||||
|
@ -1215,11 +1214,14 @@ fn ann_lift_to_node<'a, 'b: 'a>(
|
|||
inner
|
||||
}
|
||||
}
|
||||
_ => Spaces {
|
||||
before: &[],
|
||||
item: Node::TypeAnnotation(*ann),
|
||||
after: &[],
|
||||
},
|
||||
_ => {
|
||||
let lifted = ann_lift_spaces(arena, ann);
|
||||
Spaces {
|
||||
before: lifted.before,
|
||||
item: Node::TypeAnnotation(lifted.item),
|
||||
after: lifted.after,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
1 : (
|
||||
()n, #
|
||||
)n
|
||||
l
|
|
@ -0,0 +1,63 @@
|
|||
@0-16 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-14,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Annotation(
|
||||
@0-1 NumLiteral(
|
||||
"1",
|
||||
),
|
||||
@2-14 Tuple {
|
||||
elems: [
|
||||
@3-10 Tuple {
|
||||
elems: [],
|
||||
ext: Some(
|
||||
@6-7 SpaceAfter(
|
||||
BoundVariable(
|
||||
"n",
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
},
|
||||
],
|
||||
ext: Some(
|
||||
@12-13 BoundVariable(
|
||||
"n",
|
||||
),
|
||||
),
|
||||
},
|
||||
),
|
||||
],
|
||||
},
|
||||
@15-16 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "l",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
1:(()(n#
|
||||
))(n)
|
||||
l
|
|
@ -301,6 +301,7 @@ mod test_snapshots {
|
|||
pass/annotation_tuple_comment.expr,
|
||||
pass/annotation_tuple_newline.expr,
|
||||
pass/annotation_tuple_parens_newlines.expr,
|
||||
pass/annotation_tuples_ext_galore.expr,
|
||||
pass/applies_in_binop.expr,
|
||||
pass/apply_binop_switch.expr,
|
||||
pass/apply_closure_pizza.expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue