yarp 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/yarp/api_node.c CHANGED
@@ -25,14 +25,15 @@ static VALUE rb_cYARPAssocSplatNode;
25
25
  static VALUE rb_cYARPBackReferenceReadNode;
26
26
  static VALUE rb_cYARPBeginNode;
27
27
  static VALUE rb_cYARPBlockArgumentNode;
28
+ static VALUE rb_cYARPBlockLocalVariableNode;
28
29
  static VALUE rb_cYARPBlockNode;
29
30
  static VALUE rb_cYARPBlockParameterNode;
30
31
  static VALUE rb_cYARPBlockParametersNode;
31
32
  static VALUE rb_cYARPBreakNode;
33
+ static VALUE rb_cYARPCallAndWriteNode;
32
34
  static VALUE rb_cYARPCallNode;
33
- static VALUE rb_cYARPCallOperatorAndWriteNode;
34
- static VALUE rb_cYARPCallOperatorOrWriteNode;
35
35
  static VALUE rb_cYARPCallOperatorWriteNode;
36
+ static VALUE rb_cYARPCallOrWriteNode;
36
37
  static VALUE rb_cYARPCapturePatternNode;
37
38
  static VALUE rb_cYARPCaseNode;
38
39
  static VALUE rb_cYARPClassNode;
@@ -104,6 +105,7 @@ static VALUE rb_cYARPMatchPredicateNode;
104
105
  static VALUE rb_cYARPMatchRequiredNode;
105
106
  static VALUE rb_cYARPMissingNode;
106
107
  static VALUE rb_cYARPModuleNode;
108
+ static VALUE rb_cYARPMultiTargetNode;
107
109
  static VALUE rb_cYARPMultiWriteNode;
108
110
  static VALUE rb_cYARPNextNode;
109
111
  static VALUE rb_cYARPNilNode;
@@ -176,8 +178,8 @@ yp_string_new(yp_string_t *string, rb_encoding *encoding) {
176
178
 
177
179
  // Create a YARP::Source object from the given parser.
178
180
  VALUE
179
- yp_source_new(yp_parser_t *parser) {
180
- VALUE source = rb_str_new((const char *) parser->start, parser->end - parser->start);
181
+ yp_source_new(yp_parser_t *parser, rb_encoding *encoding) {
182
+ VALUE source = rb_enc_str_new((const char *) parser->start, parser->end - parser->start, encoding);
181
183
  VALUE offsets = rb_ary_new_capa(parser->newline_list.size);
182
184
 
183
185
  for (size_t index = 0; index < parser->newline_list.size; index++) {
@@ -216,7 +218,7 @@ yp_node_stack_pop(yp_node_stack_node_t **stack) {
216
218
 
217
219
  VALUE
218
220
  yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
219
- VALUE source = yp_source_new(parser);
221
+ VALUE source = yp_source_new(parser, encoding);
220
222
  ID *constants = calloc(parser->constant_pool.size, sizeof(ID));
221
223
 
222
224
  for (size_t index = 0; index < parser->constant_pool.capacity; index++) {
@@ -244,28 +246,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
244
246
 
245
247
  switch (YP_NODE_TYPE(node)) {
246
248
  #line 111 "api_node.c.erb"
247
- case YP_NODE_ALIAS_NODE: {
249
+ case YP_ALIAS_NODE: {
248
250
  yp_alias_node_t *cast = (yp_alias_node_t *) node;
249
251
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->new_name);
250
252
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->old_name);
251
253
  break;
252
254
  }
253
255
  #line 111 "api_node.c.erb"
254
- case YP_NODE_ALTERNATION_PATTERN_NODE: {
256
+ case YP_ALTERNATION_PATTERN_NODE: {
255
257
  yp_alternation_pattern_node_t *cast = (yp_alternation_pattern_node_t *) node;
256
258
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
257
259
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
258
260
  break;
259
261
  }
260
262
  #line 111 "api_node.c.erb"
261
- case YP_NODE_AND_NODE: {
263
+ case YP_AND_NODE: {
262
264
  yp_and_node_t *cast = (yp_and_node_t *) node;
263
265
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
264
266
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
265
267
  break;
266
268
  }
267
269
  #line 111 "api_node.c.erb"
268
- case YP_NODE_ARGUMENTS_NODE: {
270
+ case YP_ARGUMENTS_NODE: {
269
271
  yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
270
272
  for (size_t index = 0; index < cast->arguments.size; index++) {
271
273
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments.nodes[index]);
@@ -273,7 +275,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
273
275
  break;
274
276
  }
275
277
  #line 111 "api_node.c.erb"
276
- case YP_NODE_ARRAY_NODE: {
278
+ case YP_ARRAY_NODE: {
277
279
  yp_array_node_t *cast = (yp_array_node_t *) node;
278
280
  for (size_t index = 0; index < cast->elements.size; index++) {
279
281
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
@@ -281,7 +283,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
281
283
  break;
282
284
  }
283
285
  #line 111 "api_node.c.erb"
284
- case YP_NODE_ARRAY_PATTERN_NODE: {
286
+ case YP_ARRAY_PATTERN_NODE: {
285
287
  yp_array_pattern_node_t *cast = (yp_array_pattern_node_t *) node;
286
288
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
287
289
  for (size_t index = 0; index < cast->requireds.size; index++) {
@@ -294,20 +296,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
294
296
  break;
295
297
  }
296
298
  #line 111 "api_node.c.erb"
297
- case YP_NODE_ASSOC_NODE: {
299
+ case YP_ASSOC_NODE: {
298
300
  yp_assoc_node_t *cast = (yp_assoc_node_t *) node;
299
301
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->key);
300
302
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
301
303
  break;
302
304
  }
303
305
  #line 111 "api_node.c.erb"
304
- case YP_NODE_ASSOC_SPLAT_NODE: {
306
+ case YP_ASSOC_SPLAT_NODE: {
305
307
  yp_assoc_splat_node_t *cast = (yp_assoc_splat_node_t *) node;
306
308
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
307
309
  break;
308
310
  }
309
311
  #line 111 "api_node.c.erb"
310
- case YP_NODE_BEGIN_NODE: {
312
+ case YP_BEGIN_NODE: {
311
313
  yp_begin_node_t *cast = (yp_begin_node_t *) node;
312
314
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
313
315
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->rescue_clause);
@@ -316,68 +318,74 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
316
318
  break;
317
319
  }
318
320
  #line 111 "api_node.c.erb"
319
- case YP_NODE_BLOCK_ARGUMENT_NODE: {
321
+ case YP_BLOCK_ARGUMENT_NODE: {
320
322
  yp_block_argument_node_t *cast = (yp_block_argument_node_t *) node;
321
323
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
322
324
  break;
323
325
  }
324
326
  #line 111 "api_node.c.erb"
325
- case YP_NODE_BLOCK_NODE: {
327
+ case YP_BLOCK_NODE: {
326
328
  yp_block_node_t *cast = (yp_block_node_t *) node;
327
329
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
328
330
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
329
331
  break;
330
332
  }
331
333
  #line 111 "api_node.c.erb"
332
- case YP_NODE_BLOCK_PARAMETERS_NODE: {
334
+ case YP_BLOCK_PARAMETERS_NODE: {
333
335
  yp_block_parameters_node_t *cast = (yp_block_parameters_node_t *) node;
334
336
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
337
+ for (size_t index = 0; index < cast->locals.size; index++) {
338
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->locals.nodes[index]);
339
+ }
335
340
  break;
336
341
  }
337
342
  #line 111 "api_node.c.erb"
338
- case YP_NODE_BREAK_NODE: {
343
+ case YP_BREAK_NODE: {
339
344
  yp_break_node_t *cast = (yp_break_node_t *) node;
340
345
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
341
346
  break;
342
347
  }
343
348
  #line 111 "api_node.c.erb"
344
- case YP_NODE_CALL_NODE: {
345
- yp_call_node_t *cast = (yp_call_node_t *) node;
349
+ case YP_CALL_AND_WRITE_NODE: {
350
+ yp_call_and_write_node_t *cast = (yp_call_and_write_node_t *) node;
346
351
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
347
352
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
348
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
353
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
349
354
  break;
350
355
  }
351
356
  #line 111 "api_node.c.erb"
352
- case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE: {
353
- yp_call_operator_and_write_node_t *cast = (yp_call_operator_and_write_node_t *) node;
354
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
355
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
357
+ case YP_CALL_NODE: {
358
+ yp_call_node_t *cast = (yp_call_node_t *) node;
359
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
360
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
361
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
356
362
  break;
357
363
  }
358
364
  #line 111 "api_node.c.erb"
359
- case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE: {
360
- yp_call_operator_or_write_node_t *cast = (yp_call_operator_or_write_node_t *) node;
361
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
365
+ case YP_CALL_OPERATOR_WRITE_NODE: {
366
+ yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
367
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
368
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
362
369
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
363
370
  break;
364
371
  }
365
372
  #line 111 "api_node.c.erb"
366
- case YP_NODE_CALL_OPERATOR_WRITE_NODE: {
367
- yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
368
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
373
+ case YP_CALL_OR_WRITE_NODE: {
374
+ yp_call_or_write_node_t *cast = (yp_call_or_write_node_t *) node;
375
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
376
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
369
377
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
370
378
  break;
371
379
  }
372
380
  #line 111 "api_node.c.erb"
373
- case YP_NODE_CAPTURE_PATTERN_NODE: {
381
+ case YP_CAPTURE_PATTERN_NODE: {
374
382
  yp_capture_pattern_node_t *cast = (yp_capture_pattern_node_t *) node;
375
383
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
376
384
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
377
385
  break;
378
386
  }
379
387
  #line 111 "api_node.c.erb"
380
- case YP_NODE_CASE_NODE: {
388
+ case YP_CASE_NODE: {
381
389
  yp_case_node_t *cast = (yp_case_node_t *) node;
382
390
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
383
391
  for (size_t index = 0; index < cast->conditions.size; index++) {
@@ -387,7 +395,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
387
395
  break;
388
396
  }
389
397
  #line 111 "api_node.c.erb"
390
- case YP_NODE_CLASS_NODE: {
398
+ case YP_CLASS_NODE: {
391
399
  yp_class_node_t *cast = (yp_class_node_t *) node;
392
400
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant_path);
393
401
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->superclass);
@@ -395,97 +403,97 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
395
403
  break;
396
404
  }
397
405
  #line 111 "api_node.c.erb"
398
- case YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE: {
406
+ case YP_CLASS_VARIABLE_AND_WRITE_NODE: {
399
407
  yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
400
408
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
401
409
  break;
402
410
  }
403
411
  #line 111 "api_node.c.erb"
404
- case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
412
+ case YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
405
413
  yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
406
414
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
407
415
  break;
408
416
  }
409
417
  #line 111 "api_node.c.erb"
410
- case YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE: {
418
+ case YP_CLASS_VARIABLE_OR_WRITE_NODE: {
411
419
  yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
412
420
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
413
421
  break;
414
422
  }
415
423
  #line 111 "api_node.c.erb"
416
- case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
424
+ case YP_CLASS_VARIABLE_WRITE_NODE: {
417
425
  yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
418
426
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
419
427
  break;
420
428
  }
421
429
  #line 111 "api_node.c.erb"
422
- case YP_NODE_CONSTANT_AND_WRITE_NODE: {
430
+ case YP_CONSTANT_AND_WRITE_NODE: {
423
431
  yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
424
432
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
425
433
  break;
426
434
  }
427
435
  #line 111 "api_node.c.erb"
428
- case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
436
+ case YP_CONSTANT_OPERATOR_WRITE_NODE: {
429
437
  yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
430
438
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
431
439
  break;
432
440
  }
433
441
  #line 111 "api_node.c.erb"
434
- case YP_NODE_CONSTANT_OR_WRITE_NODE: {
442
+ case YP_CONSTANT_OR_WRITE_NODE: {
435
443
  yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
436
444
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
437
445
  break;
438
446
  }
439
447
  #line 111 "api_node.c.erb"
440
- case YP_NODE_CONSTANT_PATH_AND_WRITE_NODE: {
448
+ case YP_CONSTANT_PATH_AND_WRITE_NODE: {
441
449
  yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
442
450
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
443
451
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
444
452
  break;
445
453
  }
446
454
  #line 111 "api_node.c.erb"
447
- case YP_NODE_CONSTANT_PATH_NODE: {
455
+ case YP_CONSTANT_PATH_NODE: {
448
456
  yp_constant_path_node_t *cast = (yp_constant_path_node_t *) node;
449
457
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parent);
450
458
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
451
459
  break;
452
460
  }
453
461
  #line 111 "api_node.c.erb"
454
- case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
462
+ case YP_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
455
463
  yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
456
464
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
457
465
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
458
466
  break;
459
467
  }
460
468
  #line 111 "api_node.c.erb"
461
- case YP_NODE_CONSTANT_PATH_OR_WRITE_NODE: {
469
+ case YP_CONSTANT_PATH_OR_WRITE_NODE: {
462
470
  yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
463
471
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
464
472
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
465
473
  break;
466
474
  }
467
475
  #line 111 "api_node.c.erb"
468
- case YP_NODE_CONSTANT_PATH_TARGET_NODE: {
476
+ case YP_CONSTANT_PATH_TARGET_NODE: {
469
477
  yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
470
478
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parent);
471
479
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
472
480
  break;
473
481
  }
474
482
  #line 111 "api_node.c.erb"
475
- case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
483
+ case YP_CONSTANT_PATH_WRITE_NODE: {
476
484
  yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
477
485
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
478
486
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
479
487
  break;
480
488
  }
481
489
  #line 111 "api_node.c.erb"
482
- case YP_NODE_CONSTANT_WRITE_NODE: {
490
+ case YP_CONSTANT_WRITE_NODE: {
483
491
  yp_constant_write_node_t *cast = (yp_constant_write_node_t *) node;
484
492
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
485
493
  break;
486
494
  }
487
495
  #line 111 "api_node.c.erb"
488
- case YP_NODE_DEF_NODE: {
496
+ case YP_DEF_NODE: {
489
497
  yp_def_node_t *cast = (yp_def_node_t *) node;
490
498
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
491
499
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
@@ -493,37 +501,37 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
493
501
  break;
494
502
  }
495
503
  #line 111 "api_node.c.erb"
496
- case YP_NODE_DEFINED_NODE: {
504
+ case YP_DEFINED_NODE: {
497
505
  yp_defined_node_t *cast = (yp_defined_node_t *) node;
498
506
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
499
507
  break;
500
508
  }
501
509
  #line 111 "api_node.c.erb"
502
- case YP_NODE_ELSE_NODE: {
510
+ case YP_ELSE_NODE: {
503
511
  yp_else_node_t *cast = (yp_else_node_t *) node;
504
512
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
505
513
  break;
506
514
  }
507
515
  #line 111 "api_node.c.erb"
508
- case YP_NODE_EMBEDDED_STATEMENTS_NODE: {
516
+ case YP_EMBEDDED_STATEMENTS_NODE: {
509
517
  yp_embedded_statements_node_t *cast = (yp_embedded_statements_node_t *) node;
510
518
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
511
519
  break;
512
520
  }
513
521
  #line 111 "api_node.c.erb"
514
- case YP_NODE_EMBEDDED_VARIABLE_NODE: {
522
+ case YP_EMBEDDED_VARIABLE_NODE: {
515
523
  yp_embedded_variable_node_t *cast = (yp_embedded_variable_node_t *) node;
516
524
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->variable);
517
525
  break;
518
526
  }
519
527
  #line 111 "api_node.c.erb"
520
- case YP_NODE_ENSURE_NODE: {
528
+ case YP_ENSURE_NODE: {
521
529
  yp_ensure_node_t *cast = (yp_ensure_node_t *) node;
522
530
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
523
531
  break;
524
532
  }
525
533
  #line 111 "api_node.c.erb"
526
- case YP_NODE_FIND_PATTERN_NODE: {
534
+ case YP_FIND_PATTERN_NODE: {
527
535
  yp_find_pattern_node_t *cast = (yp_find_pattern_node_t *) node;
528
536
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
529
537
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
@@ -534,14 +542,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
534
542
  break;
535
543
  }
536
544
  #line 111 "api_node.c.erb"
537
- case YP_NODE_FLIP_FLOP_NODE: {
545
+ case YP_FLIP_FLOP_NODE: {
538
546
  yp_flip_flop_node_t *cast = (yp_flip_flop_node_t *) node;
539
547
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
540
548
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
541
549
  break;
542
550
  }
543
551
  #line 111 "api_node.c.erb"
544
- case YP_NODE_FOR_NODE: {
552
+ case YP_FOR_NODE: {
545
553
  yp_for_node_t *cast = (yp_for_node_t *) node;
546
554
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->index);
547
555
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->collection);
@@ -549,37 +557,37 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
549
557
  break;
550
558
  }
551
559
  #line 111 "api_node.c.erb"
552
- case YP_NODE_FORWARDING_SUPER_NODE: {
560
+ case YP_FORWARDING_SUPER_NODE: {
553
561
  yp_forwarding_super_node_t *cast = (yp_forwarding_super_node_t *) node;
554
562
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
555
563
  break;
556
564
  }
557
565
  #line 111 "api_node.c.erb"
558
- case YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE: {
566
+ case YP_GLOBAL_VARIABLE_AND_WRITE_NODE: {
559
567
  yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
560
568
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
561
569
  break;
562
570
  }
563
571
  #line 111 "api_node.c.erb"
564
- case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
572
+ case YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
565
573
  yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
566
574
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
567
575
  break;
568
576
  }
569
577
  #line 111 "api_node.c.erb"
570
- case YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE: {
578
+ case YP_GLOBAL_VARIABLE_OR_WRITE_NODE: {
571
579
  yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
572
580
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
573
581
  break;
574
582
  }
575
583
  #line 111 "api_node.c.erb"
576
- case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
584
+ case YP_GLOBAL_VARIABLE_WRITE_NODE: {
577
585
  yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
578
586
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
579
587
  break;
580
588
  }
581
589
  #line 111 "api_node.c.erb"
582
- case YP_NODE_HASH_NODE: {
590
+ case YP_HASH_NODE: {
583
591
  yp_hash_node_t *cast = (yp_hash_node_t *) node;
584
592
  for (size_t index = 0; index < cast->elements.size; index++) {
585
593
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
@@ -587,7 +595,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
587
595
  break;
588
596
  }
589
597
  #line 111 "api_node.c.erb"
590
- case YP_NODE_HASH_PATTERN_NODE: {
598
+ case YP_HASH_PATTERN_NODE: {
591
599
  yp_hash_pattern_node_t *cast = (yp_hash_pattern_node_t *) node;
592
600
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
593
601
  for (size_t index = 0; index < cast->assocs.size; index++) {
@@ -597,7 +605,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
597
605
  break;
598
606
  }
599
607
  #line 111 "api_node.c.erb"
600
- case YP_NODE_IF_NODE: {
608
+ case YP_IF_NODE: {
601
609
  yp_if_node_t *cast = (yp_if_node_t *) node;
602
610
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
603
611
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
@@ -605,44 +613,44 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
605
613
  break;
606
614
  }
607
615
  #line 111 "api_node.c.erb"
608
- case YP_NODE_IMAGINARY_NODE: {
616
+ case YP_IMAGINARY_NODE: {
609
617
  yp_imaginary_node_t *cast = (yp_imaginary_node_t *) node;
610
618
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->numeric);
611
619
  break;
612
620
  }
613
621
  #line 111 "api_node.c.erb"
614
- case YP_NODE_IN_NODE: {
622
+ case YP_IN_NODE: {
615
623
  yp_in_node_t *cast = (yp_in_node_t *) node;
616
624
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
617
625
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
618
626
  break;
619
627
  }
620
628
  #line 111 "api_node.c.erb"
621
- case YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE: {
629
+ case YP_INSTANCE_VARIABLE_AND_WRITE_NODE: {
622
630
  yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
623
631
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
624
632
  break;
625
633
  }
626
634
  #line 111 "api_node.c.erb"
627
- case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
635
+ case YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
628
636
  yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
629
637
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
630
638
  break;
631
639
  }
632
640
  #line 111 "api_node.c.erb"
633
- case YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE: {
641
+ case YP_INSTANCE_VARIABLE_OR_WRITE_NODE: {
634
642
  yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
635
643
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
636
644
  break;
637
645
  }
638
646
  #line 111 "api_node.c.erb"
639
- case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
647
+ case YP_INSTANCE_VARIABLE_WRITE_NODE: {
640
648
  yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
641
649
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
642
650
  break;
643
651
  }
644
652
  #line 111 "api_node.c.erb"
645
- case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
653
+ case YP_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
646
654
  yp_interpolated_regular_expression_node_t *cast = (yp_interpolated_regular_expression_node_t *) node;
647
655
  for (size_t index = 0; index < cast->parts.size; index++) {
648
656
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
@@ -650,7 +658,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
650
658
  break;
651
659
  }
652
660
  #line 111 "api_node.c.erb"
653
- case YP_NODE_INTERPOLATED_STRING_NODE: {
661
+ case YP_INTERPOLATED_STRING_NODE: {
654
662
  yp_interpolated_string_node_t *cast = (yp_interpolated_string_node_t *) node;
655
663
  for (size_t index = 0; index < cast->parts.size; index++) {
656
664
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
@@ -658,7 +666,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
658
666
  break;
659
667
  }
660
668
  #line 111 "api_node.c.erb"
661
- case YP_NODE_INTERPOLATED_SYMBOL_NODE: {
669
+ case YP_INTERPOLATED_SYMBOL_NODE: {
662
670
  yp_interpolated_symbol_node_t *cast = (yp_interpolated_symbol_node_t *) node;
663
671
  for (size_t index = 0; index < cast->parts.size; index++) {
664
672
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
@@ -666,7 +674,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
666
674
  break;
667
675
  }
668
676
  #line 111 "api_node.c.erb"
669
- case YP_NODE_INTERPOLATED_X_STRING_NODE: {
677
+ case YP_INTERPOLATED_X_STRING_NODE: {
670
678
  yp_interpolated_x_string_node_t *cast = (yp_interpolated_x_string_node_t *) node;
671
679
  for (size_t index = 0; index < cast->parts.size; index++) {
672
680
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
@@ -674,7 +682,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
674
682
  break;
675
683
  }
676
684
  #line 111 "api_node.c.erb"
677
- case YP_NODE_KEYWORD_HASH_NODE: {
685
+ case YP_KEYWORD_HASH_NODE: {
678
686
  yp_keyword_hash_node_t *cast = (yp_keyword_hash_node_t *) node;
679
687
  for (size_t index = 0; index < cast->elements.size; index++) {
680
688
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
@@ -682,65 +690,73 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
682
690
  break;
683
691
  }
684
692
  #line 111 "api_node.c.erb"
685
- case YP_NODE_KEYWORD_PARAMETER_NODE: {
693
+ case YP_KEYWORD_PARAMETER_NODE: {
686
694
  yp_keyword_parameter_node_t *cast = (yp_keyword_parameter_node_t *) node;
687
695
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
688
696
  break;
689
697
  }
690
698
  #line 111 "api_node.c.erb"
691
- case YP_NODE_LAMBDA_NODE: {
699
+ case YP_LAMBDA_NODE: {
692
700
  yp_lambda_node_t *cast = (yp_lambda_node_t *) node;
693
701
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
694
702
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
695
703
  break;
696
704
  }
697
705
  #line 111 "api_node.c.erb"
698
- case YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE: {
706
+ case YP_LOCAL_VARIABLE_AND_WRITE_NODE: {
699
707
  yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
700
708
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
701
709
  break;
702
710
  }
703
711
  #line 111 "api_node.c.erb"
704
- case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
712
+ case YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
705
713
  yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
706
714
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
707
715
  break;
708
716
  }
709
717
  #line 111 "api_node.c.erb"
710
- case YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE: {
718
+ case YP_LOCAL_VARIABLE_OR_WRITE_NODE: {
711
719
  yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
712
720
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
713
721
  break;
714
722
  }
715
723
  #line 111 "api_node.c.erb"
716
- case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
724
+ case YP_LOCAL_VARIABLE_WRITE_NODE: {
717
725
  yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
718
726
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
719
727
  break;
720
728
  }
721
729
  #line 111 "api_node.c.erb"
722
- case YP_NODE_MATCH_PREDICATE_NODE: {
730
+ case YP_MATCH_PREDICATE_NODE: {
723
731
  yp_match_predicate_node_t *cast = (yp_match_predicate_node_t *) node;
724
732
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
725
733
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
726
734
  break;
727
735
  }
728
736
  #line 111 "api_node.c.erb"
729
- case YP_NODE_MATCH_REQUIRED_NODE: {
737
+ case YP_MATCH_REQUIRED_NODE: {
730
738
  yp_match_required_node_t *cast = (yp_match_required_node_t *) node;
731
739
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
732
740
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
733
741
  break;
734
742
  }
735
743
  #line 111 "api_node.c.erb"
736
- case YP_NODE_MODULE_NODE: {
744
+ case YP_MODULE_NODE: {
737
745
  yp_module_node_t *cast = (yp_module_node_t *) node;
738
746
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant_path);
739
747
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
740
748
  break;
741
749
  }
742
750
  #line 111 "api_node.c.erb"
743
- case YP_NODE_MULTI_WRITE_NODE: {
751
+ case YP_MULTI_TARGET_NODE: {
752
+ yp_multi_target_node_t *cast = (yp_multi_target_node_t *) node;
753
+ for (size_t index = 0; index < cast->targets.size; index++) {
754
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->targets.nodes[index]);
755
+ }
756
+ break;
757
+ }
758
+ #line 111 "api_node.c.erb"
759
+ case YP_MULTI_WRITE_NODE: {
744
760
  yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
745
761
  for (size_t index = 0; index < cast->targets.size; index++) {
746
762
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->targets.nodes[index]);
@@ -749,26 +765,26 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
749
765
  break;
750
766
  }
751
767
  #line 111 "api_node.c.erb"
752
- case YP_NODE_NEXT_NODE: {
768
+ case YP_NEXT_NODE: {
753
769
  yp_next_node_t *cast = (yp_next_node_t *) node;
754
770
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
755
771
  break;
756
772
  }
757
773
  #line 111 "api_node.c.erb"
758
- case YP_NODE_OPTIONAL_PARAMETER_NODE: {
774
+ case YP_OPTIONAL_PARAMETER_NODE: {
759
775
  yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
760
776
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
761
777
  break;
762
778
  }
763
779
  #line 111 "api_node.c.erb"
764
- case YP_NODE_OR_NODE: {
780
+ case YP_OR_NODE: {
765
781
  yp_or_node_t *cast = (yp_or_node_t *) node;
766
782
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
767
783
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
768
784
  break;
769
785
  }
770
786
  #line 111 "api_node.c.erb"
771
- case YP_NODE_PARAMETERS_NODE: {
787
+ case YP_PARAMETERS_NODE: {
772
788
  yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
773
789
  for (size_t index = 0; index < cast->requireds.size; index++) {
774
790
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->requireds.nodes[index]);
@@ -788,56 +804,56 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
788
804
  break;
789
805
  }
790
806
  #line 111 "api_node.c.erb"
791
- case YP_NODE_PARENTHESES_NODE: {
807
+ case YP_PARENTHESES_NODE: {
792
808
  yp_parentheses_node_t *cast = (yp_parentheses_node_t *) node;
793
809
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
794
810
  break;
795
811
  }
796
812
  #line 111 "api_node.c.erb"
797
- case YP_NODE_PINNED_EXPRESSION_NODE: {
813
+ case YP_PINNED_EXPRESSION_NODE: {
798
814
  yp_pinned_expression_node_t *cast = (yp_pinned_expression_node_t *) node;
799
815
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
800
816
  break;
801
817
  }
802
818
  #line 111 "api_node.c.erb"
803
- case YP_NODE_PINNED_VARIABLE_NODE: {
819
+ case YP_PINNED_VARIABLE_NODE: {
804
820
  yp_pinned_variable_node_t *cast = (yp_pinned_variable_node_t *) node;
805
821
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->variable);
806
822
  break;
807
823
  }
808
824
  #line 111 "api_node.c.erb"
809
- case YP_NODE_POST_EXECUTION_NODE: {
825
+ case YP_POST_EXECUTION_NODE: {
810
826
  yp_post_execution_node_t *cast = (yp_post_execution_node_t *) node;
811
827
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
812
828
  break;
813
829
  }
814
830
  #line 111 "api_node.c.erb"
815
- case YP_NODE_PRE_EXECUTION_NODE: {
831
+ case YP_PRE_EXECUTION_NODE: {
816
832
  yp_pre_execution_node_t *cast = (yp_pre_execution_node_t *) node;
817
833
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
818
834
  break;
819
835
  }
820
836
  #line 111 "api_node.c.erb"
821
- case YP_NODE_PROGRAM_NODE: {
837
+ case YP_PROGRAM_NODE: {
822
838
  yp_program_node_t *cast = (yp_program_node_t *) node;
823
839
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
824
840
  break;
825
841
  }
826
842
  #line 111 "api_node.c.erb"
827
- case YP_NODE_RANGE_NODE: {
843
+ case YP_RANGE_NODE: {
828
844
  yp_range_node_t *cast = (yp_range_node_t *) node;
829
845
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
830
846
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
831
847
  break;
832
848
  }
833
849
  #line 111 "api_node.c.erb"
834
- case YP_NODE_RATIONAL_NODE: {
850
+ case YP_RATIONAL_NODE: {
835
851
  yp_rational_node_t *cast = (yp_rational_node_t *) node;
836
852
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->numeric);
837
853
  break;
838
854
  }
839
855
  #line 111 "api_node.c.erb"
840
- case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
856
+ case YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
841
857
  yp_required_destructured_parameter_node_t *cast = (yp_required_destructured_parameter_node_t *) node;
842
858
  for (size_t index = 0; index < cast->parameters.size; index++) {
843
859
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters.nodes[index]);
@@ -845,14 +861,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
845
861
  break;
846
862
  }
847
863
  #line 111 "api_node.c.erb"
848
- case YP_NODE_RESCUE_MODIFIER_NODE: {
864
+ case YP_RESCUE_MODIFIER_NODE: {
849
865
  yp_rescue_modifier_node_t *cast = (yp_rescue_modifier_node_t *) node;
850
866
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
851
867
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->rescue_expression);
852
868
  break;
853
869
  }
854
870
  #line 111 "api_node.c.erb"
855
- case YP_NODE_RESCUE_NODE: {
871
+ case YP_RESCUE_NODE: {
856
872
  yp_rescue_node_t *cast = (yp_rescue_node_t *) node;
857
873
  for (size_t index = 0; index < cast->exceptions.size; index++) {
858
874
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->exceptions.nodes[index]);
@@ -863,26 +879,26 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
863
879
  break;
864
880
  }
865
881
  #line 111 "api_node.c.erb"
866
- case YP_NODE_RETURN_NODE: {
882
+ case YP_RETURN_NODE: {
867
883
  yp_return_node_t *cast = (yp_return_node_t *) node;
868
884
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
869
885
  break;
870
886
  }
871
887
  #line 111 "api_node.c.erb"
872
- case YP_NODE_SINGLETON_CLASS_NODE: {
888
+ case YP_SINGLETON_CLASS_NODE: {
873
889
  yp_singleton_class_node_t *cast = (yp_singleton_class_node_t *) node;
874
890
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
875
891
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
876
892
  break;
877
893
  }
878
894
  #line 111 "api_node.c.erb"
879
- case YP_NODE_SPLAT_NODE: {
895
+ case YP_SPLAT_NODE: {
880
896
  yp_splat_node_t *cast = (yp_splat_node_t *) node;
881
897
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
882
898
  break;
883
899
  }
884
900
  #line 111 "api_node.c.erb"
885
- case YP_NODE_STATEMENTS_NODE: {
901
+ case YP_STATEMENTS_NODE: {
886
902
  yp_statements_node_t *cast = (yp_statements_node_t *) node;
887
903
  for (size_t index = 0; index < cast->body.size; index++) {
888
904
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->body.nodes[index]);
@@ -890,21 +906,21 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
890
906
  break;
891
907
  }
892
908
  #line 111 "api_node.c.erb"
893
- case YP_NODE_STRING_CONCAT_NODE: {
909
+ case YP_STRING_CONCAT_NODE: {
894
910
  yp_string_concat_node_t *cast = (yp_string_concat_node_t *) node;
895
911
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
896
912
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
897
913
  break;
898
914
  }
899
915
  #line 111 "api_node.c.erb"
900
- case YP_NODE_SUPER_NODE: {
916
+ case YP_SUPER_NODE: {
901
917
  yp_super_node_t *cast = (yp_super_node_t *) node;
902
918
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
903
919
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
904
920
  break;
905
921
  }
906
922
  #line 111 "api_node.c.erb"
907
- case YP_NODE_UNDEF_NODE: {
923
+ case YP_UNDEF_NODE: {
908
924
  yp_undef_node_t *cast = (yp_undef_node_t *) node;
909
925
  for (size_t index = 0; index < cast->names.size; index++) {
910
926
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->names.nodes[index]);
@@ -912,7 +928,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
912
928
  break;
913
929
  }
914
930
  #line 111 "api_node.c.erb"
915
- case YP_NODE_UNLESS_NODE: {
931
+ case YP_UNLESS_NODE: {
916
932
  yp_unless_node_t *cast = (yp_unless_node_t *) node;
917
933
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
918
934
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
@@ -920,14 +936,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
920
936
  break;
921
937
  }
922
938
  #line 111 "api_node.c.erb"
923
- case YP_NODE_UNTIL_NODE: {
939
+ case YP_UNTIL_NODE: {
924
940
  yp_until_node_t *cast = (yp_until_node_t *) node;
925
941
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
926
942
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
927
943
  break;
928
944
  }
929
945
  #line 111 "api_node.c.erb"
930
- case YP_NODE_WHEN_NODE: {
946
+ case YP_WHEN_NODE: {
931
947
  yp_when_node_t *cast = (yp_when_node_t *) node;
932
948
  for (size_t index = 0; index < cast->conditions.size; index++) {
933
949
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->conditions.nodes[index]);
@@ -936,14 +952,14 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
936
952
  break;
937
953
  }
938
954
  #line 111 "api_node.c.erb"
939
- case YP_NODE_WHILE_NODE: {
955
+ case YP_WHILE_NODE: {
940
956
  yp_while_node_t *cast = (yp_while_node_t *) node;
941
957
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
942
958
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
943
959
  break;
944
960
  }
945
961
  #line 111 "api_node.c.erb"
946
- case YP_NODE_YIELD_NODE: {
962
+ case YP_YIELD_NODE: {
947
963
  yp_yield_node_t *cast = (yp_yield_node_t *) node;
948
964
  yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
949
965
  break;
@@ -957,17 +973,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
957
973
 
958
974
  switch (YP_NODE_TYPE(node)) {
959
975
  #line 137 "api_node.c.erb"
960
- case YP_NODE_ALIAS_NODE: {
976
+ case YP_ALIAS_NODE: {
961
977
  yp_alias_node_t *cast = (yp_alias_node_t *) node;
962
978
  VALUE argv[4];
963
979
 
964
980
  // new_name
981
+ #line 148 "api_node.c.erb"
965
982
  argv[0] = rb_ary_pop(value_stack);
966
983
 
967
984
  // old_name
985
+ #line 148 "api_node.c.erb"
968
986
  argv[1] = rb_ary_pop(value_stack);
969
987
 
970
988
  // keyword_loc
989
+ #line 173 "api_node.c.erb"
971
990
  argv[2] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
972
991
 
973
992
  // location
@@ -977,17 +996,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
977
996
  break;
978
997
  }
979
998
  #line 137 "api_node.c.erb"
980
- case YP_NODE_ALTERNATION_PATTERN_NODE: {
999
+ case YP_ALTERNATION_PATTERN_NODE: {
981
1000
  yp_alternation_pattern_node_t *cast = (yp_alternation_pattern_node_t *) node;
982
1001
  VALUE argv[4];
983
1002
 
984
1003
  // left
1004
+ #line 148 "api_node.c.erb"
985
1005
  argv[0] = rb_ary_pop(value_stack);
986
1006
 
987
1007
  // right
1008
+ #line 148 "api_node.c.erb"
988
1009
  argv[1] = rb_ary_pop(value_stack);
989
1010
 
990
1011
  // operator_loc
1012
+ #line 173 "api_node.c.erb"
991
1013
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
992
1014
 
993
1015
  // location
@@ -997,17 +1019,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
997
1019
  break;
998
1020
  }
999
1021
  #line 137 "api_node.c.erb"
1000
- case YP_NODE_AND_NODE: {
1022
+ case YP_AND_NODE: {
1001
1023
  yp_and_node_t *cast = (yp_and_node_t *) node;
1002
1024
  VALUE argv[4];
1003
1025
 
1004
1026
  // left
1027
+ #line 148 "api_node.c.erb"
1005
1028
  argv[0] = rb_ary_pop(value_stack);
1006
1029
 
1007
1030
  // right
1031
+ #line 148 "api_node.c.erb"
1008
1032
  argv[1] = rb_ary_pop(value_stack);
1009
1033
 
1010
1034
  // operator_loc
1035
+ #line 173 "api_node.c.erb"
1011
1036
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1012
1037
 
1013
1038
  // location
@@ -1017,11 +1042,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1017
1042
  break;
1018
1043
  }
1019
1044
  #line 137 "api_node.c.erb"
1020
- case YP_NODE_ARGUMENTS_NODE: {
1045
+ case YP_ARGUMENTS_NODE: {
1021
1046
  yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
1022
1047
  VALUE argv[2];
1023
1048
 
1024
1049
  // arguments
1050
+ #line 151 "api_node.c.erb"
1025
1051
  argv[0] = rb_ary_new_capa(cast->arguments.size);
1026
1052
  for (size_t index = 0; index < cast->arguments.size; index++) {
1027
1053
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
@@ -1034,20 +1060,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1034
1060
  break;
1035
1061
  }
1036
1062
  #line 137 "api_node.c.erb"
1037
- case YP_NODE_ARRAY_NODE: {
1063
+ case YP_ARRAY_NODE: {
1038
1064
  yp_array_node_t *cast = (yp_array_node_t *) node;
1039
1065
  VALUE argv[4];
1040
1066
 
1041
1067
  // elements
1068
+ #line 151 "api_node.c.erb"
1042
1069
  argv[0] = rb_ary_new_capa(cast->elements.size);
1043
1070
  for (size_t index = 0; index < cast->elements.size; index++) {
1044
1071
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
1045
1072
  }
1046
1073
 
1047
1074
  // opening_loc
1075
+ #line 176 "api_node.c.erb"
1048
1076
  argv[1] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1049
1077
 
1050
1078
  // closing_loc
1079
+ #line 176 "api_node.c.erb"
1051
1080
  argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1052
1081
 
1053
1082
  // location
@@ -1057,32 +1086,38 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1057
1086
  break;
1058
1087
  }
1059
1088
  #line 137 "api_node.c.erb"
1060
- case YP_NODE_ARRAY_PATTERN_NODE: {
1089
+ case YP_ARRAY_PATTERN_NODE: {
1061
1090
  yp_array_pattern_node_t *cast = (yp_array_pattern_node_t *) node;
1062
1091
  VALUE argv[7];
1063
1092
 
1064
1093
  // constant
1094
+ #line 148 "api_node.c.erb"
1065
1095
  argv[0] = rb_ary_pop(value_stack);
1066
1096
 
1067
1097
  // requireds
1098
+ #line 151 "api_node.c.erb"
1068
1099
  argv[1] = rb_ary_new_capa(cast->requireds.size);
1069
1100
  for (size_t index = 0; index < cast->requireds.size; index++) {
1070
1101
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
1071
1102
  }
1072
1103
 
1073
1104
  // rest
1105
+ #line 148 "api_node.c.erb"
1074
1106
  argv[2] = rb_ary_pop(value_stack);
1075
1107
 
1076
1108
  // posts
1109
+ #line 151 "api_node.c.erb"
1077
1110
  argv[3] = rb_ary_new_capa(cast->posts.size);
1078
1111
  for (size_t index = 0; index < cast->posts.size; index++) {
1079
1112
  rb_ary_push(argv[3], rb_ary_pop(value_stack));
1080
1113
  }
1081
1114
 
1082
1115
  // opening_loc
1116
+ #line 176 "api_node.c.erb"
1083
1117
  argv[4] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1084
1118
 
1085
1119
  // closing_loc
1120
+ #line 176 "api_node.c.erb"
1086
1121
  argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1087
1122
 
1088
1123
  // location
@@ -1092,17 +1127,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1092
1127
  break;
1093
1128
  }
1094
1129
  #line 137 "api_node.c.erb"
1095
- case YP_NODE_ASSOC_NODE: {
1130
+ case YP_ASSOC_NODE: {
1096
1131
  yp_assoc_node_t *cast = (yp_assoc_node_t *) node;
1097
1132
  VALUE argv[4];
1098
1133
 
1099
1134
  // key
1135
+ #line 148 "api_node.c.erb"
1100
1136
  argv[0] = rb_ary_pop(value_stack);
1101
1137
 
1102
1138
  // value
1139
+ #line 148 "api_node.c.erb"
1103
1140
  argv[1] = rb_ary_pop(value_stack);
1104
1141
 
1105
1142
  // operator_loc
1143
+ #line 176 "api_node.c.erb"
1106
1144
  argv[2] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1107
1145
 
1108
1146
  // location
@@ -1112,14 +1150,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1112
1150
  break;
1113
1151
  }
1114
1152
  #line 137 "api_node.c.erb"
1115
- case YP_NODE_ASSOC_SPLAT_NODE: {
1153
+ case YP_ASSOC_SPLAT_NODE: {
1116
1154
  yp_assoc_splat_node_t *cast = (yp_assoc_splat_node_t *) node;
1117
1155
  VALUE argv[3];
1118
1156
 
1119
1157
  // value
1158
+ #line 148 "api_node.c.erb"
1120
1159
  argv[0] = rb_ary_pop(value_stack);
1121
1160
 
1122
1161
  // operator_loc
1162
+ #line 173 "api_node.c.erb"
1123
1163
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1124
1164
 
1125
1165
  // location
@@ -1129,7 +1169,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1129
1169
  break;
1130
1170
  }
1131
1171
  #line 137 "api_node.c.erb"
1132
- case YP_NODE_BACK_REFERENCE_READ_NODE: {
1172
+ case YP_BACK_REFERENCE_READ_NODE: {
1133
1173
  VALUE argv[1];
1134
1174
 
1135
1175
  // location
@@ -1139,26 +1179,32 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1139
1179
  break;
1140
1180
  }
1141
1181
  #line 137 "api_node.c.erb"
1142
- case YP_NODE_BEGIN_NODE: {
1182
+ case YP_BEGIN_NODE: {
1143
1183
  yp_begin_node_t *cast = (yp_begin_node_t *) node;
1144
1184
  VALUE argv[7];
1145
1185
 
1146
1186
  // begin_keyword_loc
1187
+ #line 176 "api_node.c.erb"
1147
1188
  argv[0] = cast->begin_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->begin_keyword_loc.start, cast->begin_keyword_loc.end, source);
1148
1189
 
1149
1190
  // statements
1191
+ #line 148 "api_node.c.erb"
1150
1192
  argv[1] = rb_ary_pop(value_stack);
1151
1193
 
1152
1194
  // rescue_clause
1195
+ #line 148 "api_node.c.erb"
1153
1196
  argv[2] = rb_ary_pop(value_stack);
1154
1197
 
1155
1198
  // else_clause
1199
+ #line 148 "api_node.c.erb"
1156
1200
  argv[3] = rb_ary_pop(value_stack);
1157
1201
 
1158
1202
  // ensure_clause
1203
+ #line 148 "api_node.c.erb"
1159
1204
  argv[4] = rb_ary_pop(value_stack);
1160
1205
 
1161
1206
  // end_keyword_loc
1207
+ #line 176 "api_node.c.erb"
1162
1208
  argv[5] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
1163
1209
 
1164
1210
  // location
@@ -1168,14 +1214,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1168
1214
  break;
1169
1215
  }
1170
1216
  #line 137 "api_node.c.erb"
1171
- case YP_NODE_BLOCK_ARGUMENT_NODE: {
1217
+ case YP_BLOCK_ARGUMENT_NODE: {
1172
1218
  yp_block_argument_node_t *cast = (yp_block_argument_node_t *) node;
1173
1219
  VALUE argv[3];
1174
1220
 
1175
1221
  // expression
1222
+ #line 148 "api_node.c.erb"
1176
1223
  argv[0] = rb_ary_pop(value_stack);
1177
1224
 
1178
1225
  // operator_loc
1226
+ #line 173 "api_node.c.erb"
1179
1227
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1180
1228
 
1181
1229
  // location
@@ -1185,26 +1233,48 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1185
1233
  break;
1186
1234
  }
1187
1235
  #line 137 "api_node.c.erb"
1188
- case YP_NODE_BLOCK_NODE: {
1236
+ case YP_BLOCK_LOCAL_VARIABLE_NODE: {
1237
+ yp_block_local_variable_node_t *cast = (yp_block_local_variable_node_t *) node;
1238
+ VALUE argv[2];
1239
+
1240
+ // name
1241
+ #line 160 "api_node.c.erb"
1242
+ assert(cast->name != 0);
1243
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1244
+
1245
+ // location
1246
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
1247
+
1248
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPBlockLocalVariableNode));
1249
+ break;
1250
+ }
1251
+ #line 137 "api_node.c.erb"
1252
+ case YP_BLOCK_NODE: {
1189
1253
  yp_block_node_t *cast = (yp_block_node_t *) node;
1190
1254
  VALUE argv[6];
1191
1255
 
1192
1256
  // locals
1257
+ #line 166 "api_node.c.erb"
1193
1258
  argv[0] = rb_ary_new_capa(cast->locals.size);
1194
1259
  for (size_t index = 0; index < cast->locals.size; index++) {
1260
+ assert(cast->locals.ids[index] != 0);
1195
1261
  rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
1196
1262
  }
1197
1263
 
1198
1264
  // parameters
1265
+ #line 148 "api_node.c.erb"
1199
1266
  argv[1] = rb_ary_pop(value_stack);
1200
1267
 
1201
1268
  // body
1269
+ #line 148 "api_node.c.erb"
1202
1270
  argv[2] = rb_ary_pop(value_stack);
1203
1271
 
1204
1272
  // opening_loc
1273
+ #line 173 "api_node.c.erb"
1205
1274
  argv[3] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1206
1275
 
1207
1276
  // closing_loc
1277
+ #line 173 "api_node.c.erb"
1208
1278
  argv[4] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1209
1279
 
1210
1280
  // location
@@ -1214,41 +1284,49 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1214
1284
  break;
1215
1285
  }
1216
1286
  #line 137 "api_node.c.erb"
1217
- case YP_NODE_BLOCK_PARAMETER_NODE: {
1287
+ case YP_BLOCK_PARAMETER_NODE: {
1218
1288
  yp_block_parameter_node_t *cast = (yp_block_parameter_node_t *) node;
1219
- VALUE argv[3];
1289
+ VALUE argv[4];
1290
+
1291
+ // name
1292
+ argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
1220
1293
 
1221
1294
  // name_loc
1222
- argv[0] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1295
+ #line 176 "api_node.c.erb"
1296
+ argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1223
1297
 
1224
1298
  // operator_loc
1225
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1299
+ #line 173 "api_node.c.erb"
1300
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1226
1301
 
1227
1302
  // location
1228
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
1303
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
1229
1304
 
1230
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPBlockParameterNode));
1305
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPBlockParameterNode));
1231
1306
  break;
1232
1307
  }
1233
1308
  #line 137 "api_node.c.erb"
1234
- case YP_NODE_BLOCK_PARAMETERS_NODE: {
1309
+ case YP_BLOCK_PARAMETERS_NODE: {
1235
1310
  yp_block_parameters_node_t *cast = (yp_block_parameters_node_t *) node;
1236
1311
  VALUE argv[5];
1237
1312
 
1238
1313
  // parameters
1314
+ #line 148 "api_node.c.erb"
1239
1315
  argv[0] = rb_ary_pop(value_stack);
1240
1316
 
1241
1317
  // locals
1318
+ #line 151 "api_node.c.erb"
1242
1319
  argv[1] = rb_ary_new_capa(cast->locals.size);
1243
1320
  for (size_t index = 0; index < cast->locals.size; index++) {
1244
- yp_location_t location = cast->locals.locations[index];
1245
- rb_ary_push(argv[1], yp_location_new(parser, location.start, location.end, source));
1321
+ rb_ary_push(argv[1], rb_ary_pop(value_stack));
1246
1322
  }
1247
1323
 
1248
1324
  // opening_loc
1325
+ #line 176 "api_node.c.erb"
1249
1326
  argv[2] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1250
1327
 
1251
1328
  // closing_loc
1329
+ #line 176 "api_node.c.erb"
1252
1330
  argv[3] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1253
1331
 
1254
1332
  // location
@@ -1258,14 +1336,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1258
1336
  break;
1259
1337
  }
1260
1338
  #line 137 "api_node.c.erb"
1261
- case YP_NODE_BREAK_NODE: {
1339
+ case YP_BREAK_NODE: {
1262
1340
  yp_break_node_t *cast = (yp_break_node_t *) node;
1263
1341
  VALUE argv[3];
1264
1342
 
1265
1343
  // arguments
1344
+ #line 148 "api_node.c.erb"
1266
1345
  argv[0] = rb_ary_pop(value_stack);
1267
1346
 
1268
1347
  // keyword_loc
1348
+ #line 173 "api_node.c.erb"
1269
1349
  argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
1270
1350
 
1271
1351
  // location
@@ -1275,35 +1355,99 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1275
1355
  break;
1276
1356
  }
1277
1357
  #line 137 "api_node.c.erb"
1278
- case YP_NODE_CALL_NODE: {
1358
+ case YP_CALL_AND_WRITE_NODE: {
1359
+ yp_call_and_write_node_t *cast = (yp_call_and_write_node_t *) node;
1360
+ VALUE argv[12];
1361
+
1362
+ // receiver
1363
+ #line 148 "api_node.c.erb"
1364
+ argv[0] = rb_ary_pop(value_stack);
1365
+
1366
+ // call_operator_loc
1367
+ #line 176 "api_node.c.erb"
1368
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
1369
+
1370
+ // message_loc
1371
+ #line 176 "api_node.c.erb"
1372
+ argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
1373
+
1374
+ // opening_loc
1375
+ #line 176 "api_node.c.erb"
1376
+ argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1377
+
1378
+ // arguments
1379
+ #line 148 "api_node.c.erb"
1380
+ argv[4] = rb_ary_pop(value_stack);
1381
+
1382
+ // closing_loc
1383
+ #line 176 "api_node.c.erb"
1384
+ argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1385
+
1386
+ // flags
1387
+ #line 182 "api_node.c.erb"
1388
+ argv[6] = ULONG2NUM(node->flags >> 1);
1389
+
1390
+ // read_name
1391
+ #line 157 "api_node.c.erb"
1392
+ argv[7] = yp_string_new(&cast->read_name, encoding);
1393
+
1394
+ // write_name
1395
+ #line 157 "api_node.c.erb"
1396
+ argv[8] = yp_string_new(&cast->write_name, encoding);
1397
+
1398
+ // operator_loc
1399
+ #line 173 "api_node.c.erb"
1400
+ argv[9] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1401
+
1402
+ // value
1403
+ #line 148 "api_node.c.erb"
1404
+ argv[10] = rb_ary_pop(value_stack);
1405
+
1406
+ // location
1407
+ argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
1408
+
1409
+ rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPCallAndWriteNode));
1410
+ break;
1411
+ }
1412
+ #line 137 "api_node.c.erb"
1413
+ case YP_CALL_NODE: {
1279
1414
  yp_call_node_t *cast = (yp_call_node_t *) node;
1280
1415
  VALUE argv[10];
1281
1416
 
1282
1417
  // receiver
1418
+ #line 148 "api_node.c.erb"
1283
1419
  argv[0] = rb_ary_pop(value_stack);
1284
1420
 
1285
- // operator_loc
1286
- argv[1] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1421
+ // call_operator_loc
1422
+ #line 176 "api_node.c.erb"
1423
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
1287
1424
 
1288
1425
  // message_loc
1426
+ #line 176 "api_node.c.erb"
1289
1427
  argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
1290
1428
 
1291
1429
  // opening_loc
1430
+ #line 176 "api_node.c.erb"
1292
1431
  argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1293
1432
 
1294
1433
  // arguments
1434
+ #line 148 "api_node.c.erb"
1295
1435
  argv[4] = rb_ary_pop(value_stack);
1296
1436
 
1297
1437
  // closing_loc
1438
+ #line 176 "api_node.c.erb"
1298
1439
  argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1299
1440
 
1300
1441
  // block
1442
+ #line 148 "api_node.c.erb"
1301
1443
  argv[6] = rb_ary_pop(value_stack);
1302
1444
 
1303
1445
  // flags
1446
+ #line 182 "api_node.c.erb"
1304
1447
  argv[7] = ULONG2NUM(node->flags >> 1);
1305
1448
 
1306
1449
  // name
1450
+ #line 157 "api_node.c.erb"
1307
1451
  argv[8] = yp_string_new(&cast->name, encoding);
1308
1452
 
1309
1453
  // location
@@ -1313,80 +1457,135 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1313
1457
  break;
1314
1458
  }
1315
1459
  #line 137 "api_node.c.erb"
1316
- case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE: {
1317
- yp_call_operator_and_write_node_t *cast = (yp_call_operator_and_write_node_t *) node;
1318
- VALUE argv[4];
1460
+ case YP_CALL_OPERATOR_WRITE_NODE: {
1461
+ yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
1462
+ VALUE argv[13];
1319
1463
 
1320
- // target
1464
+ // receiver
1465
+ #line 148 "api_node.c.erb"
1321
1466
  argv[0] = rb_ary_pop(value_stack);
1322
1467
 
1468
+ // call_operator_loc
1469
+ #line 176 "api_node.c.erb"
1470
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
1471
+
1472
+ // message_loc
1473
+ #line 176 "api_node.c.erb"
1474
+ argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
1475
+
1476
+ // opening_loc
1477
+ #line 176 "api_node.c.erb"
1478
+ argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1479
+
1480
+ // arguments
1481
+ #line 148 "api_node.c.erb"
1482
+ argv[4] = rb_ary_pop(value_stack);
1483
+
1484
+ // closing_loc
1485
+ #line 176 "api_node.c.erb"
1486
+ argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1487
+
1488
+ // flags
1489
+ #line 182 "api_node.c.erb"
1490
+ argv[6] = ULONG2NUM(node->flags >> 1);
1491
+
1492
+ // read_name
1493
+ #line 157 "api_node.c.erb"
1494
+ argv[7] = yp_string_new(&cast->read_name, encoding);
1495
+
1496
+ // write_name
1497
+ #line 157 "api_node.c.erb"
1498
+ argv[8] = yp_string_new(&cast->write_name, encoding);
1499
+
1500
+ // operator
1501
+ #line 160 "api_node.c.erb"
1502
+ assert(cast->operator != 0);
1503
+ argv[9] = rb_id2sym(constants[cast->operator - 1]);
1504
+
1323
1505
  // operator_loc
1324
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1506
+ #line 173 "api_node.c.erb"
1507
+ argv[10] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1325
1508
 
1326
1509
  // value
1327
- argv[2] = rb_ary_pop(value_stack);
1510
+ #line 148 "api_node.c.erb"
1511
+ argv[11] = rb_ary_pop(value_stack);
1328
1512
 
1329
1513
  // location
1330
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
1514
+ argv[12] = yp_location_new(parser, node->location.start, node->location.end, source);
1331
1515
 
1332
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPCallOperatorAndWriteNode));
1516
+ rb_ary_push(value_stack, rb_class_new_instance(13, argv, rb_cYARPCallOperatorWriteNode));
1333
1517
  break;
1334
1518
  }
1335
1519
  #line 137 "api_node.c.erb"
1336
- case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE: {
1337
- yp_call_operator_or_write_node_t *cast = (yp_call_operator_or_write_node_t *) node;
1338
- VALUE argv[4];
1520
+ case YP_CALL_OR_WRITE_NODE: {
1521
+ yp_call_or_write_node_t *cast = (yp_call_or_write_node_t *) node;
1522
+ VALUE argv[12];
1339
1523
 
1340
- // target
1524
+ // receiver
1525
+ #line 148 "api_node.c.erb"
1341
1526
  argv[0] = rb_ary_pop(value_stack);
1342
1527
 
1343
- // value
1344
- argv[1] = rb_ary_pop(value_stack);
1528
+ // call_operator_loc
1529
+ #line 176 "api_node.c.erb"
1530
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
1345
1531
 
1346
- // operator_loc
1347
- argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1532
+ // message_loc
1533
+ #line 176 "api_node.c.erb"
1534
+ argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
1348
1535
 
1349
- // location
1350
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
1536
+ // opening_loc
1537
+ #line 176 "api_node.c.erb"
1538
+ argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1351
1539
 
1352
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPCallOperatorOrWriteNode));
1353
- break;
1354
- }
1355
- #line 137 "api_node.c.erb"
1356
- case YP_NODE_CALL_OPERATOR_WRITE_NODE: {
1357
- yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
1358
- VALUE argv[5];
1540
+ // arguments
1541
+ #line 148 "api_node.c.erb"
1542
+ argv[4] = rb_ary_pop(value_stack);
1359
1543
 
1360
- // target
1361
- argv[0] = rb_ary_pop(value_stack);
1544
+ // closing_loc
1545
+ #line 176 "api_node.c.erb"
1546
+ argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1547
+
1548
+ // flags
1549
+ #line 182 "api_node.c.erb"
1550
+ argv[6] = ULONG2NUM(node->flags >> 1);
1551
+
1552
+ // read_name
1553
+ #line 157 "api_node.c.erb"
1554
+ argv[7] = yp_string_new(&cast->read_name, encoding);
1555
+
1556
+ // write_name
1557
+ #line 157 "api_node.c.erb"
1558
+ argv[8] = yp_string_new(&cast->write_name, encoding);
1362
1559
 
1363
1560
  // operator_loc
1364
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1561
+ #line 173 "api_node.c.erb"
1562
+ argv[9] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1365
1563
 
1366
1564
  // value
1367
- argv[2] = rb_ary_pop(value_stack);
1368
-
1369
- // operator
1370
- argv[3] = rb_id2sym(constants[cast->operator - 1]);
1565
+ #line 148 "api_node.c.erb"
1566
+ argv[10] = rb_ary_pop(value_stack);
1371
1567
 
1372
1568
  // location
1373
- argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
1569
+ argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
1374
1570
 
1375
- rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPCallOperatorWriteNode));
1571
+ rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPCallOrWriteNode));
1376
1572
  break;
1377
1573
  }
1378
1574
  #line 137 "api_node.c.erb"
1379
- case YP_NODE_CAPTURE_PATTERN_NODE: {
1575
+ case YP_CAPTURE_PATTERN_NODE: {
1380
1576
  yp_capture_pattern_node_t *cast = (yp_capture_pattern_node_t *) node;
1381
1577
  VALUE argv[4];
1382
1578
 
1383
1579
  // value
1580
+ #line 148 "api_node.c.erb"
1384
1581
  argv[0] = rb_ary_pop(value_stack);
1385
1582
 
1386
1583
  // target
1584
+ #line 148 "api_node.c.erb"
1387
1585
  argv[1] = rb_ary_pop(value_stack);
1388
1586
 
1389
1587
  // operator_loc
1588
+ #line 173 "api_node.c.erb"
1390
1589
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1391
1590
 
1392
1591
  // location
@@ -1396,26 +1595,31 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1396
1595
  break;
1397
1596
  }
1398
1597
  #line 137 "api_node.c.erb"
1399
- case YP_NODE_CASE_NODE: {
1598
+ case YP_CASE_NODE: {
1400
1599
  yp_case_node_t *cast = (yp_case_node_t *) node;
1401
1600
  VALUE argv[6];
1402
1601
 
1403
1602
  // predicate
1603
+ #line 148 "api_node.c.erb"
1404
1604
  argv[0] = rb_ary_pop(value_stack);
1405
1605
 
1406
1606
  // conditions
1607
+ #line 151 "api_node.c.erb"
1407
1608
  argv[1] = rb_ary_new_capa(cast->conditions.size);
1408
1609
  for (size_t index = 0; index < cast->conditions.size; index++) {
1409
1610
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
1410
1611
  }
1411
1612
 
1412
1613
  // consequent
1614
+ #line 148 "api_node.c.erb"
1413
1615
  argv[2] = rb_ary_pop(value_stack);
1414
1616
 
1415
1617
  // case_keyword_loc
1618
+ #line 173 "api_node.c.erb"
1416
1619
  argv[3] = yp_location_new(parser, cast->case_keyword_loc.start, cast->case_keyword_loc.end, source);
1417
1620
 
1418
1621
  // end_keyword_loc
1622
+ #line 173 "api_node.c.erb"
1419
1623
  argv[4] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
1420
1624
 
1421
1625
  // location
@@ -1425,36 +1629,46 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1425
1629
  break;
1426
1630
  }
1427
1631
  #line 137 "api_node.c.erb"
1428
- case YP_NODE_CLASS_NODE: {
1632
+ case YP_CLASS_NODE: {
1429
1633
  yp_class_node_t *cast = (yp_class_node_t *) node;
1430
1634
  VALUE argv[9];
1431
1635
 
1432
1636
  // locals
1637
+ #line 166 "api_node.c.erb"
1433
1638
  argv[0] = rb_ary_new_capa(cast->locals.size);
1434
1639
  for (size_t index = 0; index < cast->locals.size; index++) {
1640
+ assert(cast->locals.ids[index] != 0);
1435
1641
  rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
1436
1642
  }
1437
1643
 
1438
1644
  // class_keyword_loc
1645
+ #line 173 "api_node.c.erb"
1439
1646
  argv[1] = yp_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);
1440
1647
 
1441
1648
  // constant_path
1649
+ #line 148 "api_node.c.erb"
1442
1650
  argv[2] = rb_ary_pop(value_stack);
1443
1651
 
1444
1652
  // inheritance_operator_loc
1653
+ #line 176 "api_node.c.erb"
1445
1654
  argv[3] = cast->inheritance_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->inheritance_operator_loc.start, cast->inheritance_operator_loc.end, source);
1446
1655
 
1447
1656
  // superclass
1657
+ #line 148 "api_node.c.erb"
1448
1658
  argv[4] = rb_ary_pop(value_stack);
1449
1659
 
1450
1660
  // body
1661
+ #line 148 "api_node.c.erb"
1451
1662
  argv[5] = rb_ary_pop(value_stack);
1452
1663
 
1453
1664
  // end_keyword_loc
1665
+ #line 173 "api_node.c.erb"
1454
1666
  argv[6] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
1455
1667
 
1456
1668
  // name
1457
- argv[7] = yp_string_new(&cast->name, encoding);
1669
+ #line 160 "api_node.c.erb"
1670
+ assert(cast->name != 0);
1671
+ argv[7] = rb_id2sym(constants[cast->name - 1]);
1458
1672
 
1459
1673
  // location
1460
1674
  argv[8] = yp_location_new(parser, node->location.start, node->location.end, source);
@@ -1463,20 +1677,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1463
1677
  break;
1464
1678
  }
1465
1679
  #line 137 "api_node.c.erb"
1466
- case YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE: {
1680
+ case YP_CLASS_VARIABLE_AND_WRITE_NODE: {
1467
1681
  yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
1468
1682
  VALUE argv[5];
1469
1683
 
1470
1684
  // name
1685
+ #line 160 "api_node.c.erb"
1686
+ assert(cast->name != 0);
1471
1687
  argv[0] = rb_id2sym(constants[cast->name - 1]);
1472
1688
 
1473
1689
  // name_loc
1690
+ #line 173 "api_node.c.erb"
1474
1691
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1475
1692
 
1476
1693
  // operator_loc
1694
+ #line 173 "api_node.c.erb"
1477
1695
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1478
1696
 
1479
1697
  // value
1698
+ #line 148 "api_node.c.erb"
1480
1699
  argv[3] = rb_ary_pop(value_stack);
1481
1700
 
1482
1701
  // location
@@ -1486,23 +1705,30 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1486
1705
  break;
1487
1706
  }
1488
1707
  #line 137 "api_node.c.erb"
1489
- case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
1708
+ case YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
1490
1709
  yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
1491
1710
  VALUE argv[6];
1492
1711
 
1493
1712
  // name
1713
+ #line 160 "api_node.c.erb"
1714
+ assert(cast->name != 0);
1494
1715
  argv[0] = rb_id2sym(constants[cast->name - 1]);
1495
1716
 
1496
1717
  // name_loc
1718
+ #line 173 "api_node.c.erb"
1497
1719
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1498
1720
 
1499
1721
  // operator_loc
1722
+ #line 173 "api_node.c.erb"
1500
1723
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1501
1724
 
1502
1725
  // value
1726
+ #line 148 "api_node.c.erb"
1503
1727
  argv[3] = rb_ary_pop(value_stack);
1504
1728
 
1505
1729
  // operator
1730
+ #line 160 "api_node.c.erb"
1731
+ assert(cast->operator != 0);
1506
1732
  argv[4] = rb_id2sym(constants[cast->operator - 1]);
1507
1733
 
1508
1734
  // location
@@ -1512,20 +1738,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1512
1738
  break;
1513
1739
  }
1514
1740
  #line 137 "api_node.c.erb"
1515
- case YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE: {
1741
+ case YP_CLASS_VARIABLE_OR_WRITE_NODE: {
1516
1742
  yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
1517
1743
  VALUE argv[5];
1518
1744
 
1519
1745
  // name
1746
+ #line 160 "api_node.c.erb"
1747
+ assert(cast->name != 0);
1520
1748
  argv[0] = rb_id2sym(constants[cast->name - 1]);
1521
1749
 
1522
1750
  // name_loc
1751
+ #line 173 "api_node.c.erb"
1523
1752
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1524
1753
 
1525
1754
  // operator_loc
1755
+ #line 173 "api_node.c.erb"
1526
1756
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1527
1757
 
1528
1758
  // value
1759
+ #line 148 "api_node.c.erb"
1529
1760
  argv[3] = rb_ary_pop(value_stack);
1530
1761
 
1531
1762
  // location
@@ -1535,11 +1766,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1535
1766
  break;
1536
1767
  }
1537
1768
  #line 137 "api_node.c.erb"
1538
- case YP_NODE_CLASS_VARIABLE_READ_NODE: {
1769
+ case YP_CLASS_VARIABLE_READ_NODE: {
1539
1770
  yp_class_variable_read_node_t *cast = (yp_class_variable_read_node_t *) node;
1540
1771
  VALUE argv[2];
1541
1772
 
1542
1773
  // name
1774
+ #line 160 "api_node.c.erb"
1775
+ assert(cast->name != 0);
1543
1776
  argv[0] = rb_id2sym(constants[cast->name - 1]);
1544
1777
 
1545
1778
  // location
@@ -1549,11 +1782,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1549
1782
  break;
1550
1783
  }
1551
1784
  #line 137 "api_node.c.erb"
1552
- case YP_NODE_CLASS_VARIABLE_TARGET_NODE: {
1785
+ case YP_CLASS_VARIABLE_TARGET_NODE: {
1553
1786
  yp_class_variable_target_node_t *cast = (yp_class_variable_target_node_t *) node;
1554
1787
  VALUE argv[2];
1555
1788
 
1556
1789
  // name
1790
+ #line 160 "api_node.c.erb"
1791
+ assert(cast->name != 0);
1557
1792
  argv[0] = rb_id2sym(constants[cast->name - 1]);
1558
1793
 
1559
1794
  // location
@@ -1563,20 +1798,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1563
1798
  break;
1564
1799
  }
1565
1800
  #line 137 "api_node.c.erb"
1566
- case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
1801
+ case YP_CLASS_VARIABLE_WRITE_NODE: {
1567
1802
  yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
1568
1803
  VALUE argv[5];
1569
1804
 
1570
1805
  // name
1806
+ #line 160 "api_node.c.erb"
1807
+ assert(cast->name != 0);
1571
1808
  argv[0] = rb_id2sym(constants[cast->name - 1]);
1572
1809
 
1573
1810
  // name_loc
1811
+ #line 173 "api_node.c.erb"
1574
1812
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1575
1813
 
1576
1814
  // value
1815
+ #line 148 "api_node.c.erb"
1577
1816
  argv[2] = rb_ary_pop(value_stack);
1578
1817
 
1579
1818
  // operator_loc
1819
+ #line 176 "api_node.c.erb"
1580
1820
  argv[3] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1581
1821
 
1582
1822
  // location
@@ -1586,80 +1826,109 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1586
1826
  break;
1587
1827
  }
1588
1828
  #line 137 "api_node.c.erb"
1589
- case YP_NODE_CONSTANT_AND_WRITE_NODE: {
1829
+ case YP_CONSTANT_AND_WRITE_NODE: {
1590
1830
  yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
1591
- VALUE argv[4];
1831
+ VALUE argv[5];
1832
+
1833
+ // name
1834
+ #line 160 "api_node.c.erb"
1835
+ assert(cast->name != 0);
1836
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1592
1837
 
1593
1838
  // name_loc
1594
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1839
+ #line 173 "api_node.c.erb"
1840
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1595
1841
 
1596
1842
  // operator_loc
1597
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1843
+ #line 173 "api_node.c.erb"
1844
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1598
1845
 
1599
1846
  // value
1600
- argv[2] = rb_ary_pop(value_stack);
1847
+ #line 148 "api_node.c.erb"
1848
+ argv[3] = rb_ary_pop(value_stack);
1601
1849
 
1602
1850
  // location
1603
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
1851
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
1604
1852
 
1605
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantAndWriteNode));
1853
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantAndWriteNode));
1606
1854
  break;
1607
1855
  }
1608
1856
  #line 137 "api_node.c.erb"
1609
- case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
1857
+ case YP_CONSTANT_OPERATOR_WRITE_NODE: {
1610
1858
  yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
1611
- VALUE argv[5];
1859
+ VALUE argv[6];
1860
+
1861
+ // name
1862
+ #line 160 "api_node.c.erb"
1863
+ assert(cast->name != 0);
1864
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1612
1865
 
1613
1866
  // name_loc
1614
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1867
+ #line 173 "api_node.c.erb"
1868
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1615
1869
 
1616
1870
  // operator_loc
1617
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1871
+ #line 173 "api_node.c.erb"
1872
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1618
1873
 
1619
1874
  // value
1620
- argv[2] = rb_ary_pop(value_stack);
1875
+ #line 148 "api_node.c.erb"
1876
+ argv[3] = rb_ary_pop(value_stack);
1621
1877
 
1622
1878
  // operator
1623
- argv[3] = rb_id2sym(constants[cast->operator - 1]);
1879
+ #line 160 "api_node.c.erb"
1880
+ assert(cast->operator != 0);
1881
+ argv[4] = rb_id2sym(constants[cast->operator - 1]);
1624
1882
 
1625
1883
  // location
1626
- argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
1884
+ argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
1627
1885
 
1628
- rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantOperatorWriteNode));
1886
+ rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPConstantOperatorWriteNode));
1629
1887
  break;
1630
1888
  }
1631
1889
  #line 137 "api_node.c.erb"
1632
- case YP_NODE_CONSTANT_OR_WRITE_NODE: {
1890
+ case YP_CONSTANT_OR_WRITE_NODE: {
1633
1891
  yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
1634
- VALUE argv[4];
1892
+ VALUE argv[5];
1893
+
1894
+ // name
1895
+ #line 160 "api_node.c.erb"
1896
+ assert(cast->name != 0);
1897
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1635
1898
 
1636
1899
  // name_loc
1637
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1900
+ #line 173 "api_node.c.erb"
1901
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1638
1902
 
1639
1903
  // operator_loc
1640
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1904
+ #line 173 "api_node.c.erb"
1905
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1641
1906
 
1642
1907
  // value
1643
- argv[2] = rb_ary_pop(value_stack);
1908
+ #line 148 "api_node.c.erb"
1909
+ argv[3] = rb_ary_pop(value_stack);
1644
1910
 
1645
1911
  // location
1646
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
1912
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
1647
1913
 
1648
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantOrWriteNode));
1914
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantOrWriteNode));
1649
1915
  break;
1650
1916
  }
1651
1917
  #line 137 "api_node.c.erb"
1652
- case YP_NODE_CONSTANT_PATH_AND_WRITE_NODE: {
1918
+ case YP_CONSTANT_PATH_AND_WRITE_NODE: {
1653
1919
  yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
1654
1920
  VALUE argv[4];
1655
1921
 
1656
1922
  // target
1923
+ #line 148 "api_node.c.erb"
1657
1924
  argv[0] = rb_ary_pop(value_stack);
1658
1925
 
1659
1926
  // operator_loc
1927
+ #line 173 "api_node.c.erb"
1660
1928
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1661
1929
 
1662
1930
  // value
1931
+ #line 148 "api_node.c.erb"
1663
1932
  argv[2] = rb_ary_pop(value_stack);
1664
1933
 
1665
1934
  // location
@@ -1669,17 +1938,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1669
1938
  break;
1670
1939
  }
1671
1940
  #line 137 "api_node.c.erb"
1672
- case YP_NODE_CONSTANT_PATH_NODE: {
1941
+ case YP_CONSTANT_PATH_NODE: {
1673
1942
  yp_constant_path_node_t *cast = (yp_constant_path_node_t *) node;
1674
1943
  VALUE argv[4];
1675
1944
 
1676
1945
  // parent
1946
+ #line 148 "api_node.c.erb"
1677
1947
  argv[0] = rb_ary_pop(value_stack);
1678
1948
 
1679
1949
  // child
1950
+ #line 148 "api_node.c.erb"
1680
1951
  argv[1] = rb_ary_pop(value_stack);
1681
1952
 
1682
1953
  // delimiter_loc
1954
+ #line 173 "api_node.c.erb"
1683
1955
  argv[2] = yp_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);
1684
1956
 
1685
1957
  // location
@@ -1689,20 +1961,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1689
1961
  break;
1690
1962
  }
1691
1963
  #line 137 "api_node.c.erb"
1692
- case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
1964
+ case YP_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
1693
1965
  yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
1694
1966
  VALUE argv[5];
1695
1967
 
1696
1968
  // target
1969
+ #line 148 "api_node.c.erb"
1697
1970
  argv[0] = rb_ary_pop(value_stack);
1698
1971
 
1699
1972
  // operator_loc
1973
+ #line 173 "api_node.c.erb"
1700
1974
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1701
1975
 
1702
1976
  // value
1977
+ #line 148 "api_node.c.erb"
1703
1978
  argv[2] = rb_ary_pop(value_stack);
1704
1979
 
1705
1980
  // operator
1981
+ #line 160 "api_node.c.erb"
1982
+ assert(cast->operator != 0);
1706
1983
  argv[3] = rb_id2sym(constants[cast->operator - 1]);
1707
1984
 
1708
1985
  // location
@@ -1712,17 +1989,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1712
1989
  break;
1713
1990
  }
1714
1991
  #line 137 "api_node.c.erb"
1715
- case YP_NODE_CONSTANT_PATH_OR_WRITE_NODE: {
1992
+ case YP_CONSTANT_PATH_OR_WRITE_NODE: {
1716
1993
  yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
1717
1994
  VALUE argv[4];
1718
1995
 
1719
1996
  // target
1997
+ #line 148 "api_node.c.erb"
1720
1998
  argv[0] = rb_ary_pop(value_stack);
1721
1999
 
1722
2000
  // operator_loc
2001
+ #line 173 "api_node.c.erb"
1723
2002
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1724
2003
 
1725
2004
  // value
2005
+ #line 148 "api_node.c.erb"
1726
2006
  argv[2] = rb_ary_pop(value_stack);
1727
2007
 
1728
2008
  // location
@@ -1732,17 +2012,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1732
2012
  break;
1733
2013
  }
1734
2014
  #line 137 "api_node.c.erb"
1735
- case YP_NODE_CONSTANT_PATH_TARGET_NODE: {
2015
+ case YP_CONSTANT_PATH_TARGET_NODE: {
1736
2016
  yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
1737
2017
  VALUE argv[4];
1738
2018
 
1739
2019
  // parent
2020
+ #line 148 "api_node.c.erb"
1740
2021
  argv[0] = rb_ary_pop(value_stack);
1741
2022
 
1742
2023
  // child
2024
+ #line 148 "api_node.c.erb"
1743
2025
  argv[1] = rb_ary_pop(value_stack);
1744
2026
 
1745
2027
  // delimiter_loc
2028
+ #line 173 "api_node.c.erb"
1746
2029
  argv[2] = yp_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);
1747
2030
 
1748
2031
  // location
@@ -1752,17 +2035,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1752
2035
  break;
1753
2036
  }
1754
2037
  #line 137 "api_node.c.erb"
1755
- case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
2038
+ case YP_CONSTANT_PATH_WRITE_NODE: {
1756
2039
  yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
1757
2040
  VALUE argv[4];
1758
2041
 
1759
2042
  // target
2043
+ #line 148 "api_node.c.erb"
1760
2044
  argv[0] = rb_ary_pop(value_stack);
1761
2045
 
1762
2046
  // operator_loc
2047
+ #line 173 "api_node.c.erb"
1763
2048
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1764
2049
 
1765
2050
  // value
2051
+ #line 148 "api_node.c.erb"
1766
2052
  argv[2] = rb_ary_pop(value_stack);
1767
2053
 
1768
2054
  // location
@@ -1772,107 +2058,148 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1772
2058
  break;
1773
2059
  }
1774
2060
  #line 137 "api_node.c.erb"
1775
- case YP_NODE_CONSTANT_READ_NODE: {
1776
- VALUE argv[1];
2061
+ case YP_CONSTANT_READ_NODE: {
2062
+ yp_constant_read_node_t *cast = (yp_constant_read_node_t *) node;
2063
+ VALUE argv[2];
2064
+
2065
+ // name
2066
+ #line 160 "api_node.c.erb"
2067
+ assert(cast->name != 0);
2068
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1777
2069
 
1778
2070
  // location
1779
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
2071
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
1780
2072
 
1781
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPConstantReadNode));
2073
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPConstantReadNode));
1782
2074
  break;
1783
2075
  }
1784
2076
  #line 137 "api_node.c.erb"
1785
- case YP_NODE_CONSTANT_TARGET_NODE: {
1786
- VALUE argv[1];
2077
+ case YP_CONSTANT_TARGET_NODE: {
2078
+ yp_constant_target_node_t *cast = (yp_constant_target_node_t *) node;
2079
+ VALUE argv[2];
2080
+
2081
+ // name
2082
+ #line 160 "api_node.c.erb"
2083
+ assert(cast->name != 0);
2084
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1787
2085
 
1788
2086
  // location
1789
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
2087
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
1790
2088
 
1791
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPConstantTargetNode));
2089
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPConstantTargetNode));
1792
2090
  break;
1793
2091
  }
1794
2092
  #line 137 "api_node.c.erb"
1795
- case YP_NODE_CONSTANT_WRITE_NODE: {
2093
+ case YP_CONSTANT_WRITE_NODE: {
1796
2094
  yp_constant_write_node_t *cast = (yp_constant_write_node_t *) node;
1797
- VALUE argv[4];
2095
+ VALUE argv[5];
2096
+
2097
+ // name
2098
+ #line 160 "api_node.c.erb"
2099
+ assert(cast->name != 0);
2100
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1798
2101
 
1799
2102
  // name_loc
1800
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2103
+ #line 173 "api_node.c.erb"
2104
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1801
2105
 
1802
2106
  // value
1803
- argv[1] = rb_ary_pop(value_stack);
2107
+ #line 148 "api_node.c.erb"
2108
+ argv[2] = rb_ary_pop(value_stack);
1804
2109
 
1805
2110
  // operator_loc
1806
- argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2111
+ #line 173 "api_node.c.erb"
2112
+ argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1807
2113
 
1808
2114
  // location
1809
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
2115
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
1810
2116
 
1811
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantWriteNode));
2117
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantWriteNode));
1812
2118
  break;
1813
2119
  }
1814
2120
  #line 137 "api_node.c.erb"
1815
- case YP_NODE_DEF_NODE: {
2121
+ case YP_DEF_NODE: {
1816
2122
  yp_def_node_t *cast = (yp_def_node_t *) node;
1817
- VALUE argv[12];
2123
+ VALUE argv[13];
2124
+
2125
+ // name
2126
+ #line 160 "api_node.c.erb"
2127
+ assert(cast->name != 0);
2128
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
1818
2129
 
1819
2130
  // name_loc
1820
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2131
+ #line 173 "api_node.c.erb"
2132
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
1821
2133
 
1822
2134
  // receiver
1823
- argv[1] = rb_ary_pop(value_stack);
2135
+ #line 148 "api_node.c.erb"
2136
+ argv[2] = rb_ary_pop(value_stack);
1824
2137
 
1825
2138
  // parameters
1826
- argv[2] = rb_ary_pop(value_stack);
2139
+ #line 148 "api_node.c.erb"
2140
+ argv[3] = rb_ary_pop(value_stack);
1827
2141
 
1828
2142
  // body
1829
- argv[3] = rb_ary_pop(value_stack);
2143
+ #line 148 "api_node.c.erb"
2144
+ argv[4] = rb_ary_pop(value_stack);
1830
2145
 
1831
2146
  // locals
1832
- argv[4] = rb_ary_new_capa(cast->locals.size);
2147
+ #line 166 "api_node.c.erb"
2148
+ argv[5] = rb_ary_new_capa(cast->locals.size);
1833
2149
  for (size_t index = 0; index < cast->locals.size; index++) {
1834
- rb_ary_push(argv[4], rb_id2sym(constants[cast->locals.ids[index] - 1]));
2150
+ assert(cast->locals.ids[index] != 0);
2151
+ rb_ary_push(argv[5], rb_id2sym(constants[cast->locals.ids[index] - 1]));
1835
2152
  }
1836
2153
 
1837
2154
  // def_keyword_loc
1838
- argv[5] = yp_location_new(parser, cast->def_keyword_loc.start, cast->def_keyword_loc.end, source);
2155
+ #line 173 "api_node.c.erb"
2156
+ argv[6] = yp_location_new(parser, cast->def_keyword_loc.start, cast->def_keyword_loc.end, source);
1839
2157
 
1840
2158
  // operator_loc
1841
- argv[6] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2159
+ #line 176 "api_node.c.erb"
2160
+ argv[7] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1842
2161
 
1843
2162
  // lparen_loc
1844
- argv[7] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
2163
+ #line 176 "api_node.c.erb"
2164
+ argv[8] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
1845
2165
 
1846
2166
  // rparen_loc
1847
- argv[8] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
2167
+ #line 176 "api_node.c.erb"
2168
+ argv[9] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
1848
2169
 
1849
2170
  // equal_loc
1850
- argv[9] = cast->equal_loc.start == NULL ? Qnil : yp_location_new(parser, cast->equal_loc.start, cast->equal_loc.end, source);
2171
+ #line 176 "api_node.c.erb"
2172
+ argv[10] = cast->equal_loc.start == NULL ? Qnil : yp_location_new(parser, cast->equal_loc.start, cast->equal_loc.end, source);
1851
2173
 
1852
2174
  // end_keyword_loc
1853
- argv[10] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
2175
+ #line 176 "api_node.c.erb"
2176
+ argv[11] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
1854
2177
 
1855
2178
  // location
1856
- argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
2179
+ argv[12] = yp_location_new(parser, node->location.start, node->location.end, source);
1857
2180
 
1858
- rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPDefNode));
2181
+ rb_ary_push(value_stack, rb_class_new_instance(13, argv, rb_cYARPDefNode));
1859
2182
  break;
1860
2183
  }
1861
2184
  #line 137 "api_node.c.erb"
1862
- case YP_NODE_DEFINED_NODE: {
2185
+ case YP_DEFINED_NODE: {
1863
2186
  yp_defined_node_t *cast = (yp_defined_node_t *) node;
1864
2187
  VALUE argv[5];
1865
2188
 
1866
2189
  // lparen_loc
2190
+ #line 176 "api_node.c.erb"
1867
2191
  argv[0] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
1868
2192
 
1869
2193
  // value
2194
+ #line 148 "api_node.c.erb"
1870
2195
  argv[1] = rb_ary_pop(value_stack);
1871
2196
 
1872
2197
  // rparen_loc
2198
+ #line 176 "api_node.c.erb"
1873
2199
  argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
1874
2200
 
1875
2201
  // keyword_loc
2202
+ #line 173 "api_node.c.erb"
1876
2203
  argv[3] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
1877
2204
 
1878
2205
  // location
@@ -1882,17 +2209,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1882
2209
  break;
1883
2210
  }
1884
2211
  #line 137 "api_node.c.erb"
1885
- case YP_NODE_ELSE_NODE: {
2212
+ case YP_ELSE_NODE: {
1886
2213
  yp_else_node_t *cast = (yp_else_node_t *) node;
1887
2214
  VALUE argv[4];
1888
2215
 
1889
2216
  // else_keyword_loc
2217
+ #line 173 "api_node.c.erb"
1890
2218
  argv[0] = yp_location_new(parser, cast->else_keyword_loc.start, cast->else_keyword_loc.end, source);
1891
2219
 
1892
2220
  // statements
2221
+ #line 148 "api_node.c.erb"
1893
2222
  argv[1] = rb_ary_pop(value_stack);
1894
2223
 
1895
2224
  // end_keyword_loc
2225
+ #line 176 "api_node.c.erb"
1896
2226
  argv[2] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
1897
2227
 
1898
2228
  // location
@@ -1902,17 +2232,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1902
2232
  break;
1903
2233
  }
1904
2234
  #line 137 "api_node.c.erb"
1905
- case YP_NODE_EMBEDDED_STATEMENTS_NODE: {
2235
+ case YP_EMBEDDED_STATEMENTS_NODE: {
1906
2236
  yp_embedded_statements_node_t *cast = (yp_embedded_statements_node_t *) node;
1907
2237
  VALUE argv[4];
1908
2238
 
1909
2239
  // opening_loc
2240
+ #line 173 "api_node.c.erb"
1910
2241
  argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1911
2242
 
1912
2243
  // statements
2244
+ #line 148 "api_node.c.erb"
1913
2245
  argv[1] = rb_ary_pop(value_stack);
1914
2246
 
1915
2247
  // closing_loc
2248
+ #line 173 "api_node.c.erb"
1916
2249
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1917
2250
 
1918
2251
  // location
@@ -1922,14 +2255,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1922
2255
  break;
1923
2256
  }
1924
2257
  #line 137 "api_node.c.erb"
1925
- case YP_NODE_EMBEDDED_VARIABLE_NODE: {
2258
+ case YP_EMBEDDED_VARIABLE_NODE: {
1926
2259
  yp_embedded_variable_node_t *cast = (yp_embedded_variable_node_t *) node;
1927
2260
  VALUE argv[3];
1928
2261
 
1929
2262
  // operator_loc
2263
+ #line 173 "api_node.c.erb"
1930
2264
  argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
1931
2265
 
1932
2266
  // variable
2267
+ #line 148 "api_node.c.erb"
1933
2268
  argv[1] = rb_ary_pop(value_stack);
1934
2269
 
1935
2270
  // location
@@ -1939,17 +2274,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1939
2274
  break;
1940
2275
  }
1941
2276
  #line 137 "api_node.c.erb"
1942
- case YP_NODE_ENSURE_NODE: {
2277
+ case YP_ENSURE_NODE: {
1943
2278
  yp_ensure_node_t *cast = (yp_ensure_node_t *) node;
1944
2279
  VALUE argv[4];
1945
2280
 
1946
2281
  // ensure_keyword_loc
2282
+ #line 173 "api_node.c.erb"
1947
2283
  argv[0] = yp_location_new(parser, cast->ensure_keyword_loc.start, cast->ensure_keyword_loc.end, source);
1948
2284
 
1949
2285
  // statements
2286
+ #line 148 "api_node.c.erb"
1950
2287
  argv[1] = rb_ary_pop(value_stack);
1951
2288
 
1952
2289
  // end_keyword_loc
2290
+ #line 173 "api_node.c.erb"
1953
2291
  argv[2] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
1954
2292
 
1955
2293
  // location
@@ -1959,7 +2297,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1959
2297
  break;
1960
2298
  }
1961
2299
  #line 137 "api_node.c.erb"
1962
- case YP_NODE_FALSE_NODE: {
2300
+ case YP_FALSE_NODE: {
1963
2301
  VALUE argv[1];
1964
2302
 
1965
2303
  // location
@@ -1969,29 +2307,35 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
1969
2307
  break;
1970
2308
  }
1971
2309
  #line 137 "api_node.c.erb"
1972
- case YP_NODE_FIND_PATTERN_NODE: {
2310
+ case YP_FIND_PATTERN_NODE: {
1973
2311
  yp_find_pattern_node_t *cast = (yp_find_pattern_node_t *) node;
1974
2312
  VALUE argv[7];
1975
2313
 
1976
2314
  // constant
2315
+ #line 148 "api_node.c.erb"
1977
2316
  argv[0] = rb_ary_pop(value_stack);
1978
2317
 
1979
2318
  // left
2319
+ #line 148 "api_node.c.erb"
1980
2320
  argv[1] = rb_ary_pop(value_stack);
1981
2321
 
1982
2322
  // requireds
2323
+ #line 151 "api_node.c.erb"
1983
2324
  argv[2] = rb_ary_new_capa(cast->requireds.size);
1984
2325
  for (size_t index = 0; index < cast->requireds.size; index++) {
1985
2326
  rb_ary_push(argv[2], rb_ary_pop(value_stack));
1986
2327
  }
1987
2328
 
1988
2329
  // right
2330
+ #line 148 "api_node.c.erb"
1989
2331
  argv[3] = rb_ary_pop(value_stack);
1990
2332
 
1991
2333
  // opening_loc
2334
+ #line 176 "api_node.c.erb"
1992
2335
  argv[4] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
1993
2336
 
1994
2337
  // closing_loc
2338
+ #line 176 "api_node.c.erb"
1995
2339
  argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
1996
2340
 
1997
2341
  // location
@@ -2001,20 +2345,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2001
2345
  break;
2002
2346
  }
2003
2347
  #line 137 "api_node.c.erb"
2004
- case YP_NODE_FLIP_FLOP_NODE: {
2348
+ case YP_FLIP_FLOP_NODE: {
2005
2349
  yp_flip_flop_node_t *cast = (yp_flip_flop_node_t *) node;
2006
2350
  VALUE argv[5];
2007
2351
 
2008
2352
  // left
2353
+ #line 148 "api_node.c.erb"
2009
2354
  argv[0] = rb_ary_pop(value_stack);
2010
2355
 
2011
2356
  // right
2357
+ #line 148 "api_node.c.erb"
2012
2358
  argv[1] = rb_ary_pop(value_stack);
2013
2359
 
2014
2360
  // operator_loc
2361
+ #line 173 "api_node.c.erb"
2015
2362
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2016
2363
 
2017
2364
  // flags
2365
+ #line 182 "api_node.c.erb"
2018
2366
  argv[3] = ULONG2NUM(node->flags >> 1);
2019
2367
 
2020
2368
  // location
@@ -2024,7 +2372,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2024
2372
  break;
2025
2373
  }
2026
2374
  #line 137 "api_node.c.erb"
2027
- case YP_NODE_FLOAT_NODE: {
2375
+ case YP_FLOAT_NODE: {
2028
2376
  VALUE argv[1];
2029
2377
 
2030
2378
  // location
@@ -2034,29 +2382,36 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2034
2382
  break;
2035
2383
  }
2036
2384
  #line 137 "api_node.c.erb"
2037
- case YP_NODE_FOR_NODE: {
2385
+ case YP_FOR_NODE: {
2038
2386
  yp_for_node_t *cast = (yp_for_node_t *) node;
2039
2387
  VALUE argv[8];
2040
2388
 
2041
2389
  // index
2390
+ #line 148 "api_node.c.erb"
2042
2391
  argv[0] = rb_ary_pop(value_stack);
2043
2392
 
2044
2393
  // collection
2394
+ #line 148 "api_node.c.erb"
2045
2395
  argv[1] = rb_ary_pop(value_stack);
2046
2396
 
2047
2397
  // statements
2398
+ #line 148 "api_node.c.erb"
2048
2399
  argv[2] = rb_ary_pop(value_stack);
2049
2400
 
2050
2401
  // for_keyword_loc
2402
+ #line 173 "api_node.c.erb"
2051
2403
  argv[3] = yp_location_new(parser, cast->for_keyword_loc.start, cast->for_keyword_loc.end, source);
2052
2404
 
2053
2405
  // in_keyword_loc
2406
+ #line 173 "api_node.c.erb"
2054
2407
  argv[4] = yp_location_new(parser, cast->in_keyword_loc.start, cast->in_keyword_loc.end, source);
2055
2408
 
2056
2409
  // do_keyword_loc
2410
+ #line 176 "api_node.c.erb"
2057
2411
  argv[5] = cast->do_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->do_keyword_loc.start, cast->do_keyword_loc.end, source);
2058
2412
 
2059
2413
  // end_keyword_loc
2414
+ #line 173 "api_node.c.erb"
2060
2415
  argv[6] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
2061
2416
 
2062
2417
  // location
@@ -2066,7 +2421,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2066
2421
  break;
2067
2422
  }
2068
2423
  #line 137 "api_node.c.erb"
2069
- case YP_NODE_FORWARDING_ARGUMENTS_NODE: {
2424
+ case YP_FORWARDING_ARGUMENTS_NODE: {
2070
2425
  VALUE argv[1];
2071
2426
 
2072
2427
  // location
@@ -2076,7 +2431,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2076
2431
  break;
2077
2432
  }
2078
2433
  #line 137 "api_node.c.erb"
2079
- case YP_NODE_FORWARDING_PARAMETER_NODE: {
2434
+ case YP_FORWARDING_PARAMETER_NODE: {
2080
2435
  VALUE argv[1];
2081
2436
 
2082
2437
  // location
@@ -2086,10 +2441,11 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2086
2441
  break;
2087
2442
  }
2088
2443
  #line 137 "api_node.c.erb"
2089
- case YP_NODE_FORWARDING_SUPER_NODE: {
2444
+ case YP_FORWARDING_SUPER_NODE: {
2090
2445
  VALUE argv[2];
2091
2446
 
2092
2447
  // block
2448
+ #line 148 "api_node.c.erb"
2093
2449
  argv[0] = rb_ary_pop(value_stack);
2094
2450
 
2095
2451
  // location
@@ -2099,123 +2455,172 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2099
2455
  break;
2100
2456
  }
2101
2457
  #line 137 "api_node.c.erb"
2102
- case YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE: {
2458
+ case YP_GLOBAL_VARIABLE_AND_WRITE_NODE: {
2103
2459
  yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
2104
- VALUE argv[4];
2460
+ VALUE argv[5];
2461
+
2462
+ // name
2463
+ #line 160 "api_node.c.erb"
2464
+ assert(cast->name != 0);
2465
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
2105
2466
 
2106
2467
  // name_loc
2107
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2468
+ #line 173 "api_node.c.erb"
2469
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2108
2470
 
2109
2471
  // operator_loc
2110
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2472
+ #line 173 "api_node.c.erb"
2473
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2111
2474
 
2112
2475
  // value
2113
- argv[2] = rb_ary_pop(value_stack);
2476
+ #line 148 "api_node.c.erb"
2477
+ argv[3] = rb_ary_pop(value_stack);
2114
2478
 
2115
2479
  // location
2116
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
2480
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
2117
2481
 
2118
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableAndWriteNode));
2482
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableAndWriteNode));
2119
2483
  break;
2120
2484
  }
2121
2485
  #line 137 "api_node.c.erb"
2122
- case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
2486
+ case YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
2123
2487
  yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
2124
- VALUE argv[5];
2488
+ VALUE argv[6];
2489
+
2490
+ // name
2491
+ #line 160 "api_node.c.erb"
2492
+ assert(cast->name != 0);
2493
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
2125
2494
 
2126
2495
  // name_loc
2127
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2496
+ #line 173 "api_node.c.erb"
2497
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2128
2498
 
2129
2499
  // operator_loc
2130
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2500
+ #line 173 "api_node.c.erb"
2501
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2131
2502
 
2132
2503
  // value
2133
- argv[2] = rb_ary_pop(value_stack);
2504
+ #line 148 "api_node.c.erb"
2505
+ argv[3] = rb_ary_pop(value_stack);
2134
2506
 
2135
2507
  // operator
2136
- argv[3] = rb_id2sym(constants[cast->operator - 1]);
2508
+ #line 160 "api_node.c.erb"
2509
+ assert(cast->operator != 0);
2510
+ argv[4] = rb_id2sym(constants[cast->operator - 1]);
2137
2511
 
2138
2512
  // location
2139
- argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
2513
+ argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
2140
2514
 
2141
- rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableOperatorWriteNode));
2515
+ rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPGlobalVariableOperatorWriteNode));
2142
2516
  break;
2143
2517
  }
2144
2518
  #line 137 "api_node.c.erb"
2145
- case YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE: {
2519
+ case YP_GLOBAL_VARIABLE_OR_WRITE_NODE: {
2146
2520
  yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
2147
- VALUE argv[4];
2521
+ VALUE argv[5];
2522
+
2523
+ // name
2524
+ #line 160 "api_node.c.erb"
2525
+ assert(cast->name != 0);
2526
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
2148
2527
 
2149
2528
  // name_loc
2150
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2529
+ #line 173 "api_node.c.erb"
2530
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2151
2531
 
2152
2532
  // operator_loc
2153
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2533
+ #line 173 "api_node.c.erb"
2534
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2154
2535
 
2155
2536
  // value
2156
- argv[2] = rb_ary_pop(value_stack);
2537
+ #line 148 "api_node.c.erb"
2538
+ argv[3] = rb_ary_pop(value_stack);
2157
2539
 
2158
2540
  // location
2159
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
2541
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
2160
2542
 
2161
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableOrWriteNode));
2543
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableOrWriteNode));
2162
2544
  break;
2163
2545
  }
2164
2546
  #line 137 "api_node.c.erb"
2165
- case YP_NODE_GLOBAL_VARIABLE_READ_NODE: {
2166
- VALUE argv[1];
2547
+ case YP_GLOBAL_VARIABLE_READ_NODE: {
2548
+ yp_global_variable_read_node_t *cast = (yp_global_variable_read_node_t *) node;
2549
+ VALUE argv[2];
2550
+
2551
+ // name
2552
+ #line 160 "api_node.c.erb"
2553
+ assert(cast->name != 0);
2554
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
2167
2555
 
2168
2556
  // location
2169
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
2557
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
2170
2558
 
2171
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPGlobalVariableReadNode));
2559
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPGlobalVariableReadNode));
2172
2560
  break;
2173
2561
  }
2174
2562
  #line 137 "api_node.c.erb"
2175
- case YP_NODE_GLOBAL_VARIABLE_TARGET_NODE: {
2176
- VALUE argv[1];
2563
+ case YP_GLOBAL_VARIABLE_TARGET_NODE: {
2564
+ yp_global_variable_target_node_t *cast = (yp_global_variable_target_node_t *) node;
2565
+ VALUE argv[2];
2566
+
2567
+ // name
2568
+ #line 160 "api_node.c.erb"
2569
+ assert(cast->name != 0);
2570
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
2177
2571
 
2178
2572
  // location
2179
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
2573
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
2180
2574
 
2181
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPGlobalVariableTargetNode));
2575
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPGlobalVariableTargetNode));
2182
2576
  break;
2183
2577
  }
2184
2578
  #line 137 "api_node.c.erb"
2185
- case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
2579
+ case YP_GLOBAL_VARIABLE_WRITE_NODE: {
2186
2580
  yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
2187
- VALUE argv[4];
2581
+ VALUE argv[5];
2582
+
2583
+ // name
2584
+ #line 160 "api_node.c.erb"
2585
+ assert(cast->name != 0);
2586
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
2188
2587
 
2189
2588
  // name_loc
2190
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2589
+ #line 173 "api_node.c.erb"
2590
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2191
2591
 
2192
2592
  // value
2193
- argv[1] = rb_ary_pop(value_stack);
2593
+ #line 148 "api_node.c.erb"
2594
+ argv[2] = rb_ary_pop(value_stack);
2194
2595
 
2195
2596
  // operator_loc
2196
- argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2597
+ #line 173 "api_node.c.erb"
2598
+ argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2197
2599
 
2198
2600
  // location
2199
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
2601
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
2200
2602
 
2201
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableWriteNode));
2603
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableWriteNode));
2202
2604
  break;
2203
2605
  }
2204
2606
  #line 137 "api_node.c.erb"
2205
- case YP_NODE_HASH_NODE: {
2607
+ case YP_HASH_NODE: {
2206
2608
  yp_hash_node_t *cast = (yp_hash_node_t *) node;
2207
2609
  VALUE argv[4];
2208
2610
 
2209
2611
  // opening_loc
2612
+ #line 173 "api_node.c.erb"
2210
2613
  argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
2211
2614
 
2212
2615
  // elements
2616
+ #line 151 "api_node.c.erb"
2213
2617
  argv[1] = rb_ary_new_capa(cast->elements.size);
2214
2618
  for (size_t index = 0; index < cast->elements.size; index++) {
2215
2619
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
2216
2620
  }
2217
2621
 
2218
2622
  // closing_loc
2623
+ #line 173 "api_node.c.erb"
2219
2624
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
2220
2625
 
2221
2626
  // location
@@ -2225,26 +2630,31 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2225
2630
  break;
2226
2631
  }
2227
2632
  #line 137 "api_node.c.erb"
2228
- case YP_NODE_HASH_PATTERN_NODE: {
2633
+ case YP_HASH_PATTERN_NODE: {
2229
2634
  yp_hash_pattern_node_t *cast = (yp_hash_pattern_node_t *) node;
2230
2635
  VALUE argv[6];
2231
2636
 
2232
2637
  // constant
2638
+ #line 148 "api_node.c.erb"
2233
2639
  argv[0] = rb_ary_pop(value_stack);
2234
2640
 
2235
2641
  // assocs
2642
+ #line 151 "api_node.c.erb"
2236
2643
  argv[1] = rb_ary_new_capa(cast->assocs.size);
2237
2644
  for (size_t index = 0; index < cast->assocs.size; index++) {
2238
2645
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
2239
2646
  }
2240
2647
 
2241
2648
  // kwrest
2649
+ #line 148 "api_node.c.erb"
2242
2650
  argv[2] = rb_ary_pop(value_stack);
2243
2651
 
2244
2652
  // opening_loc
2653
+ #line 176 "api_node.c.erb"
2245
2654
  argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
2246
2655
 
2247
2656
  // closing_loc
2657
+ #line 176 "api_node.c.erb"
2248
2658
  argv[4] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
2249
2659
 
2250
2660
  // location
@@ -2254,23 +2664,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2254
2664
  break;
2255
2665
  }
2256
2666
  #line 137 "api_node.c.erb"
2257
- case YP_NODE_IF_NODE: {
2667
+ case YP_IF_NODE: {
2258
2668
  yp_if_node_t *cast = (yp_if_node_t *) node;
2259
2669
  VALUE argv[6];
2260
2670
 
2261
2671
  // if_keyword_loc
2672
+ #line 176 "api_node.c.erb"
2262
2673
  argv[0] = cast->if_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->if_keyword_loc.start, cast->if_keyword_loc.end, source);
2263
2674
 
2264
2675
  // predicate
2676
+ #line 148 "api_node.c.erb"
2265
2677
  argv[1] = rb_ary_pop(value_stack);
2266
2678
 
2267
2679
  // statements
2680
+ #line 148 "api_node.c.erb"
2268
2681
  argv[2] = rb_ary_pop(value_stack);
2269
2682
 
2270
2683
  // consequent
2684
+ #line 148 "api_node.c.erb"
2271
2685
  argv[3] = rb_ary_pop(value_stack);
2272
2686
 
2273
2687
  // end_keyword_loc
2688
+ #line 176 "api_node.c.erb"
2274
2689
  argv[4] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
2275
2690
 
2276
2691
  // location
@@ -2280,10 +2695,11 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2280
2695
  break;
2281
2696
  }
2282
2697
  #line 137 "api_node.c.erb"
2283
- case YP_NODE_IMAGINARY_NODE: {
2698
+ case YP_IMAGINARY_NODE: {
2284
2699
  VALUE argv[2];
2285
2700
 
2286
2701
  // numeric
2702
+ #line 148 "api_node.c.erb"
2287
2703
  argv[0] = rb_ary_pop(value_stack);
2288
2704
 
2289
2705
  // location
@@ -2293,20 +2709,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2293
2709
  break;
2294
2710
  }
2295
2711
  #line 137 "api_node.c.erb"
2296
- case YP_NODE_IN_NODE: {
2712
+ case YP_IN_NODE: {
2297
2713
  yp_in_node_t *cast = (yp_in_node_t *) node;
2298
2714
  VALUE argv[5];
2299
2715
 
2300
2716
  // pattern
2717
+ #line 148 "api_node.c.erb"
2301
2718
  argv[0] = rb_ary_pop(value_stack);
2302
2719
 
2303
2720
  // statements
2721
+ #line 148 "api_node.c.erb"
2304
2722
  argv[1] = rb_ary_pop(value_stack);
2305
2723
 
2306
2724
  // in_loc
2725
+ #line 173 "api_node.c.erb"
2307
2726
  argv[2] = yp_location_new(parser, cast->in_loc.start, cast->in_loc.end, source);
2308
2727
 
2309
2728
  // then_loc
2729
+ #line 176 "api_node.c.erb"
2310
2730
  argv[3] = cast->then_loc.start == NULL ? Qnil : yp_location_new(parser, cast->then_loc.start, cast->then_loc.end, source);
2311
2731
 
2312
2732
  // location
@@ -2316,20 +2736,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2316
2736
  break;
2317
2737
  }
2318
2738
  #line 137 "api_node.c.erb"
2319
- case YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE: {
2739
+ case YP_INSTANCE_VARIABLE_AND_WRITE_NODE: {
2320
2740
  yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
2321
2741
  VALUE argv[5];
2322
2742
 
2323
2743
  // name
2744
+ #line 160 "api_node.c.erb"
2745
+ assert(cast->name != 0);
2324
2746
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2325
2747
 
2326
2748
  // name_loc
2749
+ #line 173 "api_node.c.erb"
2327
2750
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2328
2751
 
2329
2752
  // operator_loc
2753
+ #line 173 "api_node.c.erb"
2330
2754
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2331
2755
 
2332
2756
  // value
2757
+ #line 148 "api_node.c.erb"
2333
2758
  argv[3] = rb_ary_pop(value_stack);
2334
2759
 
2335
2760
  // location
@@ -2339,23 +2764,30 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2339
2764
  break;
2340
2765
  }
2341
2766
  #line 137 "api_node.c.erb"
2342
- case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
2767
+ case YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
2343
2768
  yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
2344
2769
  VALUE argv[6];
2345
2770
 
2346
2771
  // name
2772
+ #line 160 "api_node.c.erb"
2773
+ assert(cast->name != 0);
2347
2774
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2348
2775
 
2349
2776
  // name_loc
2777
+ #line 173 "api_node.c.erb"
2350
2778
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2351
2779
 
2352
2780
  // operator_loc
2781
+ #line 173 "api_node.c.erb"
2353
2782
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2354
2783
 
2355
2784
  // value
2785
+ #line 148 "api_node.c.erb"
2356
2786
  argv[3] = rb_ary_pop(value_stack);
2357
2787
 
2358
2788
  // operator
2789
+ #line 160 "api_node.c.erb"
2790
+ assert(cast->operator != 0);
2359
2791
  argv[4] = rb_id2sym(constants[cast->operator - 1]);
2360
2792
 
2361
2793
  // location
@@ -2365,20 +2797,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2365
2797
  break;
2366
2798
  }
2367
2799
  #line 137 "api_node.c.erb"
2368
- case YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE: {
2800
+ case YP_INSTANCE_VARIABLE_OR_WRITE_NODE: {
2369
2801
  yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
2370
2802
  VALUE argv[5];
2371
2803
 
2372
2804
  // name
2805
+ #line 160 "api_node.c.erb"
2806
+ assert(cast->name != 0);
2373
2807
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2374
2808
 
2375
2809
  // name_loc
2810
+ #line 173 "api_node.c.erb"
2376
2811
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2377
2812
 
2378
2813
  // operator_loc
2814
+ #line 173 "api_node.c.erb"
2379
2815
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2380
2816
 
2381
2817
  // value
2818
+ #line 148 "api_node.c.erb"
2382
2819
  argv[3] = rb_ary_pop(value_stack);
2383
2820
 
2384
2821
  // location
@@ -2388,11 +2825,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2388
2825
  break;
2389
2826
  }
2390
2827
  #line 137 "api_node.c.erb"
2391
- case YP_NODE_INSTANCE_VARIABLE_READ_NODE: {
2828
+ case YP_INSTANCE_VARIABLE_READ_NODE: {
2392
2829
  yp_instance_variable_read_node_t *cast = (yp_instance_variable_read_node_t *) node;
2393
2830
  VALUE argv[2];
2394
2831
 
2395
2832
  // name
2833
+ #line 160 "api_node.c.erb"
2834
+ assert(cast->name != 0);
2396
2835
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2397
2836
 
2398
2837
  // location
@@ -2402,11 +2841,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2402
2841
  break;
2403
2842
  }
2404
2843
  #line 137 "api_node.c.erb"
2405
- case YP_NODE_INSTANCE_VARIABLE_TARGET_NODE: {
2844
+ case YP_INSTANCE_VARIABLE_TARGET_NODE: {
2406
2845
  yp_instance_variable_target_node_t *cast = (yp_instance_variable_target_node_t *) node;
2407
2846
  VALUE argv[2];
2408
2847
 
2409
2848
  // name
2849
+ #line 160 "api_node.c.erb"
2850
+ assert(cast->name != 0);
2410
2851
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2411
2852
 
2412
2853
  // location
@@ -2416,20 +2857,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2416
2857
  break;
2417
2858
  }
2418
2859
  #line 137 "api_node.c.erb"
2419
- case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
2860
+ case YP_INSTANCE_VARIABLE_WRITE_NODE: {
2420
2861
  yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
2421
2862
  VALUE argv[5];
2422
2863
 
2423
2864
  // name
2865
+ #line 160 "api_node.c.erb"
2866
+ assert(cast->name != 0);
2424
2867
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2425
2868
 
2426
2869
  // name_loc
2870
+ #line 173 "api_node.c.erb"
2427
2871
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2428
2872
 
2429
2873
  // value
2874
+ #line 148 "api_node.c.erb"
2430
2875
  argv[2] = rb_ary_pop(value_stack);
2431
2876
 
2432
2877
  // operator_loc
2878
+ #line 173 "api_node.c.erb"
2433
2879
  argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2434
2880
 
2435
2881
  // location
@@ -2439,7 +2885,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2439
2885
  break;
2440
2886
  }
2441
2887
  #line 137 "api_node.c.erb"
2442
- case YP_NODE_INTEGER_NODE: {
2888
+ case YP_INTEGER_NODE: {
2443
2889
  VALUE argv[1];
2444
2890
 
2445
2891
  // location
@@ -2449,23 +2895,27 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2449
2895
  break;
2450
2896
  }
2451
2897
  #line 137 "api_node.c.erb"
2452
- case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
2898
+ case YP_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
2453
2899
  yp_interpolated_regular_expression_node_t *cast = (yp_interpolated_regular_expression_node_t *) node;
2454
2900
  VALUE argv[5];
2455
2901
 
2456
2902
  // opening_loc
2903
+ #line 173 "api_node.c.erb"
2457
2904
  argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
2458
2905
 
2459
2906
  // parts
2907
+ #line 151 "api_node.c.erb"
2460
2908
  argv[1] = rb_ary_new_capa(cast->parts.size);
2461
2909
  for (size_t index = 0; index < cast->parts.size; index++) {
2462
2910
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
2463
2911
  }
2464
2912
 
2465
2913
  // closing_loc
2914
+ #line 173 "api_node.c.erb"
2466
2915
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
2467
2916
 
2468
2917
  // flags
2918
+ #line 182 "api_node.c.erb"
2469
2919
  argv[3] = ULONG2NUM(node->flags >> 1);
2470
2920
 
2471
2921
  // location
@@ -2475,20 +2925,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2475
2925
  break;
2476
2926
  }
2477
2927
  #line 137 "api_node.c.erb"
2478
- case YP_NODE_INTERPOLATED_STRING_NODE: {
2928
+ case YP_INTERPOLATED_STRING_NODE: {
2479
2929
  yp_interpolated_string_node_t *cast = (yp_interpolated_string_node_t *) node;
2480
2930
  VALUE argv[4];
2481
2931
 
2482
2932
  // opening_loc
2933
+ #line 176 "api_node.c.erb"
2483
2934
  argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
2484
2935
 
2485
2936
  // parts
2937
+ #line 151 "api_node.c.erb"
2486
2938
  argv[1] = rb_ary_new_capa(cast->parts.size);
2487
2939
  for (size_t index = 0; index < cast->parts.size; index++) {
2488
2940
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
2489
2941
  }
2490
2942
 
2491
2943
  // closing_loc
2944
+ #line 176 "api_node.c.erb"
2492
2945
  argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
2493
2946
 
2494
2947
  // location
@@ -2498,20 +2951,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2498
2951
  break;
2499
2952
  }
2500
2953
  #line 137 "api_node.c.erb"
2501
- case YP_NODE_INTERPOLATED_SYMBOL_NODE: {
2954
+ case YP_INTERPOLATED_SYMBOL_NODE: {
2502
2955
  yp_interpolated_symbol_node_t *cast = (yp_interpolated_symbol_node_t *) node;
2503
2956
  VALUE argv[4];
2504
2957
 
2505
2958
  // opening_loc
2959
+ #line 176 "api_node.c.erb"
2506
2960
  argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
2507
2961
 
2508
2962
  // parts
2963
+ #line 151 "api_node.c.erb"
2509
2964
  argv[1] = rb_ary_new_capa(cast->parts.size);
2510
2965
  for (size_t index = 0; index < cast->parts.size; index++) {
2511
2966
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
2512
2967
  }
2513
2968
 
2514
2969
  // closing_loc
2970
+ #line 176 "api_node.c.erb"
2515
2971
  argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
2516
2972
 
2517
2973
  // location
@@ -2521,20 +2977,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2521
2977
  break;
2522
2978
  }
2523
2979
  #line 137 "api_node.c.erb"
2524
- case YP_NODE_INTERPOLATED_X_STRING_NODE: {
2980
+ case YP_INTERPOLATED_X_STRING_NODE: {
2525
2981
  yp_interpolated_x_string_node_t *cast = (yp_interpolated_x_string_node_t *) node;
2526
2982
  VALUE argv[4];
2527
2983
 
2528
2984
  // opening_loc
2985
+ #line 173 "api_node.c.erb"
2529
2986
  argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
2530
2987
 
2531
2988
  // parts
2989
+ #line 151 "api_node.c.erb"
2532
2990
  argv[1] = rb_ary_new_capa(cast->parts.size);
2533
2991
  for (size_t index = 0; index < cast->parts.size; index++) {
2534
2992
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
2535
2993
  }
2536
2994
 
2537
2995
  // closing_loc
2996
+ #line 173 "api_node.c.erb"
2538
2997
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
2539
2998
 
2540
2999
  // location
@@ -2544,11 +3003,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2544
3003
  break;
2545
3004
  }
2546
3005
  #line 137 "api_node.c.erb"
2547
- case YP_NODE_KEYWORD_HASH_NODE: {
3006
+ case YP_KEYWORD_HASH_NODE: {
2548
3007
  yp_keyword_hash_node_t *cast = (yp_keyword_hash_node_t *) node;
2549
3008
  VALUE argv[2];
2550
3009
 
2551
3010
  // elements
3011
+ #line 151 "api_node.c.erb"
2552
3012
  argv[0] = rb_ary_new_capa(cast->elements.size);
2553
3013
  for (size_t index = 0; index < cast->elements.size; index++) {
2554
3014
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
@@ -2561,63 +3021,82 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2561
3021
  break;
2562
3022
  }
2563
3023
  #line 137 "api_node.c.erb"
2564
- case YP_NODE_KEYWORD_PARAMETER_NODE: {
3024
+ case YP_KEYWORD_PARAMETER_NODE: {
2565
3025
  yp_keyword_parameter_node_t *cast = (yp_keyword_parameter_node_t *) node;
2566
- VALUE argv[3];
3026
+ VALUE argv[4];
3027
+
3028
+ // name
3029
+ #line 160 "api_node.c.erb"
3030
+ assert(cast->name != 0);
3031
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
2567
3032
 
2568
3033
  // name_loc
2569
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
3034
+ #line 173 "api_node.c.erb"
3035
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2570
3036
 
2571
3037
  // value
2572
- argv[1] = rb_ary_pop(value_stack);
3038
+ #line 148 "api_node.c.erb"
3039
+ argv[2] = rb_ary_pop(value_stack);
2573
3040
 
2574
3041
  // location
2575
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
3042
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
2576
3043
 
2577
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPKeywordParameterNode));
3044
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPKeywordParameterNode));
2578
3045
  break;
2579
3046
  }
2580
3047
  #line 137 "api_node.c.erb"
2581
- case YP_NODE_KEYWORD_REST_PARAMETER_NODE: {
3048
+ case YP_KEYWORD_REST_PARAMETER_NODE: {
2582
3049
  yp_keyword_rest_parameter_node_t *cast = (yp_keyword_rest_parameter_node_t *) node;
2583
- VALUE argv[3];
3050
+ VALUE argv[4];
2584
3051
 
2585
- // operator_loc
2586
- argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3052
+ // name
3053
+ argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
2587
3054
 
2588
3055
  // name_loc
3056
+ #line 176 "api_node.c.erb"
2589
3057
  argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2590
3058
 
3059
+ // operator_loc
3060
+ #line 173 "api_node.c.erb"
3061
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3062
+
2591
3063
  // location
2592
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
3064
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
2593
3065
 
2594
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPKeywordRestParameterNode));
3066
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPKeywordRestParameterNode));
2595
3067
  break;
2596
3068
  }
2597
3069
  #line 137 "api_node.c.erb"
2598
- case YP_NODE_LAMBDA_NODE: {
3070
+ case YP_LAMBDA_NODE: {
2599
3071
  yp_lambda_node_t *cast = (yp_lambda_node_t *) node;
2600
3072
  VALUE argv[7];
2601
3073
 
2602
3074
  // locals
3075
+ #line 166 "api_node.c.erb"
2603
3076
  argv[0] = rb_ary_new_capa(cast->locals.size);
2604
3077
  for (size_t index = 0; index < cast->locals.size; index++) {
3078
+ assert(cast->locals.ids[index] != 0);
2605
3079
  rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
2606
3080
  }
2607
3081
 
2608
3082
  // operator_loc
3083
+ #line 173 "api_node.c.erb"
2609
3084
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2610
3085
 
2611
3086
  // opening_loc
3087
+ #line 173 "api_node.c.erb"
2612
3088
  argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
2613
3089
 
2614
3090
  // closing_loc
3091
+ #line 173 "api_node.c.erb"
2615
3092
  argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
2616
3093
 
2617
3094
  // parameters
3095
+ #line 148 "api_node.c.erb"
2618
3096
  argv[4] = rb_ary_pop(value_stack);
2619
3097
 
2620
3098
  // body
3099
+ #line 148 "api_node.c.erb"
2621
3100
  argv[5] = rb_ary_pop(value_stack);
2622
3101
 
2623
3102
  // location
@@ -2627,23 +3106,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2627
3106
  break;
2628
3107
  }
2629
3108
  #line 137 "api_node.c.erb"
2630
- case YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE: {
3109
+ case YP_LOCAL_VARIABLE_AND_WRITE_NODE: {
2631
3110
  yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
2632
3111
  VALUE argv[6];
2633
3112
 
2634
3113
  // name_loc
3114
+ #line 173 "api_node.c.erb"
2635
3115
  argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2636
3116
 
2637
3117
  // operator_loc
3118
+ #line 173 "api_node.c.erb"
2638
3119
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2639
3120
 
2640
3121
  // value
3122
+ #line 148 "api_node.c.erb"
2641
3123
  argv[2] = rb_ary_pop(value_stack);
2642
3124
 
2643
3125
  // name
3126
+ #line 160 "api_node.c.erb"
3127
+ assert(cast->name != 0);
2644
3128
  argv[3] = rb_id2sym(constants[cast->name - 1]);
2645
3129
 
2646
3130
  // depth
3131
+ #line 179 "api_node.c.erb"
2647
3132
  argv[4] = ULONG2NUM(cast->depth);
2648
3133
 
2649
3134
  // location
@@ -2653,26 +3138,34 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2653
3138
  break;
2654
3139
  }
2655
3140
  #line 137 "api_node.c.erb"
2656
- case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
3141
+ case YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
2657
3142
  yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
2658
3143
  VALUE argv[7];
2659
3144
 
2660
3145
  // name_loc
3146
+ #line 173 "api_node.c.erb"
2661
3147
  argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2662
3148
 
2663
3149
  // operator_loc
3150
+ #line 173 "api_node.c.erb"
2664
3151
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2665
3152
 
2666
3153
  // value
3154
+ #line 148 "api_node.c.erb"
2667
3155
  argv[2] = rb_ary_pop(value_stack);
2668
3156
 
2669
3157
  // name
3158
+ #line 160 "api_node.c.erb"
3159
+ assert(cast->name != 0);
2670
3160
  argv[3] = rb_id2sym(constants[cast->name - 1]);
2671
3161
 
2672
3162
  // operator
3163
+ #line 160 "api_node.c.erb"
3164
+ assert(cast->operator != 0);
2673
3165
  argv[4] = rb_id2sym(constants[cast->operator - 1]);
2674
3166
 
2675
3167
  // depth
3168
+ #line 179 "api_node.c.erb"
2676
3169
  argv[5] = ULONG2NUM(cast->depth);
2677
3170
 
2678
3171
  // location
@@ -2682,23 +3175,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2682
3175
  break;
2683
3176
  }
2684
3177
  #line 137 "api_node.c.erb"
2685
- case YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE: {
3178
+ case YP_LOCAL_VARIABLE_OR_WRITE_NODE: {
2686
3179
  yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
2687
3180
  VALUE argv[6];
2688
3181
 
2689
3182
  // name_loc
3183
+ #line 173 "api_node.c.erb"
2690
3184
  argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2691
3185
 
2692
3186
  // operator_loc
3187
+ #line 173 "api_node.c.erb"
2693
3188
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2694
3189
 
2695
3190
  // value
3191
+ #line 148 "api_node.c.erb"
2696
3192
  argv[2] = rb_ary_pop(value_stack);
2697
3193
 
2698
3194
  // name
3195
+ #line 160 "api_node.c.erb"
3196
+ assert(cast->name != 0);
2699
3197
  argv[3] = rb_id2sym(constants[cast->name - 1]);
2700
3198
 
2701
3199
  // depth
3200
+ #line 179 "api_node.c.erb"
2702
3201
  argv[4] = ULONG2NUM(cast->depth);
2703
3202
 
2704
3203
  // location
@@ -2708,14 +3207,17 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2708
3207
  break;
2709
3208
  }
2710
3209
  #line 137 "api_node.c.erb"
2711
- case YP_NODE_LOCAL_VARIABLE_READ_NODE: {
3210
+ case YP_LOCAL_VARIABLE_READ_NODE: {
2712
3211
  yp_local_variable_read_node_t *cast = (yp_local_variable_read_node_t *) node;
2713
3212
  VALUE argv[3];
2714
3213
 
2715
3214
  // name
3215
+ #line 160 "api_node.c.erb"
3216
+ assert(cast->name != 0);
2716
3217
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2717
3218
 
2718
3219
  // depth
3220
+ #line 179 "api_node.c.erb"
2719
3221
  argv[1] = ULONG2NUM(cast->depth);
2720
3222
 
2721
3223
  // location
@@ -2725,14 +3227,17 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2725
3227
  break;
2726
3228
  }
2727
3229
  #line 137 "api_node.c.erb"
2728
- case YP_NODE_LOCAL_VARIABLE_TARGET_NODE: {
3230
+ case YP_LOCAL_VARIABLE_TARGET_NODE: {
2729
3231
  yp_local_variable_target_node_t *cast = (yp_local_variable_target_node_t *) node;
2730
3232
  VALUE argv[3];
2731
3233
 
2732
3234
  // name
3235
+ #line 160 "api_node.c.erb"
3236
+ assert(cast->name != 0);
2733
3237
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2734
3238
 
2735
3239
  // depth
3240
+ #line 179 "api_node.c.erb"
2736
3241
  argv[1] = ULONG2NUM(cast->depth);
2737
3242
 
2738
3243
  // location
@@ -2742,23 +3247,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2742
3247
  break;
2743
3248
  }
2744
3249
  #line 137 "api_node.c.erb"
2745
- case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
3250
+ case YP_LOCAL_VARIABLE_WRITE_NODE: {
2746
3251
  yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
2747
3252
  VALUE argv[6];
2748
3253
 
2749
3254
  // name
3255
+ #line 160 "api_node.c.erb"
3256
+ assert(cast->name != 0);
2750
3257
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2751
3258
 
2752
3259
  // depth
3260
+ #line 179 "api_node.c.erb"
2753
3261
  argv[1] = ULONG2NUM(cast->depth);
2754
3262
 
2755
3263
  // name_loc
3264
+ #line 173 "api_node.c.erb"
2756
3265
  argv[2] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2757
3266
 
2758
3267
  // value
3268
+ #line 148 "api_node.c.erb"
2759
3269
  argv[3] = rb_ary_pop(value_stack);
2760
3270
 
2761
3271
  // operator_loc
3272
+ #line 173 "api_node.c.erb"
2762
3273
  argv[4] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2763
3274
 
2764
3275
  // location
@@ -2768,17 +3279,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2768
3279
  break;
2769
3280
  }
2770
3281
  #line 137 "api_node.c.erb"
2771
- case YP_NODE_MATCH_PREDICATE_NODE: {
3282
+ case YP_MATCH_PREDICATE_NODE: {
2772
3283
  yp_match_predicate_node_t *cast = (yp_match_predicate_node_t *) node;
2773
3284
  VALUE argv[4];
2774
3285
 
2775
3286
  // value
3287
+ #line 148 "api_node.c.erb"
2776
3288
  argv[0] = rb_ary_pop(value_stack);
2777
3289
 
2778
3290
  // pattern
3291
+ #line 148 "api_node.c.erb"
2779
3292
  argv[1] = rb_ary_pop(value_stack);
2780
3293
 
2781
3294
  // operator_loc
3295
+ #line 173 "api_node.c.erb"
2782
3296
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2783
3297
 
2784
3298
  // location
@@ -2788,17 +3302,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2788
3302
  break;
2789
3303
  }
2790
3304
  #line 137 "api_node.c.erb"
2791
- case YP_NODE_MATCH_REQUIRED_NODE: {
3305
+ case YP_MATCH_REQUIRED_NODE: {
2792
3306
  yp_match_required_node_t *cast = (yp_match_required_node_t *) node;
2793
3307
  VALUE argv[4];
2794
3308
 
2795
3309
  // value
3310
+ #line 148 "api_node.c.erb"
2796
3311
  argv[0] = rb_ary_pop(value_stack);
2797
3312
 
2798
3313
  // pattern
3314
+ #line 148 "api_node.c.erb"
2799
3315
  argv[1] = rb_ary_pop(value_stack);
2800
3316
 
2801
3317
  // operator_loc
3318
+ #line 173 "api_node.c.erb"
2802
3319
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2803
3320
 
2804
3321
  // location
@@ -2808,7 +3325,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2808
3325
  break;
2809
3326
  }
2810
3327
  #line 137 "api_node.c.erb"
2811
- case YP_NODE_MISSING_NODE: {
3328
+ case YP_MISSING_NODE: {
2812
3329
  VALUE argv[1];
2813
3330
 
2814
3331
  // location
@@ -2818,30 +3335,38 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2818
3335
  break;
2819
3336
  }
2820
3337
  #line 137 "api_node.c.erb"
2821
- case YP_NODE_MODULE_NODE: {
3338
+ case YP_MODULE_NODE: {
2822
3339
  yp_module_node_t *cast = (yp_module_node_t *) node;
2823
3340
  VALUE argv[7];
2824
3341
 
2825
3342
  // locals
3343
+ #line 166 "api_node.c.erb"
2826
3344
  argv[0] = rb_ary_new_capa(cast->locals.size);
2827
3345
  for (size_t index = 0; index < cast->locals.size; index++) {
3346
+ assert(cast->locals.ids[index] != 0);
2828
3347
  rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
2829
3348
  }
2830
3349
 
2831
3350
  // module_keyword_loc
3351
+ #line 173 "api_node.c.erb"
2832
3352
  argv[1] = yp_location_new(parser, cast->module_keyword_loc.start, cast->module_keyword_loc.end, source);
2833
3353
 
2834
3354
  // constant_path
3355
+ #line 148 "api_node.c.erb"
2835
3356
  argv[2] = rb_ary_pop(value_stack);
2836
3357
 
2837
3358
  // body
3359
+ #line 148 "api_node.c.erb"
2838
3360
  argv[3] = rb_ary_pop(value_stack);
2839
3361
 
2840
3362
  // end_keyword_loc
3363
+ #line 173 "api_node.c.erb"
2841
3364
  argv[4] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
2842
3365
 
2843
3366
  // name
2844
- argv[5] = yp_string_new(&cast->name, encoding);
3367
+ #line 160 "api_node.c.erb"
3368
+ assert(cast->name != 0);
3369
+ argv[5] = rb_id2sym(constants[cast->name - 1]);
2845
3370
 
2846
3371
  // location
2847
3372
  argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
@@ -2850,27 +3375,58 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2850
3375
  break;
2851
3376
  }
2852
3377
  #line 137 "api_node.c.erb"
2853
- case YP_NODE_MULTI_WRITE_NODE: {
2854
- yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
2855
- VALUE argv[6];
3378
+ case YP_MULTI_TARGET_NODE: {
3379
+ yp_multi_target_node_t *cast = (yp_multi_target_node_t *) node;
3380
+ VALUE argv[4];
2856
3381
 
2857
3382
  // targets
3383
+ #line 151 "api_node.c.erb"
2858
3384
  argv[0] = rb_ary_new_capa(cast->targets.size);
2859
3385
  for (size_t index = 0; index < cast->targets.size; index++) {
2860
3386
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
2861
3387
  }
2862
3388
 
2863
- // operator_loc
2864
- argv[1] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3389
+ // lparen_loc
3390
+ #line 176 "api_node.c.erb"
3391
+ argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
2865
3392
 
2866
- // value
2867
- argv[2] = rb_ary_pop(value_stack);
3393
+ // rparen_loc
3394
+ #line 176 "api_node.c.erb"
3395
+ argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
3396
+
3397
+ // location
3398
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
3399
+
3400
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPMultiTargetNode));
3401
+ break;
3402
+ }
3403
+ #line 137 "api_node.c.erb"
3404
+ case YP_MULTI_WRITE_NODE: {
3405
+ yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
3406
+ VALUE argv[6];
3407
+
3408
+ // targets
3409
+ #line 151 "api_node.c.erb"
3410
+ argv[0] = rb_ary_new_capa(cast->targets.size);
3411
+ for (size_t index = 0; index < cast->targets.size; index++) {
3412
+ rb_ary_push(argv[0], rb_ary_pop(value_stack));
3413
+ }
2868
3414
 
2869
3415
  // lparen_loc
2870
- argv[3] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
3416
+ #line 176 "api_node.c.erb"
3417
+ argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
2871
3418
 
2872
3419
  // rparen_loc
2873
- argv[4] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
3420
+ #line 176 "api_node.c.erb"
3421
+ argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
3422
+
3423
+ // operator_loc
3424
+ #line 173 "api_node.c.erb"
3425
+ argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3426
+
3427
+ // value
3428
+ #line 148 "api_node.c.erb"
3429
+ argv[4] = rb_ary_pop(value_stack);
2874
3430
 
2875
3431
  // location
2876
3432
  argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
@@ -2879,14 +3435,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2879
3435
  break;
2880
3436
  }
2881
3437
  #line 137 "api_node.c.erb"
2882
- case YP_NODE_NEXT_NODE: {
3438
+ case YP_NEXT_NODE: {
2883
3439
  yp_next_node_t *cast = (yp_next_node_t *) node;
2884
3440
  VALUE argv[3];
2885
3441
 
2886
3442
  // arguments
3443
+ #line 148 "api_node.c.erb"
2887
3444
  argv[0] = rb_ary_pop(value_stack);
2888
3445
 
2889
3446
  // keyword_loc
3447
+ #line 173 "api_node.c.erb"
2890
3448
  argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
2891
3449
 
2892
3450
  // location
@@ -2896,7 +3454,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2896
3454
  break;
2897
3455
  }
2898
3456
  #line 137 "api_node.c.erb"
2899
- case YP_NODE_NIL_NODE: {
3457
+ case YP_NIL_NODE: {
2900
3458
  VALUE argv[1];
2901
3459
 
2902
3460
  // location
@@ -2906,14 +3464,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2906
3464
  break;
2907
3465
  }
2908
3466
  #line 137 "api_node.c.erb"
2909
- case YP_NODE_NO_KEYWORDS_PARAMETER_NODE: {
3467
+ case YP_NO_KEYWORDS_PARAMETER_NODE: {
2910
3468
  yp_no_keywords_parameter_node_t *cast = (yp_no_keywords_parameter_node_t *) node;
2911
3469
  VALUE argv[3];
2912
3470
 
2913
3471
  // operator_loc
3472
+ #line 173 "api_node.c.erb"
2914
3473
  argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2915
3474
 
2916
3475
  // keyword_loc
3476
+ #line 173 "api_node.c.erb"
2917
3477
  argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
2918
3478
 
2919
3479
  // location
@@ -2923,11 +3483,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2923
3483
  break;
2924
3484
  }
2925
3485
  #line 137 "api_node.c.erb"
2926
- case YP_NODE_NUMBERED_REFERENCE_READ_NODE: {
3486
+ case YP_NUMBERED_REFERENCE_READ_NODE: {
2927
3487
  yp_numbered_reference_read_node_t *cast = (yp_numbered_reference_read_node_t *) node;
2928
3488
  VALUE argv[2];
2929
3489
 
2930
3490
  // number
3491
+ #line 179 "api_node.c.erb"
2931
3492
  argv[0] = ULONG2NUM(cast->number);
2932
3493
 
2933
3494
  // location
@@ -2937,20 +3498,25 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2937
3498
  break;
2938
3499
  }
2939
3500
  #line 137 "api_node.c.erb"
2940
- case YP_NODE_OPTIONAL_PARAMETER_NODE: {
3501
+ case YP_OPTIONAL_PARAMETER_NODE: {
2941
3502
  yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
2942
3503
  VALUE argv[5];
2943
3504
 
2944
3505
  // name
3506
+ #line 160 "api_node.c.erb"
3507
+ assert(cast->name != 0);
2945
3508
  argv[0] = rb_id2sym(constants[cast->name - 1]);
2946
3509
 
2947
3510
  // name_loc
3511
+ #line 173 "api_node.c.erb"
2948
3512
  argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
2949
3513
 
2950
3514
  // operator_loc
3515
+ #line 173 "api_node.c.erb"
2951
3516
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2952
3517
 
2953
3518
  // value
3519
+ #line 148 "api_node.c.erb"
2954
3520
  argv[3] = rb_ary_pop(value_stack);
2955
3521
 
2956
3522
  // location
@@ -2960,17 +3526,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2960
3526
  break;
2961
3527
  }
2962
3528
  #line 137 "api_node.c.erb"
2963
- case YP_NODE_OR_NODE: {
3529
+ case YP_OR_NODE: {
2964
3530
  yp_or_node_t *cast = (yp_or_node_t *) node;
2965
3531
  VALUE argv[4];
2966
3532
 
2967
3533
  // left
3534
+ #line 148 "api_node.c.erb"
2968
3535
  argv[0] = rb_ary_pop(value_stack);
2969
3536
 
2970
3537
  // right
3538
+ #line 148 "api_node.c.erb"
2971
3539
  argv[1] = rb_ary_pop(value_stack);
2972
3540
 
2973
3541
  // operator_loc
3542
+ #line 173 "api_node.c.erb"
2974
3543
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
2975
3544
 
2976
3545
  // location
@@ -2980,41 +3549,48 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
2980
3549
  break;
2981
3550
  }
2982
3551
  #line 137 "api_node.c.erb"
2983
- case YP_NODE_PARAMETERS_NODE: {
3552
+ case YP_PARAMETERS_NODE: {
2984
3553
  yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
2985
3554
  VALUE argv[8];
2986
3555
 
2987
3556
  // requireds
3557
+ #line 151 "api_node.c.erb"
2988
3558
  argv[0] = rb_ary_new_capa(cast->requireds.size);
2989
3559
  for (size_t index = 0; index < cast->requireds.size; index++) {
2990
3560
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
2991
3561
  }
2992
3562
 
2993
3563
  // optionals
3564
+ #line 151 "api_node.c.erb"
2994
3565
  argv[1] = rb_ary_new_capa(cast->optionals.size);
2995
3566
  for (size_t index = 0; index < cast->optionals.size; index++) {
2996
3567
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
2997
3568
  }
2998
3569
 
2999
3570
  // posts
3571
+ #line 151 "api_node.c.erb"
3000
3572
  argv[2] = rb_ary_new_capa(cast->posts.size);
3001
3573
  for (size_t index = 0; index < cast->posts.size; index++) {
3002
3574
  rb_ary_push(argv[2], rb_ary_pop(value_stack));
3003
3575
  }
3004
3576
 
3005
3577
  // rest
3578
+ #line 148 "api_node.c.erb"
3006
3579
  argv[3] = rb_ary_pop(value_stack);
3007
3580
 
3008
3581
  // keywords
3582
+ #line 151 "api_node.c.erb"
3009
3583
  argv[4] = rb_ary_new_capa(cast->keywords.size);
3010
3584
  for (size_t index = 0; index < cast->keywords.size; index++) {
3011
3585
  rb_ary_push(argv[4], rb_ary_pop(value_stack));
3012
3586
  }
3013
3587
 
3014
3588
  // keyword_rest
3589
+ #line 148 "api_node.c.erb"
3015
3590
  argv[5] = rb_ary_pop(value_stack);
3016
3591
 
3017
3592
  // block
3593
+ #line 148 "api_node.c.erb"
3018
3594
  argv[6] = rb_ary_pop(value_stack);
3019
3595
 
3020
3596
  // location
@@ -3024,17 +3600,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3024
3600
  break;
3025
3601
  }
3026
3602
  #line 137 "api_node.c.erb"
3027
- case YP_NODE_PARENTHESES_NODE: {
3603
+ case YP_PARENTHESES_NODE: {
3028
3604
  yp_parentheses_node_t *cast = (yp_parentheses_node_t *) node;
3029
3605
  VALUE argv[4];
3030
3606
 
3031
3607
  // body
3608
+ #line 148 "api_node.c.erb"
3032
3609
  argv[0] = rb_ary_pop(value_stack);
3033
3610
 
3034
3611
  // opening_loc
3612
+ #line 173 "api_node.c.erb"
3035
3613
  argv[1] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3036
3614
 
3037
3615
  // closing_loc
3616
+ #line 173 "api_node.c.erb"
3038
3617
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3039
3618
 
3040
3619
  // location
@@ -3044,20 +3623,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3044
3623
  break;
3045
3624
  }
3046
3625
  #line 137 "api_node.c.erb"
3047
- case YP_NODE_PINNED_EXPRESSION_NODE: {
3626
+ case YP_PINNED_EXPRESSION_NODE: {
3048
3627
  yp_pinned_expression_node_t *cast = (yp_pinned_expression_node_t *) node;
3049
3628
  VALUE argv[5];
3050
3629
 
3051
3630
  // expression
3631
+ #line 148 "api_node.c.erb"
3052
3632
  argv[0] = rb_ary_pop(value_stack);
3053
3633
 
3054
3634
  // operator_loc
3635
+ #line 173 "api_node.c.erb"
3055
3636
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3056
3637
 
3057
3638
  // lparen_loc
3639
+ #line 173 "api_node.c.erb"
3058
3640
  argv[2] = yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
3059
3641
 
3060
3642
  // rparen_loc
3643
+ #line 173 "api_node.c.erb"
3061
3644
  argv[3] = yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
3062
3645
 
3063
3646
  // location
@@ -3067,14 +3650,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3067
3650
  break;
3068
3651
  }
3069
3652
  #line 137 "api_node.c.erb"
3070
- case YP_NODE_PINNED_VARIABLE_NODE: {
3653
+ case YP_PINNED_VARIABLE_NODE: {
3071
3654
  yp_pinned_variable_node_t *cast = (yp_pinned_variable_node_t *) node;
3072
3655
  VALUE argv[3];
3073
3656
 
3074
3657
  // variable
3658
+ #line 148 "api_node.c.erb"
3075
3659
  argv[0] = rb_ary_pop(value_stack);
3076
3660
 
3077
3661
  // operator_loc
3662
+ #line 173 "api_node.c.erb"
3078
3663
  argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3079
3664
 
3080
3665
  // location
@@ -3084,20 +3669,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3084
3669
  break;
3085
3670
  }
3086
3671
  #line 137 "api_node.c.erb"
3087
- case YP_NODE_POST_EXECUTION_NODE: {
3672
+ case YP_POST_EXECUTION_NODE: {
3088
3673
  yp_post_execution_node_t *cast = (yp_post_execution_node_t *) node;
3089
3674
  VALUE argv[5];
3090
3675
 
3091
3676
  // statements
3677
+ #line 148 "api_node.c.erb"
3092
3678
  argv[0] = rb_ary_pop(value_stack);
3093
3679
 
3094
3680
  // keyword_loc
3681
+ #line 173 "api_node.c.erb"
3095
3682
  argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3096
3683
 
3097
3684
  // opening_loc
3685
+ #line 173 "api_node.c.erb"
3098
3686
  argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3099
3687
 
3100
3688
  // closing_loc
3689
+ #line 173 "api_node.c.erb"
3101
3690
  argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3102
3691
 
3103
3692
  // location
@@ -3107,20 +3696,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3107
3696
  break;
3108
3697
  }
3109
3698
  #line 137 "api_node.c.erb"
3110
- case YP_NODE_PRE_EXECUTION_NODE: {
3699
+ case YP_PRE_EXECUTION_NODE: {
3111
3700
  yp_pre_execution_node_t *cast = (yp_pre_execution_node_t *) node;
3112
3701
  VALUE argv[5];
3113
3702
 
3114
3703
  // statements
3704
+ #line 148 "api_node.c.erb"
3115
3705
  argv[0] = rb_ary_pop(value_stack);
3116
3706
 
3117
3707
  // keyword_loc
3708
+ #line 173 "api_node.c.erb"
3118
3709
  argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3119
3710
 
3120
3711
  // opening_loc
3712
+ #line 173 "api_node.c.erb"
3121
3713
  argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3122
3714
 
3123
3715
  // closing_loc
3716
+ #line 173 "api_node.c.erb"
3124
3717
  argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3125
3718
 
3126
3719
  // location
@@ -3130,17 +3723,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3130
3723
  break;
3131
3724
  }
3132
3725
  #line 137 "api_node.c.erb"
3133
- case YP_NODE_PROGRAM_NODE: {
3726
+ case YP_PROGRAM_NODE: {
3134
3727
  yp_program_node_t *cast = (yp_program_node_t *) node;
3135
3728
  VALUE argv[3];
3136
3729
 
3137
3730
  // locals
3731
+ #line 166 "api_node.c.erb"
3138
3732
  argv[0] = rb_ary_new_capa(cast->locals.size);
3139
3733
  for (size_t index = 0; index < cast->locals.size; index++) {
3734
+ assert(cast->locals.ids[index] != 0);
3140
3735
  rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
3141
3736
  }
3142
3737
 
3143
3738
  // statements
3739
+ #line 148 "api_node.c.erb"
3144
3740
  argv[1] = rb_ary_pop(value_stack);
3145
3741
 
3146
3742
  // location
@@ -3150,20 +3746,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3150
3746
  break;
3151
3747
  }
3152
3748
  #line 137 "api_node.c.erb"
3153
- case YP_NODE_RANGE_NODE: {
3749
+ case YP_RANGE_NODE: {
3154
3750
  yp_range_node_t *cast = (yp_range_node_t *) node;
3155
3751
  VALUE argv[5];
3156
3752
 
3157
3753
  // left
3754
+ #line 148 "api_node.c.erb"
3158
3755
  argv[0] = rb_ary_pop(value_stack);
3159
3756
 
3160
3757
  // right
3758
+ #line 148 "api_node.c.erb"
3161
3759
  argv[1] = rb_ary_pop(value_stack);
3162
3760
 
3163
3761
  // operator_loc
3762
+ #line 173 "api_node.c.erb"
3164
3763
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3165
3764
 
3166
3765
  // flags
3766
+ #line 182 "api_node.c.erb"
3167
3767
  argv[3] = ULONG2NUM(node->flags >> 1);
3168
3768
 
3169
3769
  // location
@@ -3173,10 +3773,11 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3173
3773
  break;
3174
3774
  }
3175
3775
  #line 137 "api_node.c.erb"
3176
- case YP_NODE_RATIONAL_NODE: {
3776
+ case YP_RATIONAL_NODE: {
3177
3777
  VALUE argv[2];
3178
3778
 
3179
3779
  // numeric
3780
+ #line 148 "api_node.c.erb"
3180
3781
  argv[0] = rb_ary_pop(value_stack);
3181
3782
 
3182
3783
  // location
@@ -3186,7 +3787,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3186
3787
  break;
3187
3788
  }
3188
3789
  #line 137 "api_node.c.erb"
3189
- case YP_NODE_REDO_NODE: {
3790
+ case YP_REDO_NODE: {
3190
3791
  VALUE argv[1];
3191
3792
 
3192
3793
  // location
@@ -3196,23 +3797,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3196
3797
  break;
3197
3798
  }
3198
3799
  #line 137 "api_node.c.erb"
3199
- case YP_NODE_REGULAR_EXPRESSION_NODE: {
3800
+ case YP_REGULAR_EXPRESSION_NODE: {
3200
3801
  yp_regular_expression_node_t *cast = (yp_regular_expression_node_t *) node;
3201
3802
  VALUE argv[6];
3202
3803
 
3203
3804
  // opening_loc
3805
+ #line 173 "api_node.c.erb"
3204
3806
  argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3205
3807
 
3206
3808
  // content_loc
3809
+ #line 173 "api_node.c.erb"
3207
3810
  argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
3208
3811
 
3209
3812
  // closing_loc
3813
+ #line 173 "api_node.c.erb"
3210
3814
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3211
3815
 
3212
3816
  // unescaped
3817
+ #line 157 "api_node.c.erb"
3213
3818
  argv[3] = yp_string_new(&cast->unescaped, encoding);
3214
3819
 
3215
3820
  // flags
3821
+ #line 182 "api_node.c.erb"
3216
3822
  argv[4] = ULONG2NUM(node->flags >> 1);
3217
3823
 
3218
3824
  // location
@@ -3222,20 +3828,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3222
3828
  break;
3223
3829
  }
3224
3830
  #line 137 "api_node.c.erb"
3225
- case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
3831
+ case YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
3226
3832
  yp_required_destructured_parameter_node_t *cast = (yp_required_destructured_parameter_node_t *) node;
3227
3833
  VALUE argv[4];
3228
3834
 
3229
3835
  // parameters
3836
+ #line 151 "api_node.c.erb"
3230
3837
  argv[0] = rb_ary_new_capa(cast->parameters.size);
3231
3838
  for (size_t index = 0; index < cast->parameters.size; index++) {
3232
3839
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
3233
3840
  }
3234
3841
 
3235
3842
  // opening_loc
3843
+ #line 173 "api_node.c.erb"
3236
3844
  argv[1] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3237
3845
 
3238
3846
  // closing_loc
3847
+ #line 173 "api_node.c.erb"
3239
3848
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3240
3849
 
3241
3850
  // location
@@ -3245,11 +3854,13 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3245
3854
  break;
3246
3855
  }
3247
3856
  #line 137 "api_node.c.erb"
3248
- case YP_NODE_REQUIRED_PARAMETER_NODE: {
3857
+ case YP_REQUIRED_PARAMETER_NODE: {
3249
3858
  yp_required_parameter_node_t *cast = (yp_required_parameter_node_t *) node;
3250
3859
  VALUE argv[2];
3251
3860
 
3252
3861
  // name
3862
+ #line 160 "api_node.c.erb"
3863
+ assert(cast->name != 0);
3253
3864
  argv[0] = rb_id2sym(constants[cast->name - 1]);
3254
3865
 
3255
3866
  // location
@@ -3259,17 +3870,20 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3259
3870
  break;
3260
3871
  }
3261
3872
  #line 137 "api_node.c.erb"
3262
- case YP_NODE_RESCUE_MODIFIER_NODE: {
3873
+ case YP_RESCUE_MODIFIER_NODE: {
3263
3874
  yp_rescue_modifier_node_t *cast = (yp_rescue_modifier_node_t *) node;
3264
3875
  VALUE argv[4];
3265
3876
 
3266
3877
  // expression
3878
+ #line 148 "api_node.c.erb"
3267
3879
  argv[0] = rb_ary_pop(value_stack);
3268
3880
 
3269
3881
  // keyword_loc
3882
+ #line 173 "api_node.c.erb"
3270
3883
  argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3271
3884
 
3272
3885
  // rescue_expression
3886
+ #line 148 "api_node.c.erb"
3273
3887
  argv[2] = rb_ary_pop(value_stack);
3274
3888
 
3275
3889
  // location
@@ -3279,29 +3893,35 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3279
3893
  break;
3280
3894
  }
3281
3895
  #line 137 "api_node.c.erb"
3282
- case YP_NODE_RESCUE_NODE: {
3896
+ case YP_RESCUE_NODE: {
3283
3897
  yp_rescue_node_t *cast = (yp_rescue_node_t *) node;
3284
3898
  VALUE argv[7];
3285
3899
 
3286
3900
  // keyword_loc
3901
+ #line 173 "api_node.c.erb"
3287
3902
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3288
3903
 
3289
3904
  // exceptions
3905
+ #line 151 "api_node.c.erb"
3290
3906
  argv[1] = rb_ary_new_capa(cast->exceptions.size);
3291
3907
  for (size_t index = 0; index < cast->exceptions.size; index++) {
3292
3908
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
3293
3909
  }
3294
3910
 
3295
3911
  // operator_loc
3912
+ #line 176 "api_node.c.erb"
3296
3913
  argv[2] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3297
3914
 
3298
3915
  // reference
3916
+ #line 148 "api_node.c.erb"
3299
3917
  argv[3] = rb_ary_pop(value_stack);
3300
3918
 
3301
3919
  // statements
3920
+ #line 148 "api_node.c.erb"
3302
3921
  argv[4] = rb_ary_pop(value_stack);
3303
3922
 
3304
3923
  // consequent
3924
+ #line 148 "api_node.c.erb"
3305
3925
  argv[5] = rb_ary_pop(value_stack);
3306
3926
 
3307
3927
  // location
@@ -3311,24 +3931,29 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3311
3931
  break;
3312
3932
  }
3313
3933
  #line 137 "api_node.c.erb"
3314
- case YP_NODE_REST_PARAMETER_NODE: {
3934
+ case YP_REST_PARAMETER_NODE: {
3315
3935
  yp_rest_parameter_node_t *cast = (yp_rest_parameter_node_t *) node;
3316
- VALUE argv[3];
3936
+ VALUE argv[4];
3317
3937
 
3318
- // operator_loc
3319
- argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3938
+ // name
3939
+ argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
3320
3940
 
3321
3941
  // name_loc
3942
+ #line 176 "api_node.c.erb"
3322
3943
  argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
3323
3944
 
3945
+ // operator_loc
3946
+ #line 173 "api_node.c.erb"
3947
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3948
+
3324
3949
  // location
3325
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
3950
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
3326
3951
 
3327
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPRestParameterNode));
3952
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPRestParameterNode));
3328
3953
  break;
3329
3954
  }
3330
3955
  #line 137 "api_node.c.erb"
3331
- case YP_NODE_RETRY_NODE: {
3956
+ case YP_RETRY_NODE: {
3332
3957
  VALUE argv[1];
3333
3958
 
3334
3959
  // location
@@ -3338,14 +3963,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3338
3963
  break;
3339
3964
  }
3340
3965
  #line 137 "api_node.c.erb"
3341
- case YP_NODE_RETURN_NODE: {
3966
+ case YP_RETURN_NODE: {
3342
3967
  yp_return_node_t *cast = (yp_return_node_t *) node;
3343
3968
  VALUE argv[3];
3344
3969
 
3345
3970
  // keyword_loc
3971
+ #line 173 "api_node.c.erb"
3346
3972
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3347
3973
 
3348
3974
  // arguments
3975
+ #line 148 "api_node.c.erb"
3349
3976
  argv[1] = rb_ary_pop(value_stack);
3350
3977
 
3351
3978
  // location
@@ -3355,7 +3982,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3355
3982
  break;
3356
3983
  }
3357
3984
  #line 137 "api_node.c.erb"
3358
- case YP_NODE_SELF_NODE: {
3985
+ case YP_SELF_NODE: {
3359
3986
  VALUE argv[1];
3360
3987
 
3361
3988
  // location
@@ -3365,29 +3992,36 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3365
3992
  break;
3366
3993
  }
3367
3994
  #line 137 "api_node.c.erb"
3368
- case YP_NODE_SINGLETON_CLASS_NODE: {
3995
+ case YP_SINGLETON_CLASS_NODE: {
3369
3996
  yp_singleton_class_node_t *cast = (yp_singleton_class_node_t *) node;
3370
3997
  VALUE argv[7];
3371
3998
 
3372
3999
  // locals
4000
+ #line 166 "api_node.c.erb"
3373
4001
  argv[0] = rb_ary_new_capa(cast->locals.size);
3374
4002
  for (size_t index = 0; index < cast->locals.size; index++) {
4003
+ assert(cast->locals.ids[index] != 0);
3375
4004
  rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
3376
4005
  }
3377
4006
 
3378
4007
  // class_keyword_loc
4008
+ #line 173 "api_node.c.erb"
3379
4009
  argv[1] = yp_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);
3380
4010
 
3381
4011
  // operator_loc
4012
+ #line 173 "api_node.c.erb"
3382
4013
  argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3383
4014
 
3384
4015
  // expression
4016
+ #line 148 "api_node.c.erb"
3385
4017
  argv[3] = rb_ary_pop(value_stack);
3386
4018
 
3387
4019
  // body
4020
+ #line 148 "api_node.c.erb"
3388
4021
  argv[4] = rb_ary_pop(value_stack);
3389
4022
 
3390
4023
  // end_keyword_loc
4024
+ #line 173 "api_node.c.erb"
3391
4025
  argv[5] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
3392
4026
 
3393
4027
  // location
@@ -3397,7 +4031,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3397
4031
  break;
3398
4032
  }
3399
4033
  #line 137 "api_node.c.erb"
3400
- case YP_NODE_SOURCE_ENCODING_NODE: {
4034
+ case YP_SOURCE_ENCODING_NODE: {
3401
4035
  VALUE argv[1];
3402
4036
 
3403
4037
  // location
@@ -3407,11 +4041,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3407
4041
  break;
3408
4042
  }
3409
4043
  #line 137 "api_node.c.erb"
3410
- case YP_NODE_SOURCE_FILE_NODE: {
4044
+ case YP_SOURCE_FILE_NODE: {
3411
4045
  yp_source_file_node_t *cast = (yp_source_file_node_t *) node;
3412
4046
  VALUE argv[2];
3413
4047
 
3414
4048
  // filepath
4049
+ #line 157 "api_node.c.erb"
3415
4050
  argv[0] = yp_string_new(&cast->filepath, encoding);
3416
4051
 
3417
4052
  // location
@@ -3421,7 +4056,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3421
4056
  break;
3422
4057
  }
3423
4058
  #line 137 "api_node.c.erb"
3424
- case YP_NODE_SOURCE_LINE_NODE: {
4059
+ case YP_SOURCE_LINE_NODE: {
3425
4060
  VALUE argv[1];
3426
4061
 
3427
4062
  // location
@@ -3431,14 +4066,16 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3431
4066
  break;
3432
4067
  }
3433
4068
  #line 137 "api_node.c.erb"
3434
- case YP_NODE_SPLAT_NODE: {
4069
+ case YP_SPLAT_NODE: {
3435
4070
  yp_splat_node_t *cast = (yp_splat_node_t *) node;
3436
4071
  VALUE argv[3];
3437
4072
 
3438
4073
  // operator_loc
4074
+ #line 173 "api_node.c.erb"
3439
4075
  argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
3440
4076
 
3441
4077
  // expression
4078
+ #line 148 "api_node.c.erb"
3442
4079
  argv[1] = rb_ary_pop(value_stack);
3443
4080
 
3444
4081
  // location
@@ -3448,11 +4085,12 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3448
4085
  break;
3449
4086
  }
3450
4087
  #line 137 "api_node.c.erb"
3451
- case YP_NODE_STATEMENTS_NODE: {
4088
+ case YP_STATEMENTS_NODE: {
3452
4089
  yp_statements_node_t *cast = (yp_statements_node_t *) node;
3453
4090
  VALUE argv[2];
3454
4091
 
3455
4092
  // body
4093
+ #line 151 "api_node.c.erb"
3456
4094
  argv[0] = rb_ary_new_capa(cast->body.size);
3457
4095
  for (size_t index = 0; index < cast->body.size; index++) {
3458
4096
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
@@ -3465,13 +4103,15 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3465
4103
  break;
3466
4104
  }
3467
4105
  #line 137 "api_node.c.erb"
3468
- case YP_NODE_STRING_CONCAT_NODE: {
4106
+ case YP_STRING_CONCAT_NODE: {
3469
4107
  VALUE argv[3];
3470
4108
 
3471
4109
  // left
4110
+ #line 148 "api_node.c.erb"
3472
4111
  argv[0] = rb_ary_pop(value_stack);
3473
4112
 
3474
4113
  // right
4114
+ #line 148 "api_node.c.erb"
3475
4115
  argv[1] = rb_ary_pop(value_stack);
3476
4116
 
3477
4117
  // location
@@ -3481,20 +4121,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3481
4121
  break;
3482
4122
  }
3483
4123
  #line 137 "api_node.c.erb"
3484
- case YP_NODE_STRING_NODE: {
4124
+ case YP_STRING_NODE: {
3485
4125
  yp_string_node_t *cast = (yp_string_node_t *) node;
3486
4126
  VALUE argv[5];
3487
4127
 
3488
4128
  // opening_loc
4129
+ #line 176 "api_node.c.erb"
3489
4130
  argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3490
4131
 
3491
4132
  // content_loc
4133
+ #line 173 "api_node.c.erb"
3492
4134
  argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
3493
4135
 
3494
4136
  // closing_loc
4137
+ #line 176 "api_node.c.erb"
3495
4138
  argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3496
4139
 
3497
4140
  // unescaped
4141
+ #line 157 "api_node.c.erb"
3498
4142
  argv[3] = yp_string_new(&cast->unescaped, encoding);
3499
4143
 
3500
4144
  // location
@@ -3504,23 +4148,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3504
4148
  break;
3505
4149
  }
3506
4150
  #line 137 "api_node.c.erb"
3507
- case YP_NODE_SUPER_NODE: {
4151
+ case YP_SUPER_NODE: {
3508
4152
  yp_super_node_t *cast = (yp_super_node_t *) node;
3509
4153
  VALUE argv[6];
3510
4154
 
3511
4155
  // keyword_loc
4156
+ #line 173 "api_node.c.erb"
3512
4157
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3513
4158
 
3514
4159
  // lparen_loc
4160
+ #line 176 "api_node.c.erb"
3515
4161
  argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
3516
4162
 
3517
4163
  // arguments
4164
+ #line 148 "api_node.c.erb"
3518
4165
  argv[2] = rb_ary_pop(value_stack);
3519
4166
 
3520
4167
  // rparen_loc
4168
+ #line 176 "api_node.c.erb"
3521
4169
  argv[3] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
3522
4170
 
3523
4171
  // block
4172
+ #line 148 "api_node.c.erb"
3524
4173
  argv[4] = rb_ary_pop(value_stack);
3525
4174
 
3526
4175
  // location
@@ -3530,20 +4179,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3530
4179
  break;
3531
4180
  }
3532
4181
  #line 137 "api_node.c.erb"
3533
- case YP_NODE_SYMBOL_NODE: {
4182
+ case YP_SYMBOL_NODE: {
3534
4183
  yp_symbol_node_t *cast = (yp_symbol_node_t *) node;
3535
4184
  VALUE argv[5];
3536
4185
 
3537
4186
  // opening_loc
4187
+ #line 176 "api_node.c.erb"
3538
4188
  argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3539
4189
 
3540
4190
  // value_loc
4191
+ #line 176 "api_node.c.erb"
3541
4192
  argv[1] = cast->value_loc.start == NULL ? Qnil : yp_location_new(parser, cast->value_loc.start, cast->value_loc.end, source);
3542
4193
 
3543
4194
  // closing_loc
4195
+ #line 176 "api_node.c.erb"
3544
4196
  argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3545
4197
 
3546
4198
  // unescaped
4199
+ #line 157 "api_node.c.erb"
3547
4200
  argv[3] = yp_string_new(&cast->unescaped, encoding);
3548
4201
 
3549
4202
  // location
@@ -3553,7 +4206,7 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3553
4206
  break;
3554
4207
  }
3555
4208
  #line 137 "api_node.c.erb"
3556
- case YP_NODE_TRUE_NODE: {
4209
+ case YP_TRUE_NODE: {
3557
4210
  VALUE argv[1];
3558
4211
 
3559
4212
  // location
@@ -3563,17 +4216,19 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3563
4216
  break;
3564
4217
  }
3565
4218
  #line 137 "api_node.c.erb"
3566
- case YP_NODE_UNDEF_NODE: {
4219
+ case YP_UNDEF_NODE: {
3567
4220
  yp_undef_node_t *cast = (yp_undef_node_t *) node;
3568
4221
  VALUE argv[3];
3569
4222
 
3570
4223
  // names
4224
+ #line 151 "api_node.c.erb"
3571
4225
  argv[0] = rb_ary_new_capa(cast->names.size);
3572
4226
  for (size_t index = 0; index < cast->names.size; index++) {
3573
4227
  rb_ary_push(argv[0], rb_ary_pop(value_stack));
3574
4228
  }
3575
4229
 
3576
4230
  // keyword_loc
4231
+ #line 173 "api_node.c.erb"
3577
4232
  argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3578
4233
 
3579
4234
  // location
@@ -3583,23 +4238,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3583
4238
  break;
3584
4239
  }
3585
4240
  #line 137 "api_node.c.erb"
3586
- case YP_NODE_UNLESS_NODE: {
4241
+ case YP_UNLESS_NODE: {
3587
4242
  yp_unless_node_t *cast = (yp_unless_node_t *) node;
3588
4243
  VALUE argv[6];
3589
4244
 
3590
4245
  // keyword_loc
4246
+ #line 173 "api_node.c.erb"
3591
4247
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3592
4248
 
3593
4249
  // predicate
4250
+ #line 148 "api_node.c.erb"
3594
4251
  argv[1] = rb_ary_pop(value_stack);
3595
4252
 
3596
4253
  // statements
4254
+ #line 148 "api_node.c.erb"
3597
4255
  argv[2] = rb_ary_pop(value_stack);
3598
4256
 
3599
4257
  // consequent
4258
+ #line 148 "api_node.c.erb"
3600
4259
  argv[3] = rb_ary_pop(value_stack);
3601
4260
 
3602
4261
  // end_keyword_loc
4262
+ #line 176 "api_node.c.erb"
3603
4263
  argv[4] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
3604
4264
 
3605
4265
  // location
@@ -3609,23 +4269,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3609
4269
  break;
3610
4270
  }
3611
4271
  #line 137 "api_node.c.erb"
3612
- case YP_NODE_UNTIL_NODE: {
4272
+ case YP_UNTIL_NODE: {
3613
4273
  yp_until_node_t *cast = (yp_until_node_t *) node;
3614
4274
  VALUE argv[6];
3615
4275
 
3616
4276
  // keyword_loc
4277
+ #line 173 "api_node.c.erb"
3617
4278
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3618
4279
 
3619
4280
  // closing_loc
4281
+ #line 176 "api_node.c.erb"
3620
4282
  argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3621
4283
 
3622
4284
  // predicate
4285
+ #line 148 "api_node.c.erb"
3623
4286
  argv[2] = rb_ary_pop(value_stack);
3624
4287
 
3625
4288
  // statements
4289
+ #line 148 "api_node.c.erb"
3626
4290
  argv[3] = rb_ary_pop(value_stack);
3627
4291
 
3628
4292
  // flags
4293
+ #line 182 "api_node.c.erb"
3629
4294
  argv[4] = ULONG2NUM(node->flags >> 1);
3630
4295
 
3631
4296
  // location
@@ -3635,20 +4300,23 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3635
4300
  break;
3636
4301
  }
3637
4302
  #line 137 "api_node.c.erb"
3638
- case YP_NODE_WHEN_NODE: {
4303
+ case YP_WHEN_NODE: {
3639
4304
  yp_when_node_t *cast = (yp_when_node_t *) node;
3640
4305
  VALUE argv[4];
3641
4306
 
3642
4307
  // keyword_loc
4308
+ #line 173 "api_node.c.erb"
3643
4309
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3644
4310
 
3645
4311
  // conditions
4312
+ #line 151 "api_node.c.erb"
3646
4313
  argv[1] = rb_ary_new_capa(cast->conditions.size);
3647
4314
  for (size_t index = 0; index < cast->conditions.size; index++) {
3648
4315
  rb_ary_push(argv[1], rb_ary_pop(value_stack));
3649
4316
  }
3650
4317
 
3651
4318
  // statements
4319
+ #line 148 "api_node.c.erb"
3652
4320
  argv[2] = rb_ary_pop(value_stack);
3653
4321
 
3654
4322
  // location
@@ -3658,23 +4326,28 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3658
4326
  break;
3659
4327
  }
3660
4328
  #line 137 "api_node.c.erb"
3661
- case YP_NODE_WHILE_NODE: {
4329
+ case YP_WHILE_NODE: {
3662
4330
  yp_while_node_t *cast = (yp_while_node_t *) node;
3663
4331
  VALUE argv[6];
3664
4332
 
3665
4333
  // keyword_loc
4334
+ #line 173 "api_node.c.erb"
3666
4335
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3667
4336
 
3668
4337
  // closing_loc
4338
+ #line 176 "api_node.c.erb"
3669
4339
  argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3670
4340
 
3671
4341
  // predicate
4342
+ #line 148 "api_node.c.erb"
3672
4343
  argv[2] = rb_ary_pop(value_stack);
3673
4344
 
3674
4345
  // statements
4346
+ #line 148 "api_node.c.erb"
3675
4347
  argv[3] = rb_ary_pop(value_stack);
3676
4348
 
3677
4349
  // flags
4350
+ #line 182 "api_node.c.erb"
3678
4351
  argv[4] = ULONG2NUM(node->flags >> 1);
3679
4352
 
3680
4353
  // location
@@ -3684,20 +4357,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3684
4357
  break;
3685
4358
  }
3686
4359
  #line 137 "api_node.c.erb"
3687
- case YP_NODE_X_STRING_NODE: {
4360
+ case YP_X_STRING_NODE: {
3688
4361
  yp_x_string_node_t *cast = (yp_x_string_node_t *) node;
3689
4362
  VALUE argv[5];
3690
4363
 
3691
4364
  // opening_loc
4365
+ #line 173 "api_node.c.erb"
3692
4366
  argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
3693
4367
 
3694
4368
  // content_loc
4369
+ #line 173 "api_node.c.erb"
3695
4370
  argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
3696
4371
 
3697
4372
  // closing_loc
4373
+ #line 173 "api_node.c.erb"
3698
4374
  argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
3699
4375
 
3700
4376
  // unescaped
4377
+ #line 157 "api_node.c.erb"
3701
4378
  argv[3] = yp_string_new(&cast->unescaped, encoding);
3702
4379
 
3703
4380
  // location
@@ -3707,20 +4384,24 @@ yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
3707
4384
  break;
3708
4385
  }
3709
4386
  #line 137 "api_node.c.erb"
3710
- case YP_NODE_YIELD_NODE: {
4387
+ case YP_YIELD_NODE: {
3711
4388
  yp_yield_node_t *cast = (yp_yield_node_t *) node;
3712
4389
  VALUE argv[5];
3713
4390
 
3714
4391
  // keyword_loc
4392
+ #line 173 "api_node.c.erb"
3715
4393
  argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
3716
4394
 
3717
4395
  // lparen_loc
4396
+ #line 176 "api_node.c.erb"
3718
4397
  argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
3719
4398
 
3720
4399
  // arguments
4400
+ #line 148 "api_node.c.erb"
3721
4401
  argv[2] = rb_ary_pop(value_stack);
3722
4402
 
3723
4403
  // rparen_loc
4404
+ #line 176 "api_node.c.erb"
3724
4405
  argv[3] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
3725
4406
 
3726
4407
  // location
@@ -3753,14 +4434,15 @@ Init_yarp_api_node(void) {
3753
4434
  rb_cYARPBackReferenceReadNode = rb_define_class_under(rb_cYARP, "BackReferenceReadNode", rb_cYARPNode);
3754
4435
  rb_cYARPBeginNode = rb_define_class_under(rb_cYARP, "BeginNode", rb_cYARPNode);
3755
4436
  rb_cYARPBlockArgumentNode = rb_define_class_under(rb_cYARP, "BlockArgumentNode", rb_cYARPNode);
4437
+ rb_cYARPBlockLocalVariableNode = rb_define_class_under(rb_cYARP, "BlockLocalVariableNode", rb_cYARPNode);
3756
4438
  rb_cYARPBlockNode = rb_define_class_under(rb_cYARP, "BlockNode", rb_cYARPNode);
3757
4439
  rb_cYARPBlockParameterNode = rb_define_class_under(rb_cYARP, "BlockParameterNode", rb_cYARPNode);
3758
4440
  rb_cYARPBlockParametersNode = rb_define_class_under(rb_cYARP, "BlockParametersNode", rb_cYARPNode);
3759
4441
  rb_cYARPBreakNode = rb_define_class_under(rb_cYARP, "BreakNode", rb_cYARPNode);
4442
+ rb_cYARPCallAndWriteNode = rb_define_class_under(rb_cYARP, "CallAndWriteNode", rb_cYARPNode);
3760
4443
  rb_cYARPCallNode = rb_define_class_under(rb_cYARP, "CallNode", rb_cYARPNode);
3761
- rb_cYARPCallOperatorAndWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorAndWriteNode", rb_cYARPNode);
3762
- rb_cYARPCallOperatorOrWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorOrWriteNode", rb_cYARPNode);
3763
4444
  rb_cYARPCallOperatorWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorWriteNode", rb_cYARPNode);
4445
+ rb_cYARPCallOrWriteNode = rb_define_class_under(rb_cYARP, "CallOrWriteNode", rb_cYARPNode);
3764
4446
  rb_cYARPCapturePatternNode = rb_define_class_under(rb_cYARP, "CapturePatternNode", rb_cYARPNode);
3765
4447
  rb_cYARPCaseNode = rb_define_class_under(rb_cYARP, "CaseNode", rb_cYARPNode);
3766
4448
  rb_cYARPClassNode = rb_define_class_under(rb_cYARP, "ClassNode", rb_cYARPNode);
@@ -3832,6 +4514,7 @@ Init_yarp_api_node(void) {
3832
4514
  rb_cYARPMatchRequiredNode = rb_define_class_under(rb_cYARP, "MatchRequiredNode", rb_cYARPNode);
3833
4515
  rb_cYARPMissingNode = rb_define_class_under(rb_cYARP, "MissingNode", rb_cYARPNode);
3834
4516
  rb_cYARPModuleNode = rb_define_class_under(rb_cYARP, "ModuleNode", rb_cYARPNode);
4517
+ rb_cYARPMultiTargetNode = rb_define_class_under(rb_cYARP, "MultiTargetNode", rb_cYARPNode);
3835
4518
  rb_cYARPMultiWriteNode = rb_define_class_under(rb_cYARP, "MultiWriteNode", rb_cYARPNode);
3836
4519
  rb_cYARPNextNode = rb_define_class_under(rb_cYARP, "NextNode", rb_cYARPNode);
3837
4520
  rb_cYARPNilNode = rb_define_class_under(rb_cYARP, "NilNode", rb_cYARPNode);