ext/yarp/api_node.c in yarp-0.10.0 vs ext/yarp/api_node.c in yarp-0.11.0
- old
+ new
@@ -23,18 +23,19 @@
static VALUE rb_cYARPAssocNode;
static VALUE rb_cYARPAssocSplatNode;
static VALUE rb_cYARPBackReferenceReadNode;
static VALUE rb_cYARPBeginNode;
static VALUE rb_cYARPBlockArgumentNode;
+static VALUE rb_cYARPBlockLocalVariableNode;
static VALUE rb_cYARPBlockNode;
static VALUE rb_cYARPBlockParameterNode;
static VALUE rb_cYARPBlockParametersNode;
static VALUE rb_cYARPBreakNode;
+static VALUE rb_cYARPCallAndWriteNode;
static VALUE rb_cYARPCallNode;
-static VALUE rb_cYARPCallOperatorAndWriteNode;
-static VALUE rb_cYARPCallOperatorOrWriteNode;
static VALUE rb_cYARPCallOperatorWriteNode;
+static VALUE rb_cYARPCallOrWriteNode;
static VALUE rb_cYARPCapturePatternNode;
static VALUE rb_cYARPCaseNode;
static VALUE rb_cYARPClassNode;
static VALUE rb_cYARPClassVariableAndWriteNode;
static VALUE rb_cYARPClassVariableOperatorWriteNode;
@@ -102,10 +103,11 @@
static VALUE rb_cYARPLocalVariableWriteNode;
static VALUE rb_cYARPMatchPredicateNode;
static VALUE rb_cYARPMatchRequiredNode;
static VALUE rb_cYARPMissingNode;
static VALUE rb_cYARPModuleNode;
+static VALUE rb_cYARPMultiTargetNode;
static VALUE rb_cYARPMultiWriteNode;
static VALUE rb_cYARPNextNode;
static VALUE rb_cYARPNilNode;
static VALUE rb_cYARPNoKeywordsParameterNode;
static VALUE rb_cYARPNumberedReferenceReadNode;
@@ -174,12 +176,12 @@
return rb_enc_str_new((const char *) yp_string_source(string), yp_string_length(string), encoding);
}
// Create a YARP::Source object from the given parser.
VALUE
-yp_source_new(yp_parser_t *parser) {
- VALUE source = rb_str_new((const char *) parser->start, parser->end - parser->start);
+yp_source_new(yp_parser_t *parser, rb_encoding *encoding) {
+ VALUE source = rb_enc_str_new((const char *) parser->start, parser->end - parser->start, encoding);
VALUE offsets = rb_ary_new_capa(parser->newline_list.size);
for (size_t index = 0; index < parser->newline_list.size; index++) {
rb_ary_push(offsets, INT2FIX(parser->newline_list.offsets[index]));
}
@@ -214,11 +216,11 @@
return visit;
}
VALUE
yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding) {
- VALUE source = yp_source_new(parser);
+ VALUE source = yp_source_new(parser, encoding);
ID *constants = calloc(parser->constant_pool.size, sizeof(ID));
for (size_t index = 0; index < parser->constant_pool.capacity; index++) {
yp_constant_t constant = parser->constant_pool.constants[index];
@@ -242,48 +244,48 @@
yp_node_t *node = node_stack->visit;
node_stack->visited = true;
switch (YP_NODE_TYPE(node)) {
#line 111 "api_node.c.erb"
- case YP_NODE_ALIAS_NODE: {
+ case YP_ALIAS_NODE: {
yp_alias_node_t *cast = (yp_alias_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->new_name);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->old_name);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ALTERNATION_PATTERN_NODE: {
+ case YP_ALTERNATION_PATTERN_NODE: {
yp_alternation_pattern_node_t *cast = (yp_alternation_pattern_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_AND_NODE: {
+ case YP_AND_NODE: {
yp_and_node_t *cast = (yp_and_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ARGUMENTS_NODE: {
+ case YP_ARGUMENTS_NODE: {
yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
for (size_t index = 0; index < cast->arguments.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ARRAY_NODE: {
+ case YP_ARRAY_NODE: {
yp_array_node_t *cast = (yp_array_node_t *) node;
for (size_t index = 0; index < cast->elements.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ARRAY_PATTERN_NODE: {
+ case YP_ARRAY_PATTERN_NODE: {
yp_array_pattern_node_t *cast = (yp_array_pattern_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
for (size_t index = 0; index < cast->requireds.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->requireds.nodes[index]);
}
@@ -292,485 +294,499 @@
yp_node_stack_push(&node_stack, (yp_node_t *) cast->posts.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ASSOC_NODE: {
+ case YP_ASSOC_NODE: {
yp_assoc_node_t *cast = (yp_assoc_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->key);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ASSOC_SPLAT_NODE: {
+ case YP_ASSOC_SPLAT_NODE: {
yp_assoc_splat_node_t *cast = (yp_assoc_splat_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_BEGIN_NODE: {
+ case YP_BEGIN_NODE: {
yp_begin_node_t *cast = (yp_begin_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->rescue_clause);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->else_clause);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->ensure_clause);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_BLOCK_ARGUMENT_NODE: {
+ case YP_BLOCK_ARGUMENT_NODE: {
yp_block_argument_node_t *cast = (yp_block_argument_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_BLOCK_NODE: {
+ case YP_BLOCK_NODE: {
yp_block_node_t *cast = (yp_block_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_BLOCK_PARAMETERS_NODE: {
+ case YP_BLOCK_PARAMETERS_NODE: {
yp_block_parameters_node_t *cast = (yp_block_parameters_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
+ for (size_t index = 0; index < cast->locals.size; index++) {
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->locals.nodes[index]);
+ }
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_BREAK_NODE: {
+ case YP_BREAK_NODE: {
yp_break_node_t *cast = (yp_break_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CALL_NODE: {
- yp_call_node_t *cast = (yp_call_node_t *) node;
+ case YP_CALL_AND_WRITE_NODE: {
+ yp_call_and_write_node_t *cast = (yp_call_and_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE: {
- yp_call_operator_and_write_node_t *cast = (yp_call_operator_and_write_node_t *) node;
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
+ case YP_CALL_NODE: {
+ yp_call_node_t *cast = (yp_call_node_t *) node;
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE: {
- yp_call_operator_or_write_node_t *cast = (yp_call_operator_or_write_node_t *) node;
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
+ case YP_CALL_OPERATOR_WRITE_NODE: {
+ yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CALL_OPERATOR_WRITE_NODE: {
- yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
- yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
+ case YP_CALL_OR_WRITE_NODE: {
+ yp_call_or_write_node_t *cast = (yp_call_or_write_node_t *) node;
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CAPTURE_PATTERN_NODE: {
+ case YP_CAPTURE_PATTERN_NODE: {
yp_capture_pattern_node_t *cast = (yp_capture_pattern_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CASE_NODE: {
+ case YP_CASE_NODE: {
yp_case_node_t *cast = (yp_case_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
for (size_t index = 0; index < cast->conditions.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->conditions.nodes[index]);
}
yp_node_stack_push(&node_stack, (yp_node_t *) cast->consequent);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CLASS_NODE: {
+ case YP_CLASS_NODE: {
yp_class_node_t *cast = (yp_class_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant_path);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->superclass);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_AND_WRITE_NODE: {
yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_OR_WRITE_NODE: {
yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_WRITE_NODE: {
yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_AND_WRITE_NODE: {
+ case YP_CONSTANT_AND_WRITE_NODE: {
yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
+ case YP_CONSTANT_OPERATOR_WRITE_NODE: {
yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_OR_WRITE_NODE: {
+ case YP_CONSTANT_OR_WRITE_NODE: {
yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_AND_WRITE_NODE: {
+ case YP_CONSTANT_PATH_AND_WRITE_NODE: {
yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_NODE: {
+ case YP_CONSTANT_PATH_NODE: {
yp_constant_path_node_t *cast = (yp_constant_path_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parent);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
+ case YP_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_OR_WRITE_NODE: {
+ case YP_CONSTANT_PATH_OR_WRITE_NODE: {
yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_TARGET_NODE: {
+ case YP_CONSTANT_PATH_TARGET_NODE: {
yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parent);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->child);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
+ case YP_CONSTANT_PATH_WRITE_NODE: {
yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->target);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_CONSTANT_WRITE_NODE: {
+ case YP_CONSTANT_WRITE_NODE: {
yp_constant_write_node_t *cast = (yp_constant_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_DEF_NODE: {
+ case YP_DEF_NODE: {
yp_def_node_t *cast = (yp_def_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->receiver);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_DEFINED_NODE: {
+ case YP_DEFINED_NODE: {
yp_defined_node_t *cast = (yp_defined_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ELSE_NODE: {
+ case YP_ELSE_NODE: {
yp_else_node_t *cast = (yp_else_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_EMBEDDED_STATEMENTS_NODE: {
+ case YP_EMBEDDED_STATEMENTS_NODE: {
yp_embedded_statements_node_t *cast = (yp_embedded_statements_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_EMBEDDED_VARIABLE_NODE: {
+ case YP_EMBEDDED_VARIABLE_NODE: {
yp_embedded_variable_node_t *cast = (yp_embedded_variable_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->variable);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_ENSURE_NODE: {
+ case YP_ENSURE_NODE: {
yp_ensure_node_t *cast = (yp_ensure_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_FIND_PATTERN_NODE: {
+ case YP_FIND_PATTERN_NODE: {
yp_find_pattern_node_t *cast = (yp_find_pattern_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
for (size_t index = 0; index < cast->requireds.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->requireds.nodes[index]);
}
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_FLIP_FLOP_NODE: {
+ case YP_FLIP_FLOP_NODE: {
yp_flip_flop_node_t *cast = (yp_flip_flop_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_FOR_NODE: {
+ case YP_FOR_NODE: {
yp_for_node_t *cast = (yp_for_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->index);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->collection);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_FORWARDING_SUPER_NODE: {
+ case YP_FORWARDING_SUPER_NODE: {
yp_forwarding_super_node_t *cast = (yp_forwarding_super_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_AND_WRITE_NODE: {
yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_OR_WRITE_NODE: {
yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_WRITE_NODE: {
yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_HASH_NODE: {
+ case YP_HASH_NODE: {
yp_hash_node_t *cast = (yp_hash_node_t *) node;
for (size_t index = 0; index < cast->elements.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_HASH_PATTERN_NODE: {
+ case YP_HASH_PATTERN_NODE: {
yp_hash_pattern_node_t *cast = (yp_hash_pattern_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant);
for (size_t index = 0; index < cast->assocs.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->assocs.nodes[index]);
}
yp_node_stack_push(&node_stack, (yp_node_t *) cast->kwrest);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_IF_NODE: {
+ case YP_IF_NODE: {
yp_if_node_t *cast = (yp_if_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->consequent);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_IMAGINARY_NODE: {
+ case YP_IMAGINARY_NODE: {
yp_imaginary_node_t *cast = (yp_imaginary_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->numeric);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_IN_NODE: {
+ case YP_IN_NODE: {
yp_in_node_t *cast = (yp_in_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_AND_WRITE_NODE: {
yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_OR_WRITE_NODE: {
yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_WRITE_NODE: {
yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
+ case YP_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
yp_interpolated_regular_expression_node_t *cast = (yp_interpolated_regular_expression_node_t *) node;
for (size_t index = 0; index < cast->parts.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_STRING_NODE: {
+ case YP_INTERPOLATED_STRING_NODE: {
yp_interpolated_string_node_t *cast = (yp_interpolated_string_node_t *) node;
for (size_t index = 0; index < cast->parts.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_SYMBOL_NODE: {
+ case YP_INTERPOLATED_SYMBOL_NODE: {
yp_interpolated_symbol_node_t *cast = (yp_interpolated_symbol_node_t *) node;
for (size_t index = 0; index < cast->parts.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_X_STRING_NODE: {
+ case YP_INTERPOLATED_X_STRING_NODE: {
yp_interpolated_x_string_node_t *cast = (yp_interpolated_x_string_node_t *) node;
for (size_t index = 0; index < cast->parts.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parts.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_KEYWORD_HASH_NODE: {
+ case YP_KEYWORD_HASH_NODE: {
yp_keyword_hash_node_t *cast = (yp_keyword_hash_node_t *) node;
for (size_t index = 0; index < cast->elements.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->elements.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_KEYWORD_PARAMETER_NODE: {
+ case YP_KEYWORD_PARAMETER_NODE: {
yp_keyword_parameter_node_t *cast = (yp_keyword_parameter_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_LAMBDA_NODE: {
+ case YP_LAMBDA_NODE: {
yp_lambda_node_t *cast = (yp_lambda_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_AND_WRITE_NODE: {
yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_OR_WRITE_NODE: {
yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_WRITE_NODE: {
yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_MATCH_PREDICATE_NODE: {
+ case YP_MATCH_PREDICATE_NODE: {
yp_match_predicate_node_t *cast = (yp_match_predicate_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_MATCH_REQUIRED_NODE: {
+ case YP_MATCH_REQUIRED_NODE: {
yp_match_required_node_t *cast = (yp_match_required_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->pattern);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_MODULE_NODE: {
+ case YP_MODULE_NODE: {
yp_module_node_t *cast = (yp_module_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->constant_path);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_MULTI_WRITE_NODE: {
+ case YP_MULTI_TARGET_NODE: {
+ yp_multi_target_node_t *cast = (yp_multi_target_node_t *) node;
+ for (size_t index = 0; index < cast->targets.size; index++) {
+ yp_node_stack_push(&node_stack, (yp_node_t *) cast->targets.nodes[index]);
+ }
+ break;
+ }
+#line 111 "api_node.c.erb"
+ case YP_MULTI_WRITE_NODE: {
yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
for (size_t index = 0; index < cast->targets.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->targets.nodes[index]);
}
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_NEXT_NODE: {
+ case YP_NEXT_NODE: {
yp_next_node_t *cast = (yp_next_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_OPTIONAL_PARAMETER_NODE: {
+ case YP_OPTIONAL_PARAMETER_NODE: {
yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->value);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_OR_NODE: {
+ case YP_OR_NODE: {
yp_or_node_t *cast = (yp_or_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_PARAMETERS_NODE: {
+ case YP_PARAMETERS_NODE: {
yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
for (size_t index = 0; index < cast->requireds.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->requireds.nodes[index]);
}
for (size_t index = 0; index < cast->optionals.size; index++) {
@@ -786,166 +802,166 @@
yp_node_stack_push(&node_stack, (yp_node_t *) cast->keyword_rest);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_PARENTHESES_NODE: {
+ case YP_PARENTHESES_NODE: {
yp_parentheses_node_t *cast = (yp_parentheses_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_PINNED_EXPRESSION_NODE: {
+ case YP_PINNED_EXPRESSION_NODE: {
yp_pinned_expression_node_t *cast = (yp_pinned_expression_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_PINNED_VARIABLE_NODE: {
+ case YP_PINNED_VARIABLE_NODE: {
yp_pinned_variable_node_t *cast = (yp_pinned_variable_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->variable);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_POST_EXECUTION_NODE: {
+ case YP_POST_EXECUTION_NODE: {
yp_post_execution_node_t *cast = (yp_post_execution_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_PRE_EXECUTION_NODE: {
+ case YP_PRE_EXECUTION_NODE: {
yp_pre_execution_node_t *cast = (yp_pre_execution_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_PROGRAM_NODE: {
+ case YP_PROGRAM_NODE: {
yp_program_node_t *cast = (yp_program_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_RANGE_NODE: {
+ case YP_RANGE_NODE: {
yp_range_node_t *cast = (yp_range_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_RATIONAL_NODE: {
+ case YP_RATIONAL_NODE: {
yp_rational_node_t *cast = (yp_rational_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->numeric);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
+ case YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
yp_required_destructured_parameter_node_t *cast = (yp_required_destructured_parameter_node_t *) node;
for (size_t index = 0; index < cast->parameters.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->parameters.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_RESCUE_MODIFIER_NODE: {
+ case YP_RESCUE_MODIFIER_NODE: {
yp_rescue_modifier_node_t *cast = (yp_rescue_modifier_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->rescue_expression);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_RESCUE_NODE: {
+ case YP_RESCUE_NODE: {
yp_rescue_node_t *cast = (yp_rescue_node_t *) node;
for (size_t index = 0; index < cast->exceptions.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->exceptions.nodes[index]);
}
yp_node_stack_push(&node_stack, (yp_node_t *) cast->reference);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->consequent);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_RETURN_NODE: {
+ case YP_RETURN_NODE: {
yp_return_node_t *cast = (yp_return_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_SINGLETON_CLASS_NODE: {
+ case YP_SINGLETON_CLASS_NODE: {
yp_singleton_class_node_t *cast = (yp_singleton_class_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_SPLAT_NODE: {
+ case YP_SPLAT_NODE: {
yp_splat_node_t *cast = (yp_splat_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->expression);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_STATEMENTS_NODE: {
+ case YP_STATEMENTS_NODE: {
yp_statements_node_t *cast = (yp_statements_node_t *) node;
for (size_t index = 0; index < cast->body.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->body.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_STRING_CONCAT_NODE: {
+ case YP_STRING_CONCAT_NODE: {
yp_string_concat_node_t *cast = (yp_string_concat_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->left);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->right);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_SUPER_NODE: {
+ case YP_SUPER_NODE: {
yp_super_node_t *cast = (yp_super_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->block);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_UNDEF_NODE: {
+ case YP_UNDEF_NODE: {
yp_undef_node_t *cast = (yp_undef_node_t *) node;
for (size_t index = 0; index < cast->names.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->names.nodes[index]);
}
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_UNLESS_NODE: {
+ case YP_UNLESS_NODE: {
yp_unless_node_t *cast = (yp_unless_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->consequent);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_UNTIL_NODE: {
+ case YP_UNTIL_NODE: {
yp_until_node_t *cast = (yp_until_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_WHEN_NODE: {
+ case YP_WHEN_NODE: {
yp_when_node_t *cast = (yp_when_node_t *) node;
for (size_t index = 0; index < cast->conditions.size; index++) {
yp_node_stack_push(&node_stack, (yp_node_t *) cast->conditions.nodes[index]);
}
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_WHILE_NODE: {
+ case YP_WHILE_NODE: {
yp_while_node_t *cast = (yp_while_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->predicate);
yp_node_stack_push(&node_stack, (yp_node_t *) cast->statements);
break;
}
#line 111 "api_node.c.erb"
- case YP_NODE_YIELD_NODE: {
+ case YP_YIELD_NODE: {
yp_yield_node_t *cast = (yp_yield_node_t *) node;
yp_node_stack_push(&node_stack, (yp_node_t *) cast->arguments);
break;
}
default:
@@ -955,75 +971,85 @@
} else {
yp_node_t *node = yp_node_stack_pop(&node_stack);
switch (YP_NODE_TYPE(node)) {
#line 137 "api_node.c.erb"
- case YP_NODE_ALIAS_NODE: {
+ case YP_ALIAS_NODE: {
yp_alias_node_t *cast = (yp_alias_node_t *) node;
VALUE argv[4];
// new_name
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// old_name
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAliasNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ALTERNATION_PATTERN_NODE: {
+ case YP_ALTERNATION_PATTERN_NODE: {
yp_alternation_pattern_node_t *cast = (yp_alternation_pattern_node_t *) node;
VALUE argv[4];
// left
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// right
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAlternationPatternNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_AND_NODE: {
+ case YP_AND_NODE: {
yp_and_node_t *cast = (yp_and_node_t *) node;
VALUE argv[4];
// left
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// right
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAndNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ARGUMENTS_NODE: {
+ case YP_ARGUMENTS_NODE: {
yp_arguments_node_t *cast = (yp_arguments_node_t *) node;
VALUE argv[2];
// arguments
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->arguments.size);
for (size_t index = 0; index < cast->arguments.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
@@ -1032,1525 +1058,1959 @@
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPArgumentsNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ARRAY_NODE: {
+ case YP_ARRAY_NODE: {
yp_array_node_t *cast = (yp_array_node_t *) node;
VALUE argv[4];
// elements
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->elements.size);
for (size_t index = 0; index < cast->elements.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
// opening_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPArrayNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ARRAY_PATTERN_NODE: {
+ case YP_ARRAY_PATTERN_NODE: {
yp_array_pattern_node_t *cast = (yp_array_pattern_node_t *) node;
VALUE argv[7];
// constant
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// requireds
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->requireds.size);
for (size_t index = 0; index < cast->requireds.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// rest
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// posts
+#line 151 "api_node.c.erb"
argv[3] = rb_ary_new_capa(cast->posts.size);
for (size_t index = 0; index < cast->posts.size; index++) {
rb_ary_push(argv[3], rb_ary_pop(value_stack));
}
// opening_loc
+#line 176 "api_node.c.erb"
argv[4] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPArrayPatternNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ASSOC_NODE: {
+ case YP_ASSOC_NODE: {
yp_assoc_node_t *cast = (yp_assoc_node_t *) node;
VALUE argv[4];
// key
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// value
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPAssocNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ASSOC_SPLAT_NODE: {
+ case YP_ASSOC_SPLAT_NODE: {
yp_assoc_splat_node_t *cast = (yp_assoc_splat_node_t *) node;
VALUE argv[3];
// value
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPAssocSplatNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_BACK_REFERENCE_READ_NODE: {
+ case YP_BACK_REFERENCE_READ_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPBackReferenceReadNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_BEGIN_NODE: {
+ case YP_BEGIN_NODE: {
yp_begin_node_t *cast = (yp_begin_node_t *) node;
VALUE argv[7];
// begin_keyword_loc
+#line 176 "api_node.c.erb"
argv[0] = cast->begin_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->begin_keyword_loc.start, cast->begin_keyword_loc.end, source);
// statements
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// rescue_clause
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// else_clause
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// ensure_clause
+#line 148 "api_node.c.erb"
argv[4] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 176 "api_node.c.erb"
argv[5] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPBeginNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_BLOCK_ARGUMENT_NODE: {
+ case YP_BLOCK_ARGUMENT_NODE: {
yp_block_argument_node_t *cast = (yp_block_argument_node_t *) node;
VALUE argv[3];
// expression
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPBlockArgumentNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_BLOCK_NODE: {
+ case YP_BLOCK_LOCAL_VARIABLE_NODE: {
+ yp_block_local_variable_node_t *cast = (yp_block_local_variable_node_t *) node;
+ VALUE argv[2];
+
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
+ // location
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
+
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPBlockLocalVariableNode));
+ break;
+ }
+#line 137 "api_node.c.erb"
+ case YP_BLOCK_NODE: {
yp_block_node_t *cast = (yp_block_node_t *) node;
VALUE argv[6];
// locals
+#line 166 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
+ assert(cast->locals.ids[index] != 0);
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
}
// parameters
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// body
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// opening_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[4] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPBlockNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_BLOCK_PARAMETER_NODE: {
+ case YP_BLOCK_PARAMETER_NODE: {
yp_block_parameter_node_t *cast = (yp_block_parameter_node_t *) node;
- VALUE argv[3];
+ VALUE argv[4];
+ // name
+ argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPBlockParameterNode));
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPBlockParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_BLOCK_PARAMETERS_NODE: {
+ case YP_BLOCK_PARAMETERS_NODE: {
yp_block_parameters_node_t *cast = (yp_block_parameters_node_t *) node;
VALUE argv[5];
// parameters
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// locals
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
- yp_location_t location = cast->locals.locations[index];
- rb_ary_push(argv[1], yp_location_new(parser, location.start, location.end, source));
+ rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// opening_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPBlockParametersNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_BREAK_NODE: {
+ case YP_BREAK_NODE: {
yp_break_node_t *cast = (yp_break_node_t *) node;
VALUE argv[3];
// arguments
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPBreakNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CALL_NODE: {
+ case YP_CALL_AND_WRITE_NODE: {
+ yp_call_and_write_node_t *cast = (yp_call_and_write_node_t *) node;
+ VALUE argv[12];
+
+ // receiver
+#line 148 "api_node.c.erb"
+ argv[0] = rb_ary_pop(value_stack);
+
+ // call_operator_loc
+#line 176 "api_node.c.erb"
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
+
+ // message_loc
+#line 176 "api_node.c.erb"
+ argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
+
+ // opening_loc
+#line 176 "api_node.c.erb"
+ argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
+
+ // arguments
+#line 148 "api_node.c.erb"
+ argv[4] = rb_ary_pop(value_stack);
+
+ // closing_loc
+#line 176 "api_node.c.erb"
+ argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
+
+ // flags
+#line 182 "api_node.c.erb"
+ argv[6] = ULONG2NUM(node->flags >> 1);
+
+ // read_name
+#line 157 "api_node.c.erb"
+ argv[7] = yp_string_new(&cast->read_name, encoding);
+
+ // write_name
+#line 157 "api_node.c.erb"
+ argv[8] = yp_string_new(&cast->write_name, encoding);
+
+ // operator_loc
+#line 173 "api_node.c.erb"
+ argv[9] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+
+ // value
+#line 148 "api_node.c.erb"
+ argv[10] = rb_ary_pop(value_stack);
+
+ // location
+ argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
+
+ rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPCallAndWriteNode));
+ break;
+ }
+#line 137 "api_node.c.erb"
+ case YP_CALL_NODE: {
yp_call_node_t *cast = (yp_call_node_t *) node;
VALUE argv[10];
// receiver
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
- // operator_loc
- argv[1] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+ // call_operator_loc
+#line 176 "api_node.c.erb"
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
// message_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
// opening_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// arguments
+#line 148 "api_node.c.erb"
argv[4] = rb_ary_pop(value_stack);
// closing_loc
+#line 176 "api_node.c.erb"
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// block
+#line 148 "api_node.c.erb"
argv[6] = rb_ary_pop(value_stack);
// flags
+#line 182 "api_node.c.erb"
argv[7] = ULONG2NUM(node->flags >> 1);
// name
+#line 157 "api_node.c.erb"
argv[8] = yp_string_new(&cast->name, encoding);
// location
argv[9] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(10, argv, rb_cYARPCallNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CALL_OPERATOR_AND_WRITE_NODE: {
- yp_call_operator_and_write_node_t *cast = (yp_call_operator_and_write_node_t *) node;
- VALUE argv[4];
+ case YP_CALL_OPERATOR_WRITE_NODE: {
+ yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
+ VALUE argv[13];
- // target
+ // receiver
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
+ // call_operator_loc
+#line 176 "api_node.c.erb"
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
+
+ // message_loc
+#line 176 "api_node.c.erb"
+ argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
+
+ // opening_loc
+#line 176 "api_node.c.erb"
+ argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
+
+ // arguments
+#line 148 "api_node.c.erb"
+ argv[4] = rb_ary_pop(value_stack);
+
+ // closing_loc
+#line 176 "api_node.c.erb"
+ argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
+
+ // flags
+#line 182 "api_node.c.erb"
+ argv[6] = ULONG2NUM(node->flags >> 1);
+
+ // read_name
+#line 157 "api_node.c.erb"
+ argv[7] = yp_string_new(&cast->read_name, encoding);
+
+ // write_name
+#line 157 "api_node.c.erb"
+ argv[8] = yp_string_new(&cast->write_name, encoding);
+
+ // operator
+#line 160 "api_node.c.erb"
+ assert(cast->operator != 0);
+ argv[9] = rb_id2sym(constants[cast->operator - 1]);
+
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[10] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[11] = rb_ary_pop(value_stack);
// location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[12] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPCallOperatorAndWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(13, argv, rb_cYARPCallOperatorWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CALL_OPERATOR_OR_WRITE_NODE: {
- yp_call_operator_or_write_node_t *cast = (yp_call_operator_or_write_node_t *) node;
- VALUE argv[4];
+ case YP_CALL_OR_WRITE_NODE: {
+ yp_call_or_write_node_t *cast = (yp_call_or_write_node_t *) node;
+ VALUE argv[12];
- // target
+ // receiver
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
- // value
- argv[1] = rb_ary_pop(value_stack);
+ // call_operator_loc
+#line 176 "api_node.c.erb"
+ argv[1] = cast->call_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);
- // operator_loc
- argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+ // message_loc
+#line 176 "api_node.c.erb"
+ argv[2] = cast->message_loc.start == NULL ? Qnil : yp_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);
- // location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ // opening_loc
+#line 176 "api_node.c.erb"
+ argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPCallOperatorOrWriteNode));
- break;
- }
-#line 137 "api_node.c.erb"
- case YP_NODE_CALL_OPERATOR_WRITE_NODE: {
- yp_call_operator_write_node_t *cast = (yp_call_operator_write_node_t *) node;
- VALUE argv[5];
+ // arguments
+#line 148 "api_node.c.erb"
+ argv[4] = rb_ary_pop(value_stack);
- // target
- argv[0] = rb_ary_pop(value_stack);
+ // closing_loc
+#line 176 "api_node.c.erb"
+ argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
+ // flags
+#line 182 "api_node.c.erb"
+ argv[6] = ULONG2NUM(node->flags >> 1);
+
+ // read_name
+#line 157 "api_node.c.erb"
+ argv[7] = yp_string_new(&cast->read_name, encoding);
+
+ // write_name
+#line 157 "api_node.c.erb"
+ argv[8] = yp_string_new(&cast->write_name, encoding);
+
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[9] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[10] = rb_ary_pop(value_stack);
- // operator
- argv[3] = rb_id2sym(constants[cast->operator - 1]);
-
// location
- argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPCallOperatorWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPCallOrWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CAPTURE_PATTERN_NODE: {
+ case YP_CAPTURE_PATTERN_NODE: {
yp_capture_pattern_node_t *cast = (yp_capture_pattern_node_t *) node;
VALUE argv[4];
// value
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// target
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPCapturePatternNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CASE_NODE: {
+ case YP_CASE_NODE: {
yp_case_node_t *cast = (yp_case_node_t *) node;
VALUE argv[6];
// predicate
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// conditions
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->conditions.size);
for (size_t index = 0; index < cast->conditions.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// consequent
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// case_keyword_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->case_keyword_loc.start, cast->case_keyword_loc.end, source);
// end_keyword_loc
+#line 173 "api_node.c.erb"
argv[4] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPCaseNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CLASS_NODE: {
+ case YP_CLASS_NODE: {
yp_class_node_t *cast = (yp_class_node_t *) node;
VALUE argv[9];
// locals
+#line 166 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
+ assert(cast->locals.ids[index] != 0);
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
}
// class_keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);
// constant_path
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// inheritance_operator_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->inheritance_operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->inheritance_operator_loc.start, cast->inheritance_operator_loc.end, source);
// superclass
+#line 148 "api_node.c.erb"
argv[4] = rb_ary_pop(value_stack);
// body
+#line 148 "api_node.c.erb"
argv[5] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 173 "api_node.c.erb"
argv[6] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// name
- argv[7] = yp_string_new(&cast->name, encoding);
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[7] = rb_id2sym(constants[cast->name - 1]);
// location
argv[8] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(9, argv, rb_cYARPClassNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_AND_WRITE_NODE: {
yp_class_variable_and_write_node_t *cast = (yp_class_variable_and_write_node_t *) node;
VALUE argv[5];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPClassVariableAndWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
yp_class_variable_operator_write_node_t *cast = (yp_class_variable_operator_write_node_t *) node;
VALUE argv[6];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// operator
+#line 160 "api_node.c.erb"
+ assert(cast->operator != 0);
argv[4] = rb_id2sym(constants[cast->operator - 1]);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPClassVariableOperatorWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_OR_WRITE_NODE: {
yp_class_variable_or_write_node_t *cast = (yp_class_variable_or_write_node_t *) node;
VALUE argv[5];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPClassVariableOrWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_READ_NODE: {
+ case YP_CLASS_VARIABLE_READ_NODE: {
yp_class_variable_read_node_t *cast = (yp_class_variable_read_node_t *) node;
VALUE argv[2];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPClassVariableReadNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_TARGET_NODE: {
+ case YP_CLASS_VARIABLE_TARGET_NODE: {
yp_class_variable_target_node_t *cast = (yp_class_variable_target_node_t *) node;
VALUE argv[2];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPClassVariableTargetNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CLASS_VARIABLE_WRITE_NODE: {
+ case YP_CLASS_VARIABLE_WRITE_NODE: {
yp_class_variable_write_node_t *cast = (yp_class_variable_write_node_t *) node;
VALUE argv[5];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// operator_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPClassVariableWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_AND_WRITE_NODE: {
+ case YP_CONSTANT_AND_WRITE_NODE: {
yp_constant_and_write_node_t *cast = (yp_constant_and_write_node_t *) node;
- VALUE argv[4];
+ VALUE argv[5];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[3] = rb_ary_pop(value_stack);
// location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantAndWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantAndWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_OPERATOR_WRITE_NODE: {
+ case YP_CONSTANT_OPERATOR_WRITE_NODE: {
yp_constant_operator_write_node_t *cast = (yp_constant_operator_write_node_t *) node;
- VALUE argv[5];
+ VALUE argv[6];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[3] = rb_ary_pop(value_stack);
// operator
- argv[3] = rb_id2sym(constants[cast->operator - 1]);
+#line 160 "api_node.c.erb"
+ assert(cast->operator != 0);
+ argv[4] = rb_id2sym(constants[cast->operator - 1]);
// location
- argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantOperatorWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPConstantOperatorWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_OR_WRITE_NODE: {
+ case YP_CONSTANT_OR_WRITE_NODE: {
yp_constant_or_write_node_t *cast = (yp_constant_or_write_node_t *) node;
- VALUE argv[4];
+ VALUE argv[5];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[3] = rb_ary_pop(value_stack);
// location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantOrWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantOrWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_AND_WRITE_NODE: {
+ case YP_CONSTANT_PATH_AND_WRITE_NODE: {
yp_constant_path_and_write_node_t *cast = (yp_constant_path_and_write_node_t *) node;
VALUE argv[4];
// target
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathAndWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_NODE: {
+ case YP_CONSTANT_PATH_NODE: {
yp_constant_path_node_t *cast = (yp_constant_path_node_t *) node;
VALUE argv[4];
// parent
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// child
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// delimiter_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
+ case YP_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
yp_constant_path_operator_write_node_t *cast = (yp_constant_path_operator_write_node_t *) node;
VALUE argv[5];
// target
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// operator
+#line 160 "api_node.c.erb"
+ assert(cast->operator != 0);
argv[3] = rb_id2sym(constants[cast->operator - 1]);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantPathOperatorWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_OR_WRITE_NODE: {
+ case YP_CONSTANT_PATH_OR_WRITE_NODE: {
yp_constant_path_or_write_node_t *cast = (yp_constant_path_or_write_node_t *) node;
VALUE argv[4];
// target
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathOrWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_TARGET_NODE: {
+ case YP_CONSTANT_PATH_TARGET_NODE: {
yp_constant_path_target_node_t *cast = (yp_constant_path_target_node_t *) node;
VALUE argv[4];
// parent
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// child
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// delimiter_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathTargetNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_PATH_WRITE_NODE: {
+ case YP_CONSTANT_PATH_WRITE_NODE: {
yp_constant_path_write_node_t *cast = (yp_constant_path_write_node_t *) node;
VALUE argv[4];
// target
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantPathWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_READ_NODE: {
- VALUE argv[1];
+ case YP_CONSTANT_READ_NODE: {
+ yp_constant_read_node_t *cast = (yp_constant_read_node_t *) node;
+ VALUE argv[2];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// location
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPConstantReadNode));
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPConstantReadNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_TARGET_NODE: {
- VALUE argv[1];
+ case YP_CONSTANT_TARGET_NODE: {
+ yp_constant_target_node_t *cast = (yp_constant_target_node_t *) node;
+ VALUE argv[2];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// location
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPConstantTargetNode));
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPConstantTargetNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_CONSTANT_WRITE_NODE: {
+ case YP_CONSTANT_WRITE_NODE: {
yp_constant_write_node_t *cast = (yp_constant_write_node_t *) node;
- VALUE argv[4];
+ VALUE argv[5];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// value
- argv[1] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[2] = rb_ary_pop(value_stack);
// operator_loc
- argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPConstantWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPConstantWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_DEF_NODE: {
+ case YP_DEF_NODE: {
yp_def_node_t *cast = (yp_def_node_t *) node;
- VALUE argv[12];
+ VALUE argv[13];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// receiver
- argv[1] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[2] = rb_ary_pop(value_stack);
// parameters
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[3] = rb_ary_pop(value_stack);
// body
- argv[3] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[4] = rb_ary_pop(value_stack);
// locals
- argv[4] = rb_ary_new_capa(cast->locals.size);
+#line 166 "api_node.c.erb"
+ argv[5] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
- rb_ary_push(argv[4], rb_id2sym(constants[cast->locals.ids[index] - 1]));
+ assert(cast->locals.ids[index] != 0);
+ rb_ary_push(argv[5], rb_id2sym(constants[cast->locals.ids[index] - 1]));
}
// def_keyword_loc
- argv[5] = yp_location_new(parser, cast->def_keyword_loc.start, cast->def_keyword_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[6] = yp_location_new(parser, cast->def_keyword_loc.start, cast->def_keyword_loc.end, source);
// operator_loc
- argv[6] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[7] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// lparen_loc
- argv[7] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[8] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
// rparen_loc
- argv[8] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[9] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
// equal_loc
- argv[9] = cast->equal_loc.start == NULL ? Qnil : yp_location_new(parser, cast->equal_loc.start, cast->equal_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[10] = cast->equal_loc.start == NULL ? Qnil : yp_location_new(parser, cast->equal_loc.start, cast->equal_loc.end, source);
// end_keyword_loc
- argv[10] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[11] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
- argv[11] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[12] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(12, argv, rb_cYARPDefNode));
+ rb_ary_push(value_stack, rb_class_new_instance(13, argv, rb_cYARPDefNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_DEFINED_NODE: {
+ case YP_DEFINED_NODE: {
yp_defined_node_t *cast = (yp_defined_node_t *) node;
VALUE argv[5];
// lparen_loc
+#line 176 "api_node.c.erb"
argv[0] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// rparen_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPDefinedNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ELSE_NODE: {
+ case YP_ELSE_NODE: {
yp_else_node_t *cast = (yp_else_node_t *) node;
VALUE argv[4];
// else_keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->else_keyword_loc.start, cast->else_keyword_loc.end, source);
// statements
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPElseNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_EMBEDDED_STATEMENTS_NODE: {
+ case YP_EMBEDDED_STATEMENTS_NODE: {
yp_embedded_statements_node_t *cast = (yp_embedded_statements_node_t *) node;
VALUE argv[4];
// opening_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// statements
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPEmbeddedStatementsNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_EMBEDDED_VARIABLE_NODE: {
+ case YP_EMBEDDED_VARIABLE_NODE: {
yp_embedded_variable_node_t *cast = (yp_embedded_variable_node_t *) node;
VALUE argv[3];
// operator_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// variable
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPEmbeddedVariableNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_ENSURE_NODE: {
+ case YP_ENSURE_NODE: {
yp_ensure_node_t *cast = (yp_ensure_node_t *) node;
VALUE argv[4];
// ensure_keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->ensure_keyword_loc.start, cast->ensure_keyword_loc.end, source);
// statements
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPEnsureNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FALSE_NODE: {
+ case YP_FALSE_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPFalseNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FIND_PATTERN_NODE: {
+ case YP_FIND_PATTERN_NODE: {
yp_find_pattern_node_t *cast = (yp_find_pattern_node_t *) node;
VALUE argv[7];
// constant
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// left
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// requireds
+#line 151 "api_node.c.erb"
argv[2] = rb_ary_new_capa(cast->requireds.size);
for (size_t index = 0; index < cast->requireds.size; index++) {
rb_ary_push(argv[2], rb_ary_pop(value_stack));
}
// right
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// opening_loc
+#line 176 "api_node.c.erb"
argv[4] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[5] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPFindPatternNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FLIP_FLOP_NODE: {
+ case YP_FLIP_FLOP_NODE: {
yp_flip_flop_node_t *cast = (yp_flip_flop_node_t *) node;
VALUE argv[5];
// left
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// right
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// flags
+#line 182 "api_node.c.erb"
argv[3] = ULONG2NUM(node->flags >> 1);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPFlipFlopNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FLOAT_NODE: {
+ case YP_FLOAT_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPFloatNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FOR_NODE: {
+ case YP_FOR_NODE: {
yp_for_node_t *cast = (yp_for_node_t *) node;
VALUE argv[8];
// index
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// collection
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// statements
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// for_keyword_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->for_keyword_loc.start, cast->for_keyword_loc.end, source);
// in_keyword_loc
+#line 173 "api_node.c.erb"
argv[4] = yp_location_new(parser, cast->in_keyword_loc.start, cast->in_keyword_loc.end, source);
// do_keyword_loc
+#line 176 "api_node.c.erb"
argv[5] = cast->do_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->do_keyword_loc.start, cast->do_keyword_loc.end, source);
// end_keyword_loc
+#line 173 "api_node.c.erb"
argv[6] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[7] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(8, argv, rb_cYARPForNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FORWARDING_ARGUMENTS_NODE: {
+ case YP_FORWARDING_ARGUMENTS_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPForwardingArgumentsNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FORWARDING_PARAMETER_NODE: {
+ case YP_FORWARDING_PARAMETER_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPForwardingParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_FORWARDING_SUPER_NODE: {
+ case YP_FORWARDING_SUPER_NODE: {
VALUE argv[2];
// block
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPForwardingSuperNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_AND_WRITE_NODE: {
yp_global_variable_and_write_node_t *cast = (yp_global_variable_and_write_node_t *) node;
- VALUE argv[4];
+ VALUE argv[5];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[3] = rb_ary_pop(value_stack);
// location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableAndWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableAndWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
yp_global_variable_operator_write_node_t *cast = (yp_global_variable_operator_write_node_t *) node;
- VALUE argv[5];
+ VALUE argv[6];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[3] = rb_ary_pop(value_stack);
// operator
- argv[3] = rb_id2sym(constants[cast->operator - 1]);
+#line 160 "api_node.c.erb"
+ assert(cast->operator != 0);
+ argv[4] = rb_id2sym(constants[cast->operator - 1]);
// location
- argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableOperatorWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPGlobalVariableOperatorWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_OR_WRITE_NODE: {
yp_global_variable_or_write_node_t *cast = (yp_global_variable_or_write_node_t *) node;
- VALUE argv[4];
+ VALUE argv[5];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
- argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
- argv[2] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[3] = rb_ary_pop(value_stack);
// location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableOrWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableOrWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_READ_NODE: {
- VALUE argv[1];
+ case YP_GLOBAL_VARIABLE_READ_NODE: {
+ yp_global_variable_read_node_t *cast = (yp_global_variable_read_node_t *) node;
+ VALUE argv[2];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// location
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPGlobalVariableReadNode));
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPGlobalVariableReadNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_TARGET_NODE: {
- VALUE argv[1];
+ case YP_GLOBAL_VARIABLE_TARGET_NODE: {
+ yp_global_variable_target_node_t *cast = (yp_global_variable_target_node_t *) node;
+ VALUE argv[2];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// location
- argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPGlobalVariableTargetNode));
+ rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPGlobalVariableTargetNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_GLOBAL_VARIABLE_WRITE_NODE: {
+ case YP_GLOBAL_VARIABLE_WRITE_NODE: {
yp_global_variable_write_node_t *cast = (yp_global_variable_write_node_t *) node;
- VALUE argv[4];
+ VALUE argv[5];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// value
- argv[1] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[2] = rb_ary_pop(value_stack);
// operator_loc
- argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
- argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPGlobalVariableWriteNode));
+ rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPGlobalVariableWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_HASH_NODE: {
+ case YP_HASH_NODE: {
yp_hash_node_t *cast = (yp_hash_node_t *) node;
VALUE argv[4];
// opening_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// elements
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->elements.size);
for (size_t index = 0; index < cast->elements.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPHashNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_HASH_PATTERN_NODE: {
+ case YP_HASH_PATTERN_NODE: {
yp_hash_pattern_node_t *cast = (yp_hash_pattern_node_t *) node;
VALUE argv[6];
// constant
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// assocs
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->assocs.size);
for (size_t index = 0; index < cast->assocs.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// kwrest
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// opening_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[4] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPHashPatternNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_IF_NODE: {
+ case YP_IF_NODE: {
yp_if_node_t *cast = (yp_if_node_t *) node;
VALUE argv[6];
// if_keyword_loc
+#line 176 "api_node.c.erb"
argv[0] = cast->if_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->if_keyword_loc.start, cast->if_keyword_loc.end, source);
// predicate
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// statements
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// consequent
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 176 "api_node.c.erb"
argv[4] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPIfNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_IMAGINARY_NODE: {
+ case YP_IMAGINARY_NODE: {
VALUE argv[2];
// numeric
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPImaginaryNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_IN_NODE: {
+ case YP_IN_NODE: {
yp_in_node_t *cast = (yp_in_node_t *) node;
VALUE argv[5];
// pattern
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// statements
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// in_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->in_loc.start, cast->in_loc.end, source);
// then_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->then_loc.start == NULL ? Qnil : yp_location_new(parser, cast->then_loc.start, cast->then_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_AND_WRITE_NODE: {
yp_instance_variable_and_write_node_t *cast = (yp_instance_variable_and_write_node_t *) node;
VALUE argv[5];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInstanceVariableAndWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
yp_instance_variable_operator_write_node_t *cast = (yp_instance_variable_operator_write_node_t *) node;
VALUE argv[6];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// operator
+#line 160 "api_node.c.erb"
+ assert(cast->operator != 0);
argv[4] = rb_id2sym(constants[cast->operator - 1]);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPInstanceVariableOperatorWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_OR_WRITE_NODE: {
yp_instance_variable_or_write_node_t *cast = (yp_instance_variable_or_write_node_t *) node;
VALUE argv[5];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInstanceVariableOrWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_READ_NODE: {
+ case YP_INSTANCE_VARIABLE_READ_NODE: {
yp_instance_variable_read_node_t *cast = (yp_instance_variable_read_node_t *) node;
VALUE argv[2];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPInstanceVariableReadNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_TARGET_NODE: {
+ case YP_INSTANCE_VARIABLE_TARGET_NODE: {
yp_instance_variable_target_node_t *cast = (yp_instance_variable_target_node_t *) node;
VALUE argv[2];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPInstanceVariableTargetNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INSTANCE_VARIABLE_WRITE_NODE: {
+ case YP_INSTANCE_VARIABLE_WRITE_NODE: {
yp_instance_variable_write_node_t *cast = (yp_instance_variable_write_node_t *) node;
VALUE argv[5];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInstanceVariableWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INTEGER_NODE: {
+ case YP_INTEGER_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPIntegerNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
+ case YP_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
yp_interpolated_regular_expression_node_t *cast = (yp_interpolated_regular_expression_node_t *) node;
VALUE argv[5];
// opening_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// parts
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->parts.size);
for (size_t index = 0; index < cast->parts.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// flags
+#line 182 "api_node.c.erb"
argv[3] = ULONG2NUM(node->flags >> 1);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPInterpolatedRegularExpressionNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_STRING_NODE: {
+ case YP_INTERPOLATED_STRING_NODE: {
yp_interpolated_string_node_t *cast = (yp_interpolated_string_node_t *) node;
VALUE argv[4];
// opening_loc
+#line 176 "api_node.c.erb"
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// parts
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->parts.size);
for (size_t index = 0; index < cast->parts.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// closing_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPInterpolatedStringNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_SYMBOL_NODE: {
+ case YP_INTERPOLATED_SYMBOL_NODE: {
yp_interpolated_symbol_node_t *cast = (yp_interpolated_symbol_node_t *) node;
VALUE argv[4];
// opening_loc
+#line 176 "api_node.c.erb"
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// parts
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->parts.size);
for (size_t index = 0; index < cast->parts.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// closing_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPInterpolatedSymbolNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_INTERPOLATED_X_STRING_NODE: {
+ case YP_INTERPOLATED_X_STRING_NODE: {
yp_interpolated_x_string_node_t *cast = (yp_interpolated_x_string_node_t *) node;
VALUE argv[4];
// opening_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// parts
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->parts.size);
for (size_t index = 0; index < cast->parts.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPInterpolatedXStringNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_KEYWORD_HASH_NODE: {
+ case YP_KEYWORD_HASH_NODE: {
yp_keyword_hash_node_t *cast = (yp_keyword_hash_node_t *) node;
VALUE argv[2];
// elements
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->elements.size);
for (size_t index = 0; index < cast->elements.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
@@ -2559,902 +3019,1080 @@
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPKeywordHashNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_KEYWORD_PARAMETER_NODE: {
+ case YP_KEYWORD_PARAMETER_NODE: {
yp_keyword_parameter_node_t *cast = (yp_keyword_parameter_node_t *) node;
- VALUE argv[3];
+ VALUE argv[4];
+ // name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[0] = rb_id2sym(constants[cast->name - 1]);
+
// name_loc
- argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+#line 173 "api_node.c.erb"
+ argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// value
- argv[1] = rb_ary_pop(value_stack);
+#line 148 "api_node.c.erb"
+ argv[2] = rb_ary_pop(value_stack);
// location
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPKeywordParameterNode));
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPKeywordParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_KEYWORD_REST_PARAMETER_NODE: {
+ case YP_KEYWORD_REST_PARAMETER_NODE: {
yp_keyword_rest_parameter_node_t *cast = (yp_keyword_rest_parameter_node_t *) node;
- VALUE argv[3];
+ VALUE argv[4];
- // operator_loc
- argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+ // name
+ argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+ // operator_loc
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+
// location
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPKeywordRestParameterNode));
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPKeywordRestParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_LAMBDA_NODE: {
+ case YP_LAMBDA_NODE: {
yp_lambda_node_t *cast = (yp_lambda_node_t *) node;
VALUE argv[7];
// locals
+#line 166 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
+ assert(cast->locals.ids[index] != 0);
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
}
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// opening_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// parameters
+#line 148 "api_node.c.erb"
argv[4] = rb_ary_pop(value_stack);
// body
+#line 148 "api_node.c.erb"
argv[5] = rb_ary_pop(value_stack);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPLambdaNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_AND_WRITE_NODE: {
yp_local_variable_and_write_node_t *cast = (yp_local_variable_and_write_node_t *) node;
VALUE argv[6];
// name_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[3] = rb_id2sym(constants[cast->name - 1]);
// depth
+#line 179 "api_node.c.erb"
argv[4] = ULONG2NUM(cast->depth);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPLocalVariableAndWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
yp_local_variable_operator_write_node_t *cast = (yp_local_variable_operator_write_node_t *) node;
VALUE argv[7];
// name_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[3] = rb_id2sym(constants[cast->name - 1]);
// operator
+#line 160 "api_node.c.erb"
+ assert(cast->operator != 0);
argv[4] = rb_id2sym(constants[cast->operator - 1]);
// depth
+#line 179 "api_node.c.erb"
argv[5] = ULONG2NUM(cast->depth);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPLocalVariableOperatorWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_OR_WRITE_NODE: {
yp_local_variable_or_write_node_t *cast = (yp_local_variable_or_write_node_t *) node;
VALUE argv[6];
// name_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[3] = rb_id2sym(constants[cast->name - 1]);
// depth
+#line 179 "api_node.c.erb"
argv[4] = ULONG2NUM(cast->depth);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPLocalVariableOrWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_READ_NODE: {
+ case YP_LOCAL_VARIABLE_READ_NODE: {
yp_local_variable_read_node_t *cast = (yp_local_variable_read_node_t *) node;
VALUE argv[3];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// depth
+#line 179 "api_node.c.erb"
argv[1] = ULONG2NUM(cast->depth);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPLocalVariableReadNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_TARGET_NODE: {
+ case YP_LOCAL_VARIABLE_TARGET_NODE: {
yp_local_variable_target_node_t *cast = (yp_local_variable_target_node_t *) node;
VALUE argv[3];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// depth
+#line 179 "api_node.c.erb"
argv[1] = ULONG2NUM(cast->depth);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPLocalVariableTargetNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_LOCAL_VARIABLE_WRITE_NODE: {
+ case YP_LOCAL_VARIABLE_WRITE_NODE: {
yp_local_variable_write_node_t *cast = (yp_local_variable_write_node_t *) node;
VALUE argv[6];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// depth
+#line 179 "api_node.c.erb"
argv[1] = ULONG2NUM(cast->depth);
// name_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[4] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPLocalVariableWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_MATCH_PREDICATE_NODE: {
+ case YP_MATCH_PREDICATE_NODE: {
yp_match_predicate_node_t *cast = (yp_match_predicate_node_t *) node;
VALUE argv[4];
// value
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// pattern
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPMatchPredicateNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_MATCH_REQUIRED_NODE: {
+ case YP_MATCH_REQUIRED_NODE: {
yp_match_required_node_t *cast = (yp_match_required_node_t *) node;
VALUE argv[4];
// value
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// pattern
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPMatchRequiredNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_MISSING_NODE: {
+ case YP_MISSING_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPMissingNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_MODULE_NODE: {
+ case YP_MODULE_NODE: {
yp_module_node_t *cast = (yp_module_node_t *) node;
VALUE argv[7];
// locals
+#line 166 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
+ assert(cast->locals.ids[index] != 0);
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
}
// module_keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->module_keyword_loc.start, cast->module_keyword_loc.end, source);
// constant_path
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// body
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 173 "api_node.c.erb"
argv[4] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// name
- argv[5] = yp_string_new(&cast->name, encoding);
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
+ argv[5] = rb_id2sym(constants[cast->name - 1]);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPModuleNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_MULTI_WRITE_NODE: {
- yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
- VALUE argv[6];
+ case YP_MULTI_TARGET_NODE: {
+ yp_multi_target_node_t *cast = (yp_multi_target_node_t *) node;
+ VALUE argv[4];
// targets
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->targets.size);
for (size_t index = 0; index < cast->targets.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
- // operator_loc
- argv[1] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+ // lparen_loc
+#line 176 "api_node.c.erb"
+ argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
- // value
- argv[2] = rb_ary_pop(value_stack);
+ // rparen_loc
+#line 176 "api_node.c.erb"
+ argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
+ // location
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
+
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPMultiTargetNode));
+ break;
+ }
+#line 137 "api_node.c.erb"
+ case YP_MULTI_WRITE_NODE: {
+ yp_multi_write_node_t *cast = (yp_multi_write_node_t *) node;
+ VALUE argv[6];
+
+ // targets
+#line 151 "api_node.c.erb"
+ argv[0] = rb_ary_new_capa(cast->targets.size);
+ for (size_t index = 0; index < cast->targets.size; index++) {
+ rb_ary_push(argv[0], rb_ary_pop(value_stack));
+ }
+
// lparen_loc
- argv[3] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
// rparen_loc
- argv[4] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
+#line 176 "api_node.c.erb"
+ argv[2] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
+ // operator_loc
+#line 173 "api_node.c.erb"
+ argv[3] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+
+ // value
+#line 148 "api_node.c.erb"
+ argv[4] = rb_ary_pop(value_stack);
+
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPMultiWriteNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_NEXT_NODE: {
+ case YP_NEXT_NODE: {
yp_next_node_t *cast = (yp_next_node_t *) node;
VALUE argv[3];
// arguments
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPNextNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_NIL_NODE: {
+ case YP_NIL_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPNilNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_NO_KEYWORDS_PARAMETER_NODE: {
+ case YP_NO_KEYWORDS_PARAMETER_NODE: {
yp_no_keywords_parameter_node_t *cast = (yp_no_keywords_parameter_node_t *) node;
VALUE argv[3];
// operator_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPNoKeywordsParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_NUMBERED_REFERENCE_READ_NODE: {
+ case YP_NUMBERED_REFERENCE_READ_NODE: {
yp_numbered_reference_read_node_t *cast = (yp_numbered_reference_read_node_t *) node;
VALUE argv[2];
// number
+#line 179 "api_node.c.erb"
argv[0] = ULONG2NUM(cast->number);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPNumberedReferenceReadNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_OPTIONAL_PARAMETER_NODE: {
+ case YP_OPTIONAL_PARAMETER_NODE: {
yp_optional_parameter_node_t *cast = (yp_optional_parameter_node_t *) node;
VALUE argv[5];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// value
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPOptionalParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_OR_NODE: {
+ case YP_OR_NODE: {
yp_or_node_t *cast = (yp_or_node_t *) node;
VALUE argv[4];
// left
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// right
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPOrNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_PARAMETERS_NODE: {
+ case YP_PARAMETERS_NODE: {
yp_parameters_node_t *cast = (yp_parameters_node_t *) node;
VALUE argv[8];
// requireds
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->requireds.size);
for (size_t index = 0; index < cast->requireds.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
// optionals
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->optionals.size);
for (size_t index = 0; index < cast->optionals.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// posts
+#line 151 "api_node.c.erb"
argv[2] = rb_ary_new_capa(cast->posts.size);
for (size_t index = 0; index < cast->posts.size; index++) {
rb_ary_push(argv[2], rb_ary_pop(value_stack));
}
// rest
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// keywords
+#line 151 "api_node.c.erb"
argv[4] = rb_ary_new_capa(cast->keywords.size);
for (size_t index = 0; index < cast->keywords.size; index++) {
rb_ary_push(argv[4], rb_ary_pop(value_stack));
}
// keyword_rest
+#line 148 "api_node.c.erb"
argv[5] = rb_ary_pop(value_stack);
// block
+#line 148 "api_node.c.erb"
argv[6] = rb_ary_pop(value_stack);
// location
argv[7] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(8, argv, rb_cYARPParametersNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_PARENTHESES_NODE: {
+ case YP_PARENTHESES_NODE: {
yp_parentheses_node_t *cast = (yp_parentheses_node_t *) node;
VALUE argv[4];
// body
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// opening_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPParenthesesNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_PINNED_EXPRESSION_NODE: {
+ case YP_PINNED_EXPRESSION_NODE: {
yp_pinned_expression_node_t *cast = (yp_pinned_expression_node_t *) node;
VALUE argv[5];
// expression
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// lparen_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
// rparen_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPPinnedExpressionNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_PINNED_VARIABLE_NODE: {
+ case YP_PINNED_VARIABLE_NODE: {
yp_pinned_variable_node_t *cast = (yp_pinned_variable_node_t *) node;
VALUE argv[3];
// variable
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPPinnedVariableNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_POST_EXECUTION_NODE: {
+ case YP_POST_EXECUTION_NODE: {
yp_post_execution_node_t *cast = (yp_post_execution_node_t *) node;
VALUE argv[5];
// statements
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// opening_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPPostExecutionNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_PRE_EXECUTION_NODE: {
+ case YP_PRE_EXECUTION_NODE: {
yp_pre_execution_node_t *cast = (yp_pre_execution_node_t *) node;
VALUE argv[5];
// statements
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// opening_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[3] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPPreExecutionNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_PROGRAM_NODE: {
+ case YP_PROGRAM_NODE: {
yp_program_node_t *cast = (yp_program_node_t *) node;
VALUE argv[3];
// locals
+#line 166 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
+ assert(cast->locals.ids[index] != 0);
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
}
// statements
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPProgramNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_RANGE_NODE: {
+ case YP_RANGE_NODE: {
yp_range_node_t *cast = (yp_range_node_t *) node;
VALUE argv[5];
// left
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// right
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// flags
+#line 182 "api_node.c.erb"
argv[3] = ULONG2NUM(node->flags >> 1);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPRangeNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_RATIONAL_NODE: {
+ case YP_RATIONAL_NODE: {
VALUE argv[2];
// numeric
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPRationalNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_REDO_NODE: {
+ case YP_REDO_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPRedoNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_REGULAR_EXPRESSION_NODE: {
+ case YP_REGULAR_EXPRESSION_NODE: {
yp_regular_expression_node_t *cast = (yp_regular_expression_node_t *) node;
VALUE argv[6];
// opening_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// content_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// unescaped
+#line 157 "api_node.c.erb"
argv[3] = yp_string_new(&cast->unescaped, encoding);
// flags
+#line 182 "api_node.c.erb"
argv[4] = ULONG2NUM(node->flags >> 1);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPRegularExpressionNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
+ case YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE: {
yp_required_destructured_parameter_node_t *cast = (yp_required_destructured_parameter_node_t *) node;
VALUE argv[4];
// parameters
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->parameters.size);
for (size_t index = 0; index < cast->parameters.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
// opening_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPRequiredDestructuredParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_REQUIRED_PARAMETER_NODE: {
+ case YP_REQUIRED_PARAMETER_NODE: {
yp_required_parameter_node_t *cast = (yp_required_parameter_node_t *) node;
VALUE argv[2];
// name
+#line 160 "api_node.c.erb"
+ assert(cast->name != 0);
argv[0] = rb_id2sym(constants[cast->name - 1]);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPRequiredParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_RESCUE_MODIFIER_NODE: {
+ case YP_RESCUE_MODIFIER_NODE: {
yp_rescue_modifier_node_t *cast = (yp_rescue_modifier_node_t *) node;
VALUE argv[4];
// expression
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// rescue_expression
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPRescueModifierNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_RESCUE_NODE: {
+ case YP_RESCUE_NODE: {
yp_rescue_node_t *cast = (yp_rescue_node_t *) node;
VALUE argv[7];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// exceptions
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->exceptions.size);
for (size_t index = 0; index < cast->exceptions.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// operator_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->operator_loc.start == NULL ? Qnil : yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// reference
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// statements
+#line 148 "api_node.c.erb"
argv[4] = rb_ary_pop(value_stack);
// consequent
+#line 148 "api_node.c.erb"
argv[5] = rb_ary_pop(value_stack);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPRescueNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_REST_PARAMETER_NODE: {
+ case YP_REST_PARAMETER_NODE: {
yp_rest_parameter_node_t *cast = (yp_rest_parameter_node_t *) node;
- VALUE argv[3];
+ VALUE argv[4];
- // operator_loc
- argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+ // name
+ argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);
// name_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->name_loc.start == NULL ? Qnil : yp_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);
+ // operator_loc
+#line 173 "api_node.c.erb"
+ argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
+
// location
- argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
+ argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
- rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPRestParameterNode));
+ rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPRestParameterNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_RETRY_NODE: {
+ case YP_RETRY_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPRetryNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_RETURN_NODE: {
+ case YP_RETURN_NODE: {
yp_return_node_t *cast = (yp_return_node_t *) node;
VALUE argv[3];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// arguments
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPReturnNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SELF_NODE: {
+ case YP_SELF_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPSelfNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SINGLETON_CLASS_NODE: {
+ case YP_SINGLETON_CLASS_NODE: {
yp_singleton_class_node_t *cast = (yp_singleton_class_node_t *) node;
VALUE argv[7];
// locals
+#line 166 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->locals.size);
for (size_t index = 0; index < cast->locals.size; index++) {
+ assert(cast->locals.ids[index] != 0);
rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
}
// class_keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);
// operator_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// expression
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// body
+#line 148 "api_node.c.erb"
argv[4] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 173 "api_node.c.erb"
argv[5] = yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[6] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cYARPSingletonClassNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SOURCE_ENCODING_NODE: {
+ case YP_SOURCE_ENCODING_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPSourceEncodingNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SOURCE_FILE_NODE: {
+ case YP_SOURCE_FILE_NODE: {
yp_source_file_node_t *cast = (yp_source_file_node_t *) node;
VALUE argv[2];
// filepath
+#line 157 "api_node.c.erb"
argv[0] = yp_string_new(&cast->filepath, encoding);
// location
argv[1] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPSourceFileNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SOURCE_LINE_NODE: {
+ case YP_SOURCE_LINE_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPSourceLineNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SPLAT_NODE: {
+ case YP_SPLAT_NODE: {
yp_splat_node_t *cast = (yp_splat_node_t *) node;
VALUE argv[3];
// operator_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);
// expression
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPSplatNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_STATEMENTS_NODE: {
+ case YP_STATEMENTS_NODE: {
yp_statements_node_t *cast = (yp_statements_node_t *) node;
VALUE argv[2];
// body
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->body.size);
for (size_t index = 0; index < cast->body.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
@@ -3463,266 +4101,309 @@
rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cYARPStatementsNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_STRING_CONCAT_NODE: {
+ case YP_STRING_CONCAT_NODE: {
VALUE argv[3];
// left
+#line 148 "api_node.c.erb"
argv[0] = rb_ary_pop(value_stack);
// right
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPStringConcatNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_STRING_NODE: {
+ case YP_STRING_NODE: {
yp_string_node_t *cast = (yp_string_node_t *) node;
VALUE argv[5];
// opening_loc
+#line 176 "api_node.c.erb"
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// content_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// unescaped
+#line 157 "api_node.c.erb"
argv[3] = yp_string_new(&cast->unescaped, encoding);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPStringNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SUPER_NODE: {
+ case YP_SUPER_NODE: {
yp_super_node_t *cast = (yp_super_node_t *) node;
VALUE argv[6];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// lparen_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
// arguments
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// rparen_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
// block
+#line 148 "api_node.c.erb"
argv[4] = rb_ary_pop(value_stack);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPSuperNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_SYMBOL_NODE: {
+ case YP_SYMBOL_NODE: {
yp_symbol_node_t *cast = (yp_symbol_node_t *) node;
VALUE argv[5];
// opening_loc
+#line 176 "api_node.c.erb"
argv[0] = cast->opening_loc.start == NULL ? Qnil : yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// value_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->value_loc.start == NULL ? Qnil : yp_location_new(parser, cast->value_loc.start, cast->value_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[2] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// unescaped
+#line 157 "api_node.c.erb"
argv[3] = yp_string_new(&cast->unescaped, encoding);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPSymbolNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_TRUE_NODE: {
+ case YP_TRUE_NODE: {
VALUE argv[1];
// location
argv[0] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cYARPTrueNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_UNDEF_NODE: {
+ case YP_UNDEF_NODE: {
yp_undef_node_t *cast = (yp_undef_node_t *) node;
VALUE argv[3];
// names
+#line 151 "api_node.c.erb"
argv[0] = rb_ary_new_capa(cast->names.size);
for (size_t index = 0; index < cast->names.size; index++) {
rb_ary_push(argv[0], rb_ary_pop(value_stack));
}
// keyword_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// location
argv[2] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cYARPUndefNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_UNLESS_NODE: {
+ case YP_UNLESS_NODE: {
yp_unless_node_t *cast = (yp_unless_node_t *) node;
VALUE argv[6];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// predicate
+#line 148 "api_node.c.erb"
argv[1] = rb_ary_pop(value_stack);
// statements
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// consequent
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// end_keyword_loc
+#line 176 "api_node.c.erb"
argv[4] = cast->end_keyword_loc.start == NULL ? Qnil : yp_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPUnlessNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_UNTIL_NODE: {
+ case YP_UNTIL_NODE: {
yp_until_node_t *cast = (yp_until_node_t *) node;
VALUE argv[6];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// predicate
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// statements
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// flags
+#line 182 "api_node.c.erb"
argv[4] = ULONG2NUM(node->flags >> 1);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPUntilNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_WHEN_NODE: {
+ case YP_WHEN_NODE: {
yp_when_node_t *cast = (yp_when_node_t *) node;
VALUE argv[4];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// conditions
+#line 151 "api_node.c.erb"
argv[1] = rb_ary_new_capa(cast->conditions.size);
for (size_t index = 0; index < cast->conditions.size; index++) {
rb_ary_push(argv[1], rb_ary_pop(value_stack));
}
// statements
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// location
argv[3] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cYARPWhenNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_WHILE_NODE: {
+ case YP_WHILE_NODE: {
yp_while_node_t *cast = (yp_while_node_t *) node;
VALUE argv[6];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// closing_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->closing_loc.start == NULL ? Qnil : yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// predicate
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// statements
+#line 148 "api_node.c.erb"
argv[3] = rb_ary_pop(value_stack);
// flags
+#line 182 "api_node.c.erb"
argv[4] = ULONG2NUM(node->flags >> 1);
// location
argv[5] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cYARPWhileNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_X_STRING_NODE: {
+ case YP_X_STRING_NODE: {
yp_x_string_node_t *cast = (yp_x_string_node_t *) node;
VALUE argv[5];
// opening_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);
// content_loc
+#line 173 "api_node.c.erb"
argv[1] = yp_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);
// closing_loc
+#line 173 "api_node.c.erb"
argv[2] = yp_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);
// unescaped
+#line 157 "api_node.c.erb"
argv[3] = yp_string_new(&cast->unescaped, encoding);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cYARPXStringNode));
break;
}
#line 137 "api_node.c.erb"
- case YP_NODE_YIELD_NODE: {
+ case YP_YIELD_NODE: {
yp_yield_node_t *cast = (yp_yield_node_t *) node;
VALUE argv[5];
// keyword_loc
+#line 173 "api_node.c.erb"
argv[0] = yp_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);
// lparen_loc
+#line 176 "api_node.c.erb"
argv[1] = cast->lparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);
// arguments
+#line 148 "api_node.c.erb"
argv[2] = rb_ary_pop(value_stack);
// rparen_loc
+#line 176 "api_node.c.erb"
argv[3] = cast->rparen_loc.start == NULL ? Qnil : yp_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);
// location
argv[4] = yp_location_new(parser, node->location.start, node->location.end, source);
@@ -3751,18 +4432,19 @@
rb_cYARPAssocNode = rb_define_class_under(rb_cYARP, "AssocNode", rb_cYARPNode);
rb_cYARPAssocSplatNode = rb_define_class_under(rb_cYARP, "AssocSplatNode", rb_cYARPNode);
rb_cYARPBackReferenceReadNode = rb_define_class_under(rb_cYARP, "BackReferenceReadNode", rb_cYARPNode);
rb_cYARPBeginNode = rb_define_class_under(rb_cYARP, "BeginNode", rb_cYARPNode);
rb_cYARPBlockArgumentNode = rb_define_class_under(rb_cYARP, "BlockArgumentNode", rb_cYARPNode);
+ rb_cYARPBlockLocalVariableNode = rb_define_class_under(rb_cYARP, "BlockLocalVariableNode", rb_cYARPNode);
rb_cYARPBlockNode = rb_define_class_under(rb_cYARP, "BlockNode", rb_cYARPNode);
rb_cYARPBlockParameterNode = rb_define_class_under(rb_cYARP, "BlockParameterNode", rb_cYARPNode);
rb_cYARPBlockParametersNode = rb_define_class_under(rb_cYARP, "BlockParametersNode", rb_cYARPNode);
rb_cYARPBreakNode = rb_define_class_under(rb_cYARP, "BreakNode", rb_cYARPNode);
+ rb_cYARPCallAndWriteNode = rb_define_class_under(rb_cYARP, "CallAndWriteNode", rb_cYARPNode);
rb_cYARPCallNode = rb_define_class_under(rb_cYARP, "CallNode", rb_cYARPNode);
- rb_cYARPCallOperatorAndWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorAndWriteNode", rb_cYARPNode);
- rb_cYARPCallOperatorOrWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorOrWriteNode", rb_cYARPNode);
rb_cYARPCallOperatorWriteNode = rb_define_class_under(rb_cYARP, "CallOperatorWriteNode", rb_cYARPNode);
+ rb_cYARPCallOrWriteNode = rb_define_class_under(rb_cYARP, "CallOrWriteNode", rb_cYARPNode);
rb_cYARPCapturePatternNode = rb_define_class_under(rb_cYARP, "CapturePatternNode", rb_cYARPNode);
rb_cYARPCaseNode = rb_define_class_under(rb_cYARP, "CaseNode", rb_cYARPNode);
rb_cYARPClassNode = rb_define_class_under(rb_cYARP, "ClassNode", rb_cYARPNode);
rb_cYARPClassVariableAndWriteNode = rb_define_class_under(rb_cYARP, "ClassVariableAndWriteNode", rb_cYARPNode);
rb_cYARPClassVariableOperatorWriteNode = rb_define_class_under(rb_cYARP, "ClassVariableOperatorWriteNode", rb_cYARPNode);
@@ -3830,9 +4512,10 @@
rb_cYARPLocalVariableWriteNode = rb_define_class_under(rb_cYARP, "LocalVariableWriteNode", rb_cYARPNode);
rb_cYARPMatchPredicateNode = rb_define_class_under(rb_cYARP, "MatchPredicateNode", rb_cYARPNode);
rb_cYARPMatchRequiredNode = rb_define_class_under(rb_cYARP, "MatchRequiredNode", rb_cYARPNode);
rb_cYARPMissingNode = rb_define_class_under(rb_cYARP, "MissingNode", rb_cYARPNode);
rb_cYARPModuleNode = rb_define_class_under(rb_cYARP, "ModuleNode", rb_cYARPNode);
+ rb_cYARPMultiTargetNode = rb_define_class_under(rb_cYARP, "MultiTargetNode", rb_cYARPNode);
rb_cYARPMultiWriteNode = rb_define_class_under(rb_cYARP, "MultiWriteNode", rb_cYARPNode);
rb_cYARPNextNode = rb_define_class_under(rb_cYARP, "NextNode", rb_cYARPNode);
rb_cYARPNilNode = rb_define_class_under(rb_cYARP, "NilNode", rb_cYARPNode);
rb_cYARPNoKeywordsParameterNode = rb_define_class_under(rb_cYARP, "NoKeywordsParameterNode", rb_cYARPNode);
rb_cYARPNumberedReferenceReadNode = rb_define_class_under(rb_cYARP, "NumberedReferenceReadNode", rb_cYARPNode);