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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
@ ProgramNode (location: (1,0)-(15,12))
├── locals: [:_a]
└── statements:
@ StatementsNode (location: (1,0)-(15,12))
└── body: (length: 8)
├── @ IfNode (location: (1,0)-(1,9))
│ ├── if_keyword_loc: ∅
│ ├── predicate:
│ │ @ CallNode (location: (1,0)-(1,1))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :a
│ │ ├── message_loc: (1,0)-(1,1) = "a"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: variable_call
│ ├── then_keyword_loc: (1,2)-(1,3) = "?"
│ ├── statements:
│ │ @ StatementsNode (location: (1,4)-(1,5))
│ │ └── body: (length: 1)
│ │ └── @ CallNode (location: (1,4)-(1,5))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :b
│ │ ├── message_loc: (1,4)-(1,5) = "b"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: variable_call
│ ├── consequent:
│ │ @ ElseNode (location: (1,6)-(1,9))
│ │ ├── else_keyword_loc: (1,6)-(1,7) = ":"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (1,8)-(1,9))
│ │ │ └── body: (length: 1)
│ │ │ └── @ CallNode (location: (1,8)-(1,9))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── name: :c
│ │ │ ├── message_loc: (1,8)-(1,9) = "c"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ └── flags: variable_call
│ │ └── end_keyword_loc: ∅
│ └── end_keyword_loc: ∅
├── @ IfNode (location: (3,0)-(3,27))
│ ├── if_keyword_loc: ∅
│ ├── predicate:
│ │ @ CallNode (location: (3,0)-(3,1))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :a
│ │ ├── message_loc: (3,0)-(3,1) = "a"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: variable_call
│ ├── then_keyword_loc: (3,2)-(3,3) = "?"
│ ├── statements:
│ │ @ StatementsNode (location: (3,4)-(3,14))
│ │ └── body: (length: 1)
│ │ └── @ DefinedNode (location: (3,4)-(3,14))
│ │ ├── lparen_loc: ∅
│ │ ├── value:
│ │ │ @ CallNode (location: (3,13)-(3,14))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── name: :b
│ │ │ ├── message_loc: (3,13)-(3,14) = "b"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ └── flags: variable_call
│ │ ├── rparen_loc: ∅
│ │ └── keyword_loc: (3,4)-(3,12) = "defined?"
│ ├── consequent:
│ │ @ ElseNode (location: (3,15)-(3,27))
│ │ ├── else_keyword_loc: (3,15)-(3,16) = ":"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (3,17)-(3,27))
│ │ │ └── body: (length: 1)
│ │ │ └── @ DefinedNode (location: (3,17)-(3,27))
│ │ │ ├── lparen_loc: ∅
│ │ │ ├── value:
│ │ │ │ @ CallNode (location: (3,26)-(3,27))
│ │ │ │ ├── receiver: ∅
│ │ │ │ ├── call_operator_loc: ∅
│ │ │ │ ├── name: :c
│ │ │ │ ├── message_loc: (3,26)-(3,27) = "c"
│ │ │ │ ├── opening_loc: ∅
│ │ │ │ ├── arguments: ∅
│ │ │ │ ├── closing_loc: ∅
│ │ │ │ ├── block: ∅
│ │ │ │ └── flags: variable_call
│ │ │ ├── rparen_loc: ∅
│ │ │ └── keyword_loc: (3,17)-(3,25) = "defined?"
│ │ └── end_keyword_loc: ∅
│ └── end_keyword_loc: ∅
├── @ IfNode (location: (5,0)-(5,15))
│ ├── if_keyword_loc: ∅
│ ├── predicate:
│ │ @ CallNode (location: (5,0)-(5,6))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :empty?
│ │ ├── message_loc: (5,0)-(5,6) = "empty?"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: ∅
│ ├── then_keyword_loc: (5,6)-(5,7) = "?"
│ ├── statements:
│ │ @ StatementsNode (location: (5,7)-(5,11))
│ │ └── body: (length: 1)
│ │ └── @ TrueNode (location: (5,7)-(5,11))
│ ├── consequent:
│ │ @ ElseNode (location: (5,11)-(5,15))
│ │ ├── else_keyword_loc: (5,11)-(5,12) = ":"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (5,12)-(5,15))
│ │ │ └── body: (length: 1)
│ │ │ └── @ NilNode (location: (5,12)-(5,15))
│ │ └── end_keyword_loc: ∅
│ └── end_keyword_loc: ∅
├── @ IfNode (location: (7,0)-(7,16))
│ ├── if_keyword_loc: ∅
│ ├── predicate:
│ │ @ CallNode (location: (7,0)-(7,6))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :empty?
│ │ ├── message_loc: (7,0)-(7,6) = "empty?"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: ∅
│ ├── then_keyword_loc: (7,6)-(7,7) = "?"
│ ├── statements:
│ │ @ StatementsNode (location: (7,7)-(7,12))
│ │ └── body: (length: 1)
│ │ └── @ FalseNode (location: (7,7)-(7,12))
│ ├── consequent:
│ │ @ ElseNode (location: (7,12)-(7,16))
│ │ ├── else_keyword_loc: (7,12)-(7,13) = ":"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (7,13)-(7,16))
│ │ │ └── body: (length: 1)
│ │ │ └── @ NilNode (location: (7,13)-(7,16))
│ │ └── end_keyword_loc: ∅
│ └── end_keyword_loc: ∅
├── @ IfNode (location: (9,0)-(9,14))
│ ├── if_keyword_loc: ∅
│ ├── predicate:
│ │ @ CallNode (location: (9,0)-(9,6))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :empty?
│ │ ├── message_loc: (9,0)-(9,6) = "empty?"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: ∅
│ ├── then_keyword_loc: (9,6)-(9,7) = "?"
│ ├── statements:
│ │ @ StatementsNode (location: (9,7)-(9,10))
│ │ └── body: (length: 1)
│ │ └── @ NilNode (location: (9,7)-(9,10))
│ ├── consequent:
│ │ @ ElseNode (location: (9,10)-(9,14))
│ │ ├── else_keyword_loc: (9,10)-(9,11) = ":"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (9,11)-(9,14))
│ │ │ └── body: (length: 1)
│ │ │ └── @ NilNode (location: (9,11)-(9,14))
│ │ └── end_keyword_loc: ∅
│ └── end_keyword_loc: ∅
├── @ IfNode (location: (11,0)-(11,10))
│ ├── if_keyword_loc: ∅
│ ├── predicate:
│ │ @ CallNode (location: (11,0)-(11,2))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :a?
│ │ ├── message_loc: (11,0)-(11,2) = "a?"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: ∅
│ ├── then_keyword_loc: (11,2)-(11,3) = "?"
│ ├── statements:
│ │ @ StatementsNode (location: (11,3)-(11,6))
│ │ └── body: (length: 1)
│ │ └── @ NilNode (location: (11,3)-(11,6))
│ ├── consequent:
│ │ @ ElseNode (location: (11,6)-(11,10))
│ │ ├── else_keyword_loc: (11,6)-(11,7) = ":"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (11,7)-(11,10))
│ │ │ └── body: (length: 1)
│ │ │ └── @ NilNode (location: (11,7)-(11,10))
│ │ └── end_keyword_loc: ∅
│ └── end_keyword_loc: ∅
├── @ IfNode (location: (13,0)-(13,14))
│ ├── if_keyword_loc: ∅
│ ├── predicate:
│ │ @ CallNode (location: (13,0)-(13,1))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :a
│ │ ├── message_loc: (13,0)-(13,1) = "a"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: variable_call
│ ├── then_keyword_loc: (13,2)-(13,3) = "?"
│ ├── statements:
│ │ @ StatementsNode (location: (13,3)-(13,7))
│ │ └── body: (length: 1)
│ │ └── @ CallNode (location: (13,3)-(13,7))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :var1
│ │ ├── message_loc: (13,3)-(13,7) = "var1"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ └── flags: variable_call
│ ├── consequent:
│ │ @ ElseNode (location: (13,8)-(13,14))
│ │ ├── else_keyword_loc: (13,8)-(13,9) = ":"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (13,10)-(13,14))
│ │ │ └── body: (length: 1)
│ │ │ └── @ CallNode (location: (13,10)-(13,14))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── name: :var2
│ │ │ ├── message_loc: (13,10)-(13,14) = "var2"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ └── flags: variable_call
│ │ └── end_keyword_loc: ∅
│ └── end_keyword_loc: ∅
└── @ IfNode (location: (15,0)-(15,12))
├── if_keyword_loc: ∅
├── predicate:
│ @ CallNode (location: (15,0)-(15,4))
│ ├── receiver: ∅
│ ├── call_operator_loc: ∅
│ ├── name: :nil?
│ ├── message_loc: (15,0)-(15,4) = "nil?"
│ ├── opening_loc: ∅
│ ├── arguments: ∅
│ ├── closing_loc: ∅
│ ├── block: ∅
│ └── flags: ∅
├── then_keyword_loc: (15,4)-(15,5) = "?"
├── statements:
│ @ StatementsNode (location: (15,5)-(15,10))
│ └── body: (length: 1)
│ └── @ LocalVariableWriteNode (location: (15,5)-(15,10))
│ ├── name: :_a
│ ├── depth: 0
│ ├── name_loc: (15,5)-(15,7) = "_a"
│ ├── value:
│ │ @ IntegerNode (location: (15,9)-(15,10))
│ │ └── flags: decimal
│ └── operator_loc: (15,8)-(15,9) = "="
├── consequent:
│ @ ElseNode (location: (15,10)-(15,12))
│ ├── else_keyword_loc: (15,10)-(15,11) = ":"
│ ├── statements:
│ │ @ StatementsNode (location: (15,11)-(15,12))
│ │ └── body: (length: 1)
│ │ └── @ IntegerNode (location: (15,11)-(15,12))
│ │ └── flags: decimal
│ └── end_keyword_loc: ∅
└── end_keyword_loc: ∅
|