allow arrow to be an expr terminator in when guards

This commit is contained in:
Joshua Warner 2025-01-10 19:49:37 -08:00
parent 13a70c060d
commit 05033ac40b
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 65 additions and 0 deletions

View file

@ -0,0 +1,6 @@
when
f
is
s if \t ->
"""
""" -> e

View file

@ -0,0 +1,48 @@
@0-27 SpaceAfter(
When(
@5-6 SpaceAfter(
Var {
module_name: "",
ident: "f",
},
[
Newline,
],
),
[
WhenBranch {
patterns: [
@10-11 SpaceBefore(
Identifier {
ident: "s",
},
[
Newline,
],
),
],
value: @26-27 Var {
module_name: "",
ident: "e",
},
guard: Some(
@14-24 Closure(
[
@15-16 Identifier {
ident: "t",
},
],
@18-24 Str(
Block(
[],
),
),
),
),
},
],
),
[
Newline,
],
)

View file

@ -0,0 +1,3 @@
when f
is
s if\t->""""""->e