Also conservatively check for spaces at the beginning of the pattern

This commit is contained in:
Joshua Warner 2024-12-14 10:16:53 -08:00
parent 0feed5d57b
commit a15998872d
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 109 additions and 3 deletions

View file

@ -0,0 +1,68 @@
@0-13 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(0),
EitherIndex(2147483648),
],
regions: [
@0-3,
@4-11,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 1 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
Slice<roc_parse::ast::CommentOrNewline> { start: 1, length: 0 },
],
spaces: [
Newline,
],
type_defs: [
Alias {
header: TypeHeader {
name: @0-1 "H",
vars: [],
},
ann: @2-3 BoundVariable(
"p",
),
},
],
value_defs: [
Body(
@7-8 SpaceBefore(
Identifier {
ident: "s",
},
[
LineComment(
"",
),
],
),
@10-11 Var {
module_name: "",
ident: "p",
},
),
],
},
@12-13 SpaceBefore(
Var {
module_name: "",
ident: "d",
},
[
Newline,
],
),
),
[
LineComment(
"",
),
],
)

View file

@ -289,6 +289,7 @@ mod test_snapshots {
pass/ann_effectful_fn.expr,
pass/ann_open_union.expr,
pass/ann_parens_comments.expr,
pass/ann_pattern_comment_before_body.expr,
pass/ann_record_pat_with_comment.expr,
pass/ann_tag_union_newline_comment.expr,
pass/annotate_tuple_func.expr,