summaryrefslogtreecommitdiff
path: root/test/prism/snapshots/unparser/corpus/literal/if.txt
blob: 00eeba179c6782cc5492e258d4db3ba4964f8f04 (plain)
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
@ ProgramNode (location: (1,0)-(36,3))
├── locals: [:foo, :pair]
└── statements:
    @ StatementsNode (location: (1,0)-(36,3))
    └── body: (length: 10)
        ├── @ IfNode (location: (1,0)-(3,3))
        │   ├── if_keyword_loc: (1,0)-(1,2) = "if"
        │   ├── predicate:
        │   │   @ MatchLastLineNode (location: (1,3)-(1,8))
        │   │   ├── flags: forced_us_ascii_encoding
        │   │   ├── opening_loc: (1,3)-(1,4) = "/"
        │   │   ├── content_loc: (1,4)-(1,7) = "foo"
        │   │   ├── closing_loc: (1,7)-(1,8) = "/"
        │   │   └── unescaped: "foo"
        │   ├── then_keyword_loc: ∅
        │   ├── statements:
        │   │   @ StatementsNode (location: (2,2)-(2,5))
        │   │   └── body: (length: 1)
        │   │       └── @ CallNode (location: (2,2)-(2,5))
        │   │           ├── flags: variable_call, ignore_visibility
        │   │           ├── receiver: ∅
        │   │           ├── call_operator_loc: ∅
        │   │           ├── name: :bar
        │   │           ├── message_loc: (2,2)-(2,5) = "bar"
        │   │           ├── opening_loc: ∅
        │   │           ├── arguments: ∅
        │   │           ├── closing_loc: ∅
        │   │           └── block: ∅
        │   ├── consequent: ∅
        │   └── end_keyword_loc: (3,0)-(3,3) = "end"
        ├── @ IfNode (location: (4,0)-(6,3))
        │   ├── if_keyword_loc: (4,0)-(4,2) = "if"
        │   ├── predicate:
        │   │   @ IntegerNode (location: (4,3)-(4,4))
        │   │   ├── flags: decimal
        │   │   └── value: 3
        │   ├── then_keyword_loc: ∅
        │   ├── statements:
        │   │   @ StatementsNode (location: (5,2)-(5,3))
        │   │   └── body: (length: 1)
        │   │       └── @ IntegerNode (location: (5,2)-(5,3))
        │   │           ├── flags: decimal
        │   │           └── value: 9
        │   ├── consequent: ∅
        │   └── end_keyword_loc: (6,0)-(6,3) = "end"
        ├── @ IfNode (location: (7,0)-(11,3))
        │   ├── if_keyword_loc: (7,0)-(7,2) = "if"
        │   ├── predicate:
        │   │   @ IntegerNode (location: (7,3)-(7,4))
        │   │   ├── flags: decimal
        │   │   └── value: 4
        │   ├── then_keyword_loc: ∅
        │   ├── statements:
        │   │   @ StatementsNode (location: (8,2)-(8,3))
        │   │   └── body: (length: 1)
        │   │       └── @ IntegerNode (location: (8,2)-(8,3))
        │   │           ├── flags: decimal
        │   │           └── value: 5
        │   ├── consequent:
        │   │   @ ElseNode (location: (9,0)-(11,3))
        │   │   ├── else_keyword_loc: (9,0)-(9,4) = "else"
        │   │   ├── statements:
        │   │   │   @ StatementsNode (location: (10,2)-(10,3))
        │   │   │   └── body: (length: 1)
        │   │   │       └── @ IntegerNode (location: (10,2)-(10,3))
        │   │   │           ├── flags: decimal
        │   │   │           └── value: 6
        │   │   └── end_keyword_loc: (11,0)-(11,3) = "end"
        │   └── end_keyword_loc: (11,0)-(11,3) = "end"
        ├── @ UnlessNode (location: (12,0)-(14,3))
        │   ├── keyword_loc: (12,0)-(12,6) = "unless"
        │   ├── predicate:
        │   │   @ IntegerNode (location: (12,7)-(12,8))
        │   │   ├── flags: decimal
        │   │   └── value: 3
        │   ├── then_keyword_loc: ∅
        │   ├── statements:
        │   │   @ StatementsNode (location: (13,2)-(13,5))
        │   │   └── body: (length: 1)
        │   │       └── @ NilNode (location: (13,2)-(13,5))
        │   ├── consequent: ∅
        │   └── end_keyword_loc: (14,0)-(14,3) = "end"
        ├── @ UnlessNode (location: (15,0)-(17,3))
        │   ├── keyword_loc: (15,0)-(15,6) = "unless"
        │   ├── predicate:
        │   │   @ IntegerNode (location: (15,7)-(15,8))
        │   │   ├── flags: decimal
        │   │   └── value: 3
        │   ├── then_keyword_loc: ∅
        │   ├── statements:
        │   │   @ StatementsNode (location: (16,2)-(16,3))
        │   │   └── body: (length: 1)
        │   │       └── @ IntegerNode (location: (16,2)-(16,3))
        │   │           ├── flags: decimal
        │   │           └── value: 9
        │   ├── consequent: ∅
        │   └── end_keyword_loc: (17,0)-(17,3) = "end"
        ├── @ IfNode (location: (18,0)-(19,3))
        │   ├── if_keyword_loc: (18,0)-(18,2) = "if"
        │   ├── predicate:
        │   │   @ CallNode (location: (18,3)-(18,6))
        │   │   ├── flags: variable_call, ignore_visibility
        │   │   ├── receiver: ∅
        │   │   ├── call_operator_loc: ∅
        │   │   ├── name: :foo
        │   │   ├── message_loc: (18,3)-(18,6) = "foo"
        │   │   ├── opening_loc: ∅
        │   │   ├── arguments: ∅
        │   │   ├── closing_loc: ∅
        │   │   └── block: ∅
        │   ├── then_keyword_loc: ∅
        │   ├── statements: ∅
        │   ├── consequent: ∅
        │   └── end_keyword_loc: (19,0)-(19,3) = "end"
        ├── @ ModuleNode (location: (21,0)-(23,3))
        │   ├── locals: [:foo]
        │   ├── module_keyword_loc: (21,0)-(21,6) = "module"
        │   ├── constant_path:
        │   │   @ ConstantReadNode (location: (21,7)-(21,8))
        │   │   └── name: :A
        │   ├── body:
        │   │   @ StatementsNode (location: (22,2)-(22,18))
        │   │   └── body: (length: 1)
        │   │       └── @ IfNode (location: (22,2)-(22,18))
        │   │           ├── if_keyword_loc: (22,12)-(22,14) = "if"
        │   │           ├── predicate:
        │   │           │   @ LocalVariableReadNode (location: (22,15)-(22,18))
        │   │           │   ├── name: :foo
        │   │           │   └── depth: 0
        │   │           ├── then_keyword_loc: ∅
        │   │           ├── statements:
        │   │           │   @ StatementsNode (location: (22,2)-(22,11))
        │   │           │   └── body: (length: 1)
        │   │           │       └── @ LocalVariableWriteNode (location: (22,2)-(22,11))
        │   │           │           ├── name: :foo
        │   │           │           ├── depth: 0
        │   │           │           ├── name_loc: (22,2)-(22,5) = "foo"
        │   │           │           ├── value:
        │   │           │           │   @ CallNode (location: (22,8)-(22,11))
        │   │           │           │   ├── flags: variable_call, ignore_visibility
        │   │           │           │   ├── receiver: ∅
        │   │           │           │   ├── call_operator_loc: ∅
        │   │           │           │   ├── name: :bar
        │   │           │           │   ├── message_loc: (22,8)-(22,11) = "bar"
        │   │           │           │   ├── opening_loc: ∅
        │   │           │           │   ├── arguments: ∅
        │   │           │           │   ├── closing_loc: ∅
        │   │           │           │   └── block: ∅
        │   │           │           └── operator_loc: (22,6)-(22,7) = "="
        │   │           ├── consequent: ∅
        │   │           └── end_keyword_loc: ∅
        │   ├── end_keyword_loc: (23,0)-(23,3) = "end"
        │   └── name: :A
        ├── @ ModuleNode (location: (25,0)-(27,3))
        │   ├── locals: [:foo]
        │   ├── module_keyword_loc: (25,0)-(25,6) = "module"
        │   ├── constant_path:
        │   │   @ ConstantReadNode (location: (25,7)-(25,8))
        │   │   └── name: :B
        │   ├── body:
        │   │   @ StatementsNode (location: (26,2)-(26,22))
        │   │   └── body: (length: 1)
        │   │       └── @ UnlessNode (location: (26,2)-(26,22))
        │   │           ├── keyword_loc: (26,12)-(26,18) = "unless"
        │   │           ├── predicate:
        │   │           │   @ LocalVariableReadNode (location: (26,19)-(26,22))
        │   │           │   ├── name: :foo
        │   │           │   └── depth: 0
        │   │           ├── then_keyword_loc: ∅
        │   │           ├── statements:
        │   │           │   @ StatementsNode (location: (26,2)-(26,11))
        │   │           │   └── body: (length: 1)
        │   │           │       └── @ LocalVariableWriteNode (location: (26,2)-(26,11))
        │   │           │           ├── name: :foo
        │   │           │           ├── depth: 0
        │   │           │           ├── name_loc: (26,2)-(26,5) = "foo"
        │   │           │           ├── value:
        │   │           │           │   @ CallNode (location: (26,8)-(26,11))
        │   │           │           │   ├── flags: variable_call, ignore_visibility
        │   │           │           │   ├── receiver: ∅
        │   │           │           │   ├── call_operator_loc: ∅
        │   │           │           │   ├── name: :bar
        │   │           │           │   ├── message_loc: (26,8)-(26,11) = "bar"
        │   │           │           │   ├── opening_loc: ∅
        │   │           │           │   ├── arguments: ∅
        │   │           │           │   ├── closing_loc: ∅
        │   │           │           │   └── block: ∅
        │   │           │           └── operator_loc: (26,6)-(26,7) = "="
        │   │           ├── consequent: ∅
        │   │           └── end_keyword_loc: ∅
        │   ├── end_keyword_loc: (27,0)-(27,3) = "end"
        │   └── name: :B
        ├── @ UnlessNode (location: (28,0)-(30,3))
        │   ├── keyword_loc: (28,0)-(28,6) = "unless"
        │   ├── predicate:
        │   │   @ CallNode (location: (28,7)-(28,10))
        │   │   ├── flags: variable_call, ignore_visibility
        │   │   ├── receiver: ∅
        │   │   ├── call_operator_loc: ∅
        │   │   ├── name: :foo
        │   │   ├── message_loc: (28,7)-(28,10) = "foo"
        │   │   ├── opening_loc: ∅
        │   │   ├── arguments: ∅
        │   │   ├── closing_loc: ∅
        │   │   └── block: ∅
        │   ├── then_keyword_loc: ∅
        │   ├── statements:
        │   │   @ StatementsNode (location: (29,2)-(29,11))
        │   │   └── body: (length: 1)
        │   │       └── @ LocalVariableWriteNode (location: (29,2)-(29,11))
        │   │           ├── name: :foo
        │   │           ├── depth: 0
        │   │           ├── name_loc: (29,2)-(29,5) = "foo"
        │   │           ├── value:
        │   │           │   @ CallNode (location: (29,8)-(29,11))
        │   │           │   ├── flags: variable_call, ignore_visibility
        │   │           │   ├── receiver: ∅
        │   │           │   ├── call_operator_loc: ∅
        │   │           │   ├── name: :bar
        │   │           │   ├── message_loc: (29,8)-(29,11) = "bar"
        │   │           │   ├── opening_loc: ∅
        │   │           │   ├── arguments: ∅
        │   │           │   ├── closing_loc: ∅
        │   │           │   └── block: ∅
        │   │           └── operator_loc: (29,6)-(29,7) = "="
        │   ├── consequent: ∅
        │   └── end_keyword_loc: (30,0)-(30,3) = "end"
        └── @ IfNode (location: (31,0)-(36,3))
            ├── if_keyword_loc: (31,0)-(31,2) = "if"
            ├── predicate:
            │   @ CallNode (location: (31,3)-(33,1))
            │   ├── flags: ignore_visibility
            │   ├── receiver: ∅
            │   ├── call_operator_loc: ∅
            │   ├── name: :foo
            │   ├── message_loc: (31,3)-(31,6) = "foo"
            │   ├── opening_loc: ∅
            │   ├── arguments: ∅
            │   ├── closing_loc: ∅
            │   └── block:
            │       @ BlockNode (location: (31,7)-(33,1))
            │       ├── locals: [:pair]
            │       ├── parameters:
            │       │   @ BlockParametersNode (location: (31,9)-(31,15))
            │       │   ├── parameters:
            │       │   │   @ ParametersNode (location: (31,10)-(31,14))
            │       │   │   ├── requireds: (length: 1)
            │       │   │   │   └── @ RequiredParameterNode (location: (31,10)-(31,14))
            │       │   │   │       ├── flags: ∅
            │       │   │   │       └── name: :pair
            │       │   │   ├── optionals: (length: 0)
            │       │   │   ├── rest: ∅
            │       │   │   ├── posts: (length: 0)
            │       │   │   ├── keywords: (length: 0)
            │       │   │   ├── keyword_rest: ∅
            │       │   │   └── block: ∅
            │       │   ├── locals: (length: 0)
            │       │   ├── opening_loc: (31,9)-(31,10) = "|"
            │       │   └── closing_loc: (31,14)-(31,15) = "|"
            │       ├── body:
            │       │   @ StatementsNode (location: (32,2)-(32,6))
            │       │   └── body: (length: 1)
            │       │       └── @ LocalVariableReadNode (location: (32,2)-(32,6))
            │       │           ├── name: :pair
            │       │           └── depth: 0
            │       ├── opening_loc: (31,7)-(31,8) = "{"
            │       └── closing_loc: (33,0)-(33,1) = "}"
            ├── then_keyword_loc: ∅
            ├── statements:
            │   @ StatementsNode (location: (34,2)-(35,5))
            │   └── body: (length: 2)
            │       ├── @ LocalVariableWriteNode (location: (34,2)-(34,13))
            │       │   ├── name: :pair
            │       │   ├── depth: 0
            │       │   ├── name_loc: (34,2)-(34,6) = "pair"
            │       │   ├── value:
            │       │   │   @ SymbolNode (location: (34,9)-(34,13))
            │       │   │   ├── flags: forced_us_ascii_encoding
            │       │   │   ├── opening_loc: (34,9)-(34,10) = ":"
            │       │   │   ├── value_loc: (34,10)-(34,13) = "foo"
            │       │   │   ├── closing_loc: ∅
            │       │   │   └── unescaped: "foo"
            │       │   └── operator_loc: (34,7)-(34,8) = "="
            │       └── @ LocalVariableReadNode (location: (35,2)-(35,5))
            │           ├── name: :foo
            │           └── depth: 0
            ├── consequent: ∅
            └── end_keyword_loc: (36,0)-(36,3) = "end"