Ensure formatted multiline patterns can be parsed

This commit is contained in:
Joshua Warner 2024-12-02 20:22:41 -08:00
parent 78cda703d9
commit dfcb7a0c3b
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
6 changed files with 168 additions and 39 deletions

View file

@ -0,0 +1,5 @@
1 (0 #
f)
(0 #
f) : f
e

View file

@ -0,0 +1,80 @@
SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-19,
],
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 Apply(
@0-1 NumLiteral(
"1",
),
[
@2-8 Apply(
@3-4 SpaceAfter(
NumLiteral(
"0",
),
[
LineComment(
"",
),
],
),
[
@7-8 Identifier {
ident: "f",
},
],
),
@10-16 Apply(
@11-12 SpaceAfter(
NumLiteral(
"0",
),
[
LineComment(
"",
),
],
),
[
@15-16 Identifier {
ident: "f",
},
],
),
],
),
@18-19 BoundVariable(
"f",
),
),
],
},
@20-21 SpaceBefore(
Var {
module_name: "",
ident: "e",
},
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
1((0#
)f)((0#
)f):f
e

View file

@ -1,4 +1,6 @@
1
"""
""" "^" 2 : A
"""
"^"
2 : A
""

View file

@ -442,6 +442,7 @@ mod test_snapshots {
pass/list_patterns.expr,
pass/lowest_float.expr,
pass/lowest_int.expr,
pass/mega_parens_pat.expr,
pass/min_parens_number.expr,
pass/minimal_app_header.header,
pass/minus_minus_block_string.expr,