Handle multiline string at the start of a pattern

This commit is contained in:
Joshua Warner 2024-12-15 10:21:49 -08:00
parent 10e7e24184
commit 0d182fbd28
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
6 changed files with 104 additions and 1 deletions

View file

@ -0,0 +1,7 @@
8
(
"""
"""
"")
f : C
U

View file

@ -0,0 +1,72 @@
@0-17 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
EitherIndex(2147483649),
],
regions: [
@0-1,
@2-15,
],
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: [],
value_defs: [
Stmt(
@0-1 Num(
"8",
),
),
Annotation(
@3-11 Apply(
@3-11 Apply(
@3-9 StrLiteral(
Block(
[],
),
),
[
@9-11 StrLiteral(
PlainLine(
"",
),
),
],
),
[
@12-13 Identifier {
ident: "f",
},
],
),
@14-15 Apply(
"",
"C",
[],
),
),
],
},
@16-17 SpaceBefore(
Tag(
"U",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,3 @@
8
("""""""")f:C
U

View file

@ -494,6 +494,7 @@ mod test_snapshots {
pass/multiline_backpassing.expr,
pass/multiline_binop_when_with_comments.expr,
pass/multiline_str_after_newlines_in_pat.expr,
pass/multiline_str_and_str_in_alias.expr,
pass/multiline_str_apply_in_parens_pat.expr,
pass/multiline_str_crazyness.expr,
pass/multiline_str_in_backpassing_pats.expr,