mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-03 06:02:54 +00:00
Fix placement of comma after implements in pnc apply patterns
This commit is contained in:
parent
2bbcbbd5c1
commit
2e4e4bb957
5 changed files with 61 additions and 3 deletions
|
|
@ -563,9 +563,9 @@ pub fn pattern_fmt_apply(
|
||||||
buf.push_str("(implements)");
|
buf.push_str("(implements)");
|
||||||
} else {
|
} else {
|
||||||
fmt_pattern_only(&arg.item, buf, parens, indent_more, arg.item.is_multiline());
|
fmt_pattern_only(&arg.item, buf, parens, indent_more, arg.item.is_multiline());
|
||||||
if use_commas_and_parens && (!is_last_arg || is_multiline) {
|
}
|
||||||
buf.push(',');
|
if use_commas_and_parens && (!is_last_arg || is_multiline) {
|
||||||
}
|
buf.push(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
last_after = arg.after;
|
last_after = arg.after;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
g((implements), x) = c
|
||||||
|
c
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
@0-19 SpaceAfter(
|
||||||
|
Defs(
|
||||||
|
Defs {
|
||||||
|
tags: [
|
||||||
|
EitherIndex(2147483648),
|
||||||
|
],
|
||||||
|
regions: [
|
||||||
|
@0-17,
|
||||||
|
],
|
||||||
|
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: [
|
||||||
|
Body(
|
||||||
|
@0-15 PncApply(
|
||||||
|
@0-1 Identifier {
|
||||||
|
ident: "g",
|
||||||
|
},
|
||||||
|
[
|
||||||
|
@2-12 Identifier {
|
||||||
|
ident: "implements",
|
||||||
|
},
|
||||||
|
@13-14 Identifier {
|
||||||
|
ident: "x",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
),
|
||||||
|
@16-17 Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "c",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
@18-19 SpaceBefore(
|
||||||
|
Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "c",
|
||||||
|
},
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
g(implements,x)=c
|
||||||
|
c
|
||||||
|
|
@ -465,6 +465,7 @@ mod test_snapshots {
|
||||||
pass/implements_after_comment_with_newline.expr,
|
pass/implements_after_comment_with_newline.expr,
|
||||||
pass/implements_annotation_comment.expr,
|
pass/implements_annotation_comment.expr,
|
||||||
pass/implements_in_pat_after_comment.expr,
|
pass/implements_in_pat_after_comment.expr,
|
||||||
|
pass/implements_in_pnc_pattern.expr,
|
||||||
pass/implements_newline_in_fn_ty.expr,
|
pass/implements_newline_in_fn_ty.expr,
|
||||||
pass/implements_newlines_comments.expr,
|
pass/implements_newlines_comments.expr,
|
||||||
pass/implements_not_keyword.expr,
|
pass/implements_not_keyword.expr,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue