Debian Codegraph @

test/prism/snapshots/unparser/corpus/literal/if.txt

raw
1 @ ProgramNode (location: (1,0)-(36,3))
2 ├── locals: [:foo, :pair]
3 └── statements:
4 @ StatementsNode (location: (1,0)-(36,3))
5 └── body: (length: 10)
6 ├── @ IfNode (location: (1,0)-(3,3))
7 │ ├── if_keyword_loc: (1,0)-(1,2) = "if"
8 │ ├── predicate:
9 │ │ @ MatchLastLineNode (location: (1,3)-(1,8))
10 │ │ ├── flags: ∅
11 │ │ ├── opening_loc: (1,3)-(1,4) = "/"
12 │ │ ├── content_loc: (1,4)-(1,7) = "foo"
13 │ │ ├── closing_loc: (1,7)-(1,8) = "/"
14 │ │ └── unescaped: "foo"
15 │ ├── then_keyword_loc: ∅
16 │ ├── statements:
17 │ │ @ StatementsNode (location: (2,2)-(2,5))
18 │ │ └── body: (length: 1)
19 │ │ └── @ CallNode (location: (2,2)-(2,5))
20 │ │ ├── flags: variable_call
21 │ │ ├── receiver: ∅
22 │ │ ├── call_operator_loc: ∅
23 │ │ ├── name: :bar
24 │ │ ├── message_loc: (2,2)-(2,5) = "bar"
25 │ │ ├── opening_loc: ∅
26 │ │ ├── arguments: ∅
27 │ │ ├── closing_loc: ∅
28 │ │ └── block: ∅
29 │ ├── consequent: ∅
30 │ └── end_keyword_loc: (3,0)-(3,3) = "end"
31 ├── @ IfNode (location: (4,0)-(6,3))
32 │ ├── if_keyword_loc: (4,0)-(4,2) = "if"
33 │ ├── predicate:
34 │ │ @ IntegerNode (location: (4,3)-(4,4))
35 │ │ └── flags: decimal
36 │ ├── then_keyword_loc: ∅
37 │ ├── statements:
38 │ │ @ StatementsNode (location: (5,2)-(5,3))
39 │ │ └── body: (length: 1)
40 │ │ └── @ IntegerNode (location: (5,2)-(5,3))
41 │ │ └── flags: decimal
42 │ ├── consequent: ∅
43 │ └── end_keyword_loc: (6,0)-(6,3) = "end"
44 ├── @ IfNode (location: (7,0)-(11,3))
45 │ ├── if_keyword_loc: (7,0)-(7,2) = "if"
46 │ ├── predicate:
47 │ │ @ IntegerNode (location: (7,3)-(7,4))
48 │ │ └── flags: decimal
49 │ ├── then_keyword_loc: ∅
50 │ ├── statements:
51 │ │ @ StatementsNode (location: (8,2)-(8,3))
52 │ │ └── body: (length: 1)
53 │ │ └── @ IntegerNode (location: (8,2)-(8,3))
54 │ │ └── flags: decimal
55 │ ├── consequent:
56 │ │ @ ElseNode (location: (9,0)-(11,3))
57 │ │ ├── else_keyword_loc: (9,0)-(9,4) = "else"
58 │ │ ├── statements:
59 │ │ │ @ StatementsNode (location: (10,2)-(10,3))
60 │ │ │ └── body: (length: 1)
61 │ │ │ └── @ IntegerNode (location: (10,2)-(10,3))
62 │ │ │ └── flags: decimal
63 │ │ └── end_keyword_loc: (11,0)-(11,3) = "end"
64 │ └── end_keyword_loc: (11,0)-(11,3) = "end"
65 ├── @ UnlessNode (location: (12,0)-(14,3))
66 │ ├── keyword_loc: (12,0)-(12,6) = "unless"
67 │ ├── predicate:
68 │ │ @ IntegerNode (location: (12,7)-(12,8))
69 │ │ └── flags: decimal
70 │ ├── then_keyword_loc: ∅
71 │ ├── statements:
72 │ │ @ StatementsNode (location: (13,2)-(13,5))
73 │ │ └── body: (length: 1)
74 │ │ └── @ NilNode (location: (13,2)-(13,5))
75 │ ├── consequent: ∅
76 │ └── end_keyword_loc: (14,0)-(14,3) = "end"
77 ├── @ UnlessNode (location: (15,0)-(17,3))
78 │ ├── keyword_loc: (15,0)-(15,6) = "unless"
79 │ ├── predicate:
80 │ │ @ IntegerNode (location: (15,7)-(15,8))
81 │ │ └── flags: decimal
82 │ ├── then_keyword_loc: ∅
83 │ ├── statements:
84 │ │ @ StatementsNode (location: (16,2)-(16,3))
85 │ │ └── body: (length: 1)
86 │ │ └── @ IntegerNode (location: (16,2)-(16,3))
87 │ │ └── flags: decimal
88 │ ├── consequent: ∅
89 │ └── end_keyword_loc: (17,0)-(17,3) = "end"
90 ├── @ IfNode (location: (18,0)-(19,3))
91 │ ├── if_keyword_loc: (18,0)-(18,2) = "if"
92 │ ├── predicate:
93 │ │ @ CallNode (location: (18,3)-(18,6))
94 │ │ ├── flags: variable_call
95 │ │ ├── receiver: ∅
96 │ │ ├── call_operator_loc: ∅
97 │ │ ├── name: :foo
98 │ │ ├── message_loc: (18,3)-(18,6) = "foo"
99 │ │ ├── opening_loc: ∅
100 │ │ ├── arguments: ∅
101 │ │ ├── closing_loc: ∅
102 │ │ └── block: ∅
103 │ ├── then_keyword_loc: ∅
104 │ ├── statements: ∅
105 │ ├── consequent: ∅
106 │ └── end_keyword_loc: (19,0)-(19,3) = "end"
107 ├── @ ModuleNode (location: (21,0)-(23,3))
108 │ ├── locals: [:foo]
109 │ ├── module_keyword_loc: (21,0)-(21,6) = "module"
110 │ ├── constant_path:
111 │ │ @ ConstantReadNode (location: (21,7)-(21,8))
112 │ │ └── name: :A
113 │ ├── body:
114 │ │ @ StatementsNode (location: (22,2)-(22,18))
115 │ │ └── body: (length: 1)
116 │ │ └── @ IfNode (location: (22,2)-(22,18))
117 │ │ ├── if_keyword_loc: (22,12)-(22,14) = "if"
118 │ │ ├── predicate:
119 │ │ │ @ LocalVariableReadNode (location: (22,15)-(22,18))
120 │ │ │ ├── name: :foo
121 │ │ │ └── depth: 0
122 │ │ ├── then_keyword_loc: ∅
123 │ │ ├── statements:
124 │ │ │ @ StatementsNode (location: (22,2)-(22,11))
125 │ │ │ └── body: (length: 1)
126 │ │ │ └── @ LocalVariableWriteNode (location: (22,2)-(22,11))
127 │ │ │ ├── name: :foo
128 │ │ │ ├── depth: 0
129 │ │ │ ├── name_loc: (22,2)-(22,5) = "foo"
130 │ │ │ ├── value:
131 │ │ │ │ @ CallNode (location: (22,8)-(22,11))
132 │ │ │ │ ├── flags: variable_call
133 │ │ │ │ ├── receiver: ∅
134 │ │ │ │ ├── call_operator_loc: ∅
135 │ │ │ │ ├── name: :bar
136 │ │ │ │ ├── message_loc: (22,8)-(22,11) = "bar"
137 │ │ │ │ ├── opening_loc: ∅
138 │ │ │ │ ├── arguments: ∅
139 │ │ │ │ ├── closing_loc: ∅
140 │ │ │ │ └── block: ∅
141 │ │ │ └── operator_loc: (22,6)-(22,7) = "="
142 │ │ ├── consequent: ∅
143 │ │ └── end_keyword_loc: ∅
144 │ ├── end_keyword_loc: (23,0)-(23,3) = "end"
145 │ └── name: :A
146 ├── @ ModuleNode (location: (25,0)-(27,3))
147 │ ├── locals: [:foo]
148 │ ├── module_keyword_loc: (25,0)-(25,6) = "module"
149 │ ├── constant_path:
150 │ │ @ ConstantReadNode (location: (25,7)-(25,8))
151 │ │ └── name: :B
152 │ ├── body:
153 │ │ @ StatementsNode (location: (26,2)-(26,22))
154 │ │ └── body: (length: 1)
155 │ │ └── @ UnlessNode (location: (26,2)-(26,22))
156 │ │ ├── keyword_loc: (26,12)-(26,18) = "unless"
157 │ │ ├── predicate:
158 │ │ │ @ LocalVariableReadNode (location: (26,19)-(26,22))
159 │ │ │ ├── name: :foo
160 │ │ │ └── depth: 0
161 │ │ ├── then_keyword_loc: ∅
162 │ │ ├── statements:
163 │ │ │ @ StatementsNode (location: (26,2)-(26,11))
164 │ │ │ └── body: (length: 1)
165 │ │ │ └── @ LocalVariableWriteNode (location: (26,2)-(26,11))
166 │ │ │ ├── name: :foo
167 │ │ │ ├── depth: 0
168 │ │ │ ├── name_loc: (26,2)-(26,5) = "foo"
169 │ │ │ ├── value:
170 │ │ │ │ @ CallNode (location: (26,8)-(26,11))
171 │ │ │ │ ├── flags: variable_call
172 │ │ │ │ ├── receiver: ∅
173 │ │ │ │ ├── call_operator_loc: ∅
174 │ │ │ │ ├── name: :bar
175 │ │ │ │ ├── message_loc: (26,8)-(26,11) = "bar"
176 │ │ │ │ ├── opening_loc: ∅
177 │ │ │ │ ├── arguments: ∅
178 │ │ │ │ ├── closing_loc: ∅
179 │ │ │ │ └── block: ∅
180 │ │ │ └── operator_loc: (26,6)-(26,7) = "="
181 │ │ ├── consequent: ∅
182 │ │ └── end_keyword_loc: ∅
183 │ ├── end_keyword_loc: (27,0)-(27,3) = "end"
184 │ └── name: :B
185 ├── @ UnlessNode (location: (28,0)-(30,3))
186 │ ├── keyword_loc: (28,0)-(28,6) = "unless"
187 │ ├── predicate:
188 │ │ @ CallNode (location: (28,7)-(28,10))
189 │ │ ├── flags: variable_call
190 │ │ ├── receiver: ∅
191 │ │ ├── call_operator_loc: ∅
192 │ │ ├── name: :foo
193 │ │ ├── message_loc: (28,7)-(28,10) = "foo"
194 │ │ ├── opening_loc: ∅
195 │ │ ├── arguments: ∅
196 │ │ ├── closing_loc: ∅
197 │ │ └── block: ∅
198 │ ├── then_keyword_loc: ∅
199 │ ├── statements:
200 │ │ @ StatementsNode (location: (29,2)-(29,11))
201 │ │ └── body: (length: 1)
202 │ │ └── @ LocalVariableWriteNode (location: (29,2)-(29,11))
203 │ │ ├── name: :foo
204 │ │ ├── depth: 0
205 │ │ ├── name_loc: (29,2)-(29,5) = "foo"
206 │ │ ├── value:
207 │ │ │ @ CallNode (location: (29,8)-(29,11))
208 │ │ │ ├── flags: variable_call
209 │ │ │ ├── receiver: ∅
210 │ │ │ ├── call_operator_loc: ∅
211 │ │ │ ├── name: :bar
212 │ │ │ ├── message_loc: (29,8)-(29,11) = "bar"
213 │ │ │ ├── opening_loc: ∅
214 │ │ │ ├── arguments: ∅
215 │ │ │ ├── closing_loc: ∅
216 │ │ │ └── block: ∅
217 │ │ └── operator_loc: (29,6)-(29,7) = "="
218 │ ├── consequent: ∅
219 │ └── end_keyword_loc: (30,0)-(30,3) = "end"
220 └── @ IfNode (location: (31,0)-(36,3))
221 ├── if_keyword_loc: (31,0)-(31,2) = "if"
222 ├── predicate:
223 │ @ CallNode (location: (31,3)-(33,1))
224 │ ├── flags: ∅
225 │ ├── receiver: ∅
226 │ ├── call_operator_loc: ∅
227 │ ├── name: :foo
228 │ ├── message_loc: (31,3)-(31,6) = "foo"
229 │ ├── opening_loc: ∅
230 │ ├── arguments: ∅
231 │ ├── closing_loc: ∅
232 │ └── block:
233 │ @ BlockNode (location: (31,7)-(33,1))
234 │ ├── locals: [:pair]
235 │ ├── locals_body_index: 1
236 │ ├── parameters:
237 │ │ @ BlockParametersNode (location: (31,9)-(31,15))
238 │ │ ├── parameters:
239 │ │ │ @ ParametersNode (location: (31,10)-(31,14))
240 │ │ │ ├── requireds: (length: 1)
241 │ │ │ │ └── @ RequiredParameterNode (location: (31,10)-(31,14))
242 │ │ │ │ └── name: :pair
243 │ │ │ ├── optionals: (length: 0)
244 │ │ │ ├── rest: ∅
245 │ │ │ ├── posts: (length: 0)
246 │ │ │ ├── keywords: (length: 0)
247 │ │ │ ├── keyword_rest: ∅
248 │ │ │ └── block: ∅
249 │ │ ├── locals: (length: 0)
250 │ │ ├── opening_loc: (31,9)-(31,10) = "|"
251 │ │ └── closing_loc: (31,14)-(31,15) = "|"
252 │ ├── body:
253 │ │ @ StatementsNode (location: (32,2)-(32,6))
254 │ │ └── body: (length: 1)
255 │ │ └── @ LocalVariableReadNode (location: (32,2)-(32,6))
256 │ │ ├── name: :pair
257 │ │ └── depth: 0
258 │ ├── opening_loc: (31,7)-(31,8) = "{"
259 │ └── closing_loc: (33,0)-(33,1) = "}"
260 ├── then_keyword_loc: ∅
261 ├── statements:
262 │ @ StatementsNode (location: (34,2)-(35,5))
263 │ └── body: (length: 2)
264 │ ├── @ LocalVariableWriteNode (location: (34,2)-(34,13))
265 │ │ ├── name: :pair
266 │ │ ├── depth: 0
267 │ │ ├── name_loc: (34,2)-(34,6) = "pair"
268 │ │ ├── value:
269 │ │ │ @ SymbolNode (location: (34,9)-(34,13))
270 │ │ │ ├── flags: ∅
271 │ │ │ ├── opening_loc: (34,9)-(34,10) = ":"
272 │ │ │ ├── value_loc: (34,10)-(34,13) = "foo"
273 │ │ │ ├── closing_loc: ∅
274 │ │ │ └── unescaped: "foo"
275 │ │ └── operator_loc: (34,7)-(34,8) = "="
276 │ └── @ LocalVariableReadNode (location: (35,2)-(35,5))
277 │ ├── name: :foo
278 │ └── depth: 0
279 ├── consequent: ∅
280 └── end_keyword_loc: (36,0)-(36,3) = "end"