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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
source: crates/aiken-lang/src/parser/expr/mod.rs
description: "Code:\n\nlet x = add_one(3)\n\nlet map_add_x = list.map(_, fn (y) { x + y })\n\nmap_add_x([ 1, 2, 3 ])\n"
---
Sequence {
location: 0..89,
expressions: [
Assignment {
location: 0..18,
value: Call {
arguments: [
CallArg {
label: None,
location: 16..17,
value: UInt {
location: 16..17,
value: "3",
base: Decimal {
numeric_underscore: false,
},
},
},
],
fun: Var {
location: 8..15,
name: "add_one",
},
location: 8..18,
},
pattern: Var {
location: 4..5,
name: "x",
},
kind: Let,
annotation: None,
},
Assignment {
location: 20..65,
value: Fn {
location: 36..65,
fn_style: Capture,
arguments: [
Arg {
arg_name: Named {
name: "_capture__0",
label: "_capture__0",
location: 0..0,
is_validator_param: false,
},
location: 0..0,
annotation: None,
tipo: (),
},
],
body: Call {
arguments: [
CallArg {
label: None,
location: 45..46,
value: Var {
location: 45..46,
name: "_capture__0",
},
},
CallArg {
label: None,
location: 48..64,
value: Fn {
location: 48..64,
fn_style: Plain,
arguments: [
Arg {
arg_name: Named {
name: "y",
label: "y",
location: 52..53,
is_validator_param: false,
},
location: 52..53,
annotation: None,
tipo: (),
},
],
body: BinOp {
location: 57..62,
name: AddInt,
left: Var {
location: 57..58,
name: "x",
},
right: Var {
location: 61..62,
name: "y",
},
},
return_annotation: None,
},
},
],
fun: FieldAccess {
location: 36..44,
label: "map",
container: Var {
location: 36..40,
name: "list",
},
},
location: 36..65,
},
return_annotation: None,
},
pattern: Var {
location: 24..33,
name: "map_add_x",
},
kind: Let,
annotation: None,
},
Call {
arguments: [
CallArg {
label: None,
location: 77..88,
value: List {
location: 77..88,
elements: [
UInt {
location: 79..80,
value: "1",
base: Decimal {
numeric_underscore: false,
},
},
UInt {
location: 82..83,
value: "2",
base: Decimal {
numeric_underscore: false,
},
},
UInt {
location: 85..86,
value: "3",
base: Decimal {
numeric_underscore: false,
},
},
],
tail: None,
},
},
],
fun: Var {
location: 67..76,
name: "map_add_x",
},
location: 67..89,
},
],
}