roc/crates/compiler/parse/tests/snapshots/pass/when_with_tuples.expr.result-ast
Joshua Warner ca5d084497
Implement tuple pattern parsing
Step 2 of N in implementing #4465
2022-11-13 16:11:57 -05:00

72 lines
1.8 KiB
Text

When(
@5-11 Tuple(
[
@6-7 Num(
"1",
),
@9-10 Num(
"2",
),
],
),
[
WhenBranch {
patterns: [
@16-22 SpaceBefore(
Tuple(
[
@17-18 NumLiteral(
"1",
),
@20-21 Identifier(
"x",
),
],
),
[
Newline,
],
),
],
value: @26-27 Var {
module_name: "",
ident: "x",
},
guard: None,
},
WhenBranch {
patterns: [
@29-35 SpaceBefore(
Tuple(
[
@30-31 Underscore(
"",
),
@33-34 Identifier(
"b",
),
],
),
[
Newline,
],
),
],
value: @39-44 BinOps(
[
(
@39-40 Num(
"3",
),
@41-42 Plus,
),
],
@43-44 Var {
module_name: "",
ident: "b",
},
),
guard: None,
},
],
)