1---
2source: full-moon/tests/pass_cases.rs
3expression: ast.nodes()
4input_file: full-moon/tests/cases/pass/if-3
5
6---
7stmts:
8  - - If:
9        if_token:
10          leading_trivia: []
11          token:
12            start_position:
13              bytes: 0
14              line: 1
15              character: 1
16            end_position:
17              bytes: 2
18              line: 1
19              character: 3
20            token_type:
21              type: Symbol
22              symbol: if
23          trailing_trivia:
24            - start_position:
25                bytes: 2
26                line: 1
27                character: 3
28              end_position:
29                bytes: 3
30                line: 1
31                character: 4
32              token_type:
33                type: Whitespace
34                characters: " "
35        condition:
36          value:
37            Var:
38              Name:
39                leading_trivia: []
40                token:
41                  start_position:
42                    bytes: 3
43                    line: 1
44                    character: 4
45                  end_position:
46                    bytes: 4
47                    line: 1
48                    character: 5
49                  token_type:
50                    type: Identifier
51                    identifier: x
52                trailing_trivia:
53                  - start_position:
54                      bytes: 4
55                      line: 1
56                      character: 5
57                    end_position:
58                      bytes: 5
59                      line: 1
60                      character: 6
61                    token_type:
62                      type: Whitespace
63                      characters: " "
64        then_token:
65          leading_trivia: []
66          token:
67            start_position:
68              bytes: 5
69              line: 1
70              character: 6
71            end_position:
72              bytes: 9
73              line: 1
74              character: 10
75            token_type:
76              type: Symbol
77              symbol: then
78          trailing_trivia:
79            - start_position:
80                bytes: 9
81                line: 1
82                character: 10
83              end_position:
84                bytes: 10
85                line: 1
86                character: 10
87              token_type:
88                type: Whitespace
89                characters: "\n"
90        block:
91          stmts:
92            - - FunctionCall:
93                  prefix:
94                    Name:
95                      leading_trivia:
96                        - start_position:
97                            bytes: 10
98                            line: 2
99                            character: 1
100                          end_position:
101                            bytes: 11
102                            line: 2
103                            character: 2
104                          token_type:
105                            type: Whitespace
106                            characters: "\t"
107                      token:
108                        start_position:
109                          bytes: 11
110                          line: 2
111                          character: 2
112                        end_position:
113                          bytes: 14
114                          line: 2
115                          character: 5
116                        token_type:
117                          type: Identifier
118                          identifier: foo
119                      trailing_trivia: []
120                  suffixes:
121                    - Call:
122                        AnonymousCall:
123                          Parentheses:
124                            parentheses:
125                              tokens:
126                                - leading_trivia: []
127                                  token:
128                                    start_position:
129                                      bytes: 14
130                                      line: 2
131                                      character: 5
132                                    end_position:
133                                      bytes: 15
134                                      line: 2
135                                      character: 6
136                                    token_type:
137                                      type: Symbol
138                                      symbol: (
139                                  trailing_trivia: []
140                                - leading_trivia: []
141                                  token:
142                                    start_position:
143                                      bytes: 15
144                                      line: 2
145                                      character: 6
146                                    end_position:
147                                      bytes: 16
148                                      line: 2
149                                      character: 7
150                                    token_type:
151                                      type: Symbol
152                                      symbol: )
153                                  trailing_trivia:
154                                    - start_position:
155                                        bytes: 16
156                                        line: 2
157                                        character: 7
158                                      end_position:
159                                        bytes: 17
160                                        line: 2
161                                        character: 7
162                                      token_type:
163                                        type: Whitespace
164                                        characters: "\n"
165                            arguments:
166                              pairs: []
167              - ~
168        else_if:
169          - else_if_token:
170              leading_trivia: []
171              token:
172                start_position:
173                  bytes: 17
174                  line: 3
175                  character: 1
176                end_position:
177                  bytes: 23
178                  line: 3
179                  character: 7
180                token_type:
181                  type: Symbol
182                  symbol: elseif
183              trailing_trivia:
184                - start_position:
185                    bytes: 23
186                    line: 3
187                    character: 7
188                  end_position:
189                    bytes: 24
190                    line: 3
191                    character: 8
192                  token_type:
193                    type: Whitespace
194                    characters: " "
195            condition:
196              value:
197                Var:
198                  Name:
199                    leading_trivia: []
200                    token:
201                      start_position:
202                        bytes: 24
203                        line: 3
204                        character: 8
205                      end_position:
206                        bytes: 25
207                        line: 3
208                        character: 9
209                      token_type:
210                        type: Identifier
211                        identifier: y
212                    trailing_trivia:
213                      - start_position:
214                          bytes: 25
215                          line: 3
216                          character: 9
217                        end_position:
218                          bytes: 26
219                          line: 3
220                          character: 10
221                        token_type:
222                          type: Whitespace
223                          characters: " "
224            then_token:
225              leading_trivia: []
226              token:
227                start_position:
228                  bytes: 26
229                  line: 3
230                  character: 10
231                end_position:
232                  bytes: 30
233                  line: 3
234                  character: 14
235                token_type:
236                  type: Symbol
237                  symbol: then
238              trailing_trivia:
239                - start_position:
240                    bytes: 30
241                    line: 3
242                    character: 14
243                  end_position:
244                    bytes: 31
245                    line: 3
246                    character: 14
247                  token_type:
248                    type: Whitespace
249                    characters: "\n"
250            block:
251              stmts:
252                - - FunctionCall:
253                      prefix:
254                        Name:
255                          leading_trivia:
256                            - start_position:
257                                bytes: 31
258                                line: 4
259                                character: 1
260                              end_position:
261                                bytes: 32
262                                line: 4
263                                character: 2
264                              token_type:
265                                type: Whitespace
266                                characters: "\t"
267                          token:
268                            start_position:
269                              bytes: 32
270                              line: 4
271                              character: 2
272                            end_position:
273                              bytes: 35
274                              line: 4
275                              character: 5
276                            token_type:
277                              type: Identifier
278                              identifier: bar
279                          trailing_trivia: []
280                      suffixes:
281                        - Call:
282                            AnonymousCall:
283                              Parentheses:
284                                parentheses:
285                                  tokens:
286                                    - leading_trivia: []
287                                      token:
288                                        start_position:
289                                          bytes: 35
290                                          line: 4
291                                          character: 5
292                                        end_position:
293                                          bytes: 36
294                                          line: 4
295                                          character: 6
296                                        token_type:
297                                          type: Symbol
298                                          symbol: (
299                                      trailing_trivia: []
300                                    - leading_trivia: []
301                                      token:
302                                        start_position:
303                                          bytes: 36
304                                          line: 4
305                                          character: 6
306                                        end_position:
307                                          bytes: 37
308                                          line: 4
309                                          character: 7
310                                        token_type:
311                                          type: Symbol
312                                          symbol: )
313                                      trailing_trivia:
314                                        - start_position:
315                                            bytes: 37
316                                            line: 4
317                                            character: 7
318                                          end_position:
319                                            bytes: 38
320                                            line: 4
321                                            character: 7
322                                          token_type:
323                                            type: Whitespace
324                                            characters: "\n"
325                                arguments:
326                                  pairs: []
327                  - ~
328        else_token: ~
329        else: ~
330        end_token:
331          leading_trivia: []
332          token:
333            start_position:
334              bytes: 38
335              line: 5
336              character: 1
337            end_position:
338              bytes: 41
339              line: 5
340              character: 4
341            token_type:
342              type: Symbol
343              symbol: end
344          trailing_trivia: []
345    - ~
346
347