1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
source: crates/aiken-lang/src/parser/expr/when/mod.rs
description: "Code:\n\nwhen a is {\n 1 | 4 | 5 -> {\n let amazing = 5\n amazing\n }\n 3 -> 9\n _ -> 4\n}\n"
---
When {
location: 0..84,
subject: Var {
location: 5..6,
name: "a",
},
clauses: [
UntypedClause {
location: 14..64,
patterns: [
Int {
location: 14..15,
value: "1",
base: Decimal {
numeric_underscore: false,
},
},
Int {
location: 18..19,
value: "4",
base: Decimal {
numeric_underscore: false,
},
},
Int {
location: 22..23,
value: "5",
base: Decimal {
numeric_underscore: false,
},
},
],
then: Sequence {
location: 33..60,
expressions: [
Assignment {
location: 33..48,
value: UInt {
location: 47..48,
value: "5",
base: Decimal {
numeric_underscore: false,
},
},
patterns: [
AssignmentPattern {
pattern: Var {
location: 37..44,
name: "amazing",
},
annotation: None,
location: 37..44,
},
],
kind: Let {
backpassing: false,
},
comment: None,
},
Var {
location: 53..60,
name: "amazing",
},
],
},
},
UntypedClause {
location: 67..73,
patterns: [
Int {
location: 67..68,
value: "3",
base: Decimal {
numeric_underscore: false,
},
},
],
then: UInt {
location: 72..73,
value: "9",
base: Decimal {
numeric_underscore: false,
},
},
},
UntypedClause {
location: 76..82,
patterns: [
Discard {
name: "_",
location: 76..77,
},
],
then: UInt {
location: 81..82,
value: "4",
base: Decimal {
numeric_underscore: false,
},
},
},
],
}