Ruby 3.4.1p0 (2024-12-25 revision 48d4efcb85000e1ebae42004e963b5d0cedddcf2)
parse.c
1/* A Bison parser, made by Lrama 0.6.11. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41/* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48/* Identify Bison output, and Bison version. */
49#define YYBISON 30802
50
51/* Bison version string. */
52#define YYBISON_VERSION "3.8.2"
53
54/* Skeleton name. */
55#define YYSKELETON_NAME "yacc.c"
56
57/* Pure parsers. */
58#define YYPURE 1
59
60/* Push parsers. */
61#define YYPUSH 0
62
63/* Pull parsers. */
64#define YYPULL 1
65
66
67/* First part of user prologue. */
68#line 12 "parse.y"
69
70
71#if !YYPURE
72# error needs pure parser
73#endif
74#define YYDEBUG 1
75#define YYERROR_VERBOSE 1
76#define YYSTACK_USE_ALLOCA 0
77
78/* For Ripper */
79#ifdef RUBY_EXTCONF_H
80# include RUBY_EXTCONF_H
81#endif
82
83#include "ruby/internal/config.h"
84
85#include <errno.h>
86
87#ifdef UNIVERSAL_PARSER
88
89#include "internal/ruby_parser.h"
90#include "parser_node.h"
91#include "universal_parser.c"
92
93#ifdef RIPPER
94#define STATIC_ID2SYM p->config->static_id2sym
95#define rb_str_coderange_scan_restartable p->config->str_coderange_scan_restartable
96#endif
97
98#else
99
100#include "internal.h"
101#include "internal/compile.h"
102#include "internal/compilers.h"
103#include "internal/complex.h"
104#include "internal/encoding.h"
105#include "internal/error.h"
106#include "internal/hash.h"
107#include "internal/io.h"
108#include "internal/numeric.h"
109#include "internal/parse.h"
110#include "internal/rational.h"
111#include "internal/re.h"
112#include "internal/ruby_parser.h"
113#include "internal/symbol.h"
114#include "internal/thread.h"
115#include "internal/variable.h"
116#include "node.h"
117#include "parser_node.h"
118#include "probes.h"
119#include "regenc.h"
120#include "ruby/encoding.h"
121#include "ruby/regex.h"
122#include "ruby/ruby.h"
123#include "ruby/st.h"
124#include "ruby/util.h"
125#include "ruby/ractor.h"
126#include "symbol.h"
127
128#ifndef RIPPER
129static VALUE
130syntax_error_new(void)
131{
133}
134#endif
135
136static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc, rb_parser_assignable_func assignable);
137
138#define compile_callback rb_suppress_tracing
139#endif /* !UNIVERSAL_PARSER */
140
141#define NODE_SPECIAL_EMPTY_ARGS ((NODE *)-1)
142#define NODE_EMPTY_ARGS_P(node) ((node) == NODE_SPECIAL_EMPTY_ARGS)
143
144static int rb_parser_string_hash_cmp(rb_parser_string_t *str1, rb_parser_string_t *str2);
145
146#ifndef RIPPER
147static rb_parser_string_t *rb_parser_string_deep_copy(struct parser_params *p, const rb_parser_string_t *original);
148#endif
149
150static int
151node_integer_cmp(rb_node_integer_t *n1, rb_node_integer_t *n2)
152{
153 return (n1->minus != n2->minus ||
154 n1->base != n2->base ||
155 strcmp(n1->val, n2->val));
156}
157
158static int
159node_float_cmp(rb_node_float_t *n1, rb_node_float_t *n2)
160{
161 return (n1->minus != n2->minus ||
162 strcmp(n1->val, n2->val));
163}
164
165static int
166node_rational_cmp(rb_node_rational_t *n1, rb_node_rational_t *n2)
167{
168 return (n1->minus != n2->minus ||
169 n1->base != n2->base ||
170 n1->seen_point != n2->seen_point ||
171 strcmp(n1->val, n2->val));
172}
173
174static int
175node_imaginary_cmp(rb_node_imaginary_t *n1, rb_node_imaginary_t *n2)
176{
177 return (n1->minus != n2->minus ||
178 n1->base != n2->base ||
179 n1->seen_point != n2->seen_point ||
180 n1->type != n2->type ||
181 strcmp(n1->val, n2->val));
182}
183
184static int
185rb_parser_regx_hash_cmp(rb_node_regx_t *n1, rb_node_regx_t *n2)
186{
187 return (n1->options != n2->options ||
188 rb_parser_string_hash_cmp(n1->string, n2->string));
189}
190
191static st_index_t rb_parser_str_hash(rb_parser_string_t *str);
192static st_index_t rb_char_p_hash(const char *c);
193
194static int
195literal_cmp(st_data_t val, st_data_t lit)
196{
197 if (val == lit) return 0;
198
199 NODE *node_val = RNODE(val);
200 NODE *node_lit = RNODE(lit);
201 enum node_type type_val = nd_type(node_val);
202 enum node_type type_lit = nd_type(node_lit);
203
204 if (type_val != type_lit) {
205 return -1;
206 }
207
208 switch (type_lit) {
209 case NODE_INTEGER:
210 return node_integer_cmp(RNODE_INTEGER(node_val), RNODE_INTEGER(node_lit));
211 case NODE_FLOAT:
212 return node_float_cmp(RNODE_FLOAT(node_val), RNODE_FLOAT(node_lit));
213 case NODE_RATIONAL:
214 return node_rational_cmp(RNODE_RATIONAL(node_val), RNODE_RATIONAL(node_lit));
215 case NODE_IMAGINARY:
216 return node_imaginary_cmp(RNODE_IMAGINARY(node_val), RNODE_IMAGINARY(node_lit));
217 case NODE_STR:
218 return rb_parser_string_hash_cmp(RNODE_STR(node_val)->string, RNODE_STR(node_lit)->string);
219 case NODE_SYM:
220 return rb_parser_string_hash_cmp(RNODE_SYM(node_val)->string, RNODE_SYM(node_lit)->string);
221 case NODE_REGX:
222 return rb_parser_regx_hash_cmp(RNODE_REGX(node_val), RNODE_REGX(node_lit));
223 case NODE_LINE:
224 return node_val->nd_loc.beg_pos.lineno != node_lit->nd_loc.beg_pos.lineno;
225 case NODE_FILE:
226 return rb_parser_string_hash_cmp(RNODE_FILE(node_val)->path, RNODE_FILE(node_lit)->path);
227 case NODE_ENCODING:
228 return RNODE_ENCODING(node_val)->enc != RNODE_ENCODING(node_lit)->enc;
229 default:
230#ifdef UNIVERSAL_PARSER
231 abort();
232#else
233 rb_bug("unexpected node: %s, %s", ruby_node_name(type_val), ruby_node_name(type_lit));
234#endif
235 }
236}
237
238static st_index_t
239literal_hash(st_data_t a)
240{
241 NODE *node = (NODE *)a;
242 enum node_type type = nd_type(node);
243
244 switch (type) {
245 case NODE_INTEGER:
246 return rb_char_p_hash(RNODE_INTEGER(node)->val);
247 case NODE_FLOAT:
248 return rb_char_p_hash(RNODE_FLOAT(node)->val);
249 case NODE_RATIONAL:
250 return rb_char_p_hash(RNODE_RATIONAL(node)->val);
251 case NODE_IMAGINARY:
252 return rb_char_p_hash(RNODE_IMAGINARY(node)->val);
253 case NODE_STR:
254 return rb_parser_str_hash(RNODE_STR(node)->string);
255 case NODE_SYM:
256 return rb_parser_str_hash(RNODE_SYM(node)->string);
257 case NODE_REGX:
258 return rb_parser_str_hash(RNODE_REGX(node)->string);
259 case NODE_LINE:
260 return (st_index_t)node->nd_loc.beg_pos.lineno;
261 case NODE_FILE:
262 return rb_parser_str_hash(RNODE_FILE(node)->path);
263 case NODE_ENCODING:
264 return (st_index_t)RNODE_ENCODING(node)->enc;
265 default:
266#ifdef UNIVERSAL_PARSER
267 abort();
268#else
269 rb_bug("unexpected node: %s", ruby_node_name(type));
270#endif
271 }
272}
273
274static inline int
275parse_isascii(int c)
276{
277 return '\0' <= c && c <= '\x7f';
278}
279
280#undef ISASCII
281#define ISASCII parse_isascii
282
283static inline int
284parse_isspace(int c)
285{
286 return c == ' ' || ('\t' <= c && c <= '\r');
287}
288
289#undef ISSPACE
290#define ISSPACE parse_isspace
291
292static inline int
293parse_iscntrl(int c)
294{
295 return ('\0' <= c && c < ' ') || c == '\x7f';
296}
297
298#undef ISCNTRL
299#define ISCNTRL(c) parse_iscntrl(c)
300
301static inline int
302parse_isupper(int c)
303{
304 return 'A' <= c && c <= 'Z';
305}
306
307static inline int
308parse_islower(int c)
309{
310 return 'a' <= c && c <= 'z';
311}
312
313static inline int
314parse_isalpha(int c)
315{
316 return parse_isupper(c) || parse_islower(c);
317}
318
319#undef ISALPHA
320#define ISALPHA(c) parse_isalpha(c)
321
322static inline int
323parse_isdigit(int c)
324{
325 return '0' <= c && c <= '9';
326}
327
328#undef ISDIGIT
329#define ISDIGIT(c) parse_isdigit(c)
330
331static inline int
332parse_isalnum(int c)
333{
334 return parse_isalpha(c) || parse_isdigit(c);
335}
336
337#undef ISALNUM
338#define ISALNUM(c) parse_isalnum(c)
339
340static inline int
341parse_isxdigit(int c)
342{
343 return parse_isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
344}
345
346#undef ISXDIGIT
347#define ISXDIGIT(c) parse_isxdigit(c)
348
349#include "parser_st.h"
350
351#undef STRCASECMP
352#define STRCASECMP rb_parser_st_locale_insensitive_strcasecmp
353
354#undef STRNCASECMP
355#define STRNCASECMP rb_parser_st_locale_insensitive_strncasecmp
356
357#ifdef RIPPER
358#include "ripper_init.h"
359#endif
360
361enum rescue_context {
362 before_rescue,
363 after_rescue,
364 after_else,
365 after_ensure,
366};
367
369 unsigned int in_defined: 1;
370 unsigned int in_kwarg: 1;
371 unsigned int in_argdef: 1;
372 unsigned int in_def: 1;
373 unsigned int in_class: 1;
374 BITFIELD(enum rb_parser_shareability, shareable_constant_value, 2);
375 BITFIELD(enum rescue_context, in_rescue, 2);
376 unsigned int cant_return: 1;
377};
378
379typedef struct RNode_DEF_TEMP rb_node_def_temp_t;
380
381#if defined(__GNUC__) && !defined(__clang__)
382// Suppress "parameter passing for argument of type 'struct
383// lex_context' changed" notes. `struct lex_context` is file scope,
384// and has no ABI compatibility issue.
388// Not sure why effective even after popped.
389#endif
390
391#include "parse.h"
392
393#define NO_LEX_CTXT (struct lex_context){0}
394
395#ifndef WARN_PAST_SCOPE
396# define WARN_PAST_SCOPE 0
397#endif
398
399#define TAB_WIDTH 8
400
401#define yydebug (p->debug) /* disable the global variable definition */
402
403#define YYFPRINTF(out, ...) rb_parser_printf(p, __VA_ARGS__)
404#define YY_LOCATION_PRINT(File, loc, p) \
405 rb_parser_printf(p, "%d.%d-%d.%d", \
406 (loc).beg_pos.lineno, (loc).beg_pos.column,\
407 (loc).end_pos.lineno, (loc).end_pos.column)
408#define YYLLOC_DEFAULT(Current, Rhs, N) \
409 do \
410 if (N) \
411 { \
412 (Current).beg_pos = YYRHSLOC(Rhs, 1).beg_pos; \
413 (Current).end_pos = YYRHSLOC(Rhs, N).end_pos; \
414 } \
415 else \
416 { \
417 (Current).beg_pos = YYRHSLOC(Rhs, 0).end_pos; \
418 (Current).end_pos = YYRHSLOC(Rhs, 0).end_pos; \
419 } \
420 while (0)
421#define YY_(Msgid) \
422 (((Msgid)[0] == 'm') && (strcmp((Msgid), "memory exhausted") == 0) ? \
423 "nesting too deep" : (Msgid))
424
425#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current) \
426 rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))
427#define RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(Current) \
428 rb_parser_set_location_of_delayed_token(p, &(Current))
429#define RUBY_SET_YYLLOC_OF_HEREDOC_END(Current) \
430 rb_parser_set_location_of_heredoc_end(p, &(Current))
431#define RUBY_SET_YYLLOC_OF_DUMMY_END(Current) \
432 rb_parser_set_location_of_dummy_end(p, &(Current))
433#define RUBY_SET_YYLLOC_OF_NONE(Current) \
434 rb_parser_set_location_of_none(p, &(Current))
435#define RUBY_SET_YYLLOC(Current) \
436 rb_parser_set_location(p, &(Current))
437#define RUBY_INIT_YYLLOC() \
438 { \
439 {p->ruby_sourceline, (int)(p->lex.ptok - p->lex.pbeg)}, \
440 {p->ruby_sourceline, (int)(p->lex.pcur - p->lex.pbeg)}, \
441 }
442
443#define IS_lex_state_for(x, ls) ((x) & (ls))
444#define IS_lex_state_all_for(x, ls) (((x) & (ls)) == (ls))
445#define IS_lex_state(ls) IS_lex_state_for(p->lex.state, (ls))
446#define IS_lex_state_all(ls) IS_lex_state_all_for(p->lex.state, (ls))
447
448# define SET_LEX_STATE(ls) \
449 parser_set_lex_state(p, ls, __LINE__)
450static inline enum lex_state_e parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line);
451
452typedef VALUE stack_type;
453
454static const rb_code_location_t NULL_LOC = { {0, -1}, {0, -1} };
455
456# define SHOW_BITSTACK(stack, name) (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)
457# define BITSTACK_PUSH(stack, n) (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))
458# define BITSTACK_POP(stack) (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))
459# define BITSTACK_SET_P(stack) (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)
460# define BITSTACK_SET(stack, n) ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))
461
462/* A flag to identify keyword_do_cond, "do" keyword after condition expression.
463 Examples: `while ... do`, `until ... do`, and `for ... in ... do` */
464#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n))
465#define COND_POP() BITSTACK_POP(cond_stack)
466#define COND_P() BITSTACK_SET_P(cond_stack)
467#define COND_SET(n) BITSTACK_SET(cond_stack, (n))
468
469/* A flag to identify keyword_do_block; "do" keyword after command_call.
470 Example: `foo 1, 2 do`. */
471#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n))
472#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
473#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
474#define CMDARG_SET(n) BITSTACK_SET(cmdarg_stack, (n))
475
476struct vtable {
477 ID *tbl;
478 int pos;
479 int capa;
480 struct vtable *prev;
481};
482
484 struct vtable *args;
485 struct vtable *vars;
486 struct vtable *used;
487# if WARN_PAST_SCOPE
488 struct vtable *past;
489# endif
490 struct local_vars *prev;
491 struct {
492 NODE *outer, *inner, *current;
493 } numparam;
494 NODE *it;
495};
496
497enum {
498 ORDINAL_PARAM = -1,
499 NO_PARAM = 0,
500 NUMPARAM_MAX = 9,
501};
502
503#define DVARS_INHERIT ((void*)1)
504#define DVARS_TOPSCOPE NULL
505#define DVARS_TERMINAL_P(tbl) ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)
506
507typedef struct token_info {
508 const char *token;
509 rb_code_position_t beg;
510 int indent;
511 int nonspc;
512 struct token_info *next;
513} token_info;
514
516 const rb_code_position_t *pos;
517 struct end_expect_token_locations *prev;
518} end_expect_token_locations_t;
519
521 struct parser_string_buffer_elem *next;
522 long len; /* Total length of allocated buf */
523 long used; /* Current usage of buf */
524 rb_parser_string_t *buf[FLEX_ARY_LEN];
525} parser_string_buffer_elem_t;
526
527typedef struct parser_string_buffer {
528 parser_string_buffer_elem_t *head;
529 parser_string_buffer_elem_t *last;
530} parser_string_buffer_t;
531
532#define AFTER_HEREDOC_WITHOUT_TERMINTOR ((rb_parser_string_t *)1)
533
534/*
535 Structure of Lexer Buffer:
536
537 lex.pbeg lex.ptok lex.pcur lex.pend
538 | | | |
539 |------------+------------+------------|
540 |<---------->|
541 token
542*/
544 YYSTYPE *lval;
545 YYLTYPE *yylloc;
546
547 struct {
548 rb_strterm_t *strterm;
549 rb_parser_lex_gets_func *gets;
550 rb_parser_input_data input;
551 parser_string_buffer_t string_buffer;
552 rb_parser_string_t *lastline;
553 rb_parser_string_t *nextline;
554 const char *pbeg;
555 const char *pcur;
556 const char *pend;
557 const char *ptok;
558 enum lex_state_e state;
559 /* track the nest level of any parens "()[]{}" */
560 int paren_nest;
561 /* keep p->lex.paren_nest at the beginning of lambda "->" to detect tLAMBEG and keyword_do_LAMBDA */
562 int lpar_beg;
563 /* track the nest level of only braces "{}" */
564 int brace_nest;
565 } lex;
566 stack_type cond_stack;
567 stack_type cmdarg_stack;
568 int tokidx;
569 int toksiz;
570 int heredoc_end;
571 int heredoc_indent;
572 int heredoc_line_indent;
573 char *tokenbuf;
574 struct local_vars *lvtbl;
575 st_table *pvtbl;
576 st_table *pktbl;
577 int line_count;
578 int ruby_sourceline; /* current line no. */
579 const char *ruby_sourcefile; /* current source file */
580 VALUE ruby_sourcefile_string;
581 rb_encoding *enc;
582 token_info *token_info;
583 st_table *case_labels;
584 rb_node_exits_t *exits;
585
586 VALUE debug_buffer;
587 VALUE debug_output;
588
589 struct {
590 rb_parser_string_t *token;
591 int beg_line;
592 int beg_col;
593 int end_line;
594 int end_col;
595 } delayed;
596
597 rb_ast_t *ast;
598 int node_id;
599
600 st_table *warn_duplicate_keys_table;
601
602 int max_numparam;
603 ID it_id;
604
605 struct lex_context ctxt;
606
607 NODE *eval_tree_begin;
608 NODE *eval_tree;
609 const struct rb_iseq_struct *parent_iseq;
610
611#ifdef UNIVERSAL_PARSER
612 const rb_parser_config_t *config;
613#endif
614 /* compile_option */
615 signed int frozen_string_literal:2; /* -1: not specified, 0: false, 1: true */
616
617 unsigned int command_start:1;
618 unsigned int eofp: 1;
619 unsigned int ruby__end__seen: 1;
620 unsigned int debug: 1;
621 unsigned int has_shebang: 1;
622 unsigned int token_seen: 1;
623 unsigned int token_info_enabled: 1;
624# if WARN_PAST_SCOPE
625 unsigned int past_scope_enabled: 1;
626# endif
627 unsigned int error_p: 1;
628 unsigned int cr_seen: 1;
629
630#ifndef RIPPER
631 /* Ruby core only */
632
633 unsigned int do_print: 1;
634 unsigned int do_loop: 1;
635 unsigned int do_chomp: 1;
636 unsigned int do_split: 1;
637 unsigned int error_tolerant: 1;
638 unsigned int keep_tokens: 1;
639
640 VALUE error_buffer;
641 rb_parser_ary_t *debug_lines;
642 /*
643 * Store specific keyword locations to generate dummy end token.
644 * Refer to the tail of list element.
645 */
646 end_expect_token_locations_t *end_expect_token_locations;
647 /* id for terms */
648 int token_id;
649 /* Array for term tokens */
650 rb_parser_ary_t *tokens;
651#else
652 /* Ripper only */
653
654 VALUE value;
655 VALUE result;
656 VALUE parsing_thread;
657 VALUE s_value; /* Token VALUE */
658 VALUE s_lvalue; /* VALUE generated by rule action (reduce) */
659 VALUE s_value_stack;
660#endif
661};
662
663#define NUMPARAM_ID_P(id) numparam_id_p(p, id)
664#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - (tNUMPARAM_1 - 1))
665#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 - 1 + (idx)))
666static int
667numparam_id_p(struct parser_params *p, ID id)
668{
669 if (!is_local_id(id) || id < (tNUMPARAM_1 << ID_SCOPE_SHIFT)) return 0;
670 unsigned int idx = NUMPARAM_ID_TO_IDX(id);
671 return idx > 0 && idx <= NUMPARAM_MAX;
672}
673static void numparam_name(struct parser_params *p, ID id);
674
675#ifdef RIPPER
676static void
677after_shift(struct parser_params *p)
678{
679 if (p->debug) {
680 rb_parser_printf(p, "after-shift: %+"PRIsVALUE"\n", p->s_value);
681 }
682 rb_ary_push(p->s_value_stack, p->s_value);
683 p->s_value = Qnil;
684}
685
686static void
687before_reduce(int len, struct parser_params *p)
688{
689 // Initialize $$ with $1.
690 if (len) p->s_lvalue = rb_ary_entry(p->s_value_stack, -len);
691}
692
693static void
694after_reduce(int len, struct parser_params *p)
695{
696 for (int i = 0; i < len; i++) {
697 VALUE tos = rb_ary_pop(p->s_value_stack);
698 if (p->debug) {
699 rb_parser_printf(p, "after-reduce pop: %+"PRIsVALUE"\n", tos);
700 }
701 }
702 if (p->debug) {
703 rb_parser_printf(p, "after-reduce push: %+"PRIsVALUE"\n", p->s_lvalue);
704 }
705 rb_ary_push(p->s_value_stack, p->s_lvalue);
706 p->s_lvalue = Qnil;
707}
708
709static void
710after_shift_error_token(struct parser_params *p)
711{
712 if (p->debug) {
713 rb_parser_printf(p, "after-shift-error-token:\n");
714 }
715 rb_ary_push(p->s_value_stack, Qnil);
716}
717
718static void
719after_pop_stack(int len, struct parser_params *p)
720{
721 for (int i = 0; i < len; i++) {
722 VALUE tos = rb_ary_pop(p->s_value_stack);
723 if (p->debug) {
724 rb_parser_printf(p, "after-pop-stack pop: %+"PRIsVALUE"\n", tos);
725 }
726 }
727}
728#else
729static void
730after_shift(struct parser_params *p)
731{
732}
733
734static void
735before_reduce(int len, struct parser_params *p)
736{
737}
738
739static void
740after_reduce(int len, struct parser_params *p)
741{
742}
743
744static void
745after_shift_error_token(struct parser_params *p)
746{
747}
748
749static void
750after_pop_stack(int len, struct parser_params *p)
751{
752}
753#endif
754
755#define intern_cstr(n,l,en) rb_intern3(n,l,en)
756
757#define STRING_NEW0() rb_parser_encoding_string_new(p,0,0,p->enc)
758
759#define STR_NEW(ptr,len) rb_enc_str_new((ptr),(len),p->enc)
760#define STR_NEW0() rb_enc_str_new(0,0,p->enc)
761#define STR_NEW2(ptr) rb_enc_str_new((ptr),strlen(ptr),p->enc)
762#define STR_NEW3(ptr,len,e,func) parser_str_new(p, (ptr),(len),(e),(func),p->enc)
763#define TOK_INTERN() intern_cstr(tok(p), toklen(p), p->enc)
764#define VALID_SYMNAME_P(s, l, enc, type) (rb_enc_symname_type(s, l, enc, (1U<<(type))) == (int)(type))
765
766#ifndef RIPPER
767static inline int
768char_at_end(struct parser_params *p, VALUE str, int when_empty)
769{
770 long len = RSTRING_LEN(str);
771 return len > 0 ? (unsigned char)RSTRING_PTR(str)[len-1] : when_empty;
772}
773#endif
774
775static void
776pop_pvtbl(struct parser_params *p, st_table *tbl)
777{
778 st_free_table(p->pvtbl);
779 p->pvtbl = tbl;
780}
781
782static void
783pop_pktbl(struct parser_params *p, st_table *tbl)
784{
785 if (p->pktbl) st_free_table(p->pktbl);
786 p->pktbl = tbl;
787}
788
789#define STRING_BUF_DEFAULT_LEN 16
790
791static void
792string_buffer_init(struct parser_params *p)
793{
794 parser_string_buffer_t *buf = &p->lex.string_buffer;
795 const size_t size = offsetof(parser_string_buffer_elem_t, buf) + sizeof(rb_parser_string_t *) * STRING_BUF_DEFAULT_LEN;
796
797 buf->head = buf->last = xmalloc(size);
798 buf->head->len = STRING_BUF_DEFAULT_LEN;
799 buf->head->used = 0;
800 buf->head->next = NULL;
801}
802
803static void
804string_buffer_append(struct parser_params *p, rb_parser_string_t *str)
805{
806 parser_string_buffer_t *buf = &p->lex.string_buffer;
807
808 if (buf->head->used >= buf->head->len) {
809 parser_string_buffer_elem_t *elem;
810 long n = buf->head->len * 2;
811 const size_t size = offsetof(parser_string_buffer_elem_t, buf) + sizeof(rb_parser_string_t *) * n;
812
813 elem = xmalloc(size);
814 elem->len = n;
815 elem->used = 0;
816 elem->next = NULL;
817 buf->last->next = elem;
818 buf->last = elem;
819 }
820 buf->last->buf[buf->last->used++] = str;
821}
822
823static void
824string_buffer_free(struct parser_params *p)
825{
826 parser_string_buffer_elem_t *elem = p->lex.string_buffer.head;
827
828 while (elem) {
829 parser_string_buffer_elem_t *next_elem = elem->next;
830
831 for (long i = 0; i < elem->used; i++) {
832 rb_parser_string_free(p, elem->buf[i]);
833 }
834
835 xfree(elem);
836 elem = next_elem;
837 }
838}
839
840#ifndef RIPPER
841static void flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str);
842
843static void
844debug_end_expect_token_locations(struct parser_params *p, const char *name)
845{
846 if(p->debug) {
847 VALUE mesg = rb_sprintf("%s: [", name);
848 int i = 0;
849 for (end_expect_token_locations_t *loc = p->end_expect_token_locations; loc; loc = loc->prev) {
850 if (i > 0)
851 rb_str_cat_cstr(mesg, ", ");
852 rb_str_catf(mesg, "[%d, %d]", loc->pos->lineno, loc->pos->column);
853 i++;
854 }
855 rb_str_cat_cstr(mesg, "]\n");
856 flush_debug_buffer(p, p->debug_output, mesg);
857 }
858}
859
860static void
861push_end_expect_token_locations(struct parser_params *p, const rb_code_position_t *pos)
862{
863 if(!p->error_tolerant) return;
864
865 end_expect_token_locations_t *locations;
866 locations = ALLOC(end_expect_token_locations_t);
867 locations->pos = pos;
868 locations->prev = p->end_expect_token_locations;
869 p->end_expect_token_locations = locations;
870
871 debug_end_expect_token_locations(p, "push_end_expect_token_locations");
872}
873
874static void
875pop_end_expect_token_locations(struct parser_params *p)
876{
877 if(!p->end_expect_token_locations) return;
878
879 end_expect_token_locations_t *locations = p->end_expect_token_locations->prev;
880 ruby_sized_xfree(p->end_expect_token_locations, sizeof(end_expect_token_locations_t));
881 p->end_expect_token_locations = locations;
882
883 debug_end_expect_token_locations(p, "pop_end_expect_token_locations");
884}
885
886static end_expect_token_locations_t *
887peek_end_expect_token_locations(struct parser_params *p)
888{
889 return p->end_expect_token_locations;
890}
891
892static const char *
893parser_token2char(struct parser_params *p, enum yytokentype tok)
894{
895 switch ((int) tok) {
896#define TOKEN2CHAR(tok) case tok: return (#tok);
897#define TOKEN2CHAR2(tok, name) case tok: return (name);
898 TOKEN2CHAR2(' ', "word_sep");
899 TOKEN2CHAR2('!', "!")
900 TOKEN2CHAR2('%', "%");
901 TOKEN2CHAR2('&', "&");
902 TOKEN2CHAR2('*', "*");
903 TOKEN2CHAR2('+', "+");
904 TOKEN2CHAR2('-', "-");
905 TOKEN2CHAR2('/', "/");
906 TOKEN2CHAR2('<', "<");
907 TOKEN2CHAR2('=', "=");
908 TOKEN2CHAR2('>', ">");
909 TOKEN2CHAR2('?', "?");
910 TOKEN2CHAR2('^', "^");
911 TOKEN2CHAR2('|', "|");
912 TOKEN2CHAR2('~', "~");
913 TOKEN2CHAR2(':', ":");
914 TOKEN2CHAR2(',', ",");
915 TOKEN2CHAR2('.', ".");
916 TOKEN2CHAR2(';', ";");
917 TOKEN2CHAR2('`', "`");
918 TOKEN2CHAR2('\n', "nl");
919 TOKEN2CHAR2('{', "\"{\"");
920 TOKEN2CHAR2('}', "\"}\"");
921 TOKEN2CHAR2('[', "\"[\"");
922 TOKEN2CHAR2(']', "\"]\"");
923 TOKEN2CHAR2('(', "\"(\"");
924 TOKEN2CHAR2(')', "\")\"");
925 TOKEN2CHAR2('\\', "backslash");
926 TOKEN2CHAR(keyword_class);
927 TOKEN2CHAR(keyword_module);
928 TOKEN2CHAR(keyword_def);
929 TOKEN2CHAR(keyword_undef);
930 TOKEN2CHAR(keyword_begin);
931 TOKEN2CHAR(keyword_rescue);
932 TOKEN2CHAR(keyword_ensure);
933 TOKEN2CHAR(keyword_end);
934 TOKEN2CHAR(keyword_if);
935 TOKEN2CHAR(keyword_unless);
936 TOKEN2CHAR(keyword_then);
937 TOKEN2CHAR(keyword_elsif);
938 TOKEN2CHAR(keyword_else);
939 TOKEN2CHAR(keyword_case);
940 TOKEN2CHAR(keyword_when);
941 TOKEN2CHAR(keyword_while);
942 TOKEN2CHAR(keyword_until);
943 TOKEN2CHAR(keyword_for);
944 TOKEN2CHAR(keyword_break);
945 TOKEN2CHAR(keyword_next);
946 TOKEN2CHAR(keyword_redo);
947 TOKEN2CHAR(keyword_retry);
948 TOKEN2CHAR(keyword_in);
949 TOKEN2CHAR(keyword_do);
950 TOKEN2CHAR(keyword_do_cond);
951 TOKEN2CHAR(keyword_do_block);
952 TOKEN2CHAR(keyword_do_LAMBDA);
953 TOKEN2CHAR(keyword_return);
954 TOKEN2CHAR(keyword_yield);
955 TOKEN2CHAR(keyword_super);
956 TOKEN2CHAR(keyword_self);
957 TOKEN2CHAR(keyword_nil);
958 TOKEN2CHAR(keyword_true);
959 TOKEN2CHAR(keyword_false);
960 TOKEN2CHAR(keyword_and);
961 TOKEN2CHAR(keyword_or);
962 TOKEN2CHAR(keyword_not);
963 TOKEN2CHAR(modifier_if);
964 TOKEN2CHAR(modifier_unless);
965 TOKEN2CHAR(modifier_while);
966 TOKEN2CHAR(modifier_until);
967 TOKEN2CHAR(modifier_rescue);
968 TOKEN2CHAR(keyword_alias);
969 TOKEN2CHAR(keyword_defined);
970 TOKEN2CHAR(keyword_BEGIN);
971 TOKEN2CHAR(keyword_END);
972 TOKEN2CHAR(keyword__LINE__);
973 TOKEN2CHAR(keyword__FILE__);
974 TOKEN2CHAR(keyword__ENCODING__);
975 TOKEN2CHAR(tIDENTIFIER);
976 TOKEN2CHAR(tFID);
977 TOKEN2CHAR(tGVAR);
978 TOKEN2CHAR(tIVAR);
979 TOKEN2CHAR(tCONSTANT);
980 TOKEN2CHAR(tCVAR);
981 TOKEN2CHAR(tLABEL);
982 TOKEN2CHAR(tINTEGER);
983 TOKEN2CHAR(tFLOAT);
984 TOKEN2CHAR(tRATIONAL);
985 TOKEN2CHAR(tIMAGINARY);
986 TOKEN2CHAR(tCHAR);
987 TOKEN2CHAR(tNTH_REF);
988 TOKEN2CHAR(tBACK_REF);
989 TOKEN2CHAR(tSTRING_CONTENT);
990 TOKEN2CHAR(tREGEXP_END);
991 TOKEN2CHAR(tDUMNY_END);
992 TOKEN2CHAR(tSP);
993 TOKEN2CHAR(tUPLUS);
994 TOKEN2CHAR(tUMINUS);
995 TOKEN2CHAR(tPOW);
996 TOKEN2CHAR(tCMP);
997 TOKEN2CHAR(tEQ);
998 TOKEN2CHAR(tEQQ);
999 TOKEN2CHAR(tNEQ);
1000 TOKEN2CHAR(tGEQ);
1001 TOKEN2CHAR(tLEQ);
1002 TOKEN2CHAR(tANDOP);
1003 TOKEN2CHAR(tOROP);
1004 TOKEN2CHAR(tMATCH);
1005 TOKEN2CHAR(tNMATCH);
1006 TOKEN2CHAR(tDOT2);
1007 TOKEN2CHAR(tDOT3);
1008 TOKEN2CHAR(tBDOT2);
1009 TOKEN2CHAR(tBDOT3);
1010 TOKEN2CHAR(tAREF);
1011 TOKEN2CHAR(tASET);
1012 TOKEN2CHAR(tLSHFT);
1013 TOKEN2CHAR(tRSHFT);
1014 TOKEN2CHAR(tANDDOT);
1015 TOKEN2CHAR(tCOLON2);
1016 TOKEN2CHAR(tCOLON3);
1017 TOKEN2CHAR(tOP_ASGN);
1018 TOKEN2CHAR(tASSOC);
1019 TOKEN2CHAR(tLPAREN);
1020 TOKEN2CHAR(tLPAREN_ARG);
1021 TOKEN2CHAR(tRPAREN);
1022 TOKEN2CHAR(tLBRACK);
1023 TOKEN2CHAR(tLBRACE);
1024 TOKEN2CHAR(tLBRACE_ARG);
1025 TOKEN2CHAR(tSTAR);
1026 TOKEN2CHAR(tDSTAR);
1027 TOKEN2CHAR(tAMPER);
1028 TOKEN2CHAR(tLAMBDA);
1029 TOKEN2CHAR(tSYMBEG);
1030 TOKEN2CHAR(tSTRING_BEG);
1031 TOKEN2CHAR(tXSTRING_BEG);
1032 TOKEN2CHAR(tREGEXP_BEG);
1033 TOKEN2CHAR(tWORDS_BEG);
1034 TOKEN2CHAR(tQWORDS_BEG);
1035 TOKEN2CHAR(tSYMBOLS_BEG);
1036 TOKEN2CHAR(tQSYMBOLS_BEG);
1037 TOKEN2CHAR(tSTRING_END);
1038 TOKEN2CHAR(tSTRING_DEND);
1039 TOKEN2CHAR(tSTRING_DBEG);
1040 TOKEN2CHAR(tSTRING_DVAR);
1041 TOKEN2CHAR(tLAMBEG);
1042 TOKEN2CHAR(tLABEL_END);
1043 TOKEN2CHAR(tIGNORED_NL);
1044 TOKEN2CHAR(tCOMMENT);
1045 TOKEN2CHAR(tEMBDOC_BEG);
1046 TOKEN2CHAR(tEMBDOC);
1047 TOKEN2CHAR(tEMBDOC_END);
1048 TOKEN2CHAR(tHEREDOC_BEG);
1049 TOKEN2CHAR(tHEREDOC_END);
1050 TOKEN2CHAR(k__END__);
1051 TOKEN2CHAR(tLOWEST);
1052 TOKEN2CHAR(tUMINUS_NUM);
1053 TOKEN2CHAR(tLAST_TOKEN);
1054#undef TOKEN2CHAR
1055#undef TOKEN2CHAR2
1056 }
1057
1058 rb_bug("parser_token2id: unknown token %d", tok);
1059
1061}
1062#else
1063static void
1064push_end_expect_token_locations(struct parser_params *p, const rb_code_position_t *pos)
1065{
1066}
1067
1068static void
1069pop_end_expect_token_locations(struct parser_params *p)
1070{
1071}
1072#endif
1073
1074RBIMPL_ATTR_NONNULL((1, 2, 3))
1075static int parser_yyerror(struct parser_params*, const YYLTYPE *yylloc, const char*);
1076RBIMPL_ATTR_NONNULL((1, 2))
1077static int parser_yyerror0(struct parser_params*, const char*);
1078#define yyerror0(msg) parser_yyerror0(p, (msg))
1079#define yyerror1(loc, msg) parser_yyerror(p, (loc), (msg))
1080#define yyerror(yylloc, p, msg) parser_yyerror(p, yylloc, msg)
1081#define token_flush(ptr) ((ptr)->lex.ptok = (ptr)->lex.pcur)
1082#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
1083#define lex_eol_p(p) lex_eol_n_p(p, 0)
1084#define lex_eol_n_p(p,n) lex_eol_ptr_n_p(p, (p)->lex.pcur, n)
1085#define lex_eol_ptr_p(p,ptr) lex_eol_ptr_n_p(p,ptr,0)
1086#define lex_eol_ptr_n_p(p,ptr,n) ((ptr)+(n) >= (p)->lex.pend)
1087
1088static void token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc);
1089static void token_info_push(struct parser_params*, const char *token, const rb_code_location_t *loc);
1090static void token_info_pop(struct parser_params*, const char *token, const rb_code_location_t *loc);
1091static void token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc);
1092static void token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos);
1093
1094#ifdef RIPPER
1095#define compile_for_eval (0)
1096#else
1097#define compile_for_eval (p->parent_iseq != 0)
1098#endif
1099
1100#define token_column ((int)(p->lex.ptok - p->lex.pbeg))
1101
1102#define CALL_Q_P(q) ((q) == tANDDOT)
1103#define NEW_QCALL(q,r,m,a,loc) (CALL_Q_P(q) ? NEW_QCALL0(r,m,a,loc) : NEW_CALL(r,m,a,loc))
1104
1105#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
1106
1107static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
1108
1109static inline void
1110rb_discard_node(struct parser_params *p, NODE *n)
1111{
1112 rb_ast_delete_node(p->ast, n);
1113}
1114
1115static rb_node_scope_t *rb_node_scope_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
1116static rb_node_scope_t *rb_node_scope_new2(struct parser_params *p, rb_ast_id_table_t *nd_tbl, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
1117static rb_node_block_t *rb_node_block_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
1118static rb_node_if_t *rb_node_if_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc);
1119static rb_node_unless_t *rb_node_unless_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *then_keyword_loc, const YYLTYPE *end_keyword_loc);
1120static rb_node_case_t *rb_node_case_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc);
1121static rb_node_case2_t *rb_node_case2_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc);
1122static rb_node_case3_t *rb_node_case3_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc);
1123static rb_node_when_t *rb_node_when_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *then_keyword_loc);
1124static rb_node_in_t *rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc);
1125static rb_node_while_t *rb_node_while_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *closing_loc);
1126static rb_node_until_t *rb_node_until_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *closing_loc);
1127static rb_node_iter_t *rb_node_iter_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
1128static rb_node_for_t *rb_node_for_new(struct parser_params *p, NODE *nd_iter, NODE *nd_body, const YYLTYPE *loc);
1129static rb_node_for_masgn_t *rb_node_for_masgn_new(struct parser_params *p, NODE *nd_var, const YYLTYPE *loc);
1130static rb_node_retry_t *rb_node_retry_new(struct parser_params *p, const YYLTYPE *loc);
1131static rb_node_begin_t *rb_node_begin_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1132static rb_node_rescue_t *rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *nd_else, const YYLTYPE *loc);
1133static rb_node_resbody_t *rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_exc_var, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc);
1134static rb_node_ensure_t *rb_node_ensure_new(struct parser_params *p, NODE *nd_head, NODE *nd_ensr, const YYLTYPE *loc);
1135static rb_node_and_t *rb_node_and_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *operator_loc);
1136static rb_node_or_t *rb_node_or_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *operator_loc);
1137static rb_node_masgn_t *rb_node_masgn_new(struct parser_params *p, NODE *nd_head, NODE *nd_args, const YYLTYPE *loc);
1138static rb_node_lasgn_t *rb_node_lasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
1139static rb_node_dasgn_t *rb_node_dasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
1140static rb_node_gasgn_t *rb_node_gasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
1141static rb_node_iasgn_t *rb_node_iasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
1142static rb_node_cdecl_t *rb_node_cdecl_new(struct parser_params *p, ID nd_vid, NODE *nd_value, NODE *nd_else, enum rb_parser_shareability shareability, const YYLTYPE *loc);
1143static rb_node_cvasgn_t *rb_node_cvasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
1144static rb_node_op_asgn1_t *rb_node_op_asgn1_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *index, NODE *rvalue, const YYLTYPE *loc, const YYLTYPE *call_operator_loc, const YYLTYPE *opening_loc, const YYLTYPE *closing_loc, const YYLTYPE *binary_operator_loc);
1145static rb_node_op_asgn2_t *rb_node_op_asgn2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, ID nd_vid, ID nd_mid, bool nd_aid, const YYLTYPE *loc, const YYLTYPE *call_operator_loc, const YYLTYPE *message_loc, const YYLTYPE *binary_operator_loc);
1146static rb_node_op_asgn_or_t *rb_node_op_asgn_or_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc);
1147static rb_node_op_asgn_and_t *rb_node_op_asgn_and_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc);
1148static rb_node_op_cdecl_t *rb_node_op_cdecl_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, ID nd_aid, enum rb_parser_shareability shareability, const YYLTYPE *loc);
1149static rb_node_call_t *rb_node_call_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
1150static rb_node_opcall_t *rb_node_opcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
1151static rb_node_fcall_t *rb_node_fcall_new(struct parser_params *p, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
1152static rb_node_vcall_t *rb_node_vcall_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc);
1153static rb_node_qcall_t *rb_node_qcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
1154static rb_node_super_t *rb_node_super_new(struct parser_params *p, NODE *nd_args, const YYLTYPE *loc);
1155static rb_node_zsuper_t * rb_node_zsuper_new(struct parser_params *p, const YYLTYPE *loc);
1156static rb_node_list_t *rb_node_list_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
1157static rb_node_list_t *rb_node_list_new2(struct parser_params *p, NODE *nd_head, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
1158static rb_node_zlist_t *rb_node_zlist_new(struct parser_params *p, const YYLTYPE *loc);
1159static rb_node_hash_t *rb_node_hash_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
1160static rb_node_return_t *rb_node_return_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc);
1161static rb_node_yield_t *rb_node_yield_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
1162static rb_node_lvar_t *rb_node_lvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
1163static rb_node_dvar_t *rb_node_dvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
1164static rb_node_gvar_t *rb_node_gvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
1165static rb_node_ivar_t *rb_node_ivar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
1166static rb_node_const_t *rb_node_const_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
1167static rb_node_cvar_t *rb_node_cvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
1168static rb_node_nth_ref_t *rb_node_nth_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc);
1169static rb_node_back_ref_t *rb_node_back_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc);
1170static rb_node_match2_t *rb_node_match2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc);
1171static rb_node_match3_t *rb_node_match3_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc);
1172static rb_node_integer_t * rb_node_integer_new(struct parser_params *p, char* val, int base, const YYLTYPE *loc);
1173static rb_node_float_t * rb_node_float_new(struct parser_params *p, char* val, const YYLTYPE *loc);
1174static rb_node_rational_t * rb_node_rational_new(struct parser_params *p, char* val, int base, int seen_point, const YYLTYPE *loc);
1175static rb_node_imaginary_t * rb_node_imaginary_new(struct parser_params *p, char* val, int base, int seen_point, enum rb_numeric_type, const YYLTYPE *loc);
1176static rb_node_str_t *rb_node_str_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc);
1177static rb_node_dstr_t *rb_node_dstr_new0(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
1178static rb_node_dstr_t *rb_node_dstr_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc);
1179static rb_node_xstr_t *rb_node_xstr_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc);
1180static rb_node_dxstr_t *rb_node_dxstr_new(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
1181static rb_node_evstr_t *rb_node_evstr_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1182static rb_node_regx_t *rb_node_regx_new(struct parser_params *p, rb_parser_string_t *string, int options, const YYLTYPE *loc);
1183static rb_node_once_t *rb_node_once_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1184static rb_node_args_t *rb_node_args_new(struct parser_params *p, const YYLTYPE *loc);
1185static rb_node_args_aux_t *rb_node_args_aux_new(struct parser_params *p, ID nd_pid, int nd_plen, const YYLTYPE *loc);
1186static rb_node_opt_arg_t *rb_node_opt_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1187static rb_node_kw_arg_t *rb_node_kw_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1188static rb_node_postarg_t *rb_node_postarg_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc);
1189static rb_node_argscat_t *rb_node_argscat_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc);
1190static rb_node_argspush_t *rb_node_argspush_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc);
1191static rb_node_splat_t *rb_node_splat_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc, const YYLTYPE *operator_loc);
1192static rb_node_block_pass_t *rb_node_block_pass_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *operator_loc);
1193static rb_node_defn_t *rb_node_defn_new(struct parser_params *p, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc);
1194static rb_node_defs_t *rb_node_defs_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc);
1195static rb_node_alias_t *rb_node_alias_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *keyword_loc);
1196static rb_node_valias_t *rb_node_valias_new(struct parser_params *p, ID nd_alias, ID nd_orig, const YYLTYPE *loc, const YYLTYPE *keyword_loc);
1197static rb_node_undef_t *rb_node_undef_new(struct parser_params *p, NODE *nd_undef, const YYLTYPE *loc);
1198static rb_node_class_t *rb_node_class_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, NODE *nd_super, const YYLTYPE *loc);
1199static rb_node_module_t *rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc);
1200static rb_node_sclass_t *rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const YYLTYPE *loc);
1201static rb_node_colon2_t *rb_node_colon2_new(struct parser_params *p, NODE *nd_head, ID nd_mid, const YYLTYPE *loc);
1202static rb_node_colon3_t *rb_node_colon3_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc);
1203static rb_node_dot2_t *rb_node_dot2_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc);
1204static rb_node_dot3_t *rb_node_dot3_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc);
1205static rb_node_self_t *rb_node_self_new(struct parser_params *p, const YYLTYPE *loc);
1206static rb_node_nil_t *rb_node_nil_new(struct parser_params *p, const YYLTYPE *loc);
1207static rb_node_true_t *rb_node_true_new(struct parser_params *p, const YYLTYPE *loc);
1208static rb_node_false_t *rb_node_false_new(struct parser_params *p, const YYLTYPE *loc);
1209static rb_node_errinfo_t *rb_node_errinfo_new(struct parser_params *p, const YYLTYPE *loc);
1210static rb_node_defined_t *rb_node_defined_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
1211static rb_node_postexe_t *rb_node_postexe_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1212static rb_node_sym_t *rb_node_sym_new(struct parser_params *p, VALUE str, const YYLTYPE *loc);
1213static rb_node_dsym_t *rb_node_dsym_new(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
1214static rb_node_attrasgn_t *rb_node_attrasgn_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
1215static rb_node_lambda_t *rb_node_lambda_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
1216static rb_node_aryptn_t *rb_node_aryptn_new(struct parser_params *p, NODE *pre_args, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc);
1217static rb_node_hshptn_t *rb_node_hshptn_new(struct parser_params *p, NODE *nd_pconst, NODE *nd_pkwargs, NODE *nd_pkwrestarg, const YYLTYPE *loc);
1218static rb_node_fndptn_t *rb_node_fndptn_new(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc);
1219static rb_node_line_t *rb_node_line_new(struct parser_params *p, const YYLTYPE *loc);
1220static rb_node_file_t *rb_node_file_new(struct parser_params *p, VALUE str, const YYLTYPE *loc);
1221static rb_node_error_t *rb_node_error_new(struct parser_params *p, const YYLTYPE *loc);
1222
1223#define NEW_SCOPE(a,b,loc) (NODE *)rb_node_scope_new(p,a,b,loc)
1224#define NEW_SCOPE2(t,a,b,loc) (NODE *)rb_node_scope_new2(p,t,a,b,loc)
1225#define NEW_BLOCK(a,loc) (NODE *)rb_node_block_new(p,a,loc)
1226#define NEW_IF(c,t,e,loc) (NODE *)rb_node_if_new(p,c,t,e,loc)
1227#define NEW_UNLESS(c,t,e,loc,k_loc,t_loc,e_loc) (NODE *)rb_node_unless_new(p,c,t,e,loc,k_loc,t_loc,e_loc)
1228#define NEW_CASE(h,b,loc,ck_loc,ek_loc) (NODE *)rb_node_case_new(p,h,b,loc,ck_loc,ek_loc)
1229#define NEW_CASE2(b,loc,ck_loc,ek_loc) (NODE *)rb_node_case2_new(p,b,loc,ck_loc,ek_loc)
1230#define NEW_CASE3(h,b,loc,ck_loc,ek_loc) (NODE *)rb_node_case3_new(p,h,b,loc,ck_loc,ek_loc)
1231#define NEW_WHEN(c,t,e,loc,k_loc,t_loc) (NODE *)rb_node_when_new(p,c,t,e,loc,k_loc,t_loc)
1232#define NEW_IN(c,t,e,loc) (NODE *)rb_node_in_new(p,c,t,e,loc)
1233#define NEW_WHILE(c,b,n,loc,k_loc,c_loc) (NODE *)rb_node_while_new(p,c,b,n,loc,k_loc,c_loc)
1234#define NEW_UNTIL(c,b,n,loc,k_loc,c_loc) (NODE *)rb_node_until_new(p,c,b,n,loc,k_loc,c_loc)
1235#define NEW_ITER(a,b,loc) (NODE *)rb_node_iter_new(p,a,b,loc)
1236#define NEW_FOR(i,b,loc) (NODE *)rb_node_for_new(p,i,b,loc)
1237#define NEW_FOR_MASGN(v,loc) (NODE *)rb_node_for_masgn_new(p,v,loc)
1238#define NEW_RETRY(loc) (NODE *)rb_node_retry_new(p,loc)
1239#define NEW_BEGIN(b,loc) (NODE *)rb_node_begin_new(p,b,loc)
1240#define NEW_RESCUE(b,res,e,loc) (NODE *)rb_node_rescue_new(p,b,res,e,loc)
1241#define NEW_RESBODY(a,v,ex,n,loc) (NODE *)rb_node_resbody_new(p,a,v,ex,n,loc)
1242#define NEW_ENSURE(b,en,loc) (NODE *)rb_node_ensure_new(p,b,en,loc)
1243#define NEW_AND(f,s,loc,op_loc) (NODE *)rb_node_and_new(p,f,s,loc,op_loc)
1244#define NEW_OR(f,s,loc,op_loc) (NODE *)rb_node_or_new(p,f,s,loc,op_loc)
1245#define NEW_MASGN(l,r,loc) rb_node_masgn_new(p,l,r,loc)
1246#define NEW_LASGN(v,val,loc) (NODE *)rb_node_lasgn_new(p,v,val,loc)
1247#define NEW_DASGN(v,val,loc) (NODE *)rb_node_dasgn_new(p,v,val,loc)
1248#define NEW_GASGN(v,val,loc) (NODE *)rb_node_gasgn_new(p,v,val,loc)
1249#define NEW_IASGN(v,val,loc) (NODE *)rb_node_iasgn_new(p,v,val,loc)
1250#define NEW_CDECL(v,val,path,share,loc) (NODE *)rb_node_cdecl_new(p,v,val,path,share,loc)
1251#define NEW_CVASGN(v,val,loc) (NODE *)rb_node_cvasgn_new(p,v,val,loc)
1252#define NEW_OP_ASGN1(r,id,idx,rval,loc,c_op_loc,o_loc,c_loc,b_op_loc) (NODE *)rb_node_op_asgn1_new(p,r,id,idx,rval,loc,c_op_loc,o_loc,c_loc,b_op_loc)
1253#define NEW_OP_ASGN2(r,t,i,o,val,loc,c_op_loc,m_loc,b_op_loc) (NODE *)rb_node_op_asgn2_new(p,r,val,i,o,t,loc,c_op_loc,m_loc,b_op_loc)
1254#define NEW_OP_ASGN_OR(i,val,loc) (NODE *)rb_node_op_asgn_or_new(p,i,val,loc)
1255#define NEW_OP_ASGN_AND(i,val,loc) (NODE *)rb_node_op_asgn_and_new(p,i,val,loc)
1256#define NEW_OP_CDECL(v,op,val,share,loc) (NODE *)rb_node_op_cdecl_new(p,v,val,op,share,loc)
1257#define NEW_CALL(r,m,a,loc) (NODE *)rb_node_call_new(p,r,m,a,loc)
1258#define NEW_OPCALL(r,m,a,loc) (NODE *)rb_node_opcall_new(p,r,m,a,loc)
1259#define NEW_FCALL(m,a,loc) rb_node_fcall_new(p,m,a,loc)
1260#define NEW_VCALL(m,loc) (NODE *)rb_node_vcall_new(p,m,loc)
1261#define NEW_QCALL0(r,m,a,loc) (NODE *)rb_node_qcall_new(p,r,m,a,loc)
1262#define NEW_SUPER(a,loc) (NODE *)rb_node_super_new(p,a,loc)
1263#define NEW_ZSUPER(loc) (NODE *)rb_node_zsuper_new(p,loc)
1264#define NEW_LIST(a,loc) (NODE *)rb_node_list_new(p,a,loc)
1265#define NEW_LIST2(h,l,n,loc) (NODE *)rb_node_list_new2(p,h,l,n,loc)
1266#define NEW_ZLIST(loc) (NODE *)rb_node_zlist_new(p,loc)
1267#define NEW_HASH(a,loc) (NODE *)rb_node_hash_new(p,a,loc)
1268#define NEW_RETURN(s,loc,k_loc) (NODE *)rb_node_return_new(p,s,loc,k_loc)
1269#define NEW_YIELD(a,loc) (NODE *)rb_node_yield_new(p,a,loc)
1270#define NEW_LVAR(v,loc) (NODE *)rb_node_lvar_new(p,v,loc)
1271#define NEW_DVAR(v,loc) (NODE *)rb_node_dvar_new(p,v,loc)
1272#define NEW_GVAR(v,loc) (NODE *)rb_node_gvar_new(p,v,loc)
1273#define NEW_IVAR(v,loc) (NODE *)rb_node_ivar_new(p,v,loc)
1274#define NEW_CONST(v,loc) (NODE *)rb_node_const_new(p,v,loc)
1275#define NEW_CVAR(v,loc) (NODE *)rb_node_cvar_new(p,v,loc)
1276#define NEW_NTH_REF(n,loc) (NODE *)rb_node_nth_ref_new(p,n,loc)
1277#define NEW_BACK_REF(n,loc) (NODE *)rb_node_back_ref_new(p,n,loc)
1278#define NEW_MATCH2(n1,n2,loc) (NODE *)rb_node_match2_new(p,n1,n2,loc)
1279#define NEW_MATCH3(r,n2,loc) (NODE *)rb_node_match3_new(p,r,n2,loc)
1280#define NEW_INTEGER(val, base,loc) (NODE *)rb_node_integer_new(p,val,base,loc)
1281#define NEW_FLOAT(val,loc) (NODE *)rb_node_float_new(p,val,loc)
1282#define NEW_RATIONAL(val,base,seen_point,loc) (NODE *)rb_node_rational_new(p,val,base,seen_point,loc)
1283#define NEW_IMAGINARY(val,base,seen_point,numeric_type,loc) (NODE *)rb_node_imaginary_new(p,val,base,seen_point,numeric_type,loc)
1284#define NEW_STR(s,loc) (NODE *)rb_node_str_new(p,s,loc)
1285#define NEW_DSTR0(s,l,n,loc) (NODE *)rb_node_dstr_new0(p,s,l,n,loc)
1286#define NEW_DSTR(s,loc) (NODE *)rb_node_dstr_new(p,s,loc)
1287#define NEW_XSTR(s,loc) (NODE *)rb_node_xstr_new(p,s,loc)
1288#define NEW_DXSTR(s,l,n,loc) (NODE *)rb_node_dxstr_new(p,s,l,n,loc)
1289#define NEW_EVSTR(n,loc) (NODE *)rb_node_evstr_new(p,n,loc)
1290#define NEW_REGX(str,opts,loc) (NODE *)rb_node_regx_new(p,str,opts,loc)
1291#define NEW_ONCE(b,loc) (NODE *)rb_node_once_new(p,b,loc)
1292#define NEW_ARGS(loc) rb_node_args_new(p,loc)
1293#define NEW_ARGS_AUX(r,b,loc) rb_node_args_aux_new(p,r,b,loc)
1294#define NEW_OPT_ARG(v,loc) rb_node_opt_arg_new(p,v,loc)
1295#define NEW_KW_ARG(v,loc) rb_node_kw_arg_new(p,v,loc)
1296#define NEW_POSTARG(i,v,loc) (NODE *)rb_node_postarg_new(p,i,v,loc)
1297#define NEW_ARGSCAT(a,b,loc) (NODE *)rb_node_argscat_new(p,a,b,loc)
1298#define NEW_ARGSPUSH(a,b,loc) (NODE *)rb_node_argspush_new(p,a,b,loc)
1299#define NEW_SPLAT(a,loc,op_loc) (NODE *)rb_node_splat_new(p,a,loc,op_loc)
1300#define NEW_BLOCK_PASS(b,loc,o_loc) rb_node_block_pass_new(p,b,loc,o_loc)
1301#define NEW_DEFN(i,s,loc) (NODE *)rb_node_defn_new(p,i,s,loc)
1302#define NEW_DEFS(r,i,s,loc) (NODE *)rb_node_defs_new(p,r,i,s,loc)
1303#define NEW_ALIAS(n,o,loc,k_loc) (NODE *)rb_node_alias_new(p,n,o,loc,k_loc)
1304#define NEW_VALIAS(n,o,loc,k_loc) (NODE *)rb_node_valias_new(p,n,o,loc,k_loc)
1305#define NEW_UNDEF(i,loc) (NODE *)rb_node_undef_new(p,i,loc)
1306#define NEW_CLASS(n,b,s,loc) (NODE *)rb_node_class_new(p,n,b,s,loc)
1307#define NEW_MODULE(n,b,loc) (NODE *)rb_node_module_new(p,n,b,loc)
1308#define NEW_SCLASS(r,b,loc) (NODE *)rb_node_sclass_new(p,r,b,loc)
1309#define NEW_COLON2(c,i,loc) (NODE *)rb_node_colon2_new(p,c,i,loc)
1310#define NEW_COLON3(i,loc) (NODE *)rb_node_colon3_new(p,i,loc)
1311#define NEW_DOT2(b,e,loc) (NODE *)rb_node_dot2_new(p,b,e,loc)
1312#define NEW_DOT3(b,e,loc) (NODE *)rb_node_dot3_new(p,b,e,loc)
1313#define NEW_SELF(loc) (NODE *)rb_node_self_new(p,loc)
1314#define NEW_NIL(loc) (NODE *)rb_node_nil_new(p,loc)
1315#define NEW_TRUE(loc) (NODE *)rb_node_true_new(p,loc)
1316#define NEW_FALSE(loc) (NODE *)rb_node_false_new(p,loc)
1317#define NEW_ERRINFO(loc) (NODE *)rb_node_errinfo_new(p,loc)
1318#define NEW_DEFINED(e,loc) (NODE *)rb_node_defined_new(p,e,loc)
1319#define NEW_POSTEXE(b,loc) (NODE *)rb_node_postexe_new(p,b,loc)
1320#define NEW_SYM(str,loc) (NODE *)rb_node_sym_new(p,str,loc)
1321#define NEW_DSYM(s,l,n,loc) (NODE *)rb_node_dsym_new(p,s,l,n,loc)
1322#define NEW_ATTRASGN(r,m,a,loc) (NODE *)rb_node_attrasgn_new(p,r,m,a,loc)
1323#define NEW_LAMBDA(a,b,loc) (NODE *)rb_node_lambda_new(p,a,b,loc)
1324#define NEW_ARYPTN(pre,r,post,loc) (NODE *)rb_node_aryptn_new(p,pre,r,post,loc)
1325#define NEW_HSHPTN(c,kw,kwrest,loc) (NODE *)rb_node_hshptn_new(p,c,kw,kwrest,loc)
1326#define NEW_FNDPTN(pre,a,post,loc) (NODE *)rb_node_fndptn_new(p,pre,a,post,loc)
1327#define NEW_LINE(loc) (NODE *)rb_node_line_new(p,loc)
1328#define NEW_FILE(str,loc) (NODE *)rb_node_file_new(p,str,loc)
1329#define NEW_ENCODING(loc) (NODE *)rb_node_encoding_new(p,loc)
1330#define NEW_ERROR(loc) (NODE *)rb_node_error_new(p,loc)
1331
1332enum internal_node_type {
1333 NODE_INTERNAL_ONLY = NODE_LAST,
1334 NODE_DEF_TEMP,
1335 NODE_EXITS,
1336 NODE_INTERNAL_LAST
1337};
1338
1339static const char *
1340parser_node_name(int node)
1341{
1342 switch (node) {
1343 case NODE_DEF_TEMP:
1344 return "NODE_DEF_TEMP";
1345 case NODE_EXITS:
1346 return "NODE_EXITS";
1347 default:
1348 return ruby_node_name(node);
1349 }
1350}
1351
1352/* This node is parse.y internal */
1354 NODE node;
1355
1356 /* for NODE_DEFN/NODE_DEFS */
1357
1358 struct RNode *nd_def;
1359 ID nd_mid;
1360
1361 struct {
1362 int max_numparam;
1363 NODE *numparam_save;
1364 struct lex_context ctxt;
1365 } save;
1366};
1367
1368#define RNODE_DEF_TEMP(node) ((struct RNode_DEF_TEMP *)(node))
1369
1370static rb_node_break_t *rb_node_break_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc);
1371static rb_node_next_t *rb_node_next_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc);
1372static rb_node_redo_t *rb_node_redo_new(struct parser_params *p, const YYLTYPE *loc, const YYLTYPE *keyword_loc);
1373static rb_node_def_temp_t *rb_node_def_temp_new(struct parser_params *p, const YYLTYPE *loc);
1374static rb_node_def_temp_t *def_head_save(struct parser_params *p, rb_node_def_temp_t *n);
1375
1376#define NEW_BREAK(s,loc,k_loc) (NODE *)rb_node_break_new(p,s,loc,k_loc)
1377#define NEW_NEXT(s,loc,k_loc) (NODE *)rb_node_next_new(p,s,loc,k_loc)
1378#define NEW_REDO(loc,k_loc) (NODE *)rb_node_redo_new(p,loc,k_loc)
1379#define NEW_DEF_TEMP(loc) rb_node_def_temp_new(p,loc)
1380
1381/* Make a new internal node, which should not be appeared in the
1382 * result AST and does not have node_id and location. */
1383static NODE* node_new_internal(struct parser_params *p, enum node_type type, size_t size, size_t alignment);
1384#define NODE_NEW_INTERNAL(ndtype, type) (type *)node_new_internal(p, (enum node_type)(ndtype), sizeof(type), RUBY_ALIGNOF(type))
1385
1386static NODE *nd_set_loc(NODE *nd, const YYLTYPE *loc);
1387
1388static int
1389parser_get_node_id(struct parser_params *p)
1390{
1391 int node_id = p->node_id;
1392 p->node_id++;
1393 return node_id;
1394}
1395
1396static void
1397anddot_multiple_assignment_check(struct parser_params* p, const YYLTYPE *loc, ID id)
1398{
1399 if (id == tANDDOT) {
1400 yyerror1(loc, "&. inside multiple assignment destination");
1401 }
1402}
1403
1404static inline void
1405set_line_body(NODE *body, int line)
1406{
1407 if (!body) return;
1408 switch (nd_type(body)) {
1409 case NODE_RESCUE:
1410 case NODE_ENSURE:
1411 nd_set_line(body, line);
1412 }
1413}
1414
1415static void
1416set_embraced_location(NODE *node, const rb_code_location_t *beg, const rb_code_location_t *end)
1417{
1418 RNODE_ITER(node)->nd_body->nd_loc = code_loc_gen(beg, end);
1419 nd_set_line(node, beg->end_pos.lineno);
1420}
1421
1422static NODE *
1423last_expr_node(NODE *expr)
1424{
1425 while (expr) {
1426 if (nd_type_p(expr, NODE_BLOCK)) {
1427 expr = RNODE_BLOCK(RNODE_BLOCK(expr)->nd_end)->nd_head;
1428 }
1429 else if (nd_type_p(expr, NODE_BEGIN) && RNODE_BEGIN(expr)->nd_body) {
1430 expr = RNODE_BEGIN(expr)->nd_body;
1431 }
1432 else {
1433 break;
1434 }
1435 }
1436 return expr;
1437}
1438
1439#ifndef RIPPER
1440#define yyparse ruby_yyparse
1441#endif
1442
1443static NODE* cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
1444static NODE* method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
1445#define new_nil(loc) NEW_NIL(loc)
1446static NODE *new_nil_at(struct parser_params *p, const rb_code_position_t *pos);
1447static NODE *new_if(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
1448static NODE *new_unless(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*,const YYLTYPE*,const YYLTYPE*);
1449static NODE *logop(struct parser_params*,ID,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
1450
1451static NODE *newline_node(NODE*);
1452static void fixpos(NODE*,NODE*);
1453
1454static int value_expr_gen(struct parser_params*,NODE*);
1455static void void_expr(struct parser_params*,NODE*);
1456static NODE *remove_begin(NODE*);
1457#define value_expr(node) value_expr_gen(p, (node))
1458static NODE *void_stmts(struct parser_params*,NODE*);
1459static void reduce_nodes(struct parser_params*,NODE**);
1460static void block_dup_check(struct parser_params*,NODE*,NODE*);
1461
1462static NODE *block_append(struct parser_params*,NODE*,NODE*);
1463static NODE *list_append(struct parser_params*,NODE*,NODE*);
1464static NODE *list_concat(NODE*,NODE*);
1465static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1466static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
1467static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
1468static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1469static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
1470static NODE *new_dstr(struct parser_params*,NODE*,const YYLTYPE*);
1471static NODE *str2dstr(struct parser_params*,NODE*);
1472static NODE *evstr2dstr(struct parser_params*,NODE*);
1473static NODE *splat_array(NODE*);
1474static void mark_lvar_used(struct parser_params *p, NODE *rhs);
1475
1476static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
1477static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
1478static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
1479static NODE *new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc);
1480static NODE *method_add_block(struct parser_params*p, NODE *m, NODE *b, const YYLTYPE *loc) {RNODE_ITER(b)->nd_iter = m; b->nd_loc = *loc; return b;}
1481
1482static bool args_info_empty_p(struct rb_args_info *args);
1483static rb_node_args_t *new_args(struct parser_params*,rb_node_args_aux_t*,rb_node_opt_arg_t*,ID,rb_node_args_aux_t*,rb_node_args_t*,const YYLTYPE*);
1484static rb_node_args_t *new_args_tail(struct parser_params*,rb_node_kw_arg_t*,ID,ID,const YYLTYPE*);
1485static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
1486static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc);
1487static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc);
1488static NODE *new_find_pattern_tail(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc);
1489static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
1490static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
1491
1492static rb_node_kw_arg_t *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
1493static rb_node_args_t *args_with_numbered(struct parser_params*,rb_node_args_t*,int,ID);
1494
1495static NODE* negate_lit(struct parser_params*, NODE*);
1496static NODE *ret_args(struct parser_params*,NODE*);
1497static NODE *arg_blk_pass(NODE*,rb_node_block_pass_t*);
1498static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
1499static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
1500
1501static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
1502static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
1503
1504static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1505static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
1506
1507static VALUE rb_backref_error(struct parser_params*,NODE*);
1508static NODE *node_assign(struct parser_params*,NODE*,NODE*,struct lex_context,const YYLTYPE*);
1509
1510static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
1511static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc, const YYLTYPE *call_operator_loc, const YYLTYPE *opening_loc, const YYLTYPE *closing_loc, const YYLTYPE *binary_operator_loc);
1512static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc, const YYLTYPE *call_operator_loc, const YYLTYPE *message_loc, const YYLTYPE *binary_operator_loc);
1513static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
1514static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
1515
1516static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
1517
1518static rb_node_opt_arg_t *opt_arg_append(rb_node_opt_arg_t*, rb_node_opt_arg_t*);
1519static rb_node_kw_arg_t *kwd_append(rb_node_kw_arg_t*, rb_node_kw_arg_t*);
1520
1521static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
1522static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
1523
1524static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
1525
1526static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
1527
1528#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
1529
1530static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
1531
1532static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
1533
1534static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
1535
1536static rb_ast_id_table_t *local_tbl(struct parser_params*);
1537
1538static VALUE reg_compile(struct parser_params*, rb_parser_string_t*, int);
1539static void reg_fragment_setenc(struct parser_params*, rb_parser_string_t*, int);
1540#define reg_fragment_check rb_parser_reg_fragment_check
1541int reg_fragment_check(struct parser_params*, rb_parser_string_t*, int);
1542
1543static int literal_concat0(struct parser_params *p, rb_parser_string_t *head, rb_parser_string_t *tail);
1544static NODE *heredoc_dedent(struct parser_params*,NODE*);
1545
1546static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
1547
1548#ifdef RIPPER
1549#define get_value(idx) (rb_ary_entry(p->s_value_stack, idx))
1550#define set_value(val) (p->s_lvalue = val)
1551static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
1552static int id_is_var(struct parser_params *p, ID id);
1553#endif
1554
1555RUBY_SYMBOL_EXPORT_BEGIN
1556VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
1557int rb_reg_fragment_setenc(struct parser_params*, rb_parser_string_t *, int);
1558enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
1559VALUE rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state);
1560void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
1561PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
1562YYLTYPE *rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
1563YYLTYPE *rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc);
1564YYLTYPE *rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc);
1565YYLTYPE *rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc);
1566YYLTYPE *rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc);
1567YYLTYPE *rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc);
1568void ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, rb_parser_string_t *str);
1569RUBY_SYMBOL_EXPORT_END
1570
1571static void flush_string_content(struct parser_params *p, rb_encoding *enc, size_t back);
1572static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
1573static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
1574static VALUE formal_argument_error(struct parser_params*, ID);
1575static ID shadowing_lvar(struct parser_params*,ID);
1576static void new_bv(struct parser_params*,ID);
1577
1578static void local_push(struct parser_params*,int);
1579static void local_pop(struct parser_params*);
1580static void local_var(struct parser_params*, ID);
1581static void arg_var(struct parser_params*, ID);
1582static int local_id(struct parser_params *p, ID id);
1583static int local_id_ref(struct parser_params*, ID, ID **);
1584#define internal_id rb_parser_internal_id
1585ID internal_id(struct parser_params*);
1586static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
1587static int check_forwarding_args(struct parser_params*);
1588static void add_forwarding_args(struct parser_params *p);
1589static void forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var);
1590
1591static const struct vtable *dyna_push(struct parser_params *);
1592static void dyna_pop(struct parser_params*, const struct vtable *);
1593static int dyna_in_block(struct parser_params*);
1594#define dyna_var(p, id) local_var(p, id)
1595static int dvar_defined(struct parser_params*, ID);
1596#define dvar_defined_ref rb_parser_dvar_defined_ref
1597int dvar_defined_ref(struct parser_params*, ID, ID**);
1598static int dvar_curr(struct parser_params*,ID);
1599
1600static int lvar_defined(struct parser_params*, ID);
1601
1602static NODE *numparam_push(struct parser_params *p);
1603static void numparam_pop(struct parser_params *p, NODE *prev_inner);
1604
1605#define METHOD_NOT '!'
1606
1607#define idFWD_REST '*'
1608#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
1609#define idFWD_BLOCK '&'
1610#define idFWD_ALL idDot3
1611#define arg_FWD_BLOCK idFWD_BLOCK
1612
1613#define RE_ONIG_OPTION_IGNORECASE 1
1614#define RE_ONIG_OPTION_EXTEND (RE_ONIG_OPTION_IGNORECASE<<1)
1615#define RE_ONIG_OPTION_MULTILINE (RE_ONIG_OPTION_EXTEND<<1)
1616#define RE_OPTION_ONCE (1<<16)
1617#define RE_OPTION_ENCODING_SHIFT 8
1618#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
1619#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
1620#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
1621#define RE_OPTION_MASK 0xff
1622#define RE_OPTION_ARG_ENCODING_NONE 32
1623
1624#define CHECK_LITERAL_WHEN (st_table *)1
1625#define CASE_LABELS_ENABLED_P(case_labels) (case_labels && case_labels != CHECK_LITERAL_WHEN)
1626
1627#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
1628RUBY_FUNC_EXPORTED size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
1629
1630#define TOKEN2ID(tok) ( \
1631 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
1632 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
1633 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
1634 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
1635 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
1636 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
1637 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
1638
1639/****** Ripper *******/
1640
1641#ifdef RIPPER
1642
1643#include "eventids1.h"
1644#include "eventids2.h"
1645
1646extern const struct ripper_parser_ids ripper_parser_ids;
1647
1648static VALUE ripper_dispatch0(struct parser_params*,ID);
1649static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
1650static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
1651static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
1652static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
1653static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
1654static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
1655void ripper_error(struct parser_params *p);
1656
1657#define dispatch0(n) ripper_dispatch0(p, RIPPER_ID(n))
1658#define dispatch1(n,a) ripper_dispatch1(p, RIPPER_ID(n), (a))
1659#define dispatch2(n,a,b) ripper_dispatch2(p, RIPPER_ID(n), (a), (b))
1660#define dispatch3(n,a,b,c) ripper_dispatch3(p, RIPPER_ID(n), (a), (b), (c))
1661#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, RIPPER_ID(n), (a), (b), (c), (d))
1662#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, RIPPER_ID(n), (a), (b), (c), (d), (e))
1663#define dispatch7(n,a,b,c,d,e,f,g) ripper_dispatch7(p, RIPPER_ID(n), (a), (b), (c), (d), (e), (f), (g))
1664
1665#define yyparse ripper_yyparse
1666
1667static VALUE
1668aryptn_pre_args(struct parser_params *p, VALUE pre_arg, VALUE pre_args)
1669{
1670 if (!NIL_P(pre_arg)) {
1671 if (!NIL_P(pre_args)) {
1672 rb_ary_unshift(pre_args, pre_arg);
1673 }
1674 else {
1675 pre_args = rb_ary_new_from_args(1, pre_arg);
1676 }
1677 }
1678 return pre_args;
1679}
1680
1681#define ID2VAL(id) STATIC_ID2SYM(id)
1682#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
1683#endif /* RIPPER */
1684
1685#define KWD2EID(t, v) keyword_##t
1686
1687static NODE *
1688new_scope_body(struct parser_params *p, rb_node_args_t *args, NODE *body, const YYLTYPE *loc)
1689{
1690 body = remove_begin(body);
1691 reduce_nodes(p, &body);
1692 NODE *n = NEW_SCOPE(args, body, loc);
1693 nd_set_line(n, loc->end_pos.lineno);
1694 set_line_body(body, loc->beg_pos.lineno);
1695 return n;
1696}
1697
1698static NODE *
1699rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1700 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1701{
1702 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1703 rescue = NEW_RESBODY(0, 0, remove_begin(rescue), 0, &loc);
1704 loc.beg_pos = arg_loc->beg_pos;
1705 return NEW_RESCUE(arg, rescue, 0, &loc);
1706}
1707
1708static NODE *add_block_exit(struct parser_params *p, NODE *node);
1709static rb_node_exits_t *init_block_exit(struct parser_params *p);
1710static rb_node_exits_t *allow_block_exit(struct parser_params *p);
1711static void restore_block_exit(struct parser_params *p, rb_node_exits_t *exits);
1712static void clear_block_exit(struct parser_params *p, bool error);
1713
1714static void
1715next_rescue_context(struct lex_context *next, const struct lex_context *outer, enum rescue_context def)
1716{
1717 next->in_rescue = outer->in_rescue == after_rescue ? after_rescue : def;
1718}
1719
1720static void
1721restore_defun(struct parser_params *p, rb_node_def_temp_t *temp)
1722{
1723 /* See: def_name action */
1724 struct lex_context ctxt = temp->save.ctxt;
1725 p->ctxt.in_def = ctxt.in_def;
1726 p->ctxt.shareable_constant_value = ctxt.shareable_constant_value;
1727 p->ctxt.in_rescue = ctxt.in_rescue;
1728 p->max_numparam = temp->save.max_numparam;
1729 numparam_pop(p, temp->save.numparam_save);
1730 clear_block_exit(p, true);
1731}
1732
1733static void
1734endless_method_name(struct parser_params *p, ID mid, const YYLTYPE *loc)
1735{
1736 if (is_attrset_id(mid)) {
1737 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1738 }
1739 token_info_drop(p, "def", loc->beg_pos);
1740}
1741
1742#define debug_token_line(p, name, line) do { \
1743 if (p->debug) { \
1744 const char *const pcur = p->lex.pcur; \
1745 const char *const ptok = p->lex.ptok; \
1746 rb_parser_printf(p, name ":%d (%d: %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF")\n", \
1747 line, p->ruby_sourceline, \
1748 ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur); \
1749 } \
1750 } while (0)
1751
1752#define begin_definition(k, loc_beg, loc_end) \
1753 do { \
1754 if (!(p->ctxt.in_class = (k)[0] != 0)) { \
1755 /* singleton class */ \
1756 p->ctxt.cant_return = !p->ctxt.in_def; \
1757 p->ctxt.in_def = 0; \
1758 } \
1759 else if (p->ctxt.in_def) { \
1760 YYLTYPE loc = code_loc_gen(loc_beg, loc_end); \
1761 yyerror1(&loc, k " definition in method body"); \
1762 } \
1763 else { \
1764 p->ctxt.cant_return = 1; \
1765 } \
1766 local_push(p, 0); \
1767 } while (0)
1768
1769#ifndef RIPPER
1770# define ifndef_ripper(x) (x)
1771# define ifdef_ripper(r,x) (x)
1772#else
1773# define ifndef_ripper(x)
1774# define ifdef_ripper(r,x) (r)
1775#endif
1776
1777# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1778# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1779# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1780# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1781# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1782# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1783# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1784# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1785# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1786# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1787# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1788# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1789# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1790# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1791# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1792# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1793# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1794# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1795# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1796# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1797#ifdef RIPPER
1798extern const ID id_warn, id_warning, id_gets, id_assoc;
1799# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1800# define WARN_S_L(s,l) STR_NEW(s,l)
1801# define WARN_S(s) STR_NEW2(s)
1802# define WARN_I(i) INT2NUM(i)
1803# define WARN_ID(i) rb_id2str(i)
1804# define PRIsWARN PRIsVALUE
1805# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1806# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1807# ifdef HAVE_VA_ARGS_MACRO
1808# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1809# else
1810# define WARN_CALL rb_funcall
1811# endif
1812# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1813# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1814# ifdef HAVE_VA_ARGS_MACRO
1815# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1816# else
1817# define WARNING_CALL rb_funcall
1818# endif
1819# define compile_error ripper_compile_error
1820#else
1821# define WARN_S_L(s,l) s
1822# define WARN_S(s) s
1823# define WARN_I(i) i
1824# define WARN_ID(i) rb_id2name(i)
1825# define PRIsWARN PRIsVALUE
1826# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1827# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1828# define WARN_CALL rb_compile_warn
1829# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1830# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1831# define WARNING_CALL rb_compile_warning
1832PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const rb_code_location_t *loc, const char *fmt, ...), 3, 4);
1833# define compile_error(p, ...) parser_compile_error(p, NULL, __VA_ARGS__)
1834#endif
1835
1836#define RNODE_EXITS(node) ((rb_node_exits_t*)(node))
1837
1838static NODE *
1839add_block_exit(struct parser_params *p, NODE *node)
1840{
1841 if (!node) {
1842 compile_error(p, "unexpected null node");
1843 return 0;
1844 }
1845 switch (nd_type(node)) {
1846 case NODE_BREAK: case NODE_NEXT: case NODE_REDO: break;
1847 default:
1848 compile_error(p, "add_block_exit: unexpected node: %s", parser_node_name(nd_type(node)));
1849 return node;
1850 }
1851 if (!p->ctxt.in_defined) {
1852 rb_node_exits_t *exits = p->exits;
1853 if (exits) {
1854 RNODE_EXITS(exits->nd_stts)->nd_chain = node;
1855 exits->nd_stts = node;
1856 }
1857 }
1858 return node;
1859}
1860
1861static rb_node_exits_t *
1862init_block_exit(struct parser_params *p)
1863{
1864 rb_node_exits_t *old = p->exits;
1865 rb_node_exits_t *exits = NODE_NEW_INTERNAL(NODE_EXITS, rb_node_exits_t);
1866 exits->nd_chain = 0;
1867 exits->nd_stts = RNODE(exits);
1868 p->exits = exits;
1869 return old;
1870}
1871
1872static rb_node_exits_t *
1873allow_block_exit(struct parser_params *p)
1874{
1875 rb_node_exits_t *exits = p->exits;
1876 p->exits = 0;
1877 return exits;
1878}
1879
1880static void
1881restore_block_exit(struct parser_params *p, rb_node_exits_t *exits)
1882{
1883 p->exits = exits;
1884}
1885
1886static void
1887clear_block_exit(struct parser_params *p, bool error)
1888{
1889 rb_node_exits_t *exits = p->exits;
1890 if (!exits) return;
1891 if (error) {
1892 for (NODE *e = RNODE(exits); (e = RNODE_EXITS(e)->nd_chain) != 0; ) {
1893 switch (nd_type(e)) {
1894 case NODE_BREAK:
1895 yyerror1(&e->nd_loc, "Invalid break");
1896 break;
1897 case NODE_NEXT:
1898 yyerror1(&e->nd_loc, "Invalid next");
1899 break;
1900 case NODE_REDO:
1901 yyerror1(&e->nd_loc, "Invalid redo");
1902 break;
1903 default:
1904 yyerror1(&e->nd_loc, "unexpected node");
1905 goto end_checks; /* no nd_chain */
1906 }
1907 }
1908 end_checks:;
1909 }
1910 exits->nd_stts = RNODE(exits);
1911 exits->nd_chain = 0;
1912}
1913
1914#define WARN_EOL(tok) \
1915 (looking_at_eol_p(p) ? \
1916 (void)rb_warning0("'" tok "' at the end of line without an expression") : \
1917 (void)0)
1918static int looking_at_eol_p(struct parser_params *p);
1919
1920static NODE *
1921get_nd_value(struct parser_params *p, NODE *node)
1922{
1923 switch (nd_type(node)) {
1924 case NODE_GASGN:
1925 return RNODE_GASGN(node)->nd_value;
1926 case NODE_IASGN:
1927 return RNODE_IASGN(node)->nd_value;
1928 case NODE_LASGN:
1929 return RNODE_LASGN(node)->nd_value;
1930 case NODE_DASGN:
1931 return RNODE_DASGN(node)->nd_value;
1932 case NODE_MASGN:
1933 return RNODE_MASGN(node)->nd_value;
1934 case NODE_CVASGN:
1935 return RNODE_CVASGN(node)->nd_value;
1936 case NODE_CDECL:
1937 return RNODE_CDECL(node)->nd_value;
1938 default:
1939 compile_error(p, "get_nd_value: unexpected node: %s", parser_node_name(nd_type(node)));
1940 return 0;
1941 }
1942}
1943
1944static void
1945set_nd_value(struct parser_params *p, NODE *node, NODE *rhs)
1946{
1947 switch (nd_type(node)) {
1948 case NODE_CDECL:
1949 RNODE_CDECL(node)->nd_value = rhs;
1950 break;
1951 case NODE_GASGN:
1952 RNODE_GASGN(node)->nd_value = rhs;
1953 break;
1954 case NODE_IASGN:
1955 RNODE_IASGN(node)->nd_value = rhs;
1956 break;
1957 case NODE_LASGN:
1958 RNODE_LASGN(node)->nd_value = rhs;
1959 break;
1960 case NODE_DASGN:
1961 RNODE_DASGN(node)->nd_value = rhs;
1962 break;
1963 case NODE_MASGN:
1964 RNODE_MASGN(node)->nd_value = rhs;
1965 break;
1966 case NODE_CVASGN:
1967 RNODE_CVASGN(node)->nd_value = rhs;
1968 break;
1969 default:
1970 compile_error(p, "set_nd_value: unexpected node: %s", parser_node_name(nd_type(node)));
1971 break;
1972 }
1973}
1974
1975static ID
1976get_nd_vid(struct parser_params *p, NODE *node)
1977{
1978 switch (nd_type(node)) {
1979 case NODE_CDECL:
1980 return RNODE_CDECL(node)->nd_vid;
1981 case NODE_GASGN:
1982 return RNODE_GASGN(node)->nd_vid;
1983 case NODE_IASGN:
1984 return RNODE_IASGN(node)->nd_vid;
1985 case NODE_LASGN:
1986 return RNODE_LASGN(node)->nd_vid;
1987 case NODE_DASGN:
1988 return RNODE_DASGN(node)->nd_vid;
1989 case NODE_CVASGN:
1990 return RNODE_CVASGN(node)->nd_vid;
1991 default:
1992 compile_error(p, "get_nd_vid: unexpected node: %s", parser_node_name(nd_type(node)));
1993 return 0;
1994 }
1995}
1996
1997static NODE *
1998get_nd_args(struct parser_params *p, NODE *node)
1999{
2000 switch (nd_type(node)) {
2001 case NODE_CALL:
2002 return RNODE_CALL(node)->nd_args;
2003 case NODE_OPCALL:
2004 return RNODE_OPCALL(node)->nd_args;
2005 case NODE_FCALL:
2006 return RNODE_FCALL(node)->nd_args;
2007 case NODE_QCALL:
2008 return RNODE_QCALL(node)->nd_args;
2009 case NODE_SUPER:
2010 return RNODE_SUPER(node)->nd_args;
2011 case NODE_VCALL:
2012 case NODE_ZSUPER:
2013 case NODE_YIELD:
2014 case NODE_RETURN:
2015 case NODE_BREAK:
2016 case NODE_NEXT:
2017 return 0;
2018 default:
2019 compile_error(p, "get_nd_args: unexpected node: %s", parser_node_name(nd_type(node)));
2020 return 0;
2021 }
2022}
2023
2024static st_index_t
2025djb2(const uint8_t *str, size_t len)
2026{
2027 st_index_t hash = 5381;
2028
2029 for (size_t i = 0; i < len; i++) {
2030 hash = ((hash << 5) + hash) + str[i];
2031 }
2032
2033 return hash;
2034}
2035
2036static st_index_t
2037parser_memhash(const void *ptr, long len)
2038{
2039 return djb2(ptr, len);
2040}
2041
2042#define PARSER_STRING_PTR(str) (str->ptr)
2043#define PARSER_STRING_LEN(str) (str->len)
2044#define PARSER_STRING_END(str) (&str->ptr[str->len])
2045#define STRING_SIZE(str) ((size_t)str->len + 1)
2046#define STRING_TERM_LEN(str) (1)
2047#define STRING_TERM_FILL(str) (str->ptr[str->len] = '\0')
2048#define PARSER_STRING_RESIZE_CAPA_TERM(p,str,capacity,termlen) do {\
2049 SIZED_REALLOC_N(str->ptr, char, (size_t)total + termlen, STRING_SIZE(str)); \
2050 str->len = total; \
2051} while (0)
2052#define STRING_SET_LEN(str, n) do { \
2053 (str)->len = (n); \
2054} while (0)
2055#define PARSER_STRING_GETMEM(str, ptrvar, lenvar) \
2056 ((ptrvar) = str->ptr, \
2057 (lenvar) = str->len)
2058
2059static inline int
2060parser_string_char_at_end(struct parser_params *p, rb_parser_string_t *str, int when_empty)
2061{
2062 return PARSER_STRING_LEN(str) > 0 ? (unsigned char)PARSER_STRING_END(str)[-1] : when_empty;
2063}
2064
2065static rb_parser_string_t *
2066rb_parser_string_new(rb_parser_t *p, const char *ptr, long len)
2067{
2068 rb_parser_string_t *str;
2069
2070 if (len < 0) {
2071 rb_bug("negative string size (or size too big): %ld", len);
2072 }
2073
2074 str = xcalloc(1, sizeof(rb_parser_string_t));
2075 str->ptr = xcalloc(len + 1, sizeof(char));
2076
2077 if (ptr) {
2078 memcpy(PARSER_STRING_PTR(str), ptr, len);
2079 }
2080 STRING_SET_LEN(str, len);
2081 STRING_TERM_FILL(str);
2082 return str;
2083}
2084
2085static rb_parser_string_t *
2086rb_parser_encoding_string_new(rb_parser_t *p, const char *ptr, long len, rb_encoding *enc)
2087{
2088 rb_parser_string_t *str = rb_parser_string_new(p, ptr, len);
2089 str->coderange = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2090 str->enc = enc;
2091 return str;
2092}
2093
2094#ifndef RIPPER
2095rb_parser_string_t *
2096rb_str_to_parser_string(rb_parser_t *p, VALUE str)
2097{
2098 /* Type check */
2099 rb_parser_string_t *ret = rb_parser_encoding_string_new(p, RSTRING_PTR(str), RSTRING_LEN(str), rb_enc_get(str));
2100 RB_GC_GUARD(str);
2101 return ret;
2102}
2103
2104void
2105rb_parser_string_free(rb_parser_t *p, rb_parser_string_t *str)
2106{
2107 if (!str) return;
2108 xfree(PARSER_STRING_PTR(str));
2109 xfree(str);
2110}
2111#endif
2112
2113static st_index_t
2114rb_parser_str_hash(rb_parser_string_t *str)
2115{
2116 return parser_memhash((const void *)PARSER_STRING_PTR(str), PARSER_STRING_LEN(str));
2117}
2118
2119static st_index_t
2120rb_char_p_hash(const char *c)
2121{
2122 return parser_memhash((const void *)c, strlen(c));
2123}
2124
2125static size_t
2126rb_parser_str_capacity(rb_parser_string_t *str, const int termlen)
2127{
2128 return PARSER_STRING_LEN(str);
2129}
2130
2131#ifndef RIPPER
2132static char *
2133rb_parser_string_end(rb_parser_string_t *str)
2134{
2135 return &str->ptr[str->len];
2136}
2137#endif
2138
2139static void
2140rb_parser_string_set_encoding(rb_parser_string_t *str, rb_encoding *enc)
2141{
2142 str->enc = enc;
2143}
2144
2145static rb_encoding *
2146rb_parser_str_get_encoding(rb_parser_string_t *str)
2147{
2148 return str->enc;
2149}
2150
2151#ifndef RIPPER
2152static bool
2153PARSER_ENCODING_IS_ASCII8BIT(struct parser_params *p, rb_parser_string_t *str)
2154{
2155 return rb_parser_str_get_encoding(str) == rb_ascii8bit_encoding();
2156}
2157#endif
2158
2159static int
2160PARSER_ENC_CODERANGE(rb_parser_string_t *str)
2161{
2162 return str->coderange;
2163}
2164
2165static void
2166PARSER_ENC_CODERANGE_SET(rb_parser_string_t *str, int coderange)
2167{
2168 str->coderange = coderange;
2169}
2170
2171static void
2172PARSER_ENCODING_CODERANGE_SET(rb_parser_string_t *str, rb_encoding *enc, enum rb_parser_string_coderange_type cr)
2173{
2174 rb_parser_string_set_encoding(str, enc);
2175 PARSER_ENC_CODERANGE_SET(str, cr);
2176}
2177
2178static void
2179PARSER_ENC_CODERANGE_CLEAR(rb_parser_string_t *str)
2180{
2181 str->coderange = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2182}
2183
2184static bool
2185PARSER_ENC_CODERANGE_ASCIIONLY(rb_parser_string_t *str)
2186{
2187 return PARSER_ENC_CODERANGE(str) == RB_PARSER_ENC_CODERANGE_7BIT;
2188}
2189
2190static bool
2191PARSER_ENC_CODERANGE_CLEAN_P(int cr)
2192{
2193 return cr == RB_PARSER_ENC_CODERANGE_7BIT || cr == RB_PARSER_ENC_CODERANGE_VALID;
2194}
2195
2196static const char *
2197rb_parser_search_nonascii(const char *p, const char *e)
2198{
2199 const char *s = p;
2200
2201 for (; s < e; s++) {
2202 if (*s & 0x80) return s;
2203 }
2204
2205 return NULL;
2206}
2207
2208static int
2209rb_parser_coderange_scan(struct parser_params *p, const char *ptr, long len, rb_encoding *enc)
2210{
2211 const char *e = ptr + len;
2212
2213 if (enc == rb_ascii8bit_encoding()) {
2214 /* enc is ASCII-8BIT. ASCII-8BIT string never be broken. */
2215 ptr = rb_parser_search_nonascii(ptr, e);
2216 return ptr ? RB_PARSER_ENC_CODERANGE_VALID : RB_PARSER_ENC_CODERANGE_7BIT;
2217 }
2218
2219 /* parser string encoding is always asciicompat */
2220 ptr = rb_parser_search_nonascii(ptr, e);
2221 if (!ptr) return RB_PARSER_ENC_CODERANGE_7BIT;
2222 for (;;) {
2223 int ret = rb_enc_precise_mbclen(ptr, e, enc);
2224 if (!MBCLEN_CHARFOUND_P(ret)) return RB_PARSER_ENC_CODERANGE_BROKEN;
2225 ptr += MBCLEN_CHARFOUND_LEN(ret);
2226 if (ptr == e) break;
2227 ptr = rb_parser_search_nonascii(ptr, e);
2228 if (!ptr) break;
2229 }
2230
2231 return RB_PARSER_ENC_CODERANGE_VALID;
2232}
2233
2234static int
2235rb_parser_enc_coderange_scan(struct parser_params *p, rb_parser_string_t *str, rb_encoding *enc)
2236{
2237 return rb_parser_coderange_scan(p, PARSER_STRING_PTR(str), PARSER_STRING_LEN(str), enc);
2238}
2239
2240static int
2241rb_parser_enc_str_coderange(struct parser_params *p, rb_parser_string_t *str)
2242{
2243 int cr = PARSER_ENC_CODERANGE(str);
2244
2245 if (cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2246 cr = rb_parser_enc_coderange_scan(p, str, rb_parser_str_get_encoding(str));
2247 PARSER_ENC_CODERANGE_SET(str, cr);
2248 }
2249
2250 return cr;
2251}
2252
2253static rb_parser_string_t *
2254rb_parser_enc_associate(struct parser_params *p, rb_parser_string_t *str, rb_encoding *enc)
2255{
2256 if (rb_parser_str_get_encoding(str) == enc)
2257 return str;
2258 if (!PARSER_ENC_CODERANGE_ASCIIONLY(str)) {
2259 PARSER_ENC_CODERANGE_CLEAR(str);
2260 }
2261 rb_parser_string_set_encoding(str, enc);
2262 return str;
2263}
2264
2265static bool
2266rb_parser_is_ascii_string(struct parser_params *p, rb_parser_string_t *str)
2267{
2268 return rb_parser_enc_str_coderange(p, str) == RB_PARSER_ENC_CODERANGE_7BIT;
2269}
2270
2271static rb_encoding *
2272rb_parser_enc_compatible(struct parser_params *p, rb_parser_string_t *str1, rb_parser_string_t *str2)
2273{
2274 rb_encoding *enc1 = rb_parser_str_get_encoding(str1);
2275 rb_encoding *enc2 = rb_parser_str_get_encoding(str2);
2276
2277 if (enc1 == NULL || enc2 == NULL)
2278 return 0;
2279
2280 if (enc1 == enc2) {
2281 return enc1;
2282 }
2283
2284 if (PARSER_STRING_LEN(str2) == 0)
2285 return enc1;
2286 if (PARSER_STRING_LEN(str1) == 0)
2287 return rb_parser_is_ascii_string(p, str2) ? enc1 : enc2;
2288
2289 int cr1, cr2;
2290
2291 cr1 = rb_parser_enc_str_coderange(p, str1);
2292 cr2 = rb_parser_enc_str_coderange(p, str2);
2293
2294 if (cr1 != cr2) {
2295 if (cr1 == RB_PARSER_ENC_CODERANGE_7BIT) return enc2;
2296 if (cr2 == RB_PARSER_ENC_CODERANGE_7BIT) return enc1;
2297 }
2298
2299 if (cr2 == RB_PARSER_ENC_CODERANGE_7BIT) {
2300 return enc1;
2301 }
2302
2303 if (cr1 == RB_PARSER_ENC_CODERANGE_7BIT) {
2304 return enc2;
2305 }
2306
2307 return 0;
2308}
2309
2310static void
2311rb_parser_str_modify(rb_parser_string_t *str)
2312{
2313 PARSER_ENC_CODERANGE_CLEAR(str);
2314}
2315
2316static void
2317rb_parser_str_set_len(struct parser_params *p, rb_parser_string_t *str, long len)
2318{
2319 long capa;
2320 const int termlen = STRING_TERM_LEN(str);
2321
2322 if (len > (capa = (long)(rb_parser_str_capacity(str, termlen))) || len < 0) {
2323 rb_bug("probable buffer overflow: %ld for %ld", len, capa);
2324 }
2325
2326 int cr = PARSER_ENC_CODERANGE(str);
2327 if (cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2328 /* Leave unknown. */
2329 }
2330 else if (len > PARSER_STRING_LEN(str)) {
2331 PARSER_ENC_CODERANGE_SET(str, RB_PARSER_ENC_CODERANGE_UNKNOWN);
2332 }
2333 else if (len < PARSER_STRING_LEN(str)) {
2334 if (cr != RB_PARSER_ENC_CODERANGE_7BIT) {
2335 /* ASCII-only string is keeping after truncated. Valid
2336 * and broken may be invalid or valid, leave unknown. */
2337 PARSER_ENC_CODERANGE_SET(str, RB_PARSER_ENC_CODERANGE_UNKNOWN);
2338 }
2339 }
2340
2341 STRING_SET_LEN(str, len);
2342 STRING_TERM_FILL(str);
2343}
2344
2345static rb_parser_string_t *
2346rb_parser_str_buf_cat(struct parser_params *p, rb_parser_string_t *str, const char *ptr, long len)
2347{
2348 rb_parser_str_modify(str);
2349 if (len == 0) return 0;
2350
2351 long total, olen, off = -1;
2352 char *sptr;
2353 const int termlen = STRING_TERM_LEN(str);
2354
2355 PARSER_STRING_GETMEM(str, sptr, olen);
2356 if (ptr >= sptr && ptr <= sptr + olen) {
2357 off = ptr - sptr;
2358 }
2359
2360 if (olen > LONG_MAX - len) {
2361 compile_error(p, "string sizes too big");
2362 return 0;
2363 }
2364 total = olen + len;
2365 PARSER_STRING_RESIZE_CAPA_TERM(p, str, total, termlen);
2366 sptr = PARSER_STRING_PTR(str);
2367 if (off != -1) {
2368 ptr = sptr + off;
2369 }
2370 memcpy(sptr + olen, ptr, len);
2371 STRING_SET_LEN(str, total);
2372 STRING_TERM_FILL(str);
2373
2374 return str;
2375}
2376
2377#define parser_str_cat(str, ptr, len) rb_parser_str_buf_cat(p, str, ptr, len)
2378#define parser_str_cat_cstr(str, lit) rb_parser_str_buf_cat(p, str, lit, strlen(lit))
2379
2380static rb_parser_string_t *
2381rb_parser_enc_cr_str_buf_cat(struct parser_params *p, rb_parser_string_t *str, const char *ptr, long len,
2382 rb_encoding *ptr_enc, int ptr_cr, int *ptr_cr_ret)
2383{
2384 int str_cr, res_cr;
2385 rb_encoding *str_enc, *res_enc;
2386
2387 str_enc = rb_parser_str_get_encoding(str);
2388 str_cr = PARSER_STRING_LEN(str) ? PARSER_ENC_CODERANGE(str) : RB_PARSER_ENC_CODERANGE_7BIT;
2389
2390 if (str_enc == ptr_enc) {
2391 if (str_cr != RB_PARSER_ENC_CODERANGE_UNKNOWN && ptr_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2392 ptr_cr = rb_parser_coderange_scan(p, ptr, len, ptr_enc);
2393 }
2394 }
2395 else {
2396 /* parser string encoding is always asciicompat */
2397 if (ptr_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2398 ptr_cr = rb_parser_coderange_scan(p, ptr, len, ptr_enc);
2399 }
2400 if (str_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2401 if (str_enc == rb_ascii8bit_encoding() || ptr_cr != RB_PARSER_ENC_CODERANGE_7BIT) {
2402 str_cr = rb_parser_enc_str_coderange(p, str);
2403 }
2404 }
2405 }
2406 if (ptr_cr_ret)
2407 *ptr_cr_ret = ptr_cr;
2408
2409 if (str_enc != ptr_enc &&
2410 str_cr != RB_PARSER_ENC_CODERANGE_7BIT &&
2411 ptr_cr != RB_PARSER_ENC_CODERANGE_7BIT) {
2412 goto incompatible;
2413 }
2414
2415 if (str_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2416 res_enc = str_enc;
2417 res_cr = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2418 }
2419 else if (str_cr == RB_PARSER_ENC_CODERANGE_7BIT) {
2420 if (ptr_cr == RB_PARSER_ENC_CODERANGE_7BIT) {
2421 res_enc = str_enc;
2422 res_cr = RB_PARSER_ENC_CODERANGE_7BIT;
2423 }
2424 else {
2425 res_enc = ptr_enc;
2426 res_cr = ptr_cr;
2427 }
2428 }
2429 else if (str_cr == RB_PARSER_ENC_CODERANGE_VALID) {
2430 res_enc = str_enc;
2431 if (PARSER_ENC_CODERANGE_CLEAN_P(ptr_cr))
2432 res_cr = str_cr;
2433 else
2434 res_cr = ptr_cr;
2435 }
2436 else { /* str_cr == RB_PARSER_ENC_CODERANGE_BROKEN */
2437 res_enc = str_enc;
2438 res_cr = str_cr;
2439 if (0 < len) res_cr = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2440 }
2441
2442 if (len < 0) {
2443 compile_error(p, "negative string size (or size too big)");
2444 }
2445 parser_str_cat(str, ptr, len);
2446 PARSER_ENCODING_CODERANGE_SET(str, res_enc, res_cr);
2447 return str;
2448
2449 incompatible:
2450 compile_error(p, "incompatible character encodings: %s and %s",
2451 rb_enc_name(str_enc), rb_enc_name(ptr_enc));
2453
2454}
2455
2456static rb_parser_string_t *
2457rb_parser_enc_str_buf_cat(struct parser_params *p, rb_parser_string_t *str, const char *ptr, long len,
2458 rb_encoding *ptr_enc)
2459{
2460 return rb_parser_enc_cr_str_buf_cat(p, str, ptr, len, ptr_enc, RB_PARSER_ENC_CODERANGE_UNKNOWN, NULL);
2461}
2462
2463static rb_parser_string_t *
2464rb_parser_str_buf_append(struct parser_params *p, rb_parser_string_t *str, rb_parser_string_t *str2)
2465{
2466 int str2_cr = rb_parser_enc_str_coderange(p, str2);
2467
2468 rb_parser_enc_cr_str_buf_cat(p, str, PARSER_STRING_PTR(str2), PARSER_STRING_LEN(str2),
2469 rb_parser_str_get_encoding(str2), str2_cr, &str2_cr);
2470
2471 PARSER_ENC_CODERANGE_SET(str2, str2_cr);
2472
2473 return str;
2474}
2475
2476static rb_parser_string_t *
2477rb_parser_str_resize(struct parser_params *p, rb_parser_string_t *str, long len)
2478{
2479 if (len < 0) {
2480 rb_bug("negative string size (or size too big)");
2481 }
2482
2483 long slen = PARSER_STRING_LEN(str);
2484
2485 if (slen > len && PARSER_ENC_CODERANGE(str) != RB_PARSER_ENC_CODERANGE_7BIT) {
2486 PARSER_ENC_CODERANGE_CLEAR(str);
2487 }
2488
2489 {
2490 long capa;
2491 const int termlen = STRING_TERM_LEN(str);
2492
2493 if ((capa = slen) < len) {
2494 SIZED_REALLOC_N(str->ptr, char, (size_t)len + termlen, STRING_SIZE(str));
2495 }
2496 else if (len == slen) return str;
2497 STRING_SET_LEN(str, len);
2498 STRING_TERM_FILL(str);
2499 }
2500 return str;
2501}
2502
2503# define PARSER_ENC_STRING_GETMEM(str, ptrvar, lenvar, encvar) \
2504 ((ptrvar) = str->ptr, \
2505 (lenvar) = str->len, \
2506 (encvar) = str->enc)
2507
2508static int
2509rb_parser_string_hash_cmp(rb_parser_string_t *str1, rb_parser_string_t *str2)
2510{
2511 long len1, len2;
2512 const char *ptr1, *ptr2;
2513 rb_encoding *enc1, *enc2;
2514
2515 PARSER_ENC_STRING_GETMEM(str1, ptr1, len1, enc1);
2516 PARSER_ENC_STRING_GETMEM(str2, ptr2, len2, enc2);
2517
2518 return (len1 != len2 ||
2519 enc1 != enc2 ||
2520 memcmp(ptr1, ptr2, len1) != 0);
2521}
2522
2523static void
2524rb_parser_ary_extend(rb_parser_t *p, rb_parser_ary_t *ary, long len)
2525{
2526 long i;
2527 if (ary->capa < len) {
2528 ary->capa = len;
2529 ary->data = (rb_parser_ary_data *)xrealloc(ary->data, sizeof(rb_parser_ary_data) * len);
2530 for (i = ary->len; i < len; i++) {
2531 ary->data[i] = 0;
2532 }
2533 }
2534}
2535
2536/*
2537 * Do not call this directly.
2538 * Use rb_parser_ary_new_capa_for_XXX() instead.
2539 */
2540static rb_parser_ary_t *
2541parser_ary_new_capa(rb_parser_t *p, long len)
2542{
2543 if (len < 0) {
2544 rb_bug("negative array size (or size too big): %ld", len);
2545 }
2546 rb_parser_ary_t *ary = xcalloc(1, sizeof(rb_parser_ary_t));
2547 ary->data_type = 0;
2548 ary->len = 0;
2549 ary->capa = len;
2550 if (0 < len) {
2551 ary->data = (rb_parser_ary_data *)xcalloc(len, sizeof(rb_parser_ary_data));
2552 }
2553 else {
2554 ary->data = NULL;
2555 }
2556 return ary;
2557}
2558
2559#ifndef RIPPER
2560static rb_parser_ary_t *
2561rb_parser_ary_new_capa_for_script_line(rb_parser_t *p, long len)
2562{
2563 rb_parser_ary_t *ary = parser_ary_new_capa(p, len);
2564 ary->data_type = PARSER_ARY_DATA_SCRIPT_LINE;
2565 return ary;
2566}
2567
2568static rb_parser_ary_t *
2569rb_parser_ary_new_capa_for_ast_token(rb_parser_t *p, long len)
2570{
2571 rb_parser_ary_t *ary = parser_ary_new_capa(p, len);
2572 ary->data_type = PARSER_ARY_DATA_AST_TOKEN;
2573 return ary;
2574}
2575#endif
2576
2577static rb_parser_ary_t *
2578rb_parser_ary_new_capa_for_node(rb_parser_t *p, long len)
2579{
2580 rb_parser_ary_t *ary = parser_ary_new_capa(p, len);
2581 ary->data_type = PARSER_ARY_DATA_NODE;
2582 return ary;
2583}
2584
2585/*
2586 * Do not call this directly.
2587 * Use rb_parser_ary_push_XXX() instead.
2588 */
2589static rb_parser_ary_t *
2590parser_ary_push(rb_parser_t *p, rb_parser_ary_t *ary, rb_parser_ary_data val)
2591{
2592 if (ary->len == ary->capa) {
2593 rb_parser_ary_extend(p, ary, ary->len == 0 ? 1 : ary->len * 2);
2594 }
2595 ary->data[ary->len++] = val;
2596 return ary;
2597}
2598
2599#ifndef RIPPER
2600static rb_parser_ary_t *
2601rb_parser_ary_push_ast_token(rb_parser_t *p, rb_parser_ary_t *ary, rb_parser_ast_token_t *val)
2602{
2603 if (ary->data_type != PARSER_ARY_DATA_AST_TOKEN) {
2604 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2605 }
2606 return parser_ary_push(p, ary, val);
2607}
2608
2609static rb_parser_ary_t *
2610rb_parser_ary_push_script_line(rb_parser_t *p, rb_parser_ary_t *ary, rb_parser_string_t *val)
2611{
2612 if (ary->data_type != PARSER_ARY_DATA_SCRIPT_LINE) {
2613 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2614 }
2615 return parser_ary_push(p, ary, val);
2616}
2617#endif
2618
2619static rb_parser_ary_t *
2620rb_parser_ary_push_node(rb_parser_t *p, rb_parser_ary_t *ary, NODE *val)
2621{
2622 if (ary->data_type != PARSER_ARY_DATA_NODE) {
2623 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2624 }
2625 return parser_ary_push(p, ary, val);
2626}
2627
2628#ifndef RIPPER
2629static void
2630rb_parser_ast_token_free(rb_parser_t *p, rb_parser_ast_token_t *token)
2631{
2632 if (!token) return;
2633 rb_parser_string_free(p, token->str);
2634 xfree(token);
2635}
2636
2637static void
2638rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary)
2639{
2640# define foreach_ary(ptr) \
2641 for (rb_parser_ary_data *ptr = ary->data, *const end_ary_data = ptr + ary->len; \
2642 ptr < end_ary_data; ptr++)
2643 switch (ary->data_type) {
2644 case PARSER_ARY_DATA_AST_TOKEN:
2645 foreach_ary(data) {rb_parser_ast_token_free(p, *data);}
2646 break;
2647 case PARSER_ARY_DATA_SCRIPT_LINE:
2648 foreach_ary(data) {rb_parser_string_free(p, *data);}
2649 break;
2650 case PARSER_ARY_DATA_NODE:
2651 /* Do nothing because nodes are freed when rb_ast_t is freed */
2652 break;
2653 default:
2654 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2655 break;
2656 }
2657# undef foreach_ary
2658 xfree(ary->data);
2659 xfree(ary);
2660}
2661
2662#endif /* !RIPPER */
2663
2664#line 2665 "parse.c"
2665
2666# ifndef YY_CAST
2667# ifdef __cplusplus
2668# define YY_CAST(Type, Val) static_cast<Type> (Val)
2669# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
2670# else
2671# define YY_CAST(Type, Val) ((Type) (Val))
2672# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
2673# endif
2674# endif
2675# ifndef YY_NULLPTR
2676# if defined __cplusplus
2677# if 201103L <= __cplusplus
2678# define YY_NULLPTR nullptr
2679# else
2680# define YY_NULLPTR 0
2681# endif
2682# else
2683# define YY_NULLPTR ((void*)0)
2684# endif
2685# endif
2686
2687#include "parse.h"
2688/* Symbol kind. */
2689enum yysymbol_kind_t
2690{
2691 YYSYMBOL_YYEMPTY = -2,
2692 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
2693 YYSYMBOL_YYerror = 1, /* error */
2694 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
2695 YYSYMBOL_keyword_class = 3, /* "'class'" */
2696 YYSYMBOL_keyword_module = 4, /* "'module'" */
2697 YYSYMBOL_keyword_def = 5, /* "'def'" */
2698 YYSYMBOL_keyword_undef = 6, /* "'undef'" */
2699 YYSYMBOL_keyword_begin = 7, /* "'begin'" */
2700 YYSYMBOL_keyword_rescue = 8, /* "'rescue'" */
2701 YYSYMBOL_keyword_ensure = 9, /* "'ensure'" */
2702 YYSYMBOL_keyword_end = 10, /* "'end'" */
2703 YYSYMBOL_keyword_if = 11, /* "'if'" */
2704 YYSYMBOL_keyword_unless = 12, /* "'unless'" */
2705 YYSYMBOL_keyword_then = 13, /* "'then'" */
2706 YYSYMBOL_keyword_elsif = 14, /* "'elsif'" */
2707 YYSYMBOL_keyword_else = 15, /* "'else'" */
2708 YYSYMBOL_keyword_case = 16, /* "'case'" */
2709 YYSYMBOL_keyword_when = 17, /* "'when'" */
2710 YYSYMBOL_keyword_while = 18, /* "'while'" */
2711 YYSYMBOL_keyword_until = 19, /* "'until'" */
2712 YYSYMBOL_keyword_for = 20, /* "'for'" */
2713 YYSYMBOL_keyword_break = 21, /* "'break'" */
2714 YYSYMBOL_keyword_next = 22, /* "'next'" */
2715 YYSYMBOL_keyword_redo = 23, /* "'redo'" */
2716 YYSYMBOL_keyword_retry = 24, /* "'retry'" */
2717 YYSYMBOL_keyword_in = 25, /* "'in'" */
2718 YYSYMBOL_keyword_do = 26, /* "'do'" */
2719 YYSYMBOL_keyword_do_cond = 27, /* "'do' for condition" */
2720 YYSYMBOL_keyword_do_block = 28, /* "'do' for block" */
2721 YYSYMBOL_keyword_do_LAMBDA = 29, /* "'do' for lambda" */
2722 YYSYMBOL_keyword_return = 30, /* "'return'" */
2723 YYSYMBOL_keyword_yield = 31, /* "'yield'" */
2724 YYSYMBOL_keyword_super = 32, /* "'super'" */
2725 YYSYMBOL_keyword_self = 33, /* "'self'" */
2726 YYSYMBOL_keyword_nil = 34, /* "'nil'" */
2727 YYSYMBOL_keyword_true = 35, /* "'true'" */
2728 YYSYMBOL_keyword_false = 36, /* "'false'" */
2729 YYSYMBOL_keyword_and = 37, /* "'and'" */
2730 YYSYMBOL_keyword_or = 38, /* "'or'" */
2731 YYSYMBOL_keyword_not = 39, /* "'not'" */
2732 YYSYMBOL_modifier_if = 40, /* "'if' modifier" */
2733 YYSYMBOL_modifier_unless = 41, /* "'unless' modifier" */
2734 YYSYMBOL_modifier_while = 42, /* "'while' modifier" */
2735 YYSYMBOL_modifier_until = 43, /* "'until' modifier" */
2736 YYSYMBOL_modifier_rescue = 44, /* "'rescue' modifier" */
2737 YYSYMBOL_keyword_alias = 45, /* "'alias'" */
2738 YYSYMBOL_keyword_defined = 46, /* "'defined?'" */
2739 YYSYMBOL_keyword_BEGIN = 47, /* "'BEGIN'" */
2740 YYSYMBOL_keyword_END = 48, /* "'END'" */
2741 YYSYMBOL_keyword__LINE__ = 49, /* "'__LINE__'" */
2742 YYSYMBOL_keyword__FILE__ = 50, /* "'__FILE__'" */
2743 YYSYMBOL_keyword__ENCODING__ = 51, /* "'__ENCODING__'" */
2744 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
2745 YYSYMBOL_tFID = 53, /* "method" */
2746 YYSYMBOL_tGVAR = 54, /* "global variable" */
2747 YYSYMBOL_tIVAR = 55, /* "instance variable" */
2748 YYSYMBOL_tCONSTANT = 56, /* "constant" */
2749 YYSYMBOL_tCVAR = 57, /* "class variable" */
2750 YYSYMBOL_tLABEL = 58, /* "label" */
2751 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
2752 YYSYMBOL_tFLOAT = 60, /* "float literal" */
2753 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
2754 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
2755 YYSYMBOL_tCHAR = 63, /* "char literal" */
2756 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
2757 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
2758 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
2759 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
2760 YYSYMBOL_tDUMNY_END = 68, /* "dummy end" */
2761 YYSYMBOL_69_ = 69, /* '.' */
2762 YYSYMBOL_70_backslash_ = 70, /* "backslash" */
2763 YYSYMBOL_tSP = 71, /* "escaped space" */
2764 YYSYMBOL_72_escaped_horizontal_tab_ = 72, /* "escaped horizontal tab" */
2765 YYSYMBOL_73_escaped_form_feed_ = 73, /* "escaped form feed" */
2766 YYSYMBOL_74_escaped_carriage_return_ = 74, /* "escaped carriage return" */
2767 YYSYMBOL_75_escaped_vertical_tab_ = 75, /* "escaped vertical tab" */
2768 YYSYMBOL_tUPLUS = 76, /* "unary+" */
2769 YYSYMBOL_tUMINUS = 77, /* "unary-" */
2770 YYSYMBOL_tPOW = 78, /* "**" */
2771 YYSYMBOL_tCMP = 79, /* "<=>" */
2772 YYSYMBOL_tEQ = 80, /* "==" */
2773 YYSYMBOL_tEQQ = 81, /* "===" */
2774 YYSYMBOL_tNEQ = 82, /* "!=" */
2775 YYSYMBOL_tGEQ = 83, /* ">=" */
2776 YYSYMBOL_tLEQ = 84, /* "<=" */
2777 YYSYMBOL_tANDOP = 85, /* "&&" */
2778 YYSYMBOL_tOROP = 86, /* "||" */
2779 YYSYMBOL_tMATCH = 87, /* "=~" */
2780 YYSYMBOL_tNMATCH = 88, /* "!~" */
2781 YYSYMBOL_tDOT2 = 89, /* ".." */
2782 YYSYMBOL_tDOT3 = 90, /* "..." */
2783 YYSYMBOL_tBDOT2 = 91, /* "(.." */
2784 YYSYMBOL_tBDOT3 = 92, /* "(..." */
2785 YYSYMBOL_tAREF = 93, /* "[]" */
2786 YYSYMBOL_tASET = 94, /* "[]=" */
2787 YYSYMBOL_tLSHFT = 95, /* "<<" */
2788 YYSYMBOL_tRSHFT = 96, /* ">>" */
2789 YYSYMBOL_tANDDOT = 97, /* "&." */
2790 YYSYMBOL_tCOLON2 = 98, /* "::" */
2791 YYSYMBOL_tCOLON3 = 99, /* ":: at EXPR_BEG" */
2792 YYSYMBOL_tOP_ASGN = 100, /* "operator-assignment" */
2793 YYSYMBOL_tASSOC = 101, /* "=>" */
2794 YYSYMBOL_tLPAREN = 102, /* "(" */
2795 YYSYMBOL_tLPAREN_ARG = 103, /* "( arg" */
2796 YYSYMBOL_tRPAREN = 104, /* ")" */
2797 YYSYMBOL_tLBRACK = 105, /* "[" */
2798 YYSYMBOL_tLBRACE = 106, /* "{" */
2799 YYSYMBOL_tLBRACE_ARG = 107, /* "{ arg" */
2800 YYSYMBOL_tSTAR = 108, /* "*" */
2801 YYSYMBOL_tDSTAR = 109, /* "**arg" */
2802 YYSYMBOL_tAMPER = 110, /* "&" */
2803 YYSYMBOL_tLAMBDA = 111, /* "->" */
2804 YYSYMBOL_tSYMBEG = 112, /* "symbol literal" */
2805 YYSYMBOL_tSTRING_BEG = 113, /* "string literal" */
2806 YYSYMBOL_tXSTRING_BEG = 114, /* "backtick literal" */
2807 YYSYMBOL_tREGEXP_BEG = 115, /* "regexp literal" */
2808 YYSYMBOL_tWORDS_BEG = 116, /* "word list" */
2809 YYSYMBOL_tQWORDS_BEG = 117, /* "verbatim word list" */
2810 YYSYMBOL_tSYMBOLS_BEG = 118, /* "symbol list" */
2811 YYSYMBOL_tQSYMBOLS_BEG = 119, /* "verbatim symbol list" */
2812 YYSYMBOL_tSTRING_END = 120, /* "terminator" */
2813 YYSYMBOL_tSTRING_DEND = 121, /* "'}'" */
2814 YYSYMBOL_tSTRING_DBEG = 122, /* "'#{'" */
2815 YYSYMBOL_tSTRING_DVAR = 123, /* tSTRING_DVAR */
2816 YYSYMBOL_tLAMBEG = 124, /* tLAMBEG */
2817 YYSYMBOL_tLABEL_END = 125, /* tLABEL_END */
2818 YYSYMBOL_tIGNORED_NL = 126, /* tIGNORED_NL */
2819 YYSYMBOL_tCOMMENT = 127, /* tCOMMENT */
2820 YYSYMBOL_tEMBDOC_BEG = 128, /* tEMBDOC_BEG */
2821 YYSYMBOL_tEMBDOC = 129, /* tEMBDOC */
2822 YYSYMBOL_tEMBDOC_END = 130, /* tEMBDOC_END */
2823 YYSYMBOL_tHEREDOC_BEG = 131, /* tHEREDOC_BEG */
2824 YYSYMBOL_tHEREDOC_END = 132, /* tHEREDOC_END */
2825 YYSYMBOL_k__END__ = 133, /* k__END__ */
2826 YYSYMBOL_tLOWEST = 134, /* tLOWEST */
2827 YYSYMBOL_135_ = 135, /* '=' */
2828 YYSYMBOL_136_ = 136, /* '?' */
2829 YYSYMBOL_137_ = 137, /* ':' */
2830 YYSYMBOL_138_ = 138, /* '>' */
2831 YYSYMBOL_139_ = 139, /* '<' */
2832 YYSYMBOL_140_ = 140, /* '|' */
2833 YYSYMBOL_141_ = 141, /* '^' */
2834 YYSYMBOL_142_ = 142, /* '&' */
2835 YYSYMBOL_143_ = 143, /* '+' */
2836 YYSYMBOL_144_ = 144, /* '-' */
2837 YYSYMBOL_145_ = 145, /* '*' */
2838 YYSYMBOL_146_ = 146, /* '/' */
2839 YYSYMBOL_147_ = 147, /* '%' */
2840 YYSYMBOL_tUMINUS_NUM = 148, /* tUMINUS_NUM */
2841 YYSYMBOL_149_ = 149, /* '!' */
2842 YYSYMBOL_150_ = 150, /* '~' */
2843 YYSYMBOL_tLAST_TOKEN = 151, /* tLAST_TOKEN */
2844 YYSYMBOL_152_ = 152, /* '{' */
2845 YYSYMBOL_153_ = 153, /* '}' */
2846 YYSYMBOL_154_ = 154, /* '[' */
2847 YYSYMBOL_155_n_ = 155, /* '\n' */
2848 YYSYMBOL_156_ = 156, /* ',' */
2849 YYSYMBOL_157_ = 157, /* '`' */
2850 YYSYMBOL_158_ = 158, /* '(' */
2851 YYSYMBOL_159_ = 159, /* ')' */
2852 YYSYMBOL_160_ = 160, /* ']' */
2853 YYSYMBOL_161_ = 161, /* ';' */
2854 YYSYMBOL_162_ = 162, /* ' ' */
2855 YYSYMBOL_YYACCEPT = 163, /* $accept */
2856 YYSYMBOL_164_1 = 164, /* $@1 */
2857 YYSYMBOL_program = 165, /* program */
2858 YYSYMBOL_option_terms = 166, /* option_terms */
2859 YYSYMBOL_top_compstmt = 167, /* top_compstmt */
2860 YYSYMBOL_top_stmts = 168, /* top_stmts */
2861 YYSYMBOL_top_stmt = 169, /* top_stmt */
2862 YYSYMBOL_block_open = 170, /* block_open */
2863 YYSYMBOL_begin_block = 171, /* begin_block */
2864 YYSYMBOL_172_2 = 172, /* $@2 */
2865 YYSYMBOL_173_3 = 173, /* $@3 */
2866 YYSYMBOL_bodystmt = 174, /* bodystmt */
2867 YYSYMBOL_175_4 = 175, /* $@4 */
2868 YYSYMBOL_compstmt = 176, /* compstmt */
2869 YYSYMBOL_stmts = 177, /* stmts */
2870 YYSYMBOL_stmt_or_begin = 178, /* stmt_or_begin */
2871 YYSYMBOL_179_5 = 179, /* $@5 */
2872 YYSYMBOL_allow_exits = 180, /* allow_exits */
2873 YYSYMBOL_k_END = 181, /* k_END */
2874 YYSYMBOL_182_6 = 182, /* $@6 */
2875 YYSYMBOL_stmt = 183, /* stmt */
2876 YYSYMBOL_command_asgn = 184, /* command_asgn */
2877 YYSYMBOL_endless_command = 185, /* endless_command */
2878 YYSYMBOL_option__n_ = 186, /* option_'\n' */
2879 YYSYMBOL_command_rhs = 187, /* command_rhs */
2880 YYSYMBOL_expr = 188, /* expr */
2881 YYSYMBOL_189_7 = 189, /* $@7 */
2882 YYSYMBOL_190_8 = 190, /* $@8 */
2883 YYSYMBOL_def_name = 191, /* def_name */
2884 YYSYMBOL_defn_head = 192, /* defn_head */
2885 YYSYMBOL_193_9 = 193, /* $@9 */
2886 YYSYMBOL_defs_head = 194, /* defs_head */
2887 YYSYMBOL_expr_value = 195, /* expr_value */
2888 YYSYMBOL_196_10 = 196, /* $@10 */
2889 YYSYMBOL_197_11 = 197, /* $@11 */
2890 YYSYMBOL_expr_value_do = 198, /* expr_value_do */
2891 YYSYMBOL_command_call = 199, /* command_call */
2892 YYSYMBOL_block_command = 200, /* block_command */
2893 YYSYMBOL_cmd_brace_block = 201, /* cmd_brace_block */
2894 YYSYMBOL_fcall = 202, /* fcall */
2895 YYSYMBOL_command = 203, /* command */
2896 YYSYMBOL_mlhs = 204, /* mlhs */
2897 YYSYMBOL_mlhs_inner = 205, /* mlhs_inner */
2898 YYSYMBOL_mlhs_basic = 206, /* mlhs_basic */
2899 YYSYMBOL_mlhs_item = 207, /* mlhs_item */
2900 YYSYMBOL_mlhs_head = 208, /* mlhs_head */
2901 YYSYMBOL_mlhs_post = 209, /* mlhs_post */
2902 YYSYMBOL_mlhs_node = 210, /* mlhs_node */
2903 YYSYMBOL_lhs = 211, /* lhs */
2904 YYSYMBOL_cname = 212, /* cname */
2905 YYSYMBOL_cpath = 213, /* cpath */
2906 YYSYMBOL_fname = 214, /* fname */
2907 YYSYMBOL_fitem = 215, /* fitem */
2908 YYSYMBOL_undef_list = 216, /* undef_list */
2909 YYSYMBOL_217_12 = 217, /* $@12 */
2910 YYSYMBOL_op = 218, /* op */
2911 YYSYMBOL_reswords = 219, /* reswords */
2912 YYSYMBOL_arg = 220, /* arg */
2913 YYSYMBOL_endless_arg = 221, /* endless_arg */
2914 YYSYMBOL_relop = 222, /* relop */
2915 YYSYMBOL_rel_expr = 223, /* rel_expr */
2916 YYSYMBOL_lex_ctxt = 224, /* lex_ctxt */
2917 YYSYMBOL_begin_defined = 225, /* begin_defined */
2918 YYSYMBOL_after_rescue = 226, /* after_rescue */
2919 YYSYMBOL_arg_value = 227, /* arg_value */
2920 YYSYMBOL_aref_args = 228, /* aref_args */
2921 YYSYMBOL_arg_rhs = 229, /* arg_rhs */
2922 YYSYMBOL_paren_args = 230, /* paren_args */
2923 YYSYMBOL_opt_paren_args = 231, /* opt_paren_args */
2924 YYSYMBOL_opt_call_args = 232, /* opt_call_args */
2925 YYSYMBOL_call_args = 233, /* call_args */
2926 YYSYMBOL_234_13 = 234, /* $@13 */
2927 YYSYMBOL_command_args = 235, /* command_args */
2928 YYSYMBOL_block_arg = 236, /* block_arg */
2929 YYSYMBOL_opt_block_arg = 237, /* opt_block_arg */
2930 YYSYMBOL_args = 238, /* args */
2931 YYSYMBOL_arg_splat = 239, /* arg_splat */
2932 YYSYMBOL_mrhs_arg = 240, /* mrhs_arg */
2933 YYSYMBOL_mrhs = 241, /* mrhs */
2934 YYSYMBOL_primary = 242, /* primary */
2935 YYSYMBOL_243_14 = 243, /* $@14 */
2936 YYSYMBOL_244_15 = 244, /* $@15 */
2937 YYSYMBOL_245_16 = 245, /* @16 */
2938 YYSYMBOL_246_17 = 246, /* @17 */
2939 YYSYMBOL_247_18 = 247, /* $@18 */
2940 YYSYMBOL_248_19 = 248, /* $@19 */
2941 YYSYMBOL_249_20 = 249, /* $@20 */
2942 YYSYMBOL_250_21 = 250, /* $@21 */
2943 YYSYMBOL_251_22 = 251, /* $@22 */
2944 YYSYMBOL_primary_value = 252, /* primary_value */
2945 YYSYMBOL_k_begin = 253, /* k_begin */
2946 YYSYMBOL_k_if = 254, /* k_if */
2947 YYSYMBOL_k_unless = 255, /* k_unless */
2948 YYSYMBOL_k_while = 256, /* k_while */
2949 YYSYMBOL_k_until = 257, /* k_until */
2950 YYSYMBOL_k_case = 258, /* k_case */
2951 YYSYMBOL_k_for = 259, /* k_for */
2952 YYSYMBOL_k_class = 260, /* k_class */
2953 YYSYMBOL_k_module = 261, /* k_module */
2954 YYSYMBOL_k_def = 262, /* k_def */
2955 YYSYMBOL_k_do = 263, /* k_do */
2956 YYSYMBOL_k_do_block = 264, /* k_do_block */
2957 YYSYMBOL_k_rescue = 265, /* k_rescue */
2958 YYSYMBOL_k_ensure = 266, /* k_ensure */
2959 YYSYMBOL_k_when = 267, /* k_when */
2960 YYSYMBOL_k_else = 268, /* k_else */
2961 YYSYMBOL_k_elsif = 269, /* k_elsif */
2962 YYSYMBOL_k_end = 270, /* k_end */
2963 YYSYMBOL_k_return = 271, /* k_return */
2964 YYSYMBOL_k_yield = 272, /* k_yield */
2965 YYSYMBOL_then = 273, /* then */
2966 YYSYMBOL_do = 274, /* do */
2967 YYSYMBOL_if_tail = 275, /* if_tail */
2968 YYSYMBOL_opt_else = 276, /* opt_else */
2969 YYSYMBOL_for_var = 277, /* for_var */
2970 YYSYMBOL_f_marg = 278, /* f_marg */
2971 YYSYMBOL_f_marg_list = 279, /* f_marg_list */
2972 YYSYMBOL_f_margs = 280, /* f_margs */
2973 YYSYMBOL_f_rest_marg = 281, /* f_rest_marg */
2974 YYSYMBOL_f_any_kwrest = 282, /* f_any_kwrest */
2975 YYSYMBOL_283_23 = 283, /* $@23 */
2976 YYSYMBOL_f_eq = 284, /* f_eq */
2977 YYSYMBOL_f_kwarg_f_block_kw = 285, /* f_kwarg_f_block_kw */
2978 YYSYMBOL_block_args_tail = 286, /* block_args_tail */
2979 YYSYMBOL_excessed_comma = 287, /* excessed_comma */
2980 YYSYMBOL_f_opt_primary_value = 288, /* f_opt_primary_value */
2981 YYSYMBOL_f_optarg_primary_value = 289, /* f_optarg_primary_value */
2982 YYSYMBOL_opt_args_tail_block_args_tail = 290, /* opt_args_tail_block_args_tail */
2983 YYSYMBOL_block_param = 291, /* block_param */
2984 YYSYMBOL_opt_block_param = 292, /* opt_block_param */
2985 YYSYMBOL_block_param_def = 293, /* block_param_def */
2986 YYSYMBOL_opt_bv_decl = 294, /* opt_bv_decl */
2987 YYSYMBOL_bv_decls = 295, /* bv_decls */
2988 YYSYMBOL_bvar = 296, /* bvar */
2989 YYSYMBOL_max_numparam = 297, /* max_numparam */
2990 YYSYMBOL_numparam = 298, /* numparam */
2991 YYSYMBOL_it_id = 299, /* it_id */
2992 YYSYMBOL_300_24 = 300, /* @24 */
2993 YYSYMBOL_301_25 = 301, /* $@25 */
2994 YYSYMBOL_lambda = 302, /* lambda */
2995 YYSYMBOL_f_larglist = 303, /* f_larglist */
2996 YYSYMBOL_lambda_body = 304, /* lambda_body */
2997 YYSYMBOL_305_26 = 305, /* $@26 */
2998 YYSYMBOL_do_block = 306, /* do_block */
2999 YYSYMBOL_block_call = 307, /* block_call */
3000 YYSYMBOL_method_call = 308, /* method_call */
3001 YYSYMBOL_brace_block = 309, /* brace_block */
3002 YYSYMBOL_310_27 = 310, /* @27 */
3003 YYSYMBOL_brace_body = 311, /* brace_body */
3004 YYSYMBOL_312_28 = 312, /* @28 */
3005 YYSYMBOL_do_body = 313, /* do_body */
3006 YYSYMBOL_case_args = 314, /* case_args */
3007 YYSYMBOL_case_body = 315, /* case_body */
3008 YYSYMBOL_cases = 316, /* cases */
3009 YYSYMBOL_p_pvtbl = 317, /* p_pvtbl */
3010 YYSYMBOL_p_pktbl = 318, /* p_pktbl */
3011 YYSYMBOL_p_in_kwarg = 319, /* p_in_kwarg */
3012 YYSYMBOL_320_29 = 320, /* $@29 */
3013 YYSYMBOL_p_case_body = 321, /* p_case_body */
3014 YYSYMBOL_p_cases = 322, /* p_cases */
3015 YYSYMBOL_p_top_expr = 323, /* p_top_expr */
3016 YYSYMBOL_p_top_expr_body = 324, /* p_top_expr_body */
3017 YYSYMBOL_p_expr = 325, /* p_expr */
3018 YYSYMBOL_p_as = 326, /* p_as */
3019 YYSYMBOL_p_alt = 327, /* p_alt */
3020 YYSYMBOL_p_lparen = 328, /* p_lparen */
3021 YYSYMBOL_p_lbracket = 329, /* p_lbracket */
3022 YYSYMBOL_p_expr_basic = 330, /* p_expr_basic */
3023 YYSYMBOL_331_30 = 331, /* $@30 */
3024 YYSYMBOL_p_args = 332, /* p_args */
3025 YYSYMBOL_p_args_head = 333, /* p_args_head */
3026 YYSYMBOL_p_args_tail = 334, /* p_args_tail */
3027 YYSYMBOL_p_find = 335, /* p_find */
3028 YYSYMBOL_p_rest = 336, /* p_rest */
3029 YYSYMBOL_p_args_post = 337, /* p_args_post */
3030 YYSYMBOL_p_arg = 338, /* p_arg */
3031 YYSYMBOL_p_kwargs = 339, /* p_kwargs */
3032 YYSYMBOL_p_kwarg = 340, /* p_kwarg */
3033 YYSYMBOL_p_kw = 341, /* p_kw */
3034 YYSYMBOL_p_kw_label = 342, /* p_kw_label */
3035 YYSYMBOL_p_kwrest = 343, /* p_kwrest */
3036 YYSYMBOL_p_kwnorest = 344, /* p_kwnorest */
3037 YYSYMBOL_p_any_kwrest = 345, /* p_any_kwrest */
3038 YYSYMBOL_p_value = 346, /* p_value */
3039 YYSYMBOL_p_primitive = 347, /* p_primitive */
3040 YYSYMBOL_p_variable = 348, /* p_variable */
3041 YYSYMBOL_p_var_ref = 349, /* p_var_ref */
3042 YYSYMBOL_p_expr_ref = 350, /* p_expr_ref */
3043 YYSYMBOL_p_const = 351, /* p_const */
3044 YYSYMBOL_opt_rescue = 352, /* opt_rescue */
3045 YYSYMBOL_exc_list = 353, /* exc_list */
3046 YYSYMBOL_exc_var = 354, /* exc_var */
3047 YYSYMBOL_opt_ensure = 355, /* opt_ensure */
3048 YYSYMBOL_literal = 356, /* literal */
3049 YYSYMBOL_strings = 357, /* strings */
3050 YYSYMBOL_string = 358, /* string */
3051 YYSYMBOL_string1 = 359, /* string1 */
3052 YYSYMBOL_xstring = 360, /* xstring */
3053 YYSYMBOL_regexp = 361, /* regexp */
3054 YYSYMBOL_nonempty_list__ = 362, /* nonempty_list_' ' */
3055 YYSYMBOL_words_tWORDS_BEG_word_list = 363, /* words_tWORDS_BEG_word_list */
3056 YYSYMBOL_words = 364, /* words */
3057 YYSYMBOL_word_list = 365, /* word_list */
3058 YYSYMBOL_word = 366, /* word */
3059 YYSYMBOL_words_tSYMBOLS_BEG_symbol_list = 367, /* words_tSYMBOLS_BEG_symbol_list */
3060 YYSYMBOL_symbols = 368, /* symbols */
3061 YYSYMBOL_symbol_list = 369, /* symbol_list */
3062 YYSYMBOL_words_tQWORDS_BEG_qword_list = 370, /* words_tQWORDS_BEG_qword_list */
3063 YYSYMBOL_qwords = 371, /* qwords */
3064 YYSYMBOL_words_tQSYMBOLS_BEG_qsym_list = 372, /* words_tQSYMBOLS_BEG_qsym_list */
3065 YYSYMBOL_qsymbols = 373, /* qsymbols */
3066 YYSYMBOL_qword_list = 374, /* qword_list */
3067 YYSYMBOL_qsym_list = 375, /* qsym_list */
3068 YYSYMBOL_string_contents = 376, /* string_contents */
3069 YYSYMBOL_xstring_contents = 377, /* xstring_contents */
3070 YYSYMBOL_regexp_contents = 378, /* regexp_contents */
3071 YYSYMBOL_string_content = 379, /* string_content */
3072 YYSYMBOL_380_31 = 380, /* @31 */
3073 YYSYMBOL_381_32 = 381, /* @32 */
3074 YYSYMBOL_382_33 = 382, /* @33 */
3075 YYSYMBOL_383_34 = 383, /* @34 */
3076 YYSYMBOL_string_dend = 384, /* string_dend */
3077 YYSYMBOL_string_dvar = 385, /* string_dvar */
3078 YYSYMBOL_symbol = 386, /* symbol */
3079 YYSYMBOL_ssym = 387, /* ssym */
3080 YYSYMBOL_sym = 388, /* sym */
3081 YYSYMBOL_dsym = 389, /* dsym */
3082 YYSYMBOL_numeric = 390, /* numeric */
3083 YYSYMBOL_simple_numeric = 391, /* simple_numeric */
3084 YYSYMBOL_nonlocal_var = 392, /* nonlocal_var */
3085 YYSYMBOL_user_variable = 393, /* user_variable */
3086 YYSYMBOL_keyword_variable = 394, /* keyword_variable */
3087 YYSYMBOL_var_ref = 395, /* var_ref */
3088 YYSYMBOL_var_lhs = 396, /* var_lhs */
3089 YYSYMBOL_backref = 397, /* backref */
3090 YYSYMBOL_398_35 = 398, /* $@35 */
3091 YYSYMBOL_superclass = 399, /* superclass */
3092 YYSYMBOL_f_opt_paren_args = 400, /* f_opt_paren_args */
3093 YYSYMBOL_f_paren_args = 401, /* f_paren_args */
3094 YYSYMBOL_f_arglist = 402, /* f_arglist */
3095 YYSYMBOL_403_36 = 403, /* @36 */
3096 YYSYMBOL_f_kwarg_f_kw = 404, /* f_kwarg_f_kw */
3097 YYSYMBOL_args_tail = 405, /* args_tail */
3098 YYSYMBOL_f_opt_arg_value = 406, /* f_opt_arg_value */
3099 YYSYMBOL_f_optarg_arg_value = 407, /* f_optarg_arg_value */
3100 YYSYMBOL_opt_args_tail_args_tail = 408, /* opt_args_tail_args_tail */
3101 YYSYMBOL_f_args = 409, /* f_args */
3102 YYSYMBOL_args_forward = 410, /* args_forward */
3103 YYSYMBOL_f_bad_arg = 411, /* f_bad_arg */
3104 YYSYMBOL_f_norm_arg = 412, /* f_norm_arg */
3105 YYSYMBOL_f_arg_asgn = 413, /* f_arg_asgn */
3106 YYSYMBOL_f_arg_item = 414, /* f_arg_item */
3107 YYSYMBOL_f_arg = 415, /* f_arg */
3108 YYSYMBOL_f_label = 416, /* f_label */
3109 YYSYMBOL_f_kw = 417, /* f_kw */
3110 YYSYMBOL_f_block_kw = 418, /* f_block_kw */
3111 YYSYMBOL_kwrest_mark = 419, /* kwrest_mark */
3112 YYSYMBOL_f_no_kwarg = 420, /* f_no_kwarg */
3113 YYSYMBOL_f_kwrest = 421, /* f_kwrest */
3114 YYSYMBOL_restarg_mark = 422, /* restarg_mark */
3115 YYSYMBOL_f_rest_arg = 423, /* f_rest_arg */
3116 YYSYMBOL_blkarg_mark = 424, /* blkarg_mark */
3117 YYSYMBOL_f_block_arg = 425, /* f_block_arg */
3118 YYSYMBOL_opt_f_block_arg = 426, /* opt_f_block_arg */
3119 YYSYMBOL_singleton = 427, /* singleton */
3120 YYSYMBOL_428_37 = 428, /* $@37 */
3121 YYSYMBOL_assoc_list = 429, /* assoc_list */
3122 YYSYMBOL_assocs = 430, /* assocs */
3123 YYSYMBOL_assoc = 431, /* assoc */
3124 YYSYMBOL_operation = 432, /* operation */
3125 YYSYMBOL_operation2 = 433, /* operation2 */
3126 YYSYMBOL_operation3 = 434, /* operation3 */
3127 YYSYMBOL_dot_or_colon = 435, /* dot_or_colon */
3128 YYSYMBOL_call_op = 436, /* call_op */
3129 YYSYMBOL_call_op2 = 437, /* call_op2 */
3130 YYSYMBOL_rparen = 438, /* rparen */
3131 YYSYMBOL_rbracket = 439, /* rbracket */
3132 YYSYMBOL_rbrace = 440, /* rbrace */
3133 YYSYMBOL_trailer = 441, /* trailer */
3134 YYSYMBOL_term = 442, /* term */
3135 YYSYMBOL_terms = 443, /* terms */
3136 YYSYMBOL_none = 444 /* none */
3137};
3138typedef enum yysymbol_kind_t yysymbol_kind_t;
3139
3140
3141
3142
3143#ifdef short
3144# undef short
3145#endif
3146
3147/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
3148 <limits.h> and (if available) <stdint.h> are included
3149 so that the code can choose integer types of a good width. */
3150
3151#ifndef __PTRDIFF_MAX__
3152# include <limits.h> /* INFRINGES ON USER NAME SPACE */
3153# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
3154# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
3155# define YY_STDINT_H
3156# endif
3157#endif
3158
3159/* Narrow types that promote to a signed type and that can represent a
3160 signed or unsigned integer of at least N bits. In tables they can
3161 save space and decrease cache pressure. Promoting to a signed type
3162 helps avoid bugs in integer arithmetic. */
3163
3164#ifdef __INT_LEAST8_MAX__
3165typedef __INT_LEAST8_TYPE__ yytype_int8;
3166#elif defined YY_STDINT_H
3167typedef int_least8_t yytype_int8;
3168#else
3169typedef signed char yytype_int8;
3170#endif
3171
3172#ifdef __INT_LEAST16_MAX__
3173typedef __INT_LEAST16_TYPE__ yytype_int16;
3174#elif defined YY_STDINT_H
3175typedef int_least16_t yytype_int16;
3176#else
3177typedef short yytype_int16;
3178#endif
3179
3180/* Work around bug in HP-UX 11.23, which defines these macros
3181 incorrectly for preprocessor constants. This workaround can likely
3182 be removed in 2023, as HPE has promised support for HP-UX 11.23
3183 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
3184 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
3185#ifdef __hpux
3186# undef UINT_LEAST8_MAX
3187# undef UINT_LEAST16_MAX
3188# define UINT_LEAST8_MAX 255
3189# define UINT_LEAST16_MAX 65535
3190#endif
3191
3192#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
3193typedef __UINT_LEAST8_TYPE__ yytype_uint8;
3194#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
3195 && UINT_LEAST8_MAX <= INT_MAX)
3196typedef uint_least8_t yytype_uint8;
3197#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
3198typedef unsigned char yytype_uint8;
3199#else
3200typedef short yytype_uint8;
3201#endif
3202
3203#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
3204typedef __UINT_LEAST16_TYPE__ yytype_uint16;
3205#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
3206 && UINT_LEAST16_MAX <= INT_MAX)
3207typedef uint_least16_t yytype_uint16;
3208#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
3209typedef unsigned short yytype_uint16;
3210#else
3211typedef int yytype_uint16;
3212#endif
3213
3214#ifndef YYPTRDIFF_T
3215# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
3216# define YYPTRDIFF_T __PTRDIFF_TYPE__
3217# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
3218# elif defined PTRDIFF_MAX
3219# ifndef ptrdiff_t
3220# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
3221# endif
3222# define YYPTRDIFF_T ptrdiff_t
3223# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
3224# else
3225# define YYPTRDIFF_T long
3226# define YYPTRDIFF_MAXIMUM LONG_MAX
3227# endif
3228#endif
3229
3230#ifndef YYSIZE_T
3231# ifdef __SIZE_TYPE__
3232# define YYSIZE_T __SIZE_TYPE__
3233# elif defined size_t
3234# define YYSIZE_T size_t
3235# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
3236# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
3237# define YYSIZE_T size_t
3238# else
3239# define YYSIZE_T unsigned
3240# endif
3241#endif
3242
3243#define YYSIZE_MAXIMUM \
3244 YY_CAST (YYPTRDIFF_T, \
3245 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
3246 ? YYPTRDIFF_MAXIMUM \
3247 : YY_CAST (YYSIZE_T, -1)))
3248
3249#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
3250
3251
3252/* Stored state numbers (used for stacks). */
3253typedef yytype_int16 yy_state_t;
3254
3255/* State numbers in computations. */
3256typedef int yy_state_fast_t;
3257
3258#ifndef YY_
3259# if defined YYENABLE_NLS && YYENABLE_NLS
3260# if ENABLE_NLS
3261# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
3262# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
3263# endif
3264# endif
3265# ifndef YY_
3266# define YY_(Msgid) Msgid
3267# endif
3268#endif
3269
3270
3271#ifndef YY_ATTRIBUTE_PURE
3272# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
3273# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
3274# else
3275# define YY_ATTRIBUTE_PURE
3276# endif
3277#endif
3278
3279#ifndef YY_ATTRIBUTE_UNUSED
3280# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
3281# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
3282# else
3283# define YY_ATTRIBUTE_UNUSED
3284# endif
3285#endif
3286
3287/* Suppress unused-variable warnings by "using" E. */
3288#if ! defined lint || defined __GNUC__
3289# define YY_USE(E) ((void) (E))
3290#else
3291# define YY_USE(E) /* empty */
3292#endif
3293
3294/* Suppress an incorrect diagnostic about yylval being uninitialized. */
3295#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
3296# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
3297# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
3298 _Pragma ("GCC diagnostic push") \
3299 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
3300# else
3301# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
3302 _Pragma ("GCC diagnostic push") \
3303 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
3304 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
3305# endif
3306# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
3307 _Pragma ("GCC diagnostic pop")
3308#else
3309# define YY_INITIAL_VALUE(Value) Value
3310#endif
3311#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3312# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3313# define YY_IGNORE_MAYBE_UNINITIALIZED_END
3314#endif
3315#ifndef YY_INITIAL_VALUE
3316# define YY_INITIAL_VALUE(Value) /* Nothing. */
3317#endif
3318
3319#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
3320# define YY_IGNORE_USELESS_CAST_BEGIN \
3321 _Pragma ("GCC diagnostic push") \
3322 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
3323# define YY_IGNORE_USELESS_CAST_END \
3324 _Pragma ("GCC diagnostic pop")
3325#endif
3326#ifndef YY_IGNORE_USELESS_CAST_BEGIN
3327# define YY_IGNORE_USELESS_CAST_BEGIN
3328# define YY_IGNORE_USELESS_CAST_END
3329#endif
3330
3331
3332#define YY_ASSERT(E) ((void) (0 && (E)))
3333
3334#if 1
3335
3336/* The parser invokes alloca or malloc; define the necessary symbols. */
3337
3338# ifdef YYSTACK_USE_ALLOCA
3339# if YYSTACK_USE_ALLOCA
3340# ifdef __GNUC__
3341# define YYSTACK_ALLOC __builtin_alloca
3342# elif defined __BUILTIN_VA_ARG_INCR
3343# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
3344# elif defined _AIX
3345# define YYSTACK_ALLOC __alloca
3346# elif defined _MSC_VER
3347# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
3348# define alloca _alloca
3349# else
3350# define YYSTACK_ALLOC alloca
3351# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
3352# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
3353 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
3354# ifndef EXIT_SUCCESS
3355# define EXIT_SUCCESS 0
3356# endif
3357# endif
3358# endif
3359# endif
3360# endif
3361
3362# ifdef YYSTACK_ALLOC
3363 /* Pacify GCC's 'empty if-body' warning. */
3364# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
3365# ifndef YYSTACK_ALLOC_MAXIMUM
3366 /* The OS might guarantee only one guard page at the bottom of the stack,
3367 and a page size can be as small as 4096 bytes. So we cannot safely
3368 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
3369 to allow for a few compiler-allocated temporary stack slots. */
3370# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
3371# endif
3372# else
3373# define YYSTACK_ALLOC YYMALLOC
3374# define YYSTACK_FREE YYFREE
3375# ifndef YYSTACK_ALLOC_MAXIMUM
3376# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
3377# endif
3378# if (defined __cplusplus && ! defined EXIT_SUCCESS \
3379 && ! ((defined YYMALLOC || defined malloc) \
3380 && (defined YYFREE || defined free)))
3381# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
3382# ifndef EXIT_SUCCESS
3383# define EXIT_SUCCESS 0
3384# endif
3385# endif
3386# ifndef YYMALLOC
3387# define YYMALLOC malloc
3388# if ! defined malloc && ! defined EXIT_SUCCESS
3389void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
3390# endif
3391# endif
3392# ifndef YYFREE
3393# define YYFREE free
3394# if ! defined free && ! defined EXIT_SUCCESS
3395void free (void *); /* INFRINGES ON USER NAME SPACE */
3396# endif
3397# endif
3398# endif
3399#endif /* 1 */
3400
3401#if (! defined yyoverflow \
3402 && (! defined __cplusplus \
3403 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
3404 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
3405
3406/* A type that is properly aligned for any stack member. */
3407union yyalloc
3408{
3409 yy_state_t yyss_alloc;
3410 YYSTYPE yyvs_alloc;
3411 YYLTYPE yyls_alloc;
3412};
3413
3414/* The size of the maximum gap between one aligned stack and the next. */
3415# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
3416
3417/* The size of an array large to enough to hold all stacks, each with
3418 N elements. */
3419# define YYSTACK_BYTES(N) \
3420 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
3421 + YYSIZEOF (YYLTYPE)) \
3422 + 2 * YYSTACK_GAP_MAXIMUM)
3423
3424# define YYCOPY_NEEDED 1
3425
3426/* Relocate STACK from its old location to the new one. The
3427 local variables YYSIZE and YYSTACKSIZE give the old and new number of
3428 elements in the stack, and YYPTR gives the new location of the
3429 stack. Advance YYPTR to a properly aligned location for the next
3430 stack. */
3431# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
3432 do \
3433 { \
3434 YYPTRDIFF_T yynewbytes; \
3435 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
3436 Stack = &yyptr->Stack_alloc; \
3437 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
3438 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
3439 } \
3440 while (0)
3441
3442#endif
3443
3444#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
3445/* Copy COUNT objects from SRC to DST. The source and destination do
3446 not overlap. */
3447# ifndef YYCOPY
3448# if defined __GNUC__ && 1 < __GNUC__
3449# define YYCOPY(Dst, Src, Count) \
3450 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
3451# else
3452# define YYCOPY(Dst, Src, Count) \
3453 do \
3454 { \
3455 YYPTRDIFF_T yyi; \
3456 for (yyi = 0; yyi < (Count); yyi++) \
3457 (Dst)[yyi] = (Src)[yyi]; \
3458 } \
3459 while (0)
3460# endif
3461# endif
3462#endif /* !YYCOPY_NEEDED */
3463
3464/* YYFINAL -- State number of the termination state. */
3465#define YYFINAL 134
3466/* YYLAST -- Last index in YYTABLE. */
3467#define YYLAST 15506
3468
3469/* YYNTOKENS -- Number of terminals. */
3470#define YYNTOKENS 163
3471/* YYNNTS -- Number of nonterminals. */
3472#define YYNNTS 282
3473/* YYNRULES -- Number of rules. */
3474#define YYNRULES 788
3475/* YYNSTATES -- Number of states. */
3476#define YYNSTATES 1349
3477
3478/* YYMAXUTOK -- Last valid token kind. */
3479#define YYMAXUTOK 362
3480
3481
3482/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
3483 as returned by yylex, with out-of-bounds checking. */
3484#define YYTRANSLATE(YYX) \
3485 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
3486 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
3487 : YYSYMBOL_YYUNDEF)
3488
3489/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
3490 as returned by yylex. */
3491static const yytype_uint8 yytranslate[] =
3492{
3493 0, 2, 2, 2, 2, 2, 2, 2, 2, 72,
3494 155, 75, 73, 74, 2, 2, 2, 2, 2, 2,
3495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3496 2, 2, 162, 149, 2, 2, 2, 147, 142, 2,
3497 158, 159, 145, 143, 156, 144, 69, 146, 2, 2,
3498 2, 2, 2, 2, 2, 2, 2, 2, 137, 161,
3499 139, 135, 138, 136, 2, 2, 2, 2, 2, 2,
3500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3502 2, 154, 70, 160, 141, 2, 157, 2, 2, 2,
3503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3505 2, 2, 2, 152, 140, 153, 150, 2, 89, 90,
3506 91, 92, 76, 77, 78, 79, 95, 96, 84, 83,
3507 80, 81, 82, 87, 88, 93, 94, 98, 85, 86,
3508 97, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3518 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
3519 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
3520 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
3521 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
3522 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
3523 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
3524 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
3525 65, 66, 67, 68, 71, 99, 100, 101, 102, 103,
3526 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
3527 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
3528 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
3529 134, 148, 151
3530};
3531
3532#if YYDEBUG
3533/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
3534static const yytype_int16 yyrline[] =
3535{
3536 0, 2967, 2967, 2967, 2993, 2993, 2993, 2999, 3004, 3009,
3537 3016, 3021, 3028, 3030, 3044, 3049, 3040, 3060, 3057, 3070,
3538 3076, 3081, 3086, 3093, 3098, 3097, 3107, 3109, 3116, 3116,
3539 3121, 3126, 3134, 3143, 3150, 3156, 3162, 3173, 3184, 3193,
3540 3206, 3207, 3213, 3218, 3229, 3234, 3235, 3242, 3247, 3252,
3541 3258, 3258, 3263, 3269, 3274, 3285, 3296, 3304, 3305, 3311,
3542 3311, 3311, 3318, 3323, 3331, 3334, 3335, 3340, 3345, 3350,
3543 3356, 3355, 3369, 3368, 3381, 3384, 3396, 3406, 3405, 3419,
3544 3424, 3430, 3430, 3430, 3437, 3438, 3441, 3442, 3449, 3457,
3545 3464, 3471, 3480, 3485, 3490, 3495, 3500, 3506, 3512, 3518,
3546 3523, 3530, 3539, 3540, 3547, 3548, 3555, 3560, 3565, 3570,
3547 3575, 3580, 3585, 3590, 3595, 3600, 3607, 3608, 3615, 3620,
3548 3627, 3632, 3639, 3639, 3644, 3649, 3655, 3660, 3666, 3671,
3549 3676, 3684, 3684, 3689, 3694, 3699, 3704, 3709, 3714, 3719,
3550 3727, 3735, 3738, 3743, 3748, 3755, 3755, 3756, 3757, 3762,
3551 3765, 3770, 3773, 3778, 3778, 3786, 3787, 3788, 3789, 3790,
3552 3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800,
3553 3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810,
3554 3811, 3812, 3813, 3814, 3815, 3818, 3818, 3818, 3819, 3819,
3555 3820, 3820, 3820, 3821, 3821, 3821, 3821, 3822, 3822, 3822,
3556 3822, 3823, 3823, 3823, 3824, 3824, 3824, 3824, 3825, 3825,
3557 3825, 3825, 3826, 3826, 3826, 3826, 3827, 3827, 3827, 3827,
3558 3828, 3828, 3828, 3828, 3829, 3829, 3832, 3837, 3842, 3847,
3559 3852, 3857, 3862, 3868, 3874, 3880, 3887, 3894, 3900, 3906,
3560 3912, 3918, 3923, 3928, 3933, 3938, 3943, 3948, 3953, 3958,
3561 3963, 3968, 3973, 3978, 3983, 3984, 3989, 3994, 3999, 4004,
3562 4009, 4014, 4019, 4024, 4029, 4034, 4039, 4045, 4052, 4063,
3563 4074, 4080, 4081, 4087, 4094, 4095, 4096, 4097, 4100, 4105,
3564 4113, 4119, 4126, 4133, 4140, 4141, 4145, 4150, 4157, 4162,
3565 4171, 4176, 4186, 4198, 4199, 4205, 4206, 4207, 4211, 4216,
3566 4223, 4229, 4234, 4240, 4246, 4250, 4250, 4288, 4293, 4301,
3567 4306, 4314, 4319, 4324, 4329, 4337, 4342, 4351, 4352, 4356,
3568 4361, 4366, 4384, 4384, 4384, 4384, 4384, 4384, 4384, 4384,
3569 4385, 4386, 4387, 4393, 4392, 4405, 4405, 4411, 4417, 4422,
3570 4427, 4432, 4438, 4443, 4448, 4453, 4458, 4464, 4469, 4474,
3571 4479, 4480, 4486, 4487, 4496, 4505, 4514, 4524, 4523, 4538,
3572 4537, 4550, 4557, 4600, 4599, 4617, 4616, 4636, 4635, 4654,
3573 4652, 4669, 4667, 4682, 4687, 4692, 4697, 4712, 4719, 4726,
3574 4744, 4751, 4759, 4767, 4774, 4782, 4791, 4800, 4808, 4815,
3575 4822, 4830, 4837, 4843, 4858, 4865, 4870, 4876, 4883, 4890,
3576 4891, 4892, 4895, 4896, 4899, 4900, 4910, 4911, 4918, 4919,
3577 4922, 4927, 4934, 4939, 4946, 4951, 4956, 4961, 4966, 4973,
3578 4979, 4986, 4987, 4994, 4994, 4996, 4996, 4996, 5001, 5006,
3579 5011, 5018, 5026, 5026, 5026, 5026, 5026, 5026, 5031, 5036,
3580 5041, 5046, 5051, 5057, 5062, 5067, 5072, 5077, 5082, 5087,
3581 5092, 5097, 5104, 5105, 5111, 5118, 5128, 5133, 5140, 5142,
3582 5146, 5151, 5157, 5163, 5168, 5175, 5181, 5174, 5207, 5214,
3583 5223, 5230, 5229, 5240, 5248, 5260, 5270, 5279, 5286, 5293,
3584 5304, 5310, 5315, 5321, 5327, 5332, 5337, 5345, 5351, 5359,
3585 5359, 5376, 5376, 5397, 5403, 5408, 5414, 5421, 5431, 5432,
3586 5435, 5436, 5438, 5449, 5446, 5462, 5463, 5466, 5467, 5473,
3587 5481, 5482, 5488, 5494, 5499, 5504, 5511, 5514, 5521, 5524,
3588 5529, 5532, 5539, 5546, 5547, 5548, 5555, 5562, 5569, 5575,
3589 5582, 5589, 5596, 5602, 5607, 5612, 5619, 5618, 5629, 5635,
3590 5643, 5649, 5654, 5659, 5664, 5669, 5672, 5676, 5683, 5688,
3591 5695, 5703, 5709, 5716, 5717, 5724, 5731, 5736, 5741, 5746,
3592 5753, 5755, 5762, 5768, 5780, 5781, 5796, 5801, 5808, 5814,
3593 5815, 5822, 5823, 5830, 5837, 5843, 5849, 5850, 5851, 5852,
3594 5858, 5866, 5866, 5866, 5866, 5866, 5866, 5866, 5866, 5867,
3595 5872, 5875, 5883, 5895, 5902, 5909, 5914, 5919, 5926, 5947,
3596 5950, 5955, 5959, 5962, 5967, 5970, 5977, 5980, 5981, 5984,
3597 5998, 5999, 6000, 6007, 6020, 6032, 6039, 6039, 6039, 6039,
3598 6043, 6047, 6054, 6056, 6063, 6063, 6067, 6071, 6078, 6078,
3599 6081, 6081, 6085, 6089, 6097, 6101, 6109, 6113, 6121, 6125,
3600 6133, 6137, 6163, 6166, 6165, 6180, 6188, 6192, 6179, 6211,
3601 6212, 6215, 6220, 6223, 6224, 6227, 6243, 6244, 6247, 6255,
3602 6256, 6264, 6265, 6266, 6267, 6270, 6271, 6272, 6275, 6275,
3603 6276, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6288, 6298,
3604 6305, 6305, 6312, 6313, 6317, 6316, 6327, 6333, 6334, 6343,
3605 6353, 6354, 6354, 6371, 6371, 6371, 6376, 6381, 6386, 6391,
3606 6408, 6408, 6408, 6408, 6408, 6408, 6413, 6418, 6423, 6428,
3607 6433, 6438, 6443, 6448, 6453, 6458, 6463, 6468, 6473, 6479,
3608 6486, 6497, 6506, 6515, 6524, 6535, 6536, 6546, 6554, 6559,
3609 6578, 6580, 6591, 6611, 6617, 6625, 6631, 6639, 6640, 6643,
3610 6649, 6655, 6663, 6664, 6667, 6673, 6681, 6682, 6685, 6691,
3611 6699, 6704, 6711, 6717, 6716, 6754, 6755, 6762, 6764, 6789,
3612 6794, 6799, 6806, 6812, 6817, 6826, 6826, 6827, 6830, 6831,
3613 6834, 6835, 6836, 6839, 6840, 6843, 6844, 6847, 6848, 6851,
3614 6854, 6857, 6860, 6861, 6864, 6865, 6872, 6873, 6877
3615};
3616#endif
3617
3619#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
3620
3621#if 1
3622/* The user-facing name of the symbol whose (internal) number is
3623 YYSYMBOL. No bounds checking. */
3624static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
3625
3626/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
3627 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
3628static const char *const yytname[] =
3629{
3630 "\"end-of-input\"", "error", "\"invalid token\"", "\"'class'\"",
3631 "\"'module'\"", "\"'def'\"", "\"'undef'\"", "\"'begin'\"",
3632 "\"'rescue'\"", "\"'ensure'\"", "\"'end'\"", "\"'if'\"", "\"'unless'\"",
3633 "\"'then'\"", "\"'elsif'\"", "\"'else'\"", "\"'case'\"", "\"'when'\"",
3634 "\"'while'\"", "\"'until'\"", "\"'for'\"", "\"'break'\"", "\"'next'\"",
3635 "\"'redo'\"", "\"'retry'\"", "\"'in'\"", "\"'do'\"",
3636 "\"'do' for condition\"", "\"'do' for block\"", "\"'do' for lambda\"",
3637 "\"'return'\"", "\"'yield'\"", "\"'super'\"", "\"'self'\"", "\"'nil'\"",
3638 "\"'true'\"", "\"'false'\"", "\"'and'\"", "\"'or'\"", "\"'not'\"",
3639 "\"'if' modifier\"", "\"'unless' modifier\"", "\"'while' modifier\"",
3640 "\"'until' modifier\"", "\"'rescue' modifier\"", "\"'alias'\"",
3641 "\"'defined?'\"", "\"'BEGIN'\"", "\"'END'\"", "\"'__LINE__'\"",
3642 "\"'__FILE__'\"", "\"'__ENCODING__'\"", "\"local variable or method\"",
3643 "\"method\"", "\"global variable\"", "\"instance variable\"",
3644 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
3645 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
3646 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
3647 "\"literal content\"", "tREGEXP_END", "\"dummy end\"", "'.'",
3648 "\"backslash\"", "\"escaped space\"", "\"escaped horizontal tab\"",
3649 "\"escaped form feed\"", "\"escaped carriage return\"",
3650 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
3651 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
3652 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
3653 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
3654 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
3655 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
3656 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
3657 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
3658 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
3659 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "\"'#{'\"",
3660 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tIGNORED_NL", "tCOMMENT",
3661 "tEMBDOC_BEG", "tEMBDOC", "tEMBDOC_END", "tHEREDOC_BEG", "tHEREDOC_END",
3662 "k__END__", "tLOWEST", "'='", "'?'", "':'", "'>'", "'<'", "'|'", "'^'",
3663 "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "tUMINUS_NUM", "'!'", "'~'",
3664 "tLAST_TOKEN", "'{'", "'}'", "'['", "'\\n'", "','", "'`'", "'('", "')'",
3665 "']'", "';'", "' '", "$accept", "$@1", "program", "option_terms",
3666 "top_compstmt", "top_stmts", "top_stmt", "block_open", "begin_block",
3667 "$@2", "$@3", "bodystmt", "$@4", "compstmt", "stmts", "stmt_or_begin",
3668 "$@5", "allow_exits", "k_END", "$@6", "stmt", "command_asgn",
3669 "endless_command", "option_'\\n'", "command_rhs", "expr", "$@7", "$@8",
3670 "def_name", "defn_head", "$@9", "defs_head", "expr_value", "$@10",
3671 "$@11", "expr_value_do", "command_call", "block_command",
3672 "cmd_brace_block", "fcall", "command", "mlhs", "mlhs_inner",
3673 "mlhs_basic", "mlhs_item", "mlhs_head", "mlhs_post", "mlhs_node", "lhs",
3674 "cname", "cpath", "fname", "fitem", "undef_list", "$@12", "op",
3675 "reswords", "arg", "endless_arg", "relop", "rel_expr", "lex_ctxt",
3676 "begin_defined", "after_rescue", "arg_value", "aref_args", "arg_rhs",
3677 "paren_args", "opt_paren_args", "opt_call_args", "call_args", "$@13",
3678 "command_args", "block_arg", "opt_block_arg", "args", "arg_splat",
3679 "mrhs_arg", "mrhs", "primary", "$@14", "$@15", "@16", "@17", "$@18",
3680 "$@19", "$@20", "$@21", "$@22", "primary_value", "k_begin", "k_if",
3681 "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
3682 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
3683 "k_when", "k_else", "k_elsif", "k_end", "k_return", "k_yield", "then",
3684 "do", "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list",
3685 "f_margs", "f_rest_marg", "f_any_kwrest", "$@23", "f_eq",
3686 "f_kwarg_f_block_kw", "block_args_tail", "excessed_comma",
3687 "f_opt_primary_value", "f_optarg_primary_value",
3688 "opt_args_tail_block_args_tail", "block_param", "opt_block_param",
3689 "block_param_def", "opt_bv_decl", "bv_decls", "bvar", "max_numparam",
3690 "numparam", "it_id", "@24", "$@25", "lambda", "f_larglist",
3691 "lambda_body", "$@26", "do_block", "block_call", "method_call",
3692 "brace_block", "@27", "brace_body", "@28", "do_body", "case_args",
3693 "case_body", "cases", "p_pvtbl", "p_pktbl", "p_in_kwarg", "$@29",
3694 "p_case_body", "p_cases", "p_top_expr", "p_top_expr_body", "p_expr",
3695 "p_as", "p_alt", "p_lparen", "p_lbracket", "p_expr_basic", "$@30",
3696 "p_args", "p_args_head", "p_args_tail", "p_find", "p_rest",
3697 "p_args_post", "p_arg", "p_kwargs", "p_kwarg", "p_kw", "p_kw_label",
3698 "p_kwrest", "p_kwnorest", "p_any_kwrest", "p_value", "p_primitive",
3699 "p_variable", "p_var_ref", "p_expr_ref", "p_const", "opt_rescue",
3700 "exc_list", "exc_var", "opt_ensure", "literal", "strings", "string",
3701 "string1", "xstring", "regexp", "nonempty_list_' '",
3702 "words_tWORDS_BEG_word_list", "words", "word_list", "word",
3703 "words_tSYMBOLS_BEG_symbol_list", "symbols", "symbol_list",
3704 "words_tQWORDS_BEG_qword_list", "qwords",
3705 "words_tQSYMBOLS_BEG_qsym_list", "qsymbols", "qword_list", "qsym_list",
3706 "string_contents", "xstring_contents", "regexp_contents",
3707 "string_content", "@31", "@32", "@33", "@34", "string_dend",
3708 "string_dvar", "symbol", "ssym", "sym", "dsym", "numeric",
3709 "simple_numeric", "nonlocal_var", "user_variable", "keyword_variable",
3710 "var_ref", "var_lhs", "backref", "$@35", "superclass",
3711 "f_opt_paren_args", "f_paren_args", "f_arglist", "@36", "f_kwarg_f_kw",
3712 "args_tail", "f_opt_arg_value", "f_optarg_arg_value",
3713 "opt_args_tail_args_tail", "f_args", "args_forward", "f_bad_arg",
3714 "f_norm_arg", "f_arg_asgn", "f_arg_item", "f_arg", "f_label", "f_kw",
3715 "f_block_kw", "kwrest_mark", "f_no_kwarg", "f_kwrest", "restarg_mark",
3716 "f_rest_arg", "blkarg_mark", "f_block_arg", "opt_f_block_arg",
3717 "singleton", "$@37", "assoc_list", "assocs", "assoc", "operation",
3718 "operation2", "operation3", "dot_or_colon", "call_op", "call_op2",
3719 "rparen", "rbracket", "rbrace", "trailer", "term", "terms", "none", YY_NULLPTR
3720};
3721
3722static const char *
3723yysymbol_name (yysymbol_kind_t yysymbol)
3724{
3725 return yytname[yysymbol];
3726}
3727#endif
3728
3729#define YYPACT_NINF (-1105)
3730
3731#define yypact_value_is_default(Yyn) \
3732 ((Yyn) == YYPACT_NINF)
3733
3734#define YYTABLE_NINF (-789)
3735
3736#define yytable_value_is_error(Yyn) \
3737 ((Yyn) == YYTABLE_NINF)
3738
3739/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
3740 STATE-NUM. */
3741static const yytype_int16 yypact[] =
3742{
3743 -1105, 5137, 116, -1105, -1105, -1105, -1105, 9782, -1105, -1105,
3744 -1105, -1105, -1105, -1105, -1105, 10845, 10845, -1105, -1105, -1105,
3745 -1105, 6047, -1105, -1105, -1105, -1105, 577, 9627, 14, 2,
3746 -1105, -1105, -1105, -1105, 4430, 6204, -1105, -1105, 5576, -1105,
3747 -1105, -1105, -1105, -1105, -1105, -1105, -1105, 12297, 12297, 12297,
3748 12297, 176, 8533, 8692, 11329, 11571, 10085, -1105, 9472, -1105,
3749 -1105, -1105, 117, 117, 117, 117, 1370, 12418, 12297, -1105,
3750 646, -1105, -1105, 1384, -1105, 776, 314, 314, -1105, -1105,
3751 260, 148, 160, -1105, 186, 12902, -1105, 268, 2773, 925,
3752 370, 385, -1105, 10724, 10724, -1105, -1105, 9157, 13021, 13140,
3753 13259, 9316, 10845, 6675, -1105, 683, 78, -1105, -1105, 366,
3754 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3755 -1105, -1105, -1105, -1105, -1105, -1105, -1105, 320, 420, -1105,
3756 308, 427, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3757 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3758 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3759 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3760 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3761 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3762 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3763 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3764 -1105, 333, -1105, -1105, -1105, -1105, -1105, -1105, 336, 12297,
3765 448, 8692, 12297, 12297, 12297, -1105, 12297, 314, 314, -1105,
3766 393, 5546, 480, -1105, -1105, 435, -1105, 432, 52, 53,
3767 500, 70, 465, -1105, -1105, 10966, -1105, 10845, -1105, -1105,
3768 10463, 12539, 614, -1105, 474, -1105, 8851, -1105, -1105, -1105,
3769 -1105, -1105, 519, 260, -1105, 546, -1105, 572, 621, 5703,
3770 5703, 611, -1105, 8533, 561, 646, -1105, 1384, 14, 602,
3771 -1105, -1105, 590, 720, 819, -1105, 480, 616, 819, -1105,
3772 14, 704, 1370, 13378, 613, 613, 627, -1105, 658, 731,
3773 741, 746, -1105, -1105, 818, -1105, -1105, 972, 1002, 547,
3774 -1105, 630, 630, 630, 630, 716, -1105, -1105, -1105, -1105,
3775 -1105, -1105, -1105, 5290, 672, 10724, 10724, 10724, 10724, -1105,
3776 12539, 12539, 2275, 691, 710, -1105, 2275, -1105, 752, -1105,
3777 -1105, -1105, -1105, 747, -1105, -1105, -1105, -1105, -1105, -1105,
3778 -1105, 8533, 10204, 743, -1105, -1105, 12297, 12297, 12297, 12297,
3779 12297, -1105, -1105, 12297, 12297, 12297, 12297, 12297, 12297, 12297,
3780 12297, -1105, 12297, -1105, -1105, 12297, 12297, 12297, 12297, 12297,
3781 12297, 12297, 12297, 12297, 12297, -1105, -1105, 4541, 10845, 13864,
3782 7462, -1105, 776, 88, 88, 10724, 8380, 8380, -1105, 646,
3783 733, 854, -1105, -1105, 749, 883, 81, 135, 140, 879,
3784 887, 10724, 634, -1105, 778, 793, -1105, -1105, -1105, -1105,
3785 59, 92, 526, 584, 624, 649, 719, 724, 742, -1105,
3786 -1105, -1105, -1105, 788, -1105, 10323, -1105, -1105, -1105, 15349,
3787 -1105, -1105, -1105, -1105, -1105, -1105, 410, -1105, -1105, -1105,
3788 730, 804, 807, -1105, 12297, 11087, -1105, -1105, 13963, 10845,
3789 14062, -1105, -1105, 11450, -1105, 12297, 14, -1105, 789, 14,
3790 797, -1105, -1105, 799, 177, -1105, -1105, -1105, -1105, -1105,
3791 9782, -1105, -1105, 12297, 815, 14161, 14062, -1105, 2, 14,
3792 -1105, -1105, 4702, 834, 841, -1105, 11329, -1105, -1105, 11571,
3793 -1105, -1105, -1105, 474, 809, -1105, -1105, 869, -1105, 13378,
3794 14260, 10845, 14359, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3795 -1105, -1105, -1105, -1105, -1105, 1050, 297, 1081, 326, 12297,
3796 -1105, -1105, 9004, -1105, -1105, -1105, -1105, -1105, 10603, -1105,
3797 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 1300,
3798 -1105, -1105, -1105, -1105, -1105, 876, -1105, 880, -1105, -1105,
3799 886, 14, -1105, -1105, -1105, 913, -1105, 900, 12297, -1105,
3800 115, -1105, -1105, 1007, 904, 1010, -1105, 12660, 7462, 646,
3801 12660, 7462, -1105, 914, -1105, -1105, -1105, 134, 134, 11692,
3802 14, 13378, 916, -1105, 11692, -1105, 621, 4975, 4975, 4975,
3803 4975, 5128, 4761, 4975, 4975, 5703, 5703, 529, 529, -1105,
3804 5389, 1270, 1270, 1294, 406, 406, 621, 621, 621, 1457,
3805 1457, 6832, 5733, 7146, 5890, -1105, -1105, 519, -1105, 14,
3806 920, 643, -1105, 685, -1105, -1105, 6361, 134, -1105, -1105,
3807 7615, 1056, 8074, 170, 134, 134, 1062, 1057, 164, 14458,
3808 10845, 14557, -1105, -1105, -1105, 809, -1105, -1105, -1105, 14656,
3809 10845, 14755, 7462, 12539, -1105, -1105, -1105, 14, -1105, -1105,
3810 -1105, 3926, 12418, 12418, 9782, 12297, 12781, 12781, 12297, -1105,
3811 480, -1105, -1105, 465, 5419, 6518, 14, 413, 422, 12297,
3812 12297, -1105, -1105, 11208, -1105, 11450, -1105, -1105, -1105, 12539,
3813 5546, -1105, 50, 519, 519, 12297, -1105, 259, -1105, -1105,
3814 819, 13378, 869, 305, 344, 14, 391, 423, -1105, -1105,
3815 1151, -1105, 315, -1105, 117, -1105, -1105, 315, 117, -1105,
3816 621, 931, -1105, 1300, 1251, -1105, 929, 14, 930, -1105,
3817 291, -1105, -1105, 68, -1105, 2275, -1105, -1105, 955, 12297,
3818 2275, -1105, -1105, -1105, -1105, -1105, 1777, -1105, -1105, 577,
3819 1047, -1105, 5546, 1053, 134, -1105, 1047, 1053, 134, -1105,
3820 -1105, 946, -1105, -1105, -1105, -1105, -1105, 12297, -1105, 950,
3821 951, 1071, -1105, -1105, 869, 13378, -1105, -1105, 1076, 991,
3822 4088, -1105, -1105, -1105, 852, 461, -1105, -1105, 994, -1105,
3823 -1105, -1105, -1105, 747, 968, 878, 11087, -1105, -1105, -1105,
3824 -1105, 747, -1105, -1105, 1124, 965, -1105, 1122, -1105, -1105,
3825 -1105, -1105, -1105, -1105, 11813, 134, -1105, 1062, 134, 349,
3826 359, 14, 171, 178, 8380, 646, 10724, 7462, 1242, 344,
3827 -1105, 14, 134, 177, 9937, -1105, 78, 148, -1105, 4172,
3828 -1105, -1105, -1105, -1105, -1105, 577, -1105, -1105, -1105, 527,
3829 -1105, -1105, 14, 983, 177, -1105, -1105, -1105, 467, -1105,
3830 -1105, -1105, -1105, -1105, 630, -1105, 630, 630, 630, -1105,
3831 14, -1105, 1300, -1105, 1261, -1105, -1105, 1090, 876, -1105,
3832 -1105, 987, 988, -1105, -1105, 992, -1105, 993, -1105, 987,
3833 12660, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 999, 11934,
3834 -1105, 869, -1105, -1105, -1105, 14854, 10845, 14953, -1105, -1105,
3835 12297, 12418, 12418, 997, -1105, -1105, -1105, 12418, 12418, -1105,
3836 -1105, 12055, 1122, -1105, -1105, -1105, 8380, 10724, 134, -1105,
3837 -1105, 134, -1105, 12297, -1105, 98, -1105, -1105, 134, -1105,
3838 191, 134, 7462, 646, 134, -1105, -1105, -1105, -1105, -1105,
3839 -1105, 12781, 12297, 12297, -1105, 12297, 12297, -1105, 11450, -1105,
3840 1672, 4984, -1105, -1105, 1018, 1021, -1105, 1777, -1105, 1777,
3841 -1105, 2275, -1105, 1777, -1105, -1105, 1047, 1053, 12297, 12297,
3842 -1105, -1105, 12297, 1029, 10603, 10603, 12418, 12297, 6989, 7303,
3843 14, 549, 589, 13690, 13690, 5546, -1105, -1105, -1105, -1105,
3844 -1105, 12418, -1105, -1105, -1105, -1105, 950, -1105, 1065, -1105,
3845 1178, -1105, -1105, 88, -1105, -1105, -1105, 12176, 7768, -1105,
3846 -1105, -1105, 134, -1105, -1105, 12297, 2275, -1105, -1105, 137,
3847 1261, 1261, 987, 987, 1035, 987, 5546, 5546, 1059, 1059,
3848 999, -1105, -1105, 5546, 607, -1105, -1105, -1105, 3518, 3518,
3849 779, -1105, 4010, 272, 1150, -1105, 1225, -1105, -1105, 35,
3850 -1105, 1067, -1105, -1105, -1105, 1054, -1105, 1058, -1105, 13876,
3851 -1105, -1105, -1105, -1105, 908, -1105, -1105, -1105, 41, -1105,
3852 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 469, -1105,
3853 -1105, -1105, 13497, 88, -1105, -1105, 8380, -1105, -1105, 8227,
3854 7615, 12297, -1105, 494, 13690, -1105, 14, 89, -1105, -1105,
3855 -1105, 1021, -1105, -1105, 1777, -1105, -1105, 1993, 9004, -1105,
3856 -1105, 7462, -1105, -1105, -1105, -1105, 13876, 251, 14, 13783,
3857 -1105, 14, 1064, -1105, 1068, -1105, -1105, -1105, 738, -1105,
3858 10724, -1105, 1157, 13783, 13876, 13876, 696, 1111, 3518, 3518,
3859 779, -13, 712, 13690, 13690, -1105, 1166, -1105, 875, 106,
3860 120, 188, 7462, 646, -1105, 965, -1105, -1105, -1105, -1105,
3861 88, 979, 1063, 1066, -1105, 9004, -1105, 987, 876, 1072,
3862 -1105, -1105, 1073, 14, 1093, 913, 1079, 13616, -1105, 1082,
3863 -1105, -1105, -1105, 74, -1105, 1111, 1083, 1085, -1105, -1105,
3864 -1105, -1105, -1105, 14, -1105, -1105, 1086, -1105, 1089, -1105,
3865 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3866 14, 14, 14, 14, 14, 14, 209, 15052, 10845, 15151,
3867 1124, -1105, 1178, -1105, -1105, 10724, 10724, 1290, -1105, 7462,
3868 1101, -1105, -1105, 68, -1105, 1854, -1105, 1116, -1105, 13616,
3869 1854, -1105, -1105, 1204, 890, 1697, -1105, -1105, 13876, -1105,
3870 696, -1105, 13876, 13783, 832, -1105, -1105, -1105, -1105, -1105,
3871 -1105, 227, 232, 14, 243, 244, -1105, -1105, 7921, -1105,
3872 -1105, -1105, 895, -1105, -1105, 134, -1105, -1105, 876, -1105,
3873 -1105, 1105, 1114, -1105, 890, 1119, 1120, -1105, 15250, 1105,
3874 1129, 14, 1129, -1105, -1105, 267, 409, 1290, -1105, -1105,
3875 -1105, 1697, -1105, 1697, -1105, 1854, -1105, 1697, -1105, 1130,
3876 1132, -1105, 13876, -1105, -1105, -1105, -1105, -1105, 1105, 1105,
3877 1135, 1105, -1105, -1105, 1697, -1105, -1105, 1105, -1105
3878};
3879
3880/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
3881 Performed when YYTABLE does not specify something else to do. Zero
3882 means the default is an error. */
3883static const yytype_int16 yydefact[] =
3884{
3885 2, 0, 0, 46, 385, 386, 387, 0, 378, 379,
3886 380, 383, 26, 26, 26, 373, 374, 375, 376, 397,
3887 398, 305, 672, 671, 673, 674, 59, 0, 59, 0,
3888 788, 676, 675, 677, 765, 767, 666, 665, 766, 667,
3889 661, 662, 663, 664, 610, 682, 683, 0, 0, 0,
3890 0, 0, 0, 0, 788, 788, 114, 465, 636, 636,
3891 638, 640, 0, 0, 0, 0, 0, 0, 0, 3,
3892 4, 8, 26, 10, 40, 45, 691, 691, 65, 85,
3893 305, 84, 0, 102, 0, 106, 116, 0, 74, 254,
3894 270, 0, 333, 0, 0, 81, 81, 0, 0, 0,
3895 0, 0, 342, 305, 352, 86, 350, 322, 323, 609,
3896 611, 324, 325, 619, 326, 625, 328, 629, 327, 631,
3897 329, 608, 653, 654, 607, 659, 670, 678, 679, 330,
3898 0, 331, 89, 7, 1, 195, 206, 196, 219, 192,
3899 212, 202, 201, 222, 223, 217, 200, 199, 194, 220,
3900 224, 225, 204, 193, 207, 211, 213, 205, 198, 214,
3901 221, 216, 215, 208, 218, 203, 191, 210, 209, 190,
3902 197, 188, 189, 185, 186, 187, 145, 147, 146, 180,
3903 181, 176, 158, 159, 160, 167, 164, 166, 161, 162,
3904 182, 183, 168, 169, 173, 177, 163, 165, 155, 156,
3905 157, 170, 171, 172, 174, 175, 178, 179, 184, 150,
3906 152, 33, 148, 149, 151, 381, 382, 384, 0, 761,
3907 0, 0, 316, 764, 308, 636, 0, 691, 691, 300,
3908 0, 283, 311, 100, 304, 788, 312, 0, 678, 679,
3909 0, 331, 788, 757, 101, 788, 484, 0, 97, 60,
3910 59, 0, 0, 28, 788, 12, 0, 11, 27, 280,
3911 373, 374, 485, 0, 248, 0, 342, 345, 249, 239,
3912 240, 339, 24, 0, 0, 4, 21, 23, 59, 104,
3913 20, 335, 0, 59, 59, 284, 0, 0, 59, 755,
3914 59, 0, 0, 0, 691, 691, 112, 377, 0, 122,
3915 123, 130, 462, 656, 0, 655, 657, 0, 0, 0,
3916 616, 620, 632, 626, 634, 660, 69, 260, 261, 785,
3917 784, 6, 786, 0, 0, 0, 0, 0, 0, 788,
3918 0, 0, 719, 0, 690, 369, 719, 688, 0, 371,
3919 388, 489, 478, 90, 491, 349, 389, 491, 474, 788,
3920 118, 0, 110, 107, 788, 72, 0, 0, 0, 0,
3921 0, 276, 277, 0, 0, 0, 0, 237, 238, 0,
3922 0, 70, 0, 274, 275, 0, 0, 0, 0, 0,
3923 0, 0, 0, 0, 0, 775, 776, 0, 788, 0,
3924 0, 80, 79, 0, 0, 0, 0, 0, 359, 4,
3925 5, 0, 409, 408, 0, 0, 678, 679, 331, 140,
3926 141, 0, 0, 143, 686, 0, 678, 679, 331, 367,
3927 215, 208, 218, 203, 185, 186, 187, 145, 146, 753,
3928 76, 75, 752, 0, 99, 59, 98, 778, 777, 0,
3929 351, 612, 788, 788, 153, 760, 339, 315, 763, 307,
3930 0, 0, 0, 788, 0, 0, 301, 310, 0, 788,
3931 0, 788, 788, 0, 302, 720, 59, 296, 788, 59,
3932 788, 295, 306, 0, 59, 348, 68, 30, 32, 31,
3933 0, 788, 281, 0, 0, 0, 0, 788, 0, 59,
3934 337, 19, 0, 103, 0, 340, 783, 782, 285, 783,
3935 287, 341, 756, 0, 129, 660, 120, 115, 690, 0,
3936 0, 788, 0, 463, 642, 658, 645, 643, 637, 613,
3937 614, 639, 615, 641, 617, 0, 0, 0, 0, 0,
3938 787, 9, 0, 34, 35, 36, 37, 282, 0, 66,
3939 67, 726, 723, 722, 721, 724, 732, 737, 720, 0,
3940 743, 738, 747, 746, 742, 788, 739, 788, 718, 701,
3941 704, 59, 699, 725, 727, 728, 730, 704, 734, 693,
3942 741, 422, 421, 745, 704, 749, 698, 0, 0, 0,
3943 0, 0, 462, 0, 489, 91, 462, 0, 0, 0,
3944 59, 0, 108, 119, 0, 502, 246, 253, 255, 256,
3945 257, 264, 265, 258, 259, 235, 236, 262, 263, 502,
3946 59, 250, 251, 252, 241, 242, 243, 244, 245, 278,
3947 279, 765, 767, 766, 769, 483, 768, 305, 481, 59,
3948 788, 765, 767, 766, 769, 482, 305, 0, 788, 400,
3949 0, 399, 0, 0, 0, 0, 0, 357, 339, 0,
3950 788, 0, 81, 365, 140, 141, 142, 684, 363, 0,
3951 788, 0, 0, 0, 773, 774, 77, 59, 344, 765,
3952 766, 305, 0, 0, 0, 0, 0, 0, 0, 759,
3953 313, 309, 314, 788, 765, 766, 59, 765, 766, 0,
3954 0, 758, 290, 297, 292, 299, 779, 347, 29, 0,
3955 266, 13, 338, 0, 788, 0, 25, 105, 22, 336,
3956 59, 0, 113, 770, 128, 59, 765, 766, 464, 646,
3957 0, 618, 0, 622, 0, 628, 624, 0, 0, 630,
3958 247, 0, 38, 0, 420, 412, 414, 59, 417, 410,
3959 0, 697, 751, 0, 696, 0, 714, 689, 0, 0,
3960 0, 711, 733, 568, 740, 744, 0, 716, 748, 59,
3961 54, 57, 271, 268, 0, 692, 55, 269, 0, 463,
3962 487, 0, 463, 395, 396, 488, 473, 316, 41, 318,
3963 0, 44, 317, 117, 111, 0, 64, 47, 62, 0,
3964 288, 311, 226, 42, 0, 331, 500, 500, 0, 788,
3965 788, 489, 480, 94, 0, 486, 297, 788, 788, 294,
3966 479, 92, 293, 334, 788, 788, 401, 788, 403, 82,
3967 402, 355, 356, 392, 0, 0, 502, 0, 0, 770,
3968 338, 59, 765, 766, 0, 0, 0, 0, 140, 141,
3969 144, 59, 0, 59, 0, 343, 475, 87, 48, 288,
3970 227, 56, 234, 154, 762, 59, 303, 788, 788, 486,
3971 788, 788, 59, 788, 59, 233, 286, 121, 486, 26,
3972 647, 644, 651, 652, 621, 623, 633, 627, 635, 39,
3973 59, 419, 0, 729, 0, 750, 694, 741, 788, 703,
3974 702, 704, 704, 424, 700, 704, 731, 704, 728, 704,
3975 0, 788, 788, 370, 372, 464, 88, 464, 321, 0,
3976 788, 109, 788, 788, 788, 0, 788, 0, 501, 501,
3977 0, 0, 0, 0, 95, 780, 788, 0, 0, 93,
3978 390, 788, 17, 599, 394, 393, 0, 0, 0, 404,
3979 406, 0, 83, 0, 493, 0, 360, 500, 0, 361,
3980 486, 0, 0, 0, 0, 486, 368, 754, 78, 476,
3981 477, 0, 0, 0, 788, 0, 0, 291, 298, 346,
3982 719, 0, 411, 413, 415, 418, 695, 0, 715, 0,
3983 712, 0, 707, 0, 709, 717, 61, 273, 0, 0,
3984 26, 26, 316, 319, 0, 0, 0, 0, 765, 766,
3985 59, 765, 766, 0, 0, 267, 53, 231, 52, 232,
3986 96, 0, 50, 229, 51, 230, 600, 601, 788, 602,
3987 788, 14, 407, 0, 353, 354, 494, 0, 0, 501,
3988 358, 362, 0, 685, 364, 0, 719, 466, 469, 0,
3989 0, 0, 704, 704, 704, 704, 58, 272, 788, 788,
3990 320, 43, 63, 289, 486, 591, 597, 564, 0, 0,
3991 0, 501, 59, 501, 552, 636, 0, 590, 73, 510,
3992 516, 518, 520, 514, 513, 548, 515, 557, 560, 563,
3993 569, 570, 559, 523, 571, 524, 576, 577, 578, 581,
3994 582, 583, 584, 585, 587, 586, 588, 589, 567, 71,
3995 49, 228, 0, 0, 604, 391, 0, 18, 606, 0,
3996 0, 0, 495, 788, 0, 366, 59, 0, 650, 649,
3997 648, 416, 713, 708, 0, 705, 710, 59, 0, 453,
3998 452, 0, 579, 580, 141, 595, 0, 540, 59, 541,
3999 545, 59, 0, 535, 0, 788, 538, 551, 0, 592,
4000 0, 593, 0, 511, 0, 0, 558, 562, 574, 575,
4001 0, 501, 501, 0, 0, 566, 0, 603, 0, 678,
4002 679, 331, 0, 4, 15, 788, 496, 498, 499, 497,
4003 0, 507, 456, 0, 471, 0, 467, 704, 788, 788,
4004 451, 433, 436, 59, 0, 728, 436, 736, 425, 436,
4005 430, 490, 492, 59, 533, 555, 543, 542, 534, 546,
4006 781, 536, 565, 59, 517, 512, 548, 519, 549, 553,
4007 636, 561, 556, 572, 573, 596, 522, 532, 521, 528,
4008 59, 59, 59, 59, 59, 59, 339, 0, 788, 0,
4009 788, 605, 788, 405, 503, 0, 0, 0, 468, 0,
4010 0, 706, 429, 0, 428, 0, 447, 0, 454, 0,
4011 431, 442, 444, 0, 735, 0, 449, 539, 0, 547,
4012 0, 594, 0, 0, 0, 525, 526, 527, 529, 530,
4013 531, 770, 338, 59, 765, 766, 598, 16, 0, 508,
4014 509, 460, 59, 458, 461, 0, 470, 426, 788, 435,
4015 434, 436, 436, 455, 432, 436, 436, 339, 0, 436,
4016 544, 59, 549, 550, 554, 486, 788, 0, 457, 472,
4017 427, 0, 448, 0, 445, 0, 439, 0, 441, 770,
4018 338, 450, 0, 537, 505, 506, 504, 459, 436, 436,
4019 436, 436, 446, 440, 0, 437, 443, 436, 438
4020};
4021
4022/* YYPGOTO[NTERM-NUM]. */
4023static const yytype_int16 yypgoto[] =
4024{
4025 -1105, -1105, -1105, -96, 1038, -1105, 973, -1105, 811, -1105,
4026 -1105, -533, -1105, -39, 194, 817, -1105, 5, -1105, -1105,
4027 22, 254, -520, 18, -492, -57, -1105, -1105, 470, 2485,
4028 -1105, 2614, -9, -1105, -1105, -58, 125, -1105, -244, 1231,
4029 -12, 1221, -153, 21, -51, -1105, -417, 10, 1013, -395,
4030 1220, -38, -18, -1105, -1105, 20, -1105, 3966, -547, 1232,
4031 -1105, 562, 842, 541, 2850, -1105, 702, -16, 659, -373,
4032 60, -1105, 65, -328, -226, 15, -353, -1105, -540, -28,
4033 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 867,
4034 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
4035 -1105, -1105, -1105, -1105, -1105, 402, -1105, 629, 1595, 2113,
4036 -372, -1105, 162, -767, -1105, -793, -801, 605, 453, -502,
4037 -1105, 146, -1105, 231, -1105, -1104, 100, 184, -1105, 318,
4038 -1105, -993, -1105, 51, 295, 161, -389, -1105, -1105, 581,
4039 -1105, -1105, -1105, 530, -1105, -1105, -95, -1105, -516, -1105,
4040 1026, -1105, -769, -1105, -706, -825, -513, -1105, 63, -1105,
4041 -1105, -891, -753, -1105, -1105, -1105, -1105, 228, -1105, -142,
4042 -1105, -779, -957, -980, -343, -984, -732, -1105, 225, -1105,
4043 -1105, -785, 239, -1105, -584, 235, -1105, -1105, -1105, 158,
4044 -1105, -1105, 159, 1133, 1320, -1105, 1279, 1660, 1842, 17,
4045 -1105, 2023, -1105, 877, -1105, 2256, -1105, -1105, 2643, -1105,
4046 2725, -1105, -1105, -53, -1105, -1105, -186, -1105, -1105, -1105,
4047 -1105, -1105, -1105, 32, -1105, -1105, -1105, -1105, 29, -56,
4048 3112, -1, 1305, 3168, 1958, -1105, -1105, 132, 760, 38,
4049 -1105, -1105, -311, -683, 661, -426, -307, -196, -1089, -507,
4050 -324, -663, -493, -225, 675, 168, -374, -1105, -711, -1105,
4051 -671, -1105, -557, -522, -1105, -1105, -1105, 109, -396, 263,
4052 -346, -1105, -1105, -81, -1105, 119, 151, 122, -223, -44,
4053 -63, 55
4054};
4055
4056/* YYDEFGOTO[NTERM-NUM]. */
4057static const yytype_int16 yydefgoto[] =
4058{
4059 0, 1, 2, 321, 69, 70, 71, 256, 257, 1109,
4060 1242, 637, 1020, 638, 275, 276, 488, 215, 72, 480,
4061 277, 74, 760, 473, 787, 75, 609, 595, 430, 227,
4062 844, 228, 393, 395, 942, 396, 78, 79, 585, 263,
4063 81, 82, 278, 83, 84, 85, 507, 86, 230, 413,
4064 414, 209, 210, 211, 674, 624, 213, 88, 763, 383,
4065 89, 537, 483, 538, 232, 282, 792, 625, 810, 466,
4066 467, 247, 248, 234, 456, 630, 236, 781, 782, 90,
4067 390, 494, 827, 646, 837, 835, 662, 578, 581, 265,
4068 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
4069 344, 347, 931, 1106, 824, 936, 937, 775, 266, 267,
4070 640, 819, 938, 939, 405, 735, 736, 737, 738, 555,
4071 748, 749, 1189, 1299, 1261, 1191, 1192, 1256, 1193, 1128,
4072 1129, 1183, 1292, 1293, 513, 718, 869, 302, 1117, 104,
4073 1037, 1186, 1249, 348, 105, 106, 345, 582, 583, 586,
4074 587, 945, 825, 1179, 918, 1003, 796, 1288, 828, 1336,
4075 1180, 1068, 1205, 1070, 1071, 1163, 1164, 1072, 1270, 1138,
4076 1139, 1140, 1074, 1075, 1218, 1142, 1076, 1077, 1078, 1079,
4077 1080, 556, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 932,
4078 1018, 1103, 1107, 107, 108, 109, 110, 111, 112, 311,
4079 113, 114, 525, 722, 115, 116, 527, 117, 118, 119,
4080 120, 526, 528, 304, 308, 309, 518, 720, 719, 870,
4081 971, 1120, 871, 121, 122, 305, 123, 124, 125, 126,
4082 238, 239, 129, 240, 241, 836, 658, 333, 334, 335,
4083 336, 557, 889, 559, 560, 746, 561, 562, 563, 564,
4084 898, 566, 567, 568, 569, 1198, 570, 571, 572, 573,
4085 574, 575, 576, 741, 433, 663, 287, 470, 243, 132,
4086 703, 628, 666, 661, 439, 475, 805, 1146, 498, 641,
4087 400, 259
4088};
4089
4090/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
4091 positive, shift that token. If negative, reduce the rule whose
4092 number is the opposite. If YYTABLE_NINF, syntax error. */
4093static const yytype_int16 yytable[] =
4094{
4095 128, 398, 306, 229, 229, 246, 307, 323, 565, 253,
4096 389, 440, 565, 274, 281, 629, 464, 656, 216, 217,
4097 303, 558, 642, 73, 438, 558, 322, 212, 297, 579,
4098 235, 235, 888, 767, 353, 744, 392, 392, 397, 214,
4099 392, 627, 739, 636, 251, 764, 254, 212, 768, 469,
4100 941, 128, 128, 322, 793, 300, 133, 297, 948, 214,
4101 766, 500, 890, 431, 342, 502, 296, 691, 771, 283,
4102 297, 297, 297, 279, 892, 233, 244, 324, 212, 897,
4103 312, 313, 314, 975, 300, 394, 686, 896, 399, 973,
4104 229, 919, 712, 671, 1004, 315, 797, 407, 417, 417,
4105 417, 639, 682, 691, 340, 1141, -131, 280, 280, 285,
4106 289, 639, 627, 1099, 636, 339, 134, 235, 1184, -131,
4107 489, 212, 521, 523, 242, 242, 546, 681, -672, 842,
4108 767, 337, 337, -132, 1194, 681, 1152, 1118, 715, 1160,
4109 704, 751, 249, 682, 773, 343, 547, -59, 757, 753,
4110 858, 1300, -680, -681, 255, 1207, 460, -672, 1294, 1206,
4111 -132, -671, 434, 284, 288, -139, 704, 754, 436, 249,
4112 462, 1219, 450, 1216, 784, 1152, 346, 551, 552, 491,
4113 848, 851, 274, 885, 486, -137, 885, -131, -132, -138,
4114 -671, 1153, 316, 474, 476, 1161, -134, 818, 590, 1162,
4115 1257, -139, 774, -136, 1114, -139, 1231, 1234, -766, 338,
4116 553, 242, 492, 1185, 330, 331, -133, 512, 1081, 1081,
4117 128, 1300, -138, 1181, 1073, 1073, 739, 881, 1294, 249,
4118 341, 322, 271, 229, 274, 229, 1136, -122, 1145, 1121,
4119 -135, 1029, 506, 319, 464, -137, 246, 342, 973, 320,
4120 1069, 1069, 891, 319, 1027, 128, -134, -136, 1119, 320,
4121 468, -131, 235, 899, 840, 297, 339, -131, 392, 392,
4122 392, 392, 128, 539, 540, -132, 280, 831, 73, 310,
4123 -133, -132, 337, 337, 1219, 923, 340, 841, 1219, 1314,
4124 457, -123, 300, 1313, 279, 349, -130, 457, 890, 691,
4125 471, 497, 497, 647, 954, 704, 497, 472, 503, 1137,
4126 1044, 133, 274, 947, 896, 704, 533, 534, 535, 536,
4127 -129, 505, 128, 651, 297, 319, 1157, -125, 280, 1081,
4128 -126, 320, 249, 339, -127, 1073, 1226, 1228, 392, 723,
4129 682, 723, 350, -139, 1178, 73, 1177, -124, 1314, -139,
4130 128, 300, 1152, 987, 392, 322, 242, 644, 645, 451,
4131 452, 1069, 592, 724, -138, 681, 976, 681, 911, 887,
4132 -138, 1081, 279, 635, -135, 739, 229, 739, 1081, 1081,
4133 986, 514, -135, 1203, -137, -765, 643, -137, -135, 128,
4134 -766, 1017, 728, -137, -103, 128, 128, 493, -134, -136,
4135 1137, 552, 653, 354, -134, -136, 280, -555, 442, 634,
4136 1137, 1137, 341, -338, 987, -117, -125, 725, 245, 1032,
4137 -680, 565, -133, 229, 935, -59, 565, 249, -133, 1006,
4138 1008, 1232, 1235, 553, 826, 1012, 1014, 516, 517, -377,
4139 -126, -338, -338, 471, 635, 280, 729, 229, -127, -788,
4140 235, 280, 280, 682, 385, -131, 1199, 856, 506, 634,
4141 -126, -126, 698, -765, -126, 978, 980, -377, -377, 982,
4142 635, 984, 332, 985, 1132, 1133, -122, 310, 681, 59,
4143 634, 297, 386, 387, 356, 1081, 1042, 866, 1043, 444,
4144 1045, 128, -124, 731, 250, 667, 635, 862, -338, 229,
4145 212, 385, -766, 753, 446, -126, 634, -765, 300, 935,
4146 487, 823, 214, 860, 471, -128, 990, -766, 991, 1100,
4147 -681, 1165, 861, 457, -377, 457, -125, 443, 453, 386,
4148 458, 128, 634, 739, 739, 765, 875, 128, 1311, 388,
4149 506, 875, 1298, 1000, 242, -138, -125, -125, -134, 1334,
4150 -125, 380, 381, 382, 668, -132, 682, -136, -127, 924,
4151 732, 443, -139, 297, 683, 761, 471, 929, 761, 627,
4152 1200, 636, 691, 1028, 1223, 1224, -123, 128, -127, -127,
4153 128, 454, -127, -130, 1302, 692, 459, 280, 694, 1306,
4154 300, 455, 258, 697, 834, -673, -139, 896, 1202, 820,
4155 461, 815, -124, 817, 780, 710, 843, 356, 707, 780,
4156 742, 802, 742, 514, 522, 385, 1122, 1123, 1125, 1126,
4157 809, 463, -124, -124, -673, 1188, -124, 964, 798, 1098,
4158 1098, 1187, 481, 280, 1196, 635, 280, 856, 229, 128,
4159 681, 128, 864, 386, 485, 635, 565, 804, 229, 807,
4160 626, 1110, 626, -674, 1340, 809, 853, 565, 896, 558,
4161 867, 128, -133, 1038, 872, 1135, 1252, 1254, 477, 516,
4162 517, 634, 378, 379, 380, 381, 382, 245, 478, 479,
4163 747, 634, -674, 297, -134, 457, 654, 802, 809, 808,
4164 655, 812, 803, -676, 212, 280, 885, 280, 1200, 356,
4165 459, 811, 626, 1200, 804, 471, 214, 926, 1200, 783,
4166 300, 487, 565, 917, 778, 471, 1295, 280, -675, 788,
4167 490, 626, -676, 626, -136, 558, 812, 385, 497, 1116,
4168 435, 1172, 249, 804, 506, 250, 847, -102, 457, 874,
4169 1098, 876, -133, 807, 877, 878, -138, -675, 626, 626,
4170 495, 959, 385, 1188, 1057, 386, 510, 297, 1188, 812,
4171 504, 1251, 1301, 1188, 1200, 1225, 1200, -129, 1200, 501,
4172 1200, 332, 1309, 626, 547, 626, 1320, 900, -134, 392,
4173 386, 437, 1098, 509, 300, 808, 845, 1200, -677, 1098,
4174 1098, 952, 524, -668, 529, 951, 514, 788, 788, -125,
4175 -678, 319, 863, 1195, 514, 551, 431, 320, 1244, 1220,
4176 -679, -669, 511, 330, 331, -331, 482, -677, 385, 1188,
4177 -136, 1188, -668, 1188, 532, 1188, 577, 953, -678, -678,
4178 1338, 654, 1339, 128, 1341, 1134, 128, 859, -679, -679,
4179 -669, -127, 1188, -331, -331, -687, 386, 649, 786, 804,
4180 519, 1347, 516, 517, 584, 675, 883, 664, 519, 804,
4181 516, 517, 385, 1212, 212, 1283, 868, 249, 91, 933,
4182 940, -59, 940, 961, 970, 249, 496, 769, -339, 887,
4183 392, 772, 237, 237, 514, -678, 665, 580, 761, 280,
4184 386, 659, 280, 704, 530, -679, 1098, 1022, 514, 593,
4185 -331, 635, 1197, 650, 229, -765, -339, -339, 652, 1033,
4186 648, 589, 626, -766, 626, 863, 594, 657, 457, 91,
4187 91, 385, 626, 298, 626, 1310, 786, 786, 1023, 1312,
4188 905, 1195, 1039, 907, 237, 128, 1195, 634, 515, 676,
4189 516, 517, 677, 742, 385, 693, 780, 660, -668, 386,
4190 915, 128, 298, 695, 516, 517, -669, 1212, 696, 385,
4191 237, 237, 957, -339, 237, 404, 415, 415, 701, 237,
4192 128, 471, 386, 1237, 249, 499, -668, -668, 926, 934,
4193 935, 967, 950, 969, -669, -669, 1019, 386, 1308, 1113,
4194 -117, 280, 955, 128, 128, 1048, 1049, 1158, 1159, 972,
4195 709, 1195, 1097, 1097, 672, 673, 916, 280, 361, 362,
4196 1151, 1215, 1148, -133, 87, 678, 1051, 1052, 804, 1245,
4197 1246, 1230, 1233, 689, 690, 711, 280, 128, 1197, 1238,
4198 1197, -765, 740, -668, -124, 1197, 743, -765, 514, -766,
4199 1197, -669, 745, 482, 660, -766, 788, 788, -423, 705,
4200 249, 1317, 788, 788, 508, 508, 750, 1097, 1097, 755,
4201 756, 1097, 758, 373, 374, 87, 87, 770, 514, 816,
4202 1174, 1175, 785, 1104, 297, 1108, 806, 1241, 1097, 823,
4203 804, 1144, 826, 280, 879, 882, 884, 1239, 91, 1201,
4204 893, 901, 519, 392, 516, 517, 1197, 902, 1197, 906,
4205 1197, 1170, 1197, 1130, 1130, 128, -311, 909, 128, 128,
4206 492, 403, 237, 1097, 237, 910, 514, 237, 237, 1197,
4207 912, 788, 520, 91, 516, 517, 913, 128, 925, 322,
4208 128, 920, 930, 1240, 1182, 1097, 788, 935, 1097, 968,
4209 91, 1213, 754, 977, 979, 1182, 1250, 514, 981, 983,
4210 1010, 1054, 1097, 1097, 1097, -315, 804, 1097, 1097, 804,
4211 298, 280, 1097, 1097, 280, 280, 1102, 1274, 940, 297,
4212 721, 128, 516, 517, 1040, 786, 786, 1041, 626, 804,
4213 626, 786, 786, 280, 128, -313, 280, 1105, 392, 392,
4214 91, 1124, 237, 237, 237, 237, 417, 237, 237, 1127,
4215 814, 726, 1147, 516, 517, 36, 37, 1154, 39, 1055,
4216 1155, 1182, 1152, 1143, 1156, 45, 46, 776, 91, 298,
4217 1209, 1210, 1236, 635, 1247, 1248, 229, 280, 1253, 1255,
4218 940, 297, 80, 1258, 87, 1260, 1289, 1290, 1265, 1268,
4219 280, 1269, 1272, 742, 742, 1273, 80, 80, 128, 1316,
4220 786, 804, 804, 804, 1296, 237, 1303, 91, 417, 634,
4221 1307, 1321, 237, 91, 91, 786, 813, 1097, -770, 87,
4222 1323, 1097, 1097, 821, 822, 1325, 1327, 1149, 237, 36,
4223 37, 1229, 39, 80, 80, 1332, 87, 128, -765, 1204,
4224 -766, 1344, 1208, 471, 484, 933, 531, 1108, 80, 706,
4225 1173, 804, 237, 541, 280, 542, 543, 544, 545, 708,
4226 1318, -770, 1227, 541, 958, 542, 543, 544, 545, 402,
4227 419, 384, 1267, 699, 80, 80, 237, 1150, 80, 1144,
4228 846, 1097, 1271, 80, 1021, 974, 87, 1243, 880, -770,
4229 -770, 1259, 1291, 280, 542, 543, 544, 545, 356, 1275,
4230 1276, 1277, 541, 742, 542, 543, 544, 545, 1190, 91,
4231 1305, 921, 922, 733, 87, 369, 370, 1131, 1337, 927,
4232 928, 940, 356, 588, 850, 852, 298, 960, 237, 1335,
4233 1262, 1221, 1217, 1266, 1278, 1279, 1280, 1214, 441, 369,
4234 370, 850, 852, 903, -770, 1222, -770, 904, 1286, 91,
4235 -765, 1287, 733, 87, 727, 91, 432, 865, 734, 87,
4236 87, 895, 377, 378, 379, 380, 381, 382, 886, 962,
4237 963, 1297, 965, 966, 325, 326, 327, 328, 329, 40,
4238 41, 42, 43, 1333, 1315, 0, 0, 378, 379, 380,
4239 381, 382, 988, 989, 237, 91, 0, 237, 91, 0,
4240 0, 994, 80, 995, 946, 997, 237, 949, 298, 0,
4241 0, 794, 0, 0, 0, 0, 0, 0, 0, 0,
4242 0, 956, 0, 0, 0, 996, 80, 0, 80, 0,
4243 0, 80, 80, 0, 0, 1322, 1324, 80, 1011, 1326,
4244 1328, 0, 0, 1331, 0, 0, 0, 0, 0, 0,
4245 626, 0, 626, 0, 80, 87, 0, 91, 0, 91,
4246 0, 0, 0, 0, 0, 0, 0, 237, 0, 0,
4247 0, 0, 1342, 1343, 1345, 1346, 1035, 237, 0, 91,
4248 237, 1348, 0, 0, 0, 356, 0, 0, 0, 794,
4249 794, 0, 0, 0, 0, 87, 0, 0, 0, 0,
4250 0, 87, 369, 370, 80, 0, 80, 80, 80, 80,
4251 0, 80, 80, 0, 0, 0, 237, 1024, 0, 0,
4252 1025, 626, 0, 0, 0, 0, 0, 1030, 298, 0,
4253 1031, 0, 80, 1034, 1067, 1067, 0, 0, 0, 0,
4254 0, 87, 0, 0, 87, 0, 102, 375, 376, 377,
4255 378, 379, 380, 381, 382, 0, 0, 789, 0, 0,
4256 102, 102, 0, 0, 0, 0, 0, 0, 0, 80,
4257 0, 80, 0, 1007, 1009, 0, 80, 80, 80, 1013,
4258 1015, 0, 0, 0, 0, 0, 0, 0, 0, 1067,
4259 1067, 0, 80, 1067, 0, 0, 0, 102, 102, 0,
4260 0, 0, 298, 87, 0, 87, 0, 0, 0, 0,
4261 1067, 1115, 102, 0, 1007, 1009, 80, 1013, 1015, 0,
4262 0, 0, 0, 0, 0, 87, 0, 0, 0, 0,
4263 0, 0, 0, 0, 0, 789, 789, 0, 102, 102,
4264 80, 0, 102, 0, 0, 1067, 0, 102, 0, 0,
4265 0, 91, 0, 237, 91, 0, 0, 1211, 0, 0,
4266 0, 0, 0, 1101, 0, 0, 0, 1067, 0, 0,
4267 1067, 0, 0, 80, 541, 0, 542, 543, 544, 545,
4268 546, 0, 0, 0, 1067, 1067, 1067, 1101, 0, 1067,
4269 1067, 0, 80, 0, 1067, 1067, 0, 0, 0, 541,
4270 547, 542, 543, 544, 545, 546, 0, 0, 0, 0,
4271 0, 0, 0, 80, 548, 0, 0, 237, 0, 80,
4272 0, 0, 0, 0, 549, 547, 0, 0, 0, 0,
4273 550, 551, 552, 237, 0, 0, 0, 0, 794, 794,
4274 0, 0, 0, 0, 794, 794, 0, 0, 0, 549,
4275 0, 0, 0, 91, 237, 0, 551, 552, 80, 80,
4276 0, 80, 80, 0, 553, 0, 102, 554, 0, 91,
4277 80, 0, 0, 0, 0, 80, 0, 0, 0, 541,
4278 1036, 542, 543, 544, 545, 546, 0, 0, 91, 553,
4279 102, 0, 102, 0, 0, 102, 102, 87, 0, 1067,
4280 87, 102, 0, 1067, 1067, 547, 0, 0, 0, 0,
4281 0, 91, 91, 794, 0, 0, 0, 0, 102, 548,
4282 0, 80, 0, 80, 0, 0, 0, 0, 794, 549,
4283 0, 80, 0, 0, 0, 0, 551, 552, 0, 0,
4284 0, 80, 0, 80, 80, 91, 0, 0, 0, 0,
4285 0, 0, 0, 80, 80, 0, 541, 0, 542, 543,
4286 544, 545, 546, 1067, 0, 0, 0, 0, 102, 553,
4287 102, 102, 102, 102, 1319, 102, 102, 0, 0, 0,
4288 80, 0, 547, 0, 789, 789, 0, 0, 0, 0,
4289 789, 789, 0, 0, 0, 0, 102, 0, 0, 87,
4290 0, 0, 0, 0, 0, 0, 549, 0, 0, 131,
4291 0, 0, 550, 551, 552, 87, 0, 0, 0, 1168,
4292 0, 0, 0, 91, 0, 0, 91, 91, 0, 0,
4293 0, 0, 0, 102, 87, 102, 0, 0, 0, 0,
4294 102, 102, 102, 0, 0, 91, 553, 0, 91, 554,
4295 0, 0, 0, 0, 0, 0, 102, 87, 87, 789,
4296 131, 131, 0, 0, 301, 0, 0, 237, 0, 0,
4297 0, 0, 0, 0, 789, 0, 0, 0, 0, 0,
4298 102, 0, 0, 0, 0, 0, 0, 0, 0, 91,
4299 0, 87, 0, 301, 0, 541, 0, 542, 543, 544,
4300 545, 546, 91, 0, 102, 0, 408, 418, 418, 0,
4301 0, 0, 0, 0, 1264, 80, 0, 80, 80, 0,
4302 0, 547, 0, 0, 0, 0, 0, 0, 0, 0,
4303 0, 0, 0, 0, 0, 0, 0, 102, 0, 0,
4304 0, 0, 0, 0, 0, 549, 0, 0, 0, 0,
4305 0, 550, 551, 552, 0, 237, 102, 0, 0, 0,
4306 0, 0, 237, 237, 103, 1167, 91, 0, 0, 87,
4307 0, 0, 87, 87, 0, 0, 1304, 102, 103, 103,
4308 0, 80, 0, 102, 0, 553, 1089, 1089, 554, 0,
4309 0, 87, 0, 0, 87, 0, 0, 80, 249, 0,
4310 0, 0, 80, 80, 0, 91, 0, 0, 80, 80,
4311 0, 0, 0, 0, 0, 103, 103, 80, 80, 0,
4312 0, 0, 102, 102, 0, 102, 102, 0, 0, 131,
4313 103, 0, 0, 80, 102, 87, 0, 0, 0, 102,
4314 0, 1089, 1089, 0, 0, 1089, 0, 0, 87, 0,
4315 0, 0, 80, 0, 0, 0, 103, 103, 0, 0,
4316 103, 0, 1089, 0, 131, 103, 0, 0, 0, 0,
4317 0, 0, 0, 0, 0, 80, 80, 80, 0, 0,
4318 0, 131, 0, 0, 0, 102, 0, 102, 0, 0,
4319 0, 0, 80, 0, 0, 102, 0, 1089, 0, 0,
4320 0, 301, 0, 0, 0, 102, 0, 102, 102, 80,
4321 0, 0, 87, 0, 0, 0, 0, 102, 102, 1089,
4322 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0,
4323 0, 131, 0, 0, 0, 0, 1089, 1089, 1089, 0,
4324 0, 1089, 1089, 0, 102, 0, 1089, 1089, 0, 0,
4325 0, 87, 0, 0, 0, 0, 0, 0, 0, 131,
4326 301, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4327 0, 0, 0, 1090, 1090, 0, 0, 541, 0, 542,
4328 543, 544, 545, 546, 103, 0, 0, 80, 0, 0,
4329 80, 80, 0, 0, 0, 0, 0, 0, 131, 0,
4330 0, 0, 0, 547, 131, 131, 0, 0, 103, 80,
4331 103, 0, 80, 103, 103, 0, 0, 548, 0, 103,
4332 0, 0, 0, 0, 0, 0, 0, 549, 1090, 1090,
4333 0, 80, 1090, 550, 551, 552, 103, 0, 0, 0,
4334 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090,
4335 0, 1089, 0, 80, 0, 1089, 1089, 0, 0, 0,
4336 0, 0, 0, 0, 0, 0, 80, 553, 0, 0,
4337 554, 0, 0, 0, 0, 0, 0, 0, 0, 102,
4338 0, 102, 102, 0, 1090, 0, 103, 0, 103, 103,
4339 103, 103, 0, 103, 103, 0, 0, 0, 0, 0,
4340 131, 0, 0, 0, 0, 0, 1090, 0, 0, 1090,
4341 0, 0, 0, 0, 103, 1089, 0, 301, 0, 80,
4342 0, 0, 0, 1090, 1090, 1090, 80, 80, 1090, 1090,
4343 80, 0, 0, 1090, 1090, 0, 76, 0, 0, 0,
4344 131, 0, 0, 0, 0, 102, 131, 0, 0, 0,
4345 0, 103, 0, 103, 0, 0, 0, 0, 103, 103,
4346 103, 102, 0, 0, 0, 0, 102, 102, 0, 80,
4347 0, 0, 102, 102, 103, 0, 0, 0, 0, 0,
4348 0, 102, 102, 0, 0, 0, 131, 76, 76, 131,
4349 0, 294, 0, 0, 0, 0, 0, 102, 103, 301,
4350 0, 0, 795, 0, 0, 0, 0, 0, 0, 0,
4351 0, 0, 0, 0, 0, 0, 102, 0, 0, 0,
4352 294, 0, 103, 0, 0, 0, 0, 0, 0, 0,
4353 0, 0, 0, 294, 294, 294, 0, 0, 1090, 102,
4354 102, 102, 1090, 1090, 0, 0, 0, 0, 131, 0,
4355 131, 0, 0, 0, 0, 103, 102, 0, 0, 0,
4356 0, 0, 0, 0, 0, 77, 0, 0, 0, 0,
4357 131, 0, 0, 102, 103, 0, 0, 0, 0, 0,
4358 795, 795, 0, 0, 0, 0, 0, 0, 0, 0,
4359 0, 0, 0, 0, 0, 103, 0, 0, 0, 0,
4360 0, 103, 1090, 0, 0, 0, 0, 0, 0, 0,
4361 0, 0, 0, 1091, 1091, 0, 77, 77, 0, 301,
4362 295, 0, 0, 0, 0, 0, 0, 0, 873, 0,
4363 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4364 103, 103, 0, 103, 103, 0, 0, 0, 0, 295,
4365 0, 102, 103, 0, 102, 102, 76, 103, 0, 0,
4366 0, 0, 295, 295, 295, 0, 0, 0, 1091, 1091,
4367 0, 0, 1091, 102, 0, 0, 102, 0, 0, 0,
4368 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091,
4369 0, 76, 0, 301, 0, 102, 0, 0, 0, 0,
4370 0, 0, 0, 103, 0, 103, 0, 0, 76, 0,
4371 0, 0, 0, 103, 0, 0, 0, 102, 0, 0,
4372 0, 0, 0, 103, 1091, 103, 103, 0, 294, 0,
4373 102, 0, 0, 0, 0, 103, 103, 0, 0, 0,
4374 0, 0, 131, 0, 0, 131, 1091, 0, 355, 1091,
4375 0, 0, 0, 0, 0, 0, 0, 0, 76, 0,
4376 0, 0, 103, 1091, 1091, 1091, 0, 0, 1091, 1091,
4377 0, 0, 0, 1091, 1091, 0, 0, 0, 0, 0,
4378 0, 0, 0, 102, 0, 77, 76, 294, 0, 0,
4379 102, 102, 0, 0, 102, 1092, 1092, 0, 0, 0,
4380 0, 356, 357, 358, 359, 360, 361, 362, 363, 364,
4381 365, 366, 367, 368, 0, 0, 0, 0, 369, 370,
4382 77, 0, 0, 0, 371, 76, 0, 0, 0, 795,
4383 795, 76, 76, 102, 0, 795, 795, 77, 0, 0,
4384 0, 0, 0, 0, 131, 0, 0, 0, 0, 0,
4385 1092, 1092, 0, 0, 1092, 286, 0, 295, 0, 372,
4386 131, 373, 374, 375, 376, 377, 378, 379, 380, 381,
4387 382, 1092, 0, 0, 0, 0, 0, 0, 1091, 131,
4388 0, 0, 1091, 1091, 0, 0, 0, 77, 0, 0,
4389 0, 0, 0, 0, 0, 0, 0, 103, 0, 103,
4390 103, 0, 131, 131, 795, 0, 1092, 0, 0, 0,
4391 0, 0, 0, 0, 0, 77, 295, 0, 0, 795,
4392 0, 0, 0, 0, 0, 0, 0, 76, 1092, 0,
4393 0, 1092, 0, 0, 0, 0, 131, 0, 0, 0,
4394 0, 0, 1091, 0, 294, 1092, 1092, 1092, 0, 0,
4395 1092, 1092, 0, 0, 77, 1092, 1092, 0, 0, 0,
4396 77, 77, 0, 103, 0, 0, 0, 76, 0, 0,
4397 0, 0, 0, 76, 0, 0, 1093, 1093, 0, 103,
4398 0, 0, 0, 0, 103, 103, 0, 0, 0, 0,
4399 103, 103, 0, 0, 0, 0, 0, 0, 0, 103,
4400 103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4401 1171, 0, 0, 76, 131, 103, 76, 131, 131, 445,
4402 0, 0, 447, 448, 449, 0, 294, 0, 0, 76,
4403 0, 1093, 1093, 0, 103, 1093, 131, 0, 0, 131,
4404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4405 0, 0, 1093, 0, 0, 0, 77, 103, 103, 103,
4406 1092, 0, 0, 127, 1092, 1092, 0, 0, 0, 0,
4407 0, 0, 0, 295, 103, 76, 0, 76, 0, 0,
4408 131, 0, 0, 0, 0, 0, 0, 1093, 0, 0,
4409 0, 103, 0, 131, 0, 0, 77, 76, 0, 0,
4410 0, 0, 77, 0, 0, 418, 0, 76, 76, 1093,
4411 0, 0, 1093, 0, 127, 127, 0, 0, 299, 130,
4412 0, 0, 0, 0, 1092, 0, 1093, 1093, 1093, 0,
4413 0, 1093, 1093, 0, 0, 0, 1093, 1093, 0, 0,
4414 0, 0, 77, 0, 0, 77, 294, 299, 0, 0,
4415 0, 0, 0, 0, 0, 295, 0, 131, 77, 0,
4416 406, 416, 416, 416, 0, 0, 0, 418, 0, 103,
4417 130, 130, 103, 103, 0, 0, 0, 0, 0, 0,
4418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4419 0, 103, 0, 0, 103, 0, 131, 0, 0, 0,
4420 0, 0, 0, 0, 77, 0, 77, 0, 0, 1094,
4421 1094, 0, 0, 103, 0, 0, 0, 0, 0, 0,
4422 294, 0, 0, 0, 0, 0, 77, 0, 0, 0,
4423 0, 0, 0, 0, 0, 103, 77, 77, 0, 0,
4424 0, 1093, 0, 0, 0, 1093, 1093, 0, 103, 0,
4425 0, 0, 0, 0, 679, 680, 0, 0, 0, 0,
4426 0, 0, 0, 286, 1094, 1094, 0, 0, 1094, 76,
4427 0, 0, 76, 0, 0, 295, 0, 0, 0, 0,
4428 0, 0, 0, 127, 0, 1094, 0, 0, 0, 0,
4429 0, 0, 0, 0, 0, 0, 680, 0, 0, 286,
4430 0, 103, 0, 0, 0, 1093, 0, 0, 103, 103,
4431 0, 0, 103, 0, 0, 0, 0, 0, 127, 0,
4432 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4433 0, 0, 0, 0, 0, 127, 0, 0, 0, 130,
4434 0, 0, 1094, 0, 0, 1094, 0, 0, 0, 295,
4435 0, 103, 0, 0, 0, 299, 76, 76, 0, 1094,
4436 1094, 1094, 76, 76, 1094, 1094, 0, 0, 752, 1094,
4437 1094, 76, 0, 0, 130, 0, 0, 0, 0, 0,
4438 0, 0, 0, 0, 0, 127, 0, 76, 0, 779,
4439 0, 130, 0, 0, 791, 0, 0, 0, 77, 0,
4440 0, 77, 0, 0, 0, 0, 76, 0, 0, 0,
4441 0, 0, 0, 127, 299, 0, 0, 0, 0, 0,
4442 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,
4443 76, 76, 0, 0, 0, 0, 0, 0, 0, 0,
4444 0, 130, 0, 0, 0, 0, 76, 0, 0, 0,
4445 0, 0, 127, 0, 0, 0, 0, 0, 127, 127,
4446 0, 0, 0, 76, 0, 0, 0, 0, 0, 130,
4447 0, 0, 0, 0, 1094, 854, 0, 0, 1094, 1094,
4448 0, 0, 0, 0, 0, 77, 77, 0, 0, 0,
4449 0, 77, 77, 680, 0, 286, 0, 0, 0, 0,
4450 77, 22, 23, 24, 25, 0, 0, 0, 130, 0,
4451 0, 0, 0, 0, 130, 130, 77, 31, 32, 33,
4452 0, 0, 0, 0, 0, 0, 0, 40, 41, 42,
4453 43, 44, 0, 0, 0, 77, 0, 294, 1094, 0,
4454 0, 76, 0, 0, 76, 76, 0, 0, 0, 894,
4455 0, 0, 0, 0, 127, 0, 0, 0, 77, 77,
4456 77, 0, 0, 76, 0, 0, 76, 0, 0, 0,
4457 0, 299, 0, 0, 0, 77, 0, 908, 0, 57,
4458 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
4459 0, 0, 77, 0, 127, 0, 1095, 1095, 0, 0,
4460 127, 0, 0, 0, 0, 0, 680, 76, 0, 0,
4461 130, 0, 0, 0, 0, 0, 292, 0, 0, 0,
4462 76, 0, 0, 0, 944, 0, 0, 0, 0, 0,
4463 0, 0, 294, 0, 0, 0, 0, 0, 0, 0,
4464 127, 0, 0, 127, 0, 0, 0, 0, 0, 0,
4465 130, 1095, 1095, 299, 0, 1095, 130, 0, 0, 0,
4466 0, 0, 0, 0, 0, 0, 295, 0, 0, 0,
4467 77, 0, 1095, 77, 77, 0, 0, 0, 1096, 1096,
4468 0, 0, 0, 0, 76, 0, 0, 0, 0, 0,
4469 0, 0, 77, 0, 294, 77, 130, 0, 0, 130,
4470 0, 0, 127, 0, 127, 0, 0, 1095, 0, 993,
4471 0, 0, 130, 0, 0, 0, 0, 0, 0, 0,
4472 0, 0, 0, 76, 127, 0, 0, 0, 0, 1095,
4473 0, 1016, 1095, 1096, 1096, 0, 77, 1096, 0, 0,
4474 0, 0, 0, 1026, 0, 0, 1095, 1095, 1095, 77,
4475 0, 1095, 1095, 0, 1096, 0, 1095, 1095, 130, 0,
4476 130, 295, 0, 0, 0, 0, 0, 0, 286, 0,
4477 0, 0, 0, 299, 0, 0, 0, 0, 0, 0,
4478 130, 0, 0, 0, 0, 0, 0, 0, 0, 1096,
4479 130, 130, 1050, 0, 0, 0, 0, 0, 0, 0,
4480 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4481 0, 1096, 0, 77, 1096, 0, 0, 0, 0, 0,
4482 0, 0, 0, 295, 0, 0, 0, 1112, 1096, 1096,
4483 1096, 0, 0, 1096, 1096, 0, 0, 0, 1096, 1096,
4484 0, 0, 0, 0, 0, 0, 0, 299, 0, 0,
4485 0, 0, 77, 0, 0, 0, 0, 0, 0, 0,
4486 0, 1095, 0, 0, 0, 1095, 1095, 0, 0, 0,
4487 0, 0, 0, 0, 0, 0, -788, 0, 0, 0,
4488 0, 0, 0, 0, -788, -788, -788, 0, 0, -788,
4489 -788, -788, 0, -788, 0, 0, 127, 0, 0, 127,
4490 0, -788, -788, -788, 0, 0, 0, 0, 0, 0,
4491 0, 1176, 0, -788, -788, 0, -788, -788, -788, -788,
4492 -788, 0, 0, 0, 0, 1095, 0, 0, 0, 0,
4493 0, 231, 231, 0, 0, 0, 0, 0, 0, 0,
4494 0, 0, 0, 1096, -788, -788, 0, 1096, 1096, 0,
4495 0, 0, 130, 0, 0, 130, 0, 0, 0, 0,
4496 0, 0, 0, 264, 268, 269, 270, 0, 0, 0,
4497 231, 231, 0, -788, -788, 0, 0, 0, 0, 0,
4498 0, 0, 0, 317, 318, 0, 0, 0, 0, 0,
4499 0, 0, 0, 22, 23, 24, 25, -788, 127, 0,
4500 0, 0, 0, 0, 0, 0, 0, 1096, 0, 31,
4501 32, 33, 1055, 0, 127, 0, 1056, 0, 231, 40,
4502 41, 42, 43, 44, 0, 0, 0, 0, -788, -788,
4503 0, -788, 0, 127, 245, -788, 0, -788, 0, 130,
4504 130, 0, 0, 0, 0, 130, 130, 0, 0, 0,
4505 0, 1058, 1059, 0, 130, 0, 127, 127, 0, 1060,
4506 0, 0, 1061, 0, 0, 1062, 1063, 0, 1064, 0,
4507 130, 57, 58, 59, 60, 61, 62, 63, 64, 65,
4508 0, 0, 914, 0, 0, 0, 0, 0, 0, 130,
4509 127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4510 0, 1066, 0, 0, 0, 0, 0, 0, 292, 0,
4511 0, 0, 130, 130, 130, 249, 356, 357, 358, 359,
4512 360, 361, 362, 363, 364, 365, 366, 367, 368, 130,
4513 0, 0, 0, 369, 370, 231, 0, 0, 231, 231,
4514 231, 0, 317, 0, 0, 0, 130, 0, 0, 0,
4515 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4516 0, 231, 0, 231, 1169, 0, 914, 0, 127, 0,
4517 0, 127, 127, 0, 372, 0, 373, 374, 375, 376,
4518 377, 378, 379, 380, 381, 382, 0, 0, 0, 0,
4519 127, 0, 0, 127, -283, 0, 0, 0, 0, 0,
4520 356, 357, 358, 359, 360, 361, 362, 363, 364, 365,
4521 366, 367, 368, 0, 0, 0, 0, 369, 370, 0,
4522 0, 0, 0, 0, 130, 0, 0, 130, 130, 0,
4523 0, 0, 0, 0, 127, 0, 0, 0, 0, 0,
4524 0, 0, 0, 0, 0, 0, 130, 127, 0, 130,
4525 0, 0, 0, 0, 0, 0, 0, 0, 372, 416,
4526 373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
4527 0, 0, 596, 597, 598, 599, 600, 0, 0, 601,
4528 602, 603, 604, 605, 606, 607, 608, 0, 610, 0,
4529 130, 611, 612, 613, 614, 615, 616, 617, 618, 619,
4530 620, 0, 0, 130, 231, 0, 0, 0, 0, 0,
4531 0, 127, 0, 0, 0, 0, 0, 0, 0, 0,
4532 0, 416, 0, 0, 0, 0, 0, 0, 0, 0,
4533 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4535 127, 231, 0, 0, 0, 0, 0, 0, 0, 0,
4536 0, 0, 0, 0, 0, 0, 0, 130, 0, 0,
4537 231, 231, 0, 0, 0, 231, 0, 0, 0, 231,
4538 -668, 270, 0, 0, 0, 0, 0, 0, -668, -668,
4539 -668, 0, 0, -668, -668, -668, 0, -668, 0, 700,
4540 0, 0, 0, 0, 0, -668, 130, -668, -668, -668,
4541 0, 0, 231, 0, 0, 231, 0, -668, -668, 0,
4542 -668, -668, -668, -668, -668, 0, 0, 231, 0, 0,
4543 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4544 0, 0, 0, 0, 0, 730, 0, 0, -668, -668,
4545 0, 0, 0, 0, 0, 0, 0, 0, -668, -668,
4546 -668, -668, -668, -668, -668, -668, -668, -668, -668, -668,
4547 -668, 0, 0, 0, 0, -668, -668, -668, -668, 0,
4548 -668, -668, 0, 0, 231, 0, 0, -668, 0, 0,
4549 0, 0, 0, 762, 0, 0, 762, 0, 0, 0,
4550 0, -668, 0, 0, -668, 231, 0, 0, 0, 0,
4551 790, 0, 0, 0, 0, -668, -668, -668, -668, -668,
4552 -668, -668, -668, -668, -668, -668, -668, -668, 0, 0,
4553 0, 0, 0, -668, -668, -668, -668, 0, 0, -668,
4554 -668, -668, 0, 621, 622, 0, 0, 623, 0, 0,
4555 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4556 0, 0, 0, 0, 0, 0, 231, 179, 180, 181,
4557 182, 183, 184, 185, 186, 187, 231, 0, 188, 189,
4558 0, 0, 0, 0, 190, 191, 192, 193, 849, 849,
4559 0, 231, 762, 762, 849, 0, 0, 0, 0, 194,
4560 195, 0, 0, 0, 0, 849, 849, 0, 0, 231,
4561 0, 231, 0, 0, 0, 0, 0, 0, 0, 0,
4562 0, 849, 0, 0, 0, 0, 0, 0, 0, 196,
4563 197, 198, 199, 200, 201, 202, 203, 204, 205, 0,
4564 206, 207, 0, 0, 0, 0, 0, 0, 208, 245,
4565 0, 0, -5, 3, 0, 4, 5, 6, 7, 8,
4566 -5, -5, -5, 9, 10, 231, -5, -5, 11, -5,
4567 12, 13, 14, 15, 16, 17, 18, -5, 0, 0,
4568 0, 0, 19, 20, 21, 22, 23, 24, 25, 0,
4569 0, 26, 0, 231, 0, 0, 0, 27, 28, 272,
4570 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4571 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
4572 -5, 0, 231, 0, 0, 0, 0, 0, 47, 48,
4573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4574 231, 0, 0, 49, 50, 0, 0, 0, 0, 0,
4575 0, 51, 0, 0, 52, 53, 0, 54, 55, 0,
4576 56, 0, 0, 57, 58, 59, 60, 61, 62, 63,
4577 64, 65, 0, -5, 0, 0, 0, 0, 0, 0,
4578 0, 0, 0, 0, 0, 0, 0, 0, 0, 356,
4579 357, 358, 359, 360, 361, 362, 363, 0, 365, 366,
4580 66, 67, 68, 0, 0, -5, 369, 370, 0, 0,
4581 0, -5, 0, 530, 0, 0, 762, 0, 0, 0,
4582 0, 0, 0, 0, 0, 231, 0, 0, 0, 0,
4583 0, 0, 231, 0, 0, 0, 1005, 849, 849, 0,
4584 0, 0, 0, 849, 849, 0, 0, 231, 0, 373,
4585 374, 375, 376, 377, 378, 379, 380, 381, 382, 231,
4586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4587 0, 0, 0, 0, 0, 0, 0, 762, 849, 849,
4588 0, 849, 849, 0, 231, 0, 0, 0, 0, 0,
4589 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4590 0, 0, 0, 0, 1046, 1047, 0, 0, 231, 0,
4591 0, 0, 849, 1053, 0, 0, 0, 0, 0, 0,
4592 0, 0, 0, 0, 0, 0, 0, 849, 0, 0,
4593 0, 0, 0, 0, -788, 3, 0, 4, 5, 6,
4594 7, 8, 0, 231, 0, 9, 10, 0, 0, 0,
4595 11, 849, 12, 13, 14, 15, 16, 17, 18, 0,
4596 0, 0, 0, 0, 19, 20, 21, 22, 23, 24,
4597 25, 0, 0, 26, 0, 0, 0, 0, 0, 27,
4598 28, 272, 30, 31, 32, 33, 34, 35, 36, 37,
4599 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
4600 0, 0, 0, 356, -789, -789, -789, -789, 361, 362,
4601 47, 48, -789, -789, 0, 0, 0, 0, 0, 0,
4602 369, 370, 0, 0, 0, 49, 50, 231, 0, 0,
4603 0, 0, 0, 51, 0, 0, 52, 53, 0, 54,
4604 55, 0, 56, 0, 0, 57, 58, 59, 60, 61,
4605 62, 63, 64, 65, 0, -788, 0, 0, 0, 0,
4606 0, 0, 0, 373, 374, 375, 376, 377, 378, 379,
4607 380, 381, 382, 0, 0, 0, 0, 0, 0, 0,
4608 0, 0, 66, 67, 68, 0, 0, -788, 3, -788,
4609 4, 5, 6, 7, 8, -788, 0, 0, 9, 10,
4610 0, 0, 0, 11, 0, 12, 13, 14, 15, 16,
4611 17, 18, 0, 0, 0, 0, 0, 19, 20, 21,
4612 22, 23, 24, 25, 0, 0, 26, 0, 0, 0,
4613 0, 0, 27, 28, 29, 30, 31, 32, 33, 34,
4614 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
4615 44, 45, 46, 0, 231, 0, 356, 357, 358, 359,
4616 360, 361, 362, 47, 48, 365, 366, 0, 0, 0,
4617 0, 0, 0, 369, 370, 0, 0, 0, 49, 50,
4618 0, 0, 0, 0, 0, 0, 51, 0, 0, 52,
4619 53, 0, 54, 55, 0, 56, 0, 0, 57, 58,
4620 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
4621 0, 0, 0, 0, 0, 0, 373, 374, 375, 376,
4622 377, 378, 379, 380, 381, 382, 0, 0, 0, 0,
4623 0, 0, 0, 0, 0, 66, 67, 68, 0, 0,
4624 -5, 3, -788, 4, 5, 6, 7, 8, -788, 0,
4625 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
4626 14, 15, 16, 17, 18, 0, 0, 0, 0, 0,
4627 19, 20, 21, 22, 23, 24, 25, 0, 0, 26,
4628 0, 0, 0, 0, 0, 27, 28, 29, 30, 31,
4629 32, 33, 34, 35, 36, 37, 38, 39, 0, 40,
4630 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
4631 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
4632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4633 0, 49, 50, 0, 0, 0, 0, 0, 0, 51,
4634 0, 0, 52, 53, 0, 54, 55, 0, 56, 0,
4635 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
4636 0, 0, 0, 0, 0, 0, 0, 0, 0, -770,
4637 0, 0, 0, 0, 0, 0, 0, -770, -770, -770,
4638 0, 0, -770, -770, -770, 0, -770, 0, 66, 67,
4639 68, 0, 0, -5, -770, -770, -770, -770, -770, 0,
4640 0, 530, 0, 0, 0, 0, -770, -770, 0, -770,
4641 -770, -770, -770, -770, 0, 0, 0, 356, 357, 358,
4642 359, 360, 361, 362, 363, 364, 365, 366, 367, 368,
4643 0, 0, 0, 0, 369, 370, 0, -770, -770, 0,
4644 0, 0, 0, 0, 0, 0, 0, -770, -770, -770,
4645 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4646 0, 0, 0, 0, -770, -770, -770, -770, 0, 857,
4647 -770, 0, 0, 0, 0, 372, -770, 373, 374, 375,
4648 376, 377, 378, 379, 380, 381, 382, 0, 0, 0,
4649 -770, 0, 0, -770, 249, 0, 0, 0, 0, 0,
4650 0, 0, 0, 0, -135, -770, -770, -770, -770, -770,
4651 -770, -770, -770, -770, -770, -770, -770, 0, 0, 0,
4652 0, -770, -770, -770, -770, -770, -669, 0, -770, -770,
4653 -770, 0, 0, 0, -669, -669, -669, 0, 0, -669,
4654 -669, -669, 0, -669, 0, 0, 0, 0, 0, 0,
4655 0, -669, 0, -669, -669, -669, 0, 0, 0, 0,
4656 0, 0, 0, -669, -669, 0, -669, -669, -669, -669,
4657 -669, 0, 0, 0, 356, 357, 358, 359, 360, 361,
4658 362, 363, 364, 365, 366, 367, 368, 0, 0, 0,
4659 0, 369, 370, 0, -669, -669, 0, 0, 0, 0,
4660 0, 0, 0, 0, -669, -669, -669, -669, -669, -669,
4661 -669, -669, -669, -669, -669, -669, -669, 0, 0, 0,
4662 0, -669, -669, -669, -669, 0, -669, -669, 0, 0,
4663 0, 0, 372, -669, 373, 374, 375, 376, 377, 378,
4664 379, 380, 381, 382, 0, 0, 0, -669, 0, 0,
4665 -669, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4666 0, -669, -669, -669, -669, -669, -669, -669, -669, -669,
4667 -669, -669, -669, -669, 0, 0, 0, 0, 0, -669,
4668 -669, -669, -669, -771, 0, -669, -669, -669, 0, 0,
4669 0, -771, -771, -771, 0, 0, -771, -771, -771, 0,
4670 -771, 0, 0, 0, 0, 0, 0, 0, -771, -771,
4671 -771, -771, -771, 0, 0, 0, 0, 0, 0, 0,
4672 -771, -771, 0, -771, -771, -771, -771, -771, 0, 0,
4673 0, 356, 357, 358, 359, 360, 361, 362, 363, 364,
4674 365, 366, -789, -789, 0, 0, 0, 0, 369, 370,
4675 0, -771, -771, 0, 0, 0, 0, 0, 0, 0,
4676 0, -771, -771, -771, -771, -771, -771, -771, -771, -771,
4677 -771, -771, -771, -771, 0, 0, 0, 0, -771, -771,
4678 -771, -771, 0, 0, -771, 0, 0, 0, 0, 0,
4679 -771, 373, 374, 375, 376, 377, 378, 379, 380, 381,
4680 382, 0, 0, 0, -771, 0, 0, -771, 0, 0,
4681 0, 0, 0, 0, 0, 0, 0, 0, 0, -771,
4682 -771, -771, -771, -771, -771, -771, -771, -771, -771, -771,
4683 -771, 0, 0, 0, 0, -771, -771, -771, -771, -771,
4684 -772, 0, -771, -771, -771, 0, 0, 0, -772, -772,
4685 -772, 0, 0, -772, -772, -772, 0, -772, 0, 0,
4686 0, 0, 0, 0, 0, -772, -772, -772, -772, -772,
4687 0, 0, 0, 0, 0, 0, 0, -772, -772, 0,
4688 -772, -772, -772, -772, -772, 0, 0, 0, 0, 0,
4689 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4690 0, 0, 0, 0, 0, 0, 0, 0, -772, -772,
4691 0, 0, 0, 0, 0, 0, 0, 0, -772, -772,
4692 -772, -772, -772, -772, -772, -772, -772, -772, -772, -772,
4693 -772, 0, 0, 0, 0, -772, -772, -772, -772, 0,
4694 0, -772, 0, 0, 0, 0, 0, -772, 0, 0,
4695 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4696 0, -772, 0, 0, -772, 0, 0, 0, 0, 0,
4697 0, 0, 0, 0, 0, 0, -772, -772, -772, -772,
4698 -772, -772, -772, -772, -772, -772, -772, -772, 0, 0,
4699 0, 0, -772, -772, -772, -772, -772, -485, 0, -772,
4700 -772, -772, 0, 0, 0, -485, -485, -485, 0, 0,
4701 -485, -485, -485, 0, -485, 0, 0, 0, 0, 0,
4702 0, 0, -485, -485, -485, -485, 0, 0, 0, 0,
4703 0, 0, 0, 0, -485, -485, 0, -485, -485, -485,
4704 -485, -485, 0, 0, 0, 0, 0, 0, 0, 0,
4705 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4706 0, 0, 0, 0, 0, -485, -485, 0, 0, 0,
4707 0, 0, 0, 0, 0, -485, -485, -485, -485, -485,
4708 -485, -485, -485, -485, -485, -485, -485, -485, 0, 0,
4709 0, 0, -485, -485, -485, -485, 0, 0, -485, 0,
4710 0, 0, 0, 0, -485, 0, 0, 0, 0, 0,
4711 0, 0, 0, 0, 0, 0, 0, 0, -485, 0,
4712 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4713 0, 0, 0, -485, 0, -485, -485, -485, -485, -485,
4714 -485, -485, -485, -485, -485, 0, 0, 0, 0, -485,
4715 -485, -485, -485, -485, -332, 245, -485, -485, -485, 0,
4716 0, 0, -332, -332, -332, 0, 0, -332, -332, -332,
4717 0, -332, 0, 0, 0, 0, 0, 0, 0, -332,
4718 0, -332, -332, -332, 0, 0, 0, 0, 0, 0,
4719 0, -332, -332, 0, -332, -332, -332, -332, -332, 0,
4720 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4721 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4722 0, 0, -332, -332, 0, 0, 0, 0, 0, 0,
4723 0, 0, -332, -332, -332, -332, -332, -332, -332, -332,
4724 -332, -332, -332, -332, -332, 0, 0, 0, 0, -332,
4725 -332, -332, -332, 0, 0, -332, 0, 0, 0, 0,
4726 0, -332, 0, 0, 0, 0, 0, 0, 0, 0,
4727 0, 0, 0, 0, 0, -332, 0, 0, -332, 0,
4728 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4729 -332, -332, -332, -332, -332, -332, -332, -332, -332, -332,
4730 -332, -332, 0, 0, 0, 0, 0, -332, -332, -332,
4731 -332, -788, 0, -332, -332, -332, 0, 0, 0, -788,
4732 -788, -788, 0, 0, -788, -788, -788, 0, -788, 0,
4733 0, 0, 0, 0, 0, 0, -788, -788, -788, -788,
4734 0, 0, 0, 0, 0, 0, 0, 0, -788, -788,
4735 0, -788, -788, -788, -788, -788, 0, 0, 0, 0,
4736 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4737 0, 0, 0, 0, 0, 0, 0, 0, 0, -788,
4738 -788, 0, 0, 0, 0, 0, 0, 0, 0, -788,
4739 -788, -788, -788, -788, -788, -788, -788, -788, -788, -788,
4740 -788, -788, 0, 0, 0, 0, -788, -788, -788, -788,
4741 0, 0, -788, 0, 0, 0, 0, 0, -788, 0,
4742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4743 0, 0, -788, 0, 0, 0, 0, 0, 0, 0,
4744 0, 0, 0, 0, 0, 0, 0, -788, 0, -788,
4745 -788, -788, -788, -788, -788, -788, -788, -788, -788, 0,
4746 0, 0, 0, -788, -788, -788, -788, -788, -338, 245,
4747 -788, -788, -788, 0, 0, 0, -338, -338, -338, 0,
4748 0, -338, -338, -338, 0, -338, 0, 0, 0, 0,
4749 0, 0, 0, -338, 0, -338, -338, 0, 0, 0,
4750 0, 0, 0, 0, 0, -338, -338, 0, -338, -338,
4751 -338, -338, -338, 0, 0, 0, 0, 0, 0, 0,
4752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4753 0, 0, 0, 0, 0, 0, -338, -338, 0, 0,
4754 0, 0, 0, 0, 0, 0, -338, -338, -338, -338,
4755 -338, -338, -338, -338, -338, -338, -338, -338, -338, 0,
4756 0, 0, 0, -338, -338, -338, -338, 0, 858, -338,
4757 0, 0, 0, 0, 0, -338, 0, 0, 0, 0,
4758 0, 0, 0, 0, 0, 0, 0, 0, 0, -338,
4759 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4760 0, 0, 0, -137, -338, 0, -338, -338, -338, -338,
4761 -338, -338, -338, -338, -338, -338, 0, 0, 0, 0,
4762 801, -338, -338, -338, -338, -345, 0, -338, -338, -338,
4763 0, 0, 0, -345, -345, -345, 0, 0, -345, -345,
4764 -345, 0, -345, 0, 0, 0, 0, 0, 0, 0,
4765 -345, 0, -345, -345, 0, 0, 0, 0, 0, 0,
4766 0, 0, -345, -345, 0, -345, -345, -345, -345, -345,
4767 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4768 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4769 0, 0, 0, -345, -345, 0, 0, 0, 0, 0,
4770 0, 0, 0, -345, -345, -345, -345, -345, -345, -345,
4771 -345, -345, -345, -345, -345, -345, 0, 0, 0, 0,
4772 -345, -345, -345, -345, 0, 0, -345, 0, 0, 0,
4773 0, 0, -345, 0, 0, 0, 0, 0, 0, 0,
4774 0, 0, 0, 0, 0, 0, -345, 0, 0, 0,
4775 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4776 0, -345, 0, -345, -345, -345, -345, -345, -345, -345,
4777 -345, -345, -345, 0, 0, 0, 0, 0, -345, -345,
4778 -345, -345, -770, 435, -345, -345, -345, 0, 0, 0,
4779 -770, -770, -770, 0, 0, 0, -770, -770, 0, -770,
4780 0, 0, 0, 0, 0, 0, 0, -770, -770, 0,
4781 0, 0, 0, 0, 0, 0, 0, 0, 0, -770,
4782 -770, 0, -770, -770, -770, -770, -770, 0, 0, 0,
4783 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4784 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4785 -770, -770, 0, 0, 0, 0, 0, 0, 0, 0,
4786 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4787 -770, -770, -770, 0, 0, 0, 0, -770, -770, -770,
4788 -770, 0, 799, -770, 0, 0, 0, 0, 0, 0,
4789 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4790 0, 0, 0, -770, 0, 0, 0, 0, 0, 0,
4791 0, 0, 0, 0, 0, 0, 0, -135, -770, 0,
4792 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4793 0, 0, 0, 0, -770, -770, -770, -770, -126, -770,
4794 0, -770, 0, -770, 0, 0, 0, -770, -770, -770,
4795 0, 0, 0, -770, -770, 0, -770, 0, 0, 0,
4796 0, 0, 0, 0, -770, -770, 0, 0, 0, 0,
4797 0, 0, 0, 0, 0, 0, -770, -770, 0, -770,
4798 -770, -770, -770, -770, 0, 0, 0, 0, 0, 0,
4799 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4800 0, 0, 0, 0, 0, 0, 0, -770, -770, 0,
4801 0, 0, 0, 0, 0, 0, 0, -770, -770, -770,
4802 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4803 0, 0, 0, 0, -770, -770, -770, -770, 0, 799,
4804 -770, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4805 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4806 -770, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4807 0, 0, 0, 0, -135, -770, 0, -770, -770, -770,
4808 -770, -770, -770, -770, -770, -770, -770, 0, 0, 0,
4809 0, -770, -770, -770, -770, -770, -338, 0, -770, 0,
4810 -770, 0, 0, 0, -338, -338, -338, 0, 0, 0,
4811 -338, -338, 0, -338, 0, 0, 0, 0, 0, 0,
4812 0, -338, 0, 0, 0, 0, 0, 0, 0, 0,
4813 0, 0, 0, -338, -338, 0, -338, -338, -338, -338,
4814 -338, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4815 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4816 0, 0, 0, 0, -338, -338, 0, 0, 0, 0,
4817 0, 0, 0, 0, -338, -338, -338, -338, -338, -338,
4818 -338, -338, -338, -338, -338, -338, -338, 0, 0, 0,
4819 0, -338, -338, -338, -338, 0, 800, -338, 0, 0,
4820 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4821 0, 0, 0, 0, 0, 0, 0, -338, 0, 0,
4822 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4823 0, -137, -338, 0, -338, -338, -338, -338, -338, -338,
4824 -338, -338, -338, -338, 0, 0, 0, 0, 801, -338,
4825 -338, -338, -128, -338, 0, -338, 0, -338, 0, 0,
4826 0, -338, -338, -338, 0, 0, 0, -338, -338, 0,
4827 -338, 0, 0, 0, 0, 0, 0, 0, -338, 0,
4828 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4829 -338, -338, 0, -338, -338, -338, -338, -338, 0, 0,
4830 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4832 0, -338, -338, 0, 0, 0, 0, 0, 0, 0,
4833 0, -338, -338, -338, -338, -338, -338, -338, -338, -338,
4834 -338, -338, -338, -338, 0, 0, 0, 0, -338, -338,
4835 -338, -338, 0, 800, -338, 0, 0, 0, 0, 0,
4836 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4837 0, 0, 0, 0, -338, 0, 0, 0, 0, 0,
4838 0, 0, 0, 0, 0, 0, 0, 0, -137, -338,
4839 0, -338, -338, -338, -338, -338, -338, -338, -338, -338,
4840 -338, 0, 0, 0, 0, 801, -338, -338, -338, -338,
4841 0, 0, -338, 3, -338, 4, 5, 6, 7, 8,
4842 -788, -788, -788, 9, 10, 0, 0, -788, 11, 0,
4843 12, 13, 14, 15, 16, 17, 18, 0, 0, 0,
4844 0, 0, 19, 20, 21, 22, 23, 24, 25, 0,
4845 0, 26, 0, 0, 0, 0, 0, 27, 28, 272,
4846 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4847 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
4848 -788, 0, 0, 0, 0, 0, 0, 0, 47, 48,
4849 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4850 0, 0, 0, 49, 50, 0, 0, 0, 0, 0,
4851 0, 51, 0, 0, 52, 53, 0, 54, 55, 0,
4852 56, 0, 0, 57, 58, 59, 60, 61, 62, 63,
4853 64, 65, 0, 0, 0, 0, 0, 0, 0, 0,
4854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4855 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4856 66, 67, 68, 0, 0, 0, 3, -788, 4, 5,
4857 6, 7, 8, -788, 0, -788, 9, 10, 0, -788,
4858 -788, 11, 0, 12, 13, 14, 15, 16, 17, 18,
4859 0, 0, 0, 0, 0, 19, 20, 21, 22, 23,
4860 24, 25, 0, 0, 26, 0, 0, 0, 0, 0,
4861 27, 28, 272, 30, 31, 32, 33, 34, 35, 36,
4862 37, 38, 39, 0, 40, 41, 42, 43, 44, 45,
4863 46, 0, 0, -788, 0, 0, 0, 0, 0, 0,
4864 0, 47, 48, 0, 0, 0, 0, 0, 0, 0,
4865 0, 0, 0, 0, 0, 0, 49, 50, 0, 0,
4866 0, 0, 0, 0, 51, 0, 0, 52, 53, 0,
4867 54, 55, 0, 56, 0, 0, 57, 58, 59, 60,
4868 61, 62, 63, 64, 65, 0, 0, 0, 0, 0,
4869 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4870 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4871 0, 0, 0, 66, 67, 68, 0, 0, 0, 3,
4872 -788, 4, 5, 6, 7, 8, -788, 0, -788, 9,
4873 10, 0, 0, -788, 11, -788, 12, 13, 14, 15,
4874 16, 17, 18, 0, 0, 0, 0, 0, 19, 20,
4875 21, 22, 23, 24, 25, 0, 0, 26, 0, 0,
4876 0, 0, 0, 27, 28, 272, 30, 31, 32, 33,
4877 34, 35, 36, 37, 38, 39, 0, 40, 41, 42,
4878 43, 44, 45, 46, 0, 0, -788, 0, 0, 0,
4879 0, 0, 0, 0, 47, 48, 0, 0, 0, 0,
4880 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
4881 50, 0, 0, 0, 0, 0, 0, 51, 0, 0,
4882 52, 53, 0, 54, 55, 0, 56, 0, 0, 57,
4883 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
4884 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4885 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4886 0, 0, 0, 0, 0, 0, 66, 67, 68, 0,
4887 0, 0, 3, -788, 4, 5, 6, 7, 8, -788,
4888 0, -788, 9, 10, 0, 0, -788, 11, 0, 12,
4889 13, 14, 15, 16, 17, 18, -788, 0, 0, 0,
4890 0, 19, 20, 21, 22, 23, 24, 25, 0, 0,
4891 26, 0, 0, 0, 0, 0, 27, 28, 272, 30,
4892 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
4893 40, 41, 42, 43, 44, 45, 46, 0, 0, -788,
4894 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
4895 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4896 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
4897 51, 0, 0, 52, 53, 0, 54, 55, 0, 56,
4898 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
4899 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4900 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4901 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,
4902 67, 68, 0, 0, 0, 3, -788, 4, 5, 6,
4903 7, 8, -788, 0, -788, 9, 10, 0, 0, -788,
4904 11, 0, 12, 13, 14, 15, 16, 17, 18, 0,
4905 0, 0, 0, 0, 19, 20, 21, 22, 23, 24,
4906 25, 0, 0, 26, 0, 0, 0, 0, 0, 27,
4907 28, 272, 30, 31, 32, 33, 34, 35, 36, 37,
4908 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
4909 0, 0, -788, 0, 0, 0, 0, 0, 0, 0,
4910 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
4911 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
4912 0, 0, 0, 51, 0, 0, 52, 53, 0, 54,
4913 55, 0, 56, 0, 0, 57, 58, 59, 60, 61,
4914 62, 63, 64, 65, 0, 0, 0, 0, 0, 0,
4915 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4916 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4917 0, 0, 66, 67, 68, 0, 0, 0, 3, -788,
4918 4, 5, 6, 7, 8, -788, -788, -788, 9, 10,
4919 0, 0, 0, 11, 0, 12, 13, 14, 15, 16,
4920 17, 18, 0, 0, 0, 0, 0, 19, 20, 21,
4921 22, 23, 24, 25, 0, 0, 26, 0, 0, 0,
4922 0, 0, 27, 28, 272, 30, 31, 32, 33, 34,
4923 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
4924 44, 45, 46, 0, 0, -788, 0, 0, 0, 0,
4925 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
4926 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
4927 0, 0, 0, 0, 0, 0, 51, 0, 0, 52,
4928 53, 0, 54, 55, 0, 56, 0, 0, 57, 58,
4929 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
4930 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4931 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4932 0, 0, 0, 0, 0, 66, 67, 68, 0, 0,
4933 0, 3, -788, 4, 5, 6, 7, 8, -788, 0,
4934 -788, 9, 10, 0, 0, 0, 11, 0, 12, 13,
4935 14, 15, 16, 17, 18, 0, 0, 0, 0, 0,
4936 19, 20, 21, 22, 23, 24, 25, 0, 0, 26,
4937 0, 0, 0, 0, 0, 27, 28, 272, 30, 31,
4938 32, 33, 34, 35, 36, 37, 38, 39, 0, 40,
4939 41, 42, 43, 44, 45, 46, 0, 0, -788, 0,
4940 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
4941 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4942 0, 49, 50, 0, 0, 0, 0, 0, 0, 51,
4943 0, 0, 52, 53, 0, 54, 55, 0, 56, 0,
4944 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
4945 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4946 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4947 0, 0, 0, 0, 0, 0, 0, 0, 66, 67,
4948 68, 0, 0, 0, 3, -788, 4, 5, 6, 7,
4949 8, -788, 0, 0, 9, 10, 0, 0, 0, 11,
4950 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
4951 0, 0, 0, 19, 20, 21, 22, 23, 24, 25,
4952 0, 0, 26, 0, 0, 0, 0, 0, 27, 28,
4953 272, 30, 31, 32, 33, 34, 35, 36, 37, 38,
4954 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
4955 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
4956 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4957 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
4958 0, 0, 51, 0, 0, 273, 53, 0, 54, 55,
4959 0, 56, 0, 0, 57, 58, 59, 60, 61, 62,
4960 63, 64, 65, 0, 0, 0, 0, 0, 0, 0,
4961 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4962 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4963 0, 66, 67, 68, 0, 0, 0, 0, -788, 0,
4964 0, 0, -788, 3, -788, 4, 5, 6, 7, 8,
4965 0, 0, 0, 9, 10, 0, 0, 0, 11, 0,
4966 12, 13, 14, 15, 16, 17, 18, 0, 0, 0,
4967 0, 0, 19, 20, 21, 22, 23, 24, 25, 0,
4968 0, 26, 0, 0, 0, 0, 0, 27, 28, 272,
4969 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4970 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
4971 0, 0, 0, 0, 0, 0, 0, 0, 47, 48,
4972 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4973 0, 0, 0, 49, 50, 0, 0, 0, 0, 0,
4974 0, 51, 0, 0, 52, 53, 0, 54, 55, 0,
4975 56, 0, 0, 57, 58, 59, 60, 61, 62, 63,
4976 64, 65, 0, 0, 0, 0, 0, 0, 0, 0,
4977 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4978 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4979 66, 67, 68, 0, 0, 0, 0, -788, 0, 0,
4980 0, -788, 3, -788, 4, 5, 6, 7, 8, 0,
4981 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
4982 13, 14, 15, 16, 17, 18, 0, 0, 0, 0,
4983 0, 19, 20, 21, 22, 23, 24, 25, 0, 0,
4984 26, 0, 0, 0, 0, 0, 27, 28, 29, 30,
4985 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
4986 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
4987 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
4988 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4989 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
4990 51, 0, 0, 52, 53, 0, 54, 55, 0, 56,
4991 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
4992 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4993 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4994 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,
4995 67, 68, 0, 0, -788, 3, -788, 4, 5, 6,
4996 7, 8, -788, 0, 0, 9, 10, 0, 0, 0,
4997 11, 0, 12, 13, 14, 15, 16, 17, 18, 0,
4998 0, 0, 0, 0, 19, 20, 21, 22, 23, 24,
4999 25, 0, 0, 26, 0, 0, 0, 0, 0, 27,
5000 28, 272, 30, 31, 32, 33, 34, 35, 36, 37,
5001 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
5002 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5003 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
5004 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
5005 0, 0, 0, 51, 0, 0, 52, 53, 0, 54,
5006 55, 0, 56, 0, 0, 57, 58, 59, 60, 61,
5007 62, 63, 64, 65, 0, 0, 0, 0, 0, 0,
5008 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5009 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5010 0, 0, 66, 67, 68, 0, 0, -788, 391, -788,
5011 4, 5, 6, 0, 8, -788, 0, 0, 9, 10,
5012 0, 0, 0, 11, -4, 12, 13, 14, 15, 16,
5013 17, 18, 0, 0, 0, 0, 0, 19, 20, 21,
5014 22, 23, 24, 25, 0, 0, 26, 0, 0, 0,
5015 0, 0, 0, 28, 0, 0, 31, 32, 33, 34,
5016 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
5017 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
5018 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
5019 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
5020 0, 0, 0, 0, 0, 0, 220, 0, 0, 221,
5021 53, 0, 54, 55, 0, 0, 0, 0, 57, 58,
5022 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
5023 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5024 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5025 0, 0, 0, 0, 0, 66, 67, 68, 0, 0,
5026 0, 0, 319, 0, 0, 0, 0, 0, 320, 135,
5027 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5028 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
5029 156, 157, 158, 0, 0, 0, 159, 160, 161, 420,
5030 421, 422, 423, 166, 167, 168, 0, 0, 0, 0,
5031 0, 169, 170, 171, 172, 424, 425, 426, 427, 177,
5032 36, 37, 428, 39, 0, 0, 0, 0, 0, 0,
5033 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5034 0, 0, 179, 180, 181, 182, 183, 184, 185, 186,
5035 187, 0, 0, 188, 189, 0, 0, 0, 0, 190,
5036 191, 192, 193, 0, 0, 0, 0, 0, 0, 0,
5037 0, 0, 0, 0, 194, 195, 0, 0, 0, 0,
5038 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5040 0, 0, 0, 0, 196, 197, 198, 199, 200, 201,
5041 202, 203, 204, 205, 0, 206, 207, 0, 0, 0,
5042 0, 0, 0, 208, 429, 135, 136, 137, 138, 139,
5043 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
5044 150, 151, 152, 153, 154, 155, 156, 157, 158, 0,
5045 0, 0, 159, 160, 161, 162, 163, 164, 165, 166,
5046 167, 168, 0, 0, 0, 0, 0, 169, 170, 171,
5047 172, 173, 174, 175, 176, 177, 36, 37, 178, 39,
5048 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5049 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5050 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5051 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5052 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5053 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
5054 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5055 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5056 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5057 0, 206, 207, 0, 0, 0, 0, 0, 0, 208,
5058 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
5059 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
5060 155, 156, 157, 158, 0, 0, 0, 159, 160, 161,
5061 162, 163, 164, 165, 166, 167, 168, 0, 0, 0,
5062 0, 0, 169, 170, 171, 172, 173, 174, 175, 176,
5063 177, 252, 0, 178, 0, 0, 0, 0, 0, 0,
5064 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5065 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
5066 186, 187, 0, 0, 188, 189, 0, 0, 0, 0,
5067 190, 191, 192, 193, 0, 0, 0, 0, 0, 0,
5068 0, 0, 0, 0, 0, 194, 195, 0, 0, 58,
5069 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5070 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5071 0, 0, 0, 0, 0, 196, 197, 198, 199, 200,
5072 201, 202, 203, 204, 205, 0, 206, 207, 0, 0,
5073 0, 0, 0, 0, 208, 135, 136, 137, 138, 139,
5074 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
5075 150, 151, 152, 153, 154, 155, 156, 157, 158, 0,
5076 0, 0, 159, 160, 161, 162, 163, 164, 165, 166,
5077 167, 168, 0, 0, 0, 0, 0, 169, 170, 171,
5078 172, 173, 174, 175, 176, 177, 0, 0, 178, 0,
5079 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5080 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5081 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5082 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5083 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5084 194, 195, 0, 0, 58, 0, 0, 0, 0, 0,
5085 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5086 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5087 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5088 0, 206, 207, 0, 0, 0, 0, 0, 0, 208,
5089 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
5090 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
5091 155, 156, 157, 158, 0, 0, 0, 159, 160, 161,
5092 162, 163, 164, 165, 166, 167, 168, 0, 0, 0,
5093 0, 0, 169, 170, 171, 172, 173, 174, 175, 176,
5094 177, 0, 0, 178, 0, 0, 0, 0, 0, 0,
5095 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5096 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
5097 186, 187, 0, 0, 188, 189, 0, 0, 0, 0,
5098 190, 191, 192, 193, 0, 0, 0, 0, 0, 0,
5099 0, 0, 0, 0, 0, 194, 195, 0, 0, 0,
5100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5102 0, 0, 0, 0, 0, 196, 197, 198, 199, 200,
5103 201, 202, 203, 204, 205, 0, 206, 207, 4, 5,
5104 6, 0, 8, 0, 208, 0, 9, 10, 0, 0,
5105 0, 11, 0, 12, 13, 14, 260, 261, 17, 18,
5106 0, 0, 0, 0, 0, 19, 20, 262, 22, 23,
5107 24, 25, 0, 0, 218, 0, 0, 0, 0, 0,
5108 0, 290, 0, 0, 31, 32, 33, 34, 35, 36,
5109 37, 38, 39, 0, 40, 41, 42, 43, 44, 45,
5110 46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5113 0, 0, 0, 0, 291, 0, 0, 221, 53, 0,
5114 54, 55, 0, 0, 0, 0, 57, 58, 59, 60,
5115 61, 62, 63, 64, 65, 0, 0, 4, 5, 6,
5116 0, 8, 0, 0, 0, 9, 10, 0, 0, 0,
5117 11, 0, 12, 13, 14, 260, 261, 17, 18, 0,
5118 0, 0, 0, 292, 19, 20, 262, 22, 23, 24,
5119 25, 293, 0, 218, 0, 0, 0, 0, 0, 0,
5120 290, 0, 0, 31, 32, 33, 34, 35, 36, 37,
5121 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
5122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5123 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5124 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5125 0, 0, 0, 291, 0, 0, 221, 53, 0, 54,
5126 55, 0, 0, 0, 0, 57, 58, 59, 60, 61,
5127 62, 63, 64, 65, 0, 0, 4, 5, 6, 0,
5128 8, 0, 0, 0, 9, 10, 0, 0, 0, 11,
5129 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
5130 0, 0, 292, 19, 20, 21, 22, 23, 24, 25,
5131 591, 0, 218, 0, 0, 0, 0, 0, 0, 28,
5132 0, 0, 31, 32, 33, 34, 35, 36, 37, 38,
5133 39, 219, 40, 41, 42, 43, 44, 45, 46, 0,
5134 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5135 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5136 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5137 0, 0, 220, 0, 0, 221, 53, 0, 54, 55,
5138 0, 222, 223, 224, 57, 58, 225, 60, 61, 62,
5139 63, 64, 65, 0, 0, 0, 0, 0, 0, 0,
5140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5141 0, 0, 0, 0, 0, 0, 4, 5, 6, 0,
5142 8, 66, 226, 68, 9, 10, 0, 0, 249, 11,
5143 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
5144 0, 0, 0, 19, 20, 21, 22, 23, 24, 25,
5145 0, 0, 26, 0, 0, 0, 0, 0, 0, 28,
5146 0, 0, 31, 32, 33, 34, 35, 36, 37, 38,
5147 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
5148 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5149 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5150 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5151 0, 0, 220, 0, 0, 221, 53, 0, 54, 55,
5152 0, 0, 0, 0, 57, 58, 59, 60, 61, 62,
5153 63, 64, 65, 0, 0, 0, 0, 0, 0, 0,
5154 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5155 0, 0, 0, 0, 3, 0, 4, 5, 6, 7,
5156 8, 66, 67, 68, 9, 10, 0, 0, 249, 11,
5157 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
5158 0, 0, 0, 19, 20, 21, 22, 23, 24, 25,
5159 0, 0, 26, 0, 0, 0, 0, 0, 27, 28,
5160 0, 30, 31, 32, 33, 34, 35, 36, 37, 38,
5161 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
5162 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5163 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5164 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5165 0, 0, 51, 0, 0, 52, 53, 0, 54, 55,
5166 0, 56, 0, 0, 57, 58, 59, 60, 61, 62,
5167 63, 64, 65, 0, 0, 391, 0, 4, 5, 6,
5168 0, 8, 0, 0, 0, 9, 10, 0, 0, 0,
5169 11, 0, 12, 13, 14, 15, 16, 17, 18, 0,
5170 0, 66, 67, 68, 19, 20, 21, 22, 23, 24,
5171 25, 0, 0, 26, 0, 0, 0, 0, 0, 0,
5172 28, 0, 0, 31, 32, 33, 34, 35, 36, 37,
5173 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
5174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5175 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
5176 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
5177 0, 0, 0, 220, 0, 0, 221, 53, 0, 54,
5178 55, 0, 0, 0, 0, 57, 58, 59, 60, 61,
5179 62, 63, 64, 65, 0, 0, 0, 0, 4, 5,
5180 6, 0, 8, 0, 0, 0, 9, 10, 0, 0,
5181 0, 11, 0, 12, 13, 14, 15, 16, 17, 18,
5182 0, 0, 66, 67, 68, 19, 20, 21, 22, 23,
5183 24, 25, 0, 0, 218, 0, 0, 0, 0, 0,
5184 0, 28, 0, 0, 31, 32, 33, 34, 35, 36,
5185 37, 38, 39, 219, 40, 41, 42, 43, 44, 45,
5186 46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5187 0, 47, 48, 0, 0, 0, 0, 0, 0, 0,
5188 0, 0, 0, 0, 0, 0, 49, 50, 0, 0,
5189 0, 0, 0, 0, 220, 0, 0, 221, 53, 0,
5190 54, 55, 0, 222, 223, 224, 57, 58, 225, 60,
5191 61, 62, 63, 64, 65, 0, 0, 0, 0, 4,
5192 5, 6, 0, 8, 0, 0, 0, 9, 10, 0,
5193 0, 0, 11, 0, 12, 13, 14, 15, 16, 17,
5194 18, 0, 0, 66, 226, 68, 19, 20, 21, 22,
5195 23, 24, 25, 0, 0, 218, 0, 0, 0, 0,
5196 0, 0, 28, 0, 0, 31, 32, 33, 34, 35,
5197 36, 37, 38, 39, 219, 40, 41, 42, 43, 44,
5198 45, 46, 0, 0, 0, 0, 0, 0, 0, 0,
5199 0, 0, 47, 48, 0, 0, 0, 0, 0, 0,
5200 0, 0, 0, 0, 0, 0, 0, 49, 465, 0,
5201 0, 0, 0, 0, 0, 220, 0, 0, 221, 53,
5202 0, 54, 55, 0, 222, 223, 224, 57, 58, 225,
5203 60, 61, 62, 63, 64, 65, 0, 0, 0, 0,
5204 4, 5, 6, 0, 8, 0, 0, 0, 9, 10,
5205 0, 0, 0, 11, 0, 12, 13, 14, 260, 261,
5206 17, 18, 0, 0, 66, 226, 68, 19, 20, 262,
5207 22, 23, 24, 25, 0, 0, 218, 0, 0, 0,
5208 0, 0, 0, 28, 0, 0, 31, 32, 33, 34,
5209 35, 36, 37, 38, 39, 219, 40, 41, 42, 43,
5210 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
5211 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
5212 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
5213 0, 0, 0, 0, 0, 0, 220, 0, 0, 221,
5214 53, 0, 54, 55, 0, 222, 223, 224, 57, 58,
5215 225, 60, 61, 62, 63, 64, 65, 0, 0, 0,
5216 0, 4, 5, 6, 0, 8, 0, 0, 0, 9,
5217 10, 0, 0, 0, 11, 0, 12, 13, 14, 260,
5218 261, 17, 18, 0, 0, 66, 226, 68, 19, 20,
5219 262, 22, 23, 24, 25, 0, 0, 218, 0, 0,
5220 0, 0, 0, 0, 28, 0, 0, 31, 32, 33,
5221 34, 35, 36, 37, 38, 39, 219, 40, 41, 42,
5222 43, 44, 45, 46, 0, 0, 0, 0, 0, 0,
5223 0, 0, 0, 0, 47, 48, 0, 0, 0, 0,
5224 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
5225 465, 0, 0, 0, 0, 0, 0, 220, 0, 0,
5226 221, 53, 0, 54, 55, 0, 222, 223, 224, 57,
5227 58, 225, 60, 61, 62, 63, 64, 65, 0, 0,
5228 0, 0, 4, 5, 6, 0, 8, 0, 0, 0,
5229 9, 10, 0, 0, 0, 11, 0, 12, 13, 14,
5230 260, 261, 17, 18, 0, 0, 66, 226, 68, 19,
5231 20, 262, 22, 23, 24, 25, 0, 0, 218, 0,
5232 0, 0, 0, 0, 0, 28, 0, 0, 31, 32,
5233 33, 34, 35, 36, 37, 38, 39, 219, 40, 41,
5234 42, 43, 44, 45, 46, 0, 0, 0, 0, 0,
5235 0, 0, 0, 0, 0, 47, 48, 0, 0, 0,
5236 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5237 49, 50, 0, 0, 0, 0, 0, 0, 220, 0,
5238 0, 221, 53, 0, 54, 55, 0, 222, 223, 0,
5239 57, 58, 225, 60, 61, 62, 63, 64, 65, 0,
5240 0, 0, 0, 4, 5, 6, 0, 8, 0, 0,
5241 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
5242 14, 260, 261, 17, 18, 0, 0, 66, 226, 68,
5243 19, 20, 262, 22, 23, 24, 25, 0, 0, 218,
5244 0, 0, 0, 0, 0, 0, 28, 0, 0, 31,
5245 32, 33, 34, 35, 36, 37, 38, 39, 219, 40,
5246 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
5247 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
5248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5249 0, 49, 50, 0, 0, 0, 0, 0, 0, 220,
5250 0, 0, 221, 53, 0, 54, 55, 0, 0, 223,
5251 224, 57, 58, 225, 60, 61, 62, 63, 64, 65,
5252 0, 0, 0, 0, 4, 5, 6, 0, 8, 0,
5253 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
5254 13, 14, 260, 261, 17, 18, 0, 0, 66, 226,
5255 68, 19, 20, 262, 22, 23, 24, 25, 0, 0,
5256 218, 0, 0, 0, 0, 0, 0, 28, 0, 0,
5257 31, 32, 33, 34, 35, 36, 37, 38, 39, 219,
5258 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
5259 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
5260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5261 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
5262 220, 0, 0, 221, 53, 0, 54, 55, 0, 0,
5263 223, 0, 57, 58, 225, 60, 61, 62, 63, 64,
5264 65, 0, 0, 0, 0, 4, 5, 6, 0, 8,
5265 0, 0, 0, 9, 10, 0, 0, 0, 11, 0,
5266 12, 13, 14, 15, 16, 17, 18, 0, 0, 66,
5267 226, 68, 19, 20, 21, 22, 23, 24, 25, 0,
5268 0, 218, 0, 0, 0, 0, 0, 0, 28, 0,
5269 0, 31, 32, 33, 34, 35, 36, 37, 38, 39,
5270 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
5271 0, 0, 0, 0, 0, 0, 0, 0, 47, 48,
5272 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5273 0, 0, 0, 49, 50, 0, 0, 0, 0, 0,
5274 0, 220, 0, 0, 221, 53, 0, 54, 55, 0,
5275 777, 0, 0, 57, 58, 59, 60, 61, 62, 63,
5276 64, 65, 0, 0, 0, 0, 4, 5, 6, 0,
5277 8, 0, 0, 0, 9, 10, 0, 0, 0, 11,
5278 0, 12, 13, 14, 260, 261, 17, 18, 0, 0,
5279 66, 226, 68, 19, 20, 262, 22, 23, 24, 25,
5280 0, 0, 218, 0, 0, 0, 0, 0, 0, 28,
5281 0, 0, 31, 32, 33, 34, 35, 36, 37, 38,
5282 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
5283 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5284 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5285 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5286 0, 0, 220, 0, 0, 221, 53, 0, 54, 55,
5287 0, 943, 0, 0, 57, 58, 59, 60, 61, 62,
5288 63, 64, 65, 0, 0, 0, 0, 4, 5, 6,
5289 0, 8, 0, 0, 0, 9, 10, 0, 0, 0,
5290 11, 0, 12, 13, 14, 260, 261, 17, 18, 0,
5291 0, 66, 226, 68, 19, 20, 262, 22, 23, 24,
5292 25, 0, 0, 218, 0, 0, 0, 0, 0, 0,
5293 28, 0, 0, 31, 32, 33, 34, 35, 36, 37,
5294 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
5295 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5296 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
5297 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
5298 0, 0, 0, 220, 0, 0, 221, 53, 0, 54,
5299 55, 0, 992, 0, 0, 57, 58, 59, 60, 61,
5300 62, 63, 64, 65, 0, 0, 0, 0, 4, 5,
5301 6, 0, 8, 0, 0, 0, 9, 10, 0, 0,
5302 0, 11, 0, 12, 13, 14, 260, 261, 17, 18,
5303 0, 0, 66, 226, 68, 19, 20, 262, 22, 23,
5304 24, 25, 0, 0, 218, 0, 0, 0, 0, 0,
5305 0, 28, 0, 0, 31, 32, 33, 34, 35, 36,
5306 37, 38, 39, 0, 40, 41, 42, 43, 44, 45,
5307 46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5308 0, 47, 48, 0, 0, 0, 0, 0, 0, 0,
5309 0, 0, 0, 0, 0, 0, 49, 50, 0, 0,
5310 0, 0, 0, 0, 220, 0, 0, 221, 53, 0,
5311 54, 55, 0, 777, 0, 0, 57, 58, 59, 60,
5312 61, 62, 63, 64, 65, 0, 0, 0, 0, 4,
5313 5, 6, 0, 8, 0, 0, 0, 9, 10, 0,
5314 0, 0, 11, 0, 12, 13, 14, 260, 261, 17,
5315 18, 0, 0, 66, 226, 68, 19, 20, 262, 22,
5316 23, 24, 25, 0, 0, 218, 0, 0, 0, 0,
5317 0, 0, 28, 0, 0, 31, 32, 33, 34, 35,
5318 36, 37, 38, 39, 0, 40, 41, 42, 43, 44,
5319 45, 46, 0, 0, 0, 0, 0, 0, 0, 0,
5320 0, 0, 47, 48, 0, 0, 0, 0, 0, 0,
5321 0, 0, 0, 0, 0, 0, 0, 49, 50, 0,
5322 0, 0, 0, 0, 0, 220, 0, 0, 221, 53,
5323 0, 54, 55, 0, 1111, 0, 0, 57, 58, 59,
5324 60, 61, 62, 63, 64, 65, 0, 0, 0, 0,
5325 4, 5, 6, 0, 8, 0, 0, 0, 9, 10,
5326 0, 0, 0, 11, 0, 12, 13, 14, 260, 261,
5327 17, 18, 0, 0, 66, 226, 68, 19, 20, 262,
5328 22, 23, 24, 25, 0, 0, 218, 0, 0, 0,
5329 0, 0, 0, 28, 0, 0, 31, 32, 33, 34,
5330 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
5331 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
5332 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
5333 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
5334 0, 0, 0, 0, 0, 0, 220, 0, 0, 221,
5335 53, 0, 54, 55, 0, 0, 0, 0, 57, 58,
5336 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
5337 0, 4, 5, 6, 0, 8, 0, 0, 0, 9,
5338 10, 0, 0, 0, 11, 0, 12, 13, 14, 15,
5339 16, 17, 18, 0, 0, 66, 226, 68, 19, 20,
5340 21, 22, 23, 24, 25, 0, 0, 218, 0, 0,
5341 0, 0, 0, 0, 28, 0, 0, 31, 32, 33,
5342 34, 35, 36, 37, 38, 39, 0, 40, 41, 42,
5343 43, 44, 45, 46, 0, 0, 0, 0, 0, 0,
5344 0, 0, 0, 0, 47, 48, 0, 0, 0, 0,
5345 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
5346 50, 0, 0, 0, 0, 0, 0, 220, 0, 0,
5347 221, 53, 0, 54, 55, 0, 0, 0, 0, 57,
5348 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
5349 0, 0, 4, 5, 6, 0, 8, 0, 0, 0,
5350 9, 10, 0, 0, 0, 11, 0, 12, 13, 14,
5351 15, 16, 17, 18, 0, 0, 66, 226, 68, 19,
5352 20, 21, 22, 23, 24, 25, 0, 0, 26, 0,
5353 0, 0, 0, 0, 0, 28, 0, 0, 31, 32,
5354 33, 34, 35, 36, 37, 38, 39, 0, 40, 41,
5355 42, 43, 44, 45, 46, 0, 0, 0, 0, 0,
5356 0, 0, 0, 0, 0, 47, 48, 0, 0, 0,
5357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5358 49, 50, 0, 0, 0, 0, 0, 0, 220, 0,
5359 0, 221, 53, 0, 54, 55, 0, 0, 0, 0,
5360 57, 58, 59, 60, 61, 62, 63, 64, 65, 0,
5361 0, 0, 0, 4, 5, 6, 0, 8, 0, 0,
5362 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
5363 14, 15, 16, 17, 18, 0, 0, 66, 67, 68,
5364 19, 20, 21, 22, 23, 24, 25, 0, 0, 759,
5365 0, 0, 0, 0, 0, 0, 28, 0, 0, 31,
5366 32, 33, 34, 35, 36, 37, 38, 39, 0, 40,
5367 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
5368 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
5369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5370 0, 49, 50, 0, 0, 0, 0, 0, 0, 220,
5371 0, 0, 221, 53, 0, 54, 55, 0, 0, 0,
5372 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
5373 0, 0, 0, 0, 4, 5, 6, 0, 8, 0,
5374 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
5375 13, 14, 260, 261, 17, 18, 0, 0, 66, 226,
5376 68, 19, 20, 262, 22, 23, 24, 25, 0, 0,
5377 855, 0, 0, 0, 0, 0, 0, 28, 0, 0,
5378 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
5379 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
5380 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
5381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5382 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
5383 220, 0, 0, 221, 53, 0, 54, 55, 0, 0,
5384 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
5385 65, 0, 0, 0, 0, 4, 5, 6, 0, 8,
5386 0, 0, 0, 9, 10, 0, 0, 0, 11, 0,
5387 12, 13, 14, 260, 261, 17, 18, 0, 0, 66,
5388 226, 68, 19, 20, 262, 22, 23, 24, 25, 0,
5389 0, 218, 0, 0, 0, 0, 0, 0, 290, 0,
5390 0, 31, 32, 33, 34, 35, 36, 37, 38, 39,
5391 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
5392 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5393 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5394 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5395 0, 291, 0, 0, 351, 53, 0, 54, 55, 0,
5396 352, 0, 0, 57, 58, 59, 60, 61, 62, 63,
5397 64, 65, 0, 0, 4, 5, 6, 0, 8, 0,
5398 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
5399 13, 14, 260, 261, 17, 18, 0, 0, 0, 0,
5400 292, 19, 20, 262, 22, 23, 24, 25, 0, 0,
5401 218, 0, 0, 0, 0, 0, 0, 290, 0, 0,
5402 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
5403 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
5404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5406 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5407 401, 0, 0, 52, 53, 0, 54, 55, 0, 56,
5408 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
5409 65, 0, 0, 4, 5, 6, 0, 8, 0, 0,
5410 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
5411 14, 260, 261, 17, 18, 0, 0, 0, 0, 292,
5412 19, 20, 262, 22, 23, 24, 25, 0, 0, 218,
5413 0, 0, 0, 0, 0, 0, 290, 0, 0, 31,
5414 32, 33, 409, 35, 36, 37, 410, 39, 0, 40,
5415 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
5416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5418 0, 0, 0, 0, 0, 411, 0, 0, 0, 412,
5419 0, 0, 221, 53, 0, 54, 55, 0, 0, 0,
5420 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
5421 0, 0, 4, 5, 6, 0, 8, 0, 0, 0,
5422 9, 10, 0, 0, 0, 11, 0, 12, 13, 14,
5423 260, 261, 17, 18, 0, 0, 0, 0, 292, 19,
5424 20, 262, 22, 23, 24, 25, 0, 0, 218, 0,
5425 0, 0, 0, 0, 0, 290, 0, 0, 31, 32,
5426 33, 409, 35, 36, 37, 410, 39, 0, 40, 41,
5427 42, 43, 44, 45, 46, 0, 0, 0, 0, 0,
5428 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5429 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5430 0, 0, 0, 0, 0, 0, 0, 0, 412, 0,
5431 0, 221, 53, 0, 54, 55, 0, 0, 0, 0,
5432 57, 58, 59, 60, 61, 62, 63, 64, 65, 0,
5433 0, 4, 5, 6, 0, 8, 0, 0, 0, 9,
5434 10, 0, 0, 0, 11, 0, 12, 13, 14, 260,
5435 261, 17, 18, 0, 0, 0, 0, 292, 19, 20,
5436 262, 22, 23, 24, 25, 0, 0, 218, 0, 0,
5437 0, 0, 0, 0, 290, 0, 0, 31, 32, 33,
5438 34, 35, 36, 37, 38, 39, 0, 40, 41, 42,
5439 43, 44, 45, 46, 0, 0, 0, 0, 0, 0,
5440 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5441 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5442 0, 0, 0, 0, 0, 0, 0, 291, 0, 0,
5443 351, 53, 0, 54, 55, 0, 0, 0, 0, 57,
5444 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
5445 4, 5, 6, 0, 8, 0, 0, 0, 9, 10,
5446 0, 0, 0, 11, 0, 12, 13, 14, 260, 261,
5447 17, 18, 0, 0, 0, 0, 292, 19, 20, 262,
5448 22, 23, 24, 25, 0, 0, 218, 0, 0, 0,
5449 0, 0, 0, 290, 0, 0, 31, 32, 33, 34,
5450 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
5451 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
5452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5454 0, 0, 0, 0, 0, 0, 1166, 0, 0, 221,
5455 53, 0, 54, 55, 0, 0, 0, 0, 57, 58,
5456 59, 60, 61, 62, 63, 64, 65, 0, 0, 4,
5457 5, 6, 0, 8, 0, 0, 0, 9, 10, 0,
5458 0, 0, 11, 0, 12, 13, 14, 260, 261, 17,
5459 18, 0, 0, 0, 0, 292, 19, 20, 262, 22,
5460 23, 24, 25, 0, 0, 218, 0, 0, 0, 0,
5461 0, 0, 290, 0, 0, 31, 32, 33, 34, 35,
5462 36, 37, 38, 39, 0, 40, 41, 42, 43, 44,
5463 45, 46, 0, 0, 0, 0, 0, 0, 0, 0,
5464 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5465 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5466 0, 0, 0, 0, 0, 1263, 0, 0, 221, 53,
5467 0, 54, 55, 22, 23, 24, 25, 57, 58, 59,
5468 60, 61, 62, 63, 64, 65, 0, 0, 0, 31,
5469 32, 33, 1055, 0, 0, 0, 1056, 0, 1057, 40,
5470 41, 42, 43, 44, 0, 0, 0, 0, 0, 0,
5471 0, 0, 0, 0, 292, 0, 0, 0, 547, 0,
5472 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5473 0, 1058, 1059, 0, 0, 0, 0, 0, 0, 1060,
5474 0, 0, 1061, 0, 0, 1062, 1063, 0, 1064, 551,
5475 0, 57, 58, 1065, 60, 61, 62, 63, 64, 65,
5476 0, 0, 0, 0, 0, 0, 22, 23, 24, 25,
5477 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5478 0, 1066, 31, 32, 33, 1055, 0, 0, 292, 1056,
5479 0, 0, 40, 41, 42, 43, 44, 0, 0, 0,
5480 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5482 0, 0, 0, 0, 1058, 1059, 0, 0, 0, 0,
5483 0, 0, 1060, 0, 0, 1061, 0, 0, 1062, 1063,
5484 0, 1064, 0, 0, 57, 58, 59, 60, 61, 62,
5485 63, 64, 65, 0, 0, 0, 0, 0, 0, 22,
5486 23, 24, 25, 0, 0, 0, 631, 632, 0, 0,
5487 633, 0, 0, 0, 1066, 31, 32, 33, 1055, 0,
5488 0, 292, 1056, 0, 0, 40, 41, 42, 43, 44,
5489 179, 180, 181, 182, 183, 184, 185, 186, 187, 0,
5490 0, 188, 189, 0, 0, 0, 0, 190, 191, 192,
5491 193, 0, 0, 0, 0, 0, 0, 1058, 1059, 0,
5492 0, 0, 194, 195, 0, 1060, 0, 0, 1061, 0,
5493 0, 1062, 1063, 0, 0, 0, 0, 57, 58, 59,
5494 60, 61, 62, 63, 64, 65, 0, 0, 0, 0,
5495 0, 0, 196, 197, 198, 199, 200, 201, 202, 203,
5496 204, 205, 0, 206, 207, 684, 622, 1066, 0, 685,
5497 0, 208, 245, 0, 292, 0, 0, 0, 0, 0,
5498 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
5499 180, 181, 182, 183, 184, 185, 186, 187, 0, 0,
5500 188, 189, 0, 0, 0, 0, 190, 191, 192, 193,
5501 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5502 0, 194, 195, 0, 0, 0, 0, 0, 0, 0,
5503 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5504 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5505 0, 196, 197, 198, 199, 200, 201, 202, 203, 204,
5506 205, 0, 206, 207, 687, 632, 0, 0, 688, 0,
5507 208, 245, 0, 0, 0, 0, 0, 0, 0, 0,
5508 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5509 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5510 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5511 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5512 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
5513 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5514 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5515 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5516 0, 206, 207, 684, 622, 0, 0, 702, 0, 208,
5517 245, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5518 0, 0, 0, 0, 0, 0, 0, 179, 180, 181,
5519 182, 183, 184, 185, 186, 187, 0, 0, 188, 189,
5520 0, 0, 0, 0, 190, 191, 192, 193, 0, 0,
5521 0, 0, 0, 0, 0, 0, 0, 0, 0, 194,
5522 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5523 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5524 0, 0, 0, 0, 0, 0, 0, 0, 0, 196,
5525 197, 198, 199, 200, 201, 202, 203, 204, 205, 0,
5526 206, 207, 713, 622, 0, 0, 714, 0, 208, 245,
5527 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5528 0, 0, 0, 0, 0, 0, 179, 180, 181, 182,
5529 183, 184, 185, 186, 187, 0, 0, 188, 189, 0,
5530 0, 0, 0, 190, 191, 192, 193, 0, 0, 0,
5531 0, 0, 0, 0, 0, 0, 0, 0, 194, 195,
5532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5533 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5534 0, 0, 0, 0, 0, 0, 0, 0, 196, 197,
5535 198, 199, 200, 201, 202, 203, 204, 205, 0, 206,
5536 207, 716, 632, 0, 0, 717, 0, 208, 245, 0,
5537 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5538 0, 0, 0, 0, 0, 179, 180, 181, 182, 183,
5539 184, 185, 186, 187, 0, 0, 188, 189, 0, 0,
5540 0, 0, 190, 191, 192, 193, 0, 0, 0, 0,
5541 0, 0, 0, 0, 0, 0, 0, 194, 195, 0,
5542 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5543 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5544 0, 0, 0, 0, 0, 0, 0, 196, 197, 198,
5545 199, 200, 201, 202, 203, 204, 205, 0, 206, 207,
5546 829, 622, 0, 0, 830, 0, 208, 245, 0, 0,
5547 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5548 0, 0, 0, 0, 179, 180, 181, 182, 183, 184,
5549 185, 186, 187, 0, 0, 188, 189, 0, 0, 0,
5550 0, 190, 191, 192, 193, 0, 0, 0, 0, 0,
5551 0, 0, 0, 0, 0, 0, 194, 195, 0, 0,
5552 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5554 0, 0, 0, 0, 0, 0, 196, 197, 198, 199,
5555 200, 201, 202, 203, 204, 205, 0, 206, 207, 832,
5556 632, 0, 0, 833, 0, 208, 245, 0, 0, 0,
5557 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5558 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
5559 186, 187, 0, 0, 188, 189, 0, 0, 0, 0,
5560 190, 191, 192, 193, 0, 0, 0, 0, 0, 0,
5561 0, 0, 0, 0, 0, 194, 195, 0, 0, 0,
5562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5563 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5564 0, 0, 0, 0, 0, 196, 197, 198, 199, 200,
5565 201, 202, 203, 204, 205, 0, 206, 207, 838, 622,
5566 0, 0, 839, 0, 208, 245, 0, 0, 0, 0,
5567 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5568 0, 0, 179, 180, 181, 182, 183, 184, 185, 186,
5569 187, 0, 0, 188, 189, 0, 0, 0, 0, 190,
5570 191, 192, 193, 0, 0, 0, 0, 0, 0, 0,
5571 0, 0, 0, 0, 194, 195, 0, 0, 0, 0,
5572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5574 0, 0, 0, 0, 196, 197, 198, 199, 200, 201,
5575 202, 203, 204, 205, 0, 206, 207, 669, 632, 0,
5576 0, 670, 0, 208, 245, 0, 0, 0, 0, 0,
5577 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5578 0, 179, 180, 181, 182, 183, 184, 185, 186, 187,
5579 0, 0, 188, 189, 0, 0, 0, 0, 190, 191,
5580 192, 193, 0, 0, 0, 0, 0, 0, 0, 0,
5581 0, 0, 0, 194, 195, 0, 0, 0, 0, 0,
5582 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5583 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5584 0, 0, 0, 196, 197, 198, 199, 200, 201, 202,
5585 203, 204, 205, 0, 206, 207, 998, 622, 0, 0,
5586 999, 0, 208, 245, 0, 0, 0, 0, 0, 0,
5587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5588 179, 180, 181, 182, 183, 184, 185, 186, 187, 0,
5589 0, 188, 189, 0, 0, 0, 0, 190, 191, 192,
5590 193, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5591 0, 0, 194, 195, 0, 0, 0, 0, 0, 0,
5592 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5594 0, 0, 196, 197, 198, 199, 200, 201, 202, 203,
5595 204, 205, 0, 206, 207, 1001, 632, 0, 0, 1002,
5596 0, 208, 245, 0, 0, 0, 0, 0, 0, 0,
5597 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
5598 180, 181, 182, 183, 184, 185, 186, 187, 0, 0,
5599 188, 189, 0, 0, 0, 0, 190, 191, 192, 193,
5600 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5601 0, 194, 195, 0, 0, 0, 0, 0, 0, 0,
5602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5604 0, 196, 197, 198, 199, 200, 201, 202, 203, 204,
5605 205, 0, 206, 207, 1281, 622, 0, 0, 1282, 0,
5606 208, 245, 0, 0, 0, 0, 0, 0, 0, 0,
5607 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5608 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5609 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5610 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5611 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
5612 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5613 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5614 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5615 0, 206, 207, 1284, 632, 0, 0, 1285, 0, 208,
5616 245, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5617 0, 0, 0, 0, 0, 0, 0, 179, 180, 181,
5618 182, 183, 184, 185, 186, 187, 0, 0, 188, 189,
5619 0, 0, 0, 0, 190, 191, 192, 193, 0, 0,
5620 0, 0, 0, 0, 0, 0, 0, 0, 0, 194,
5621 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5622 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5623 0, 0, 0, 0, 0, 0, 0, 0, 0, 196,
5624 197, 198, 199, 200, 201, 202, 203, 204, 205, 0,
5625 206, 207, 1329, 622, 0, 0, 1330, 0, 208, 245,
5626 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5627 0, 0, 0, 0, 0, 0, 179, 180, 181, 182,
5628 183, 184, 185, 186, 187, 0, 0, 188, 189, 0,
5629 0, 0, 0, 190, 191, 192, 193, 0, 0, 0,
5630 0, 0, 0, 0, 0, 0, 0, 0, 194, 195,
5631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5633 0, 0, 0, 0, 0, 0, 0, 0, 196, 197,
5634 198, 199, 200, 201, 202, 203, 204, 205, 0, 206,
5635 207, 669, 632, 0, 0, 670, 0, 208, 245, 0,
5636 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5637 0, 0, 0, 0, 0, 179, 180, 181, 182, 183,
5638 184, 185, 186, 187, 0, 0, 188, 189, 0, 0,
5639 0, 0, 190, 191, 192, 193, 0, 0, 0, 0,
5640 0, 0, 0, 0, 0, 0, 0, 194, 195, 0,
5641 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5643 0, 0, 0, 0, 0, 0, 0, 196, 197, 198,
5644 199, 200, 201, 202, 203, 204, 205, 0, 206, 207,
5645 0, 0, 0, 0, 0, 0, 208
5646};
5647
5648static const yytype_int16 yycheck[] =
5649{
5650 1, 97, 58, 15, 16, 21, 59, 70, 332, 27,
5651 91, 106, 336, 52, 53, 388, 242, 412, 13, 14,
5652 58, 332, 394, 1, 105, 336, 70, 7, 56, 336,
5653 15, 16, 743, 580, 85, 557, 93, 94, 96, 7,
5654 97, 387, 549, 389, 26, 578, 28, 27, 581, 245,
5655 817, 52, 53, 97, 594, 56, 1, 85, 827, 27,
5656 580, 284, 745, 101, 80, 288, 56, 463, 584, 54,
5657 98, 99, 100, 52, 745, 15, 16, 72, 58, 750,
5658 63, 64, 65, 884, 85, 94, 459, 750, 97, 882,
5659 102, 797, 509, 439, 919, 66, 609, 98, 99, 100,
5660 101, 13, 455, 499, 26, 1062, 25, 52, 53, 54,
5661 55, 13, 458, 1004, 460, 77, 0, 102, 29, 13,
5662 273, 101, 308, 309, 15, 16, 58, 455, 69, 662,
5663 677, 76, 77, 13, 1127, 463, 101, 0, 511, 98,
5664 486, 567, 155, 496, 10, 80, 78, 160, 574, 34,
5665 100, 1255, 100, 100, 152, 1139, 237, 98, 1247, 1139,
5666 25, 69, 102, 54, 55, 25, 512, 52, 103, 155,
5667 100, 1155, 225, 1153, 591, 101, 28, 109, 110, 275,
5668 672, 673, 221, 740, 265, 135, 743, 135, 135, 25,
5669 98, 156, 67, 250, 251, 154, 25, 27, 351, 158,
5670 1193, 13, 68, 25, 1029, 135, 1163, 1164, 158, 77,
5671 142, 102, 275, 124, 37, 38, 25, 298, 1003, 1004,
5672 221, 1325, 13, 1114, 1003, 1004, 733, 734, 1317, 155,
5673 152, 275, 56, 245, 273, 247, 1061, 156, 1063, 1040,
5674 13, 947, 293, 155, 470, 13, 262, 263, 1041, 161,
5675 1003, 1004, 745, 155, 156, 256, 13, 13, 121, 161,
5676 245, 155, 247, 756, 659, 293, 228, 161, 325, 326,
5677 327, 328, 273, 330, 331, 155, 221, 650, 256, 162,
5678 13, 161, 227, 228, 1268, 801, 26, 660, 1272, 1273,
5679 235, 156, 293, 1273, 273, 135, 156, 242, 981, 695,
5680 245, 283, 284, 399, 837, 651, 288, 247, 290, 1062,
5681 981, 256, 351, 826, 977, 661, 325, 326, 327, 328,
5682 156, 292, 323, 404, 352, 155, 1079, 156, 273, 1114,
5683 25, 161, 155, 295, 156, 1114, 1161, 1162, 395, 525,
5684 693, 527, 156, 155, 1113, 323, 1113, 156, 1332, 161,
5685 351, 352, 101, 900, 411, 399, 247, 396, 397, 227,
5686 228, 1114, 352, 66, 155, 693, 888, 695, 785, 743,
5687 161, 1156, 351, 389, 25, 882, 388, 884, 1163, 1164,
5688 900, 66, 155, 1136, 25, 158, 395, 155, 161, 390,
5689 158, 931, 66, 161, 135, 396, 397, 278, 155, 155,
5690 1153, 110, 411, 135, 161, 161, 351, 156, 100, 389,
5691 1163, 1164, 152, 69, 961, 156, 25, 120, 158, 952,
5692 100, 745, 155, 435, 15, 153, 750, 155, 161, 921,
5693 922, 1163, 1164, 142, 25, 927, 928, 122, 123, 69,
5694 135, 97, 98, 388, 460, 390, 120, 459, 25, 135,
5695 435, 396, 397, 806, 69, 135, 1127, 683, 509, 439,
5696 155, 156, 480, 158, 159, 891, 892, 97, 98, 895,
5697 486, 897, 158, 899, 1058, 1059, 156, 162, 806, 113,
5698 460, 509, 97, 98, 78, 1270, 979, 710, 981, 156,
5699 983, 492, 25, 532, 158, 435, 512, 693, 154, 511,
5700 480, 69, 158, 34, 56, 156, 486, 158, 509, 15,
5701 100, 17, 480, 100, 459, 156, 905, 158, 907, 1011,
5702 100, 52, 100, 468, 154, 470, 135, 100, 135, 97,
5703 98, 532, 512, 1040, 1041, 579, 722, 538, 1270, 154,
5704 591, 727, 1253, 916, 435, 135, 155, 156, 135, 1316,
5705 159, 145, 146, 147, 435, 135, 909, 135, 135, 803,
5706 538, 100, 135, 591, 455, 577, 511, 811, 580, 915,
5707 1127, 917, 968, 945, 1158, 1159, 156, 578, 155, 156,
5708 581, 101, 159, 156, 1255, 466, 154, 532, 469, 1260,
5709 591, 156, 30, 474, 652, 69, 135, 1260, 1131, 643,
5710 100, 640, 135, 642, 589, 496, 663, 78, 489, 594,
5711 555, 627, 557, 66, 67, 69, 1042, 1043, 1044, 1045,
5712 636, 156, 155, 156, 98, 1127, 159, 100, 610, 1003,
5713 1004, 1124, 158, 578, 1127, 651, 581, 863, 650, 640,
5714 968, 642, 699, 97, 98, 661, 970, 629, 660, 100,
5715 387, 1023, 389, 69, 1325, 671, 674, 981, 1321, 970,
5716 711, 662, 135, 970, 720, 1060, 1188, 1189, 54, 122,
5717 123, 651, 143, 144, 145, 146, 147, 158, 64, 65,
5718 561, 661, 98, 711, 135, 630, 52, 703, 704, 100,
5719 56, 636, 627, 69, 674, 640, 1253, 642, 1255, 78,
5720 154, 636, 439, 1260, 686, 650, 674, 100, 1265, 590,
5721 711, 100, 1036, 794, 589, 660, 1249, 662, 69, 594,
5722 159, 458, 98, 460, 135, 1036, 671, 69, 710, 1036,
5723 158, 1103, 155, 715, 785, 158, 671, 135, 683, 722,
5724 1114, 724, 135, 100, 727, 728, 135, 98, 485, 486,
5725 160, 846, 69, 1255, 58, 97, 98, 785, 1260, 704,
5726 56, 1187, 1255, 1265, 1321, 1160, 1323, 156, 1325, 153,
5727 1327, 158, 1265, 510, 78, 512, 1298, 759, 135, 836,
5728 97, 98, 1156, 156, 785, 100, 667, 1344, 69, 1163,
5729 1164, 835, 162, 69, 78, 834, 66, 672, 673, 156,
5730 69, 155, 693, 1127, 66, 109, 844, 161, 1180, 113,
5731 69, 69, 154, 37, 38, 69, 254, 98, 69, 1321,
5732 135, 1323, 98, 1325, 152, 1327, 135, 836, 97, 98,
5733 1323, 52, 1325, 834, 1327, 56, 837, 686, 97, 98,
5734 98, 156, 1344, 97, 98, 135, 97, 98, 594, 831,
5735 120, 1344, 122, 123, 107, 125, 737, 69, 120, 841,
5736 122, 123, 69, 125, 844, 1238, 715, 155, 1, 814,
5737 815, 159, 817, 855, 869, 155, 156, 582, 69, 1253,
5738 937, 586, 15, 16, 66, 154, 98, 135, 900, 834,
5739 97, 98, 837, 1239, 161, 154, 1270, 936, 66, 156,
5740 154, 917, 1127, 154, 916, 26, 97, 98, 25, 953,
5741 56, 349, 649, 26, 651, 806, 354, 139, 863, 52,
5742 53, 69, 659, 56, 661, 1268, 672, 673, 937, 1272,
5743 769, 1255, 971, 772, 67, 936, 1260, 917, 120, 135,
5744 122, 123, 135, 888, 69, 156, 931, 154, 69, 97,
5745 98, 952, 85, 156, 122, 123, 69, 125, 159, 69,
5746 93, 94, 843, 154, 97, 98, 99, 100, 153, 102,
5747 971, 916, 97, 98, 155, 156, 97, 98, 100, 14,
5748 15, 862, 831, 864, 97, 98, 931, 97, 98, 1028,
5749 156, 936, 841, 994, 995, 990, 991, 89, 90, 880,
5750 159, 1325, 1003, 1004, 442, 443, 154, 952, 83, 84,
5751 1066, 1153, 1065, 135, 1, 453, 994, 995, 1000, 40,
5752 41, 1163, 1164, 461, 462, 156, 971, 1028, 1253, 154,
5753 1255, 152, 156, 154, 156, 1260, 156, 158, 66, 152,
5754 1265, 154, 156, 481, 154, 158, 921, 922, 135, 487,
5755 155, 156, 927, 928, 294, 295, 156, 1058, 1059, 52,
5756 156, 1062, 52, 138, 139, 52, 53, 153, 66, 13,
5757 1109, 1110, 156, 1018, 1102, 1020, 156, 1173, 1079, 17,
5758 1062, 1063, 25, 1028, 153, 156, 156, 1168, 221, 1128,
5759 135, 44, 120, 1150, 122, 123, 1321, 44, 1323, 153,
5760 1325, 1102, 1327, 1048, 1049, 1106, 156, 156, 1109, 1110,
5761 1173, 98, 245, 1114, 247, 44, 66, 250, 251, 1344,
5762 44, 996, 120, 256, 122, 123, 135, 1128, 160, 1173,
5763 1131, 137, 8, 1172, 1116, 1136, 1011, 15, 1139, 156,
5764 273, 1150, 52, 156, 156, 1127, 1185, 66, 156, 156,
5765 153, 1000, 1153, 1154, 1155, 156, 1138, 1158, 1159, 1141,
5766 293, 1106, 1163, 1164, 1109, 1110, 101, 1220, 1113, 1197,
5767 120, 1172, 122, 123, 156, 921, 922, 156, 915, 1161,
5768 917, 927, 928, 1128, 1185, 156, 1131, 9, 1245, 1246,
5769 323, 156, 325, 326, 327, 328, 1197, 330, 331, 140,
5770 638, 120, 52, 122, 123, 54, 55, 140, 57, 52,
5771 156, 1193, 101, 1062, 156, 64, 65, 588, 351, 352,
5772 156, 153, 56, 1239, 161, 159, 1238, 1172, 156, 156,
5773 1175, 1259, 1, 140, 221, 156, 1245, 1246, 156, 156,
5774 1185, 156, 156, 1188, 1189, 156, 15, 16, 1249, 1288,
5775 996, 1233, 1234, 1235, 153, 388, 140, 390, 1259, 1239,
5776 56, 156, 395, 396, 397, 1011, 637, 1268, 26, 256,
5777 156, 1272, 1273, 644, 645, 156, 156, 52, 411, 54,
5778 55, 1162, 57, 52, 53, 156, 273, 1288, 158, 1138,
5779 158, 156, 1141, 1238, 256, 1240, 323, 1242, 67, 488,
5780 1106, 1283, 435, 52, 1249, 54, 55, 56, 57, 492,
5781 1292, 69, 1161, 52, 844, 54, 55, 56, 57, 98,
5782 100, 89, 1203, 481, 93, 94, 459, 102, 97, 1311,
5783 671, 1332, 1213, 102, 932, 882, 323, 1175, 733, 97,
5784 98, 1195, 52, 1288, 54, 55, 56, 57, 78, 1230,
5785 1231, 1232, 52, 1298, 54, 55, 56, 57, 1127, 492,
5786 1260, 799, 800, 102, 351, 95, 96, 1049, 1317, 807,
5787 808, 1316, 78, 347, 672, 673, 509, 847, 511, 1316,
5788 1196, 1156, 1154, 1199, 1233, 1234, 1235, 1152, 109, 95,
5789 96, 689, 690, 764, 152, 1156, 154, 768, 1240, 532,
5790 158, 1242, 102, 390, 527, 538, 101, 705, 108, 396,
5791 397, 750, 142, 143, 144, 145, 146, 147, 743, 857,
5792 858, 1253, 860, 861, 40, 41, 42, 43, 44, 59,
5793 60, 61, 62, 1311, 1283, -1, -1, 143, 144, 145,
5794 146, 147, 901, 902, 577, 578, -1, 580, 581, -1,
5795 -1, 910, 221, 912, 825, 914, 589, 828, 591, -1,
5796 -1, 594, -1, -1, -1, -1, -1, -1, -1, -1,
5797 -1, 842, -1, -1, -1, 913, 245, -1, 247, -1,
5798 -1, 250, 251, -1, -1, 1301, 1302, 256, 926, 1305,
5799 1306, -1, -1, 1309, -1, -1, -1, -1, -1, -1,
5800 1237, -1, 1239, -1, 273, 492, -1, 640, -1, 642,
5801 -1, -1, -1, -1, -1, -1, -1, 650, -1, -1,
5802 -1, -1, 1338, 1339, 1340, 1341, 964, 660, -1, 662,
5803 663, 1347, -1, -1, -1, 78, -1, -1, -1, 672,
5804 673, -1, -1, -1, -1, 532, -1, -1, -1, -1,
5805 -1, 538, 95, 96, 323, -1, 325, 326, 327, 328,
5806 -1, 330, 331, -1, -1, -1, 699, 938, -1, -1,
5807 941, 1308, -1, -1, -1, -1, -1, 948, 711, -1,
5808 951, -1, 351, 954, 1003, 1004, -1, -1, -1, -1,
5809 -1, 578, -1, -1, 581, -1, 1, 140, 141, 142,
5810 143, 144, 145, 146, 147, -1, -1, 594, -1, -1,
5811 15, 16, -1, -1, -1, -1, -1, -1, -1, 388,
5812 -1, 390, -1, 921, 922, -1, 395, 396, 397, 927,
5813 928, -1, -1, -1, -1, -1, -1, -1, -1, 1058,
5814 1059, -1, 411, 1062, -1, -1, -1, 52, 53, -1,
5815 -1, -1, 785, 640, -1, 642, -1, -1, -1, -1,
5816 1079, 1032, 67, -1, 962, 963, 435, 965, 966, -1,
5817 -1, -1, -1, -1, -1, 662, -1, -1, -1, -1,
5818 -1, -1, -1, -1, -1, 672, 673, -1, 93, 94,
5819 459, -1, 97, -1, -1, 1114, -1, 102, -1, -1,
5820 -1, 834, -1, 836, 837, -1, -1, 1145, -1, -1,
5821 -1, -1, -1, 1011, -1, -1, -1, 1136, -1, -1,
5822 1139, -1, -1, 492, 52, -1, 54, 55, 56, 57,
5823 58, -1, -1, -1, 1153, 1154, 1155, 1035, -1, 1158,
5824 1159, -1, 511, -1, 1163, 1164, -1, -1, -1, 52,
5825 78, 54, 55, 56, 57, 58, -1, -1, -1, -1,
5826 -1, -1, -1, 532, 92, -1, -1, 900, -1, 538,
5827 -1, -1, -1, -1, 102, 78, -1, -1, -1, -1,
5828 108, 109, 110, 916, -1, -1, -1, -1, 921, 922,
5829 -1, -1, -1, -1, 927, 928, -1, -1, -1, 102,
5830 -1, -1, -1, 936, 937, -1, 109, 110, 577, 578,
5831 -1, 580, 581, -1, 142, -1, 221, 145, -1, 952,
5832 589, -1, -1, -1, -1, 594, -1, -1, -1, 52,
5833 158, 54, 55, 56, 57, 58, -1, -1, 971, 142,
5834 245, -1, 247, -1, -1, 250, 251, 834, -1, 1268,
5835 837, 256, -1, 1272, 1273, 78, -1, -1, -1, -1,
5836 -1, 994, 995, 996, -1, -1, -1, -1, 273, 92,
5837 -1, 640, -1, 642, -1, -1, -1, -1, 1011, 102,
5838 -1, 650, -1, -1, -1, -1, 109, 110, -1, -1,
5839 -1, 660, -1, 662, 663, 1028, -1, -1, -1, -1,
5840 -1, -1, -1, 672, 673, -1, 52, -1, 54, 55,
5841 56, 57, 58, 1332, -1, -1, -1, -1, 323, 142,
5842 325, 326, 327, 328, 1295, 330, 331, -1, -1, -1,
5843 699, -1, 78, -1, 921, 922, -1, -1, -1, -1,
5844 927, 928, -1, -1, -1, -1, 351, -1, -1, 936,
5845 -1, -1, -1, -1, -1, -1, 102, -1, -1, 1,
5846 -1, -1, 108, 109, 110, 952, -1, -1, -1, 1102,
5847 -1, -1, -1, 1106, -1, -1, 1109, 1110, -1, -1,
5848 -1, -1, -1, 388, 971, 390, -1, -1, -1, -1,
5849 395, 396, 397, -1, -1, 1128, 142, -1, 1131, 145,
5850 -1, -1, -1, -1, -1, -1, 411, 994, 995, 996,
5851 52, 53, -1, -1, 56, -1, -1, 1150, -1, -1,
5852 -1, -1, -1, -1, 1011, -1, -1, -1, -1, -1,
5853 435, -1, -1, -1, -1, -1, -1, -1, -1, 1172,
5854 -1, 1028, -1, 85, -1, 52, -1, 54, 55, 56,
5855 57, 58, 1185, -1, 459, -1, 98, 99, 100, -1,
5856 -1, -1, -1, -1, 1197, 834, -1, 836, 837, -1,
5857 -1, 78, -1, -1, -1, -1, -1, -1, -1, -1,
5858 -1, -1, -1, -1, -1, -1, -1, 492, -1, -1,
5859 -1, -1, -1, -1, -1, 102, -1, -1, -1, -1,
5860 -1, 108, 109, 110, -1, 1238, 511, -1, -1, -1,
5861 -1, -1, 1245, 1246, 1, 1102, 1249, -1, -1, 1106,
5862 -1, -1, 1109, 1110, -1, -1, 1259, 532, 15, 16,
5863 -1, 900, -1, 538, -1, 142, 1003, 1004, 145, -1,
5864 -1, 1128, -1, -1, 1131, -1, -1, 916, 155, -1,
5865 -1, -1, 921, 922, -1, 1288, -1, -1, 927, 928,
5866 -1, -1, -1, -1, -1, 52, 53, 936, 937, -1,
5867 -1, -1, 577, 578, -1, 580, 581, -1, -1, 221,
5868 67, -1, -1, 952, 589, 1172, -1, -1, -1, 594,
5869 -1, 1058, 1059, -1, -1, 1062, -1, -1, 1185, -1,
5870 -1, -1, 971, -1, -1, -1, 93, 94, -1, -1,
5871 97, -1, 1079, -1, 256, 102, -1, -1, -1, -1,
5872 -1, -1, -1, -1, -1, 994, 995, 996, -1, -1,
5873 -1, 273, -1, -1, -1, 640, -1, 642, -1, -1,
5874 -1, -1, 1011, -1, -1, 650, -1, 1114, -1, -1,
5875 -1, 293, -1, -1, -1, 660, -1, 662, 663, 1028,
5876 -1, -1, 1249, -1, -1, -1, -1, 672, 673, 1136,
5877 -1, -1, 1139, -1, -1, -1, -1, -1, -1, -1,
5878 -1, 323, -1, -1, -1, -1, 1153, 1154, 1155, -1,
5879 -1, 1158, 1159, -1, 699, -1, 1163, 1164, -1, -1,
5880 -1, 1288, -1, -1, -1, -1, -1, -1, -1, 351,
5881 352, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5882 -1, -1, -1, 1003, 1004, -1, -1, 52, -1, 54,
5883 55, 56, 57, 58, 221, -1, -1, 1106, -1, -1,
5884 1109, 1110, -1, -1, -1, -1, -1, -1, 390, -1,
5885 -1, -1, -1, 78, 396, 397, -1, -1, 245, 1128,
5886 247, -1, 1131, 250, 251, -1, -1, 92, -1, 256,
5887 -1, -1, -1, -1, -1, -1, -1, 102, 1058, 1059,
5888 -1, 1150, 1062, 108, 109, 110, 273, -1, -1, -1,
5889 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1079,
5890 -1, 1268, -1, 1172, -1, 1272, 1273, -1, -1, -1,
5891 -1, -1, -1, -1, -1, -1, 1185, 142, -1, -1,
5892 145, -1, -1, -1, -1, -1, -1, -1, -1, 834,
5893 -1, 836, 837, -1, 1114, -1, 323, -1, 325, 326,
5894 327, 328, -1, 330, 331, -1, -1, -1, -1, -1,
5895 492, -1, -1, -1, -1, -1, 1136, -1, -1, 1139,
5896 -1, -1, -1, -1, 351, 1332, -1, 509, -1, 1238,
5897 -1, -1, -1, 1153, 1154, 1155, 1245, 1246, 1158, 1159,
5898 1249, -1, -1, 1163, 1164, -1, 1, -1, -1, -1,
5899 532, -1, -1, -1, -1, 900, 538, -1, -1, -1,
5900 -1, 388, -1, 390, -1, -1, -1, -1, 395, 396,
5901 397, 916, -1, -1, -1, -1, 921, 922, -1, 1288,
5902 -1, -1, 927, 928, 411, -1, -1, -1, -1, -1,
5903 -1, 936, 937, -1, -1, -1, 578, 52, 53, 581,
5904 -1, 56, -1, -1, -1, -1, -1, 952, 435, 591,
5905 -1, -1, 594, -1, -1, -1, -1, -1, -1, -1,
5906 -1, -1, -1, -1, -1, -1, 971, -1, -1, -1,
5907 85, -1, 459, -1, -1, -1, -1, -1, -1, -1,
5908 -1, -1, -1, 98, 99, 100, -1, -1, 1268, 994,
5909 995, 996, 1272, 1273, -1, -1, -1, -1, 640, -1,
5910 642, -1, -1, -1, -1, 492, 1011, -1, -1, -1,
5911 -1, -1, -1, -1, -1, 1, -1, -1, -1, -1,
5912 662, -1, -1, 1028, 511, -1, -1, -1, -1, -1,
5913 672, 673, -1, -1, -1, -1, -1, -1, -1, -1,
5914 -1, -1, -1, -1, -1, 532, -1, -1, -1, -1,
5915 -1, 538, 1332, -1, -1, -1, -1, -1, -1, -1,
5916 -1, -1, -1, 1003, 1004, -1, 52, 53, -1, 711,
5917 56, -1, -1, -1, -1, -1, -1, -1, 720, -1,
5918 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5919 577, 578, -1, 580, 581, -1, -1, -1, -1, 85,
5920 -1, 1106, 589, -1, 1109, 1110, 221, 594, -1, -1,
5921 -1, -1, 98, 99, 100, -1, -1, -1, 1058, 1059,
5922 -1, -1, 1062, 1128, -1, -1, 1131, -1, -1, -1,
5923 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1079,
5924 -1, 256, -1, 785, -1, 1150, -1, -1, -1, -1,
5925 -1, -1, -1, 640, -1, 642, -1, -1, 273, -1,
5926 -1, -1, -1, 650, -1, -1, -1, 1172, -1, -1,
5927 -1, -1, -1, 660, 1114, 662, 663, -1, 293, -1,
5928 1185, -1, -1, -1, -1, 672, 673, -1, -1, -1,
5929 -1, -1, 834, -1, -1, 837, 1136, -1, 25, 1139,
5930 -1, -1, -1, -1, -1, -1, -1, -1, 323, -1,
5931 -1, -1, 699, 1153, 1154, 1155, -1, -1, 1158, 1159,
5932 -1, -1, -1, 1163, 1164, -1, -1, -1, -1, -1,
5933 -1, -1, -1, 1238, -1, 221, 351, 352, -1, -1,
5934 1245, 1246, -1, -1, 1249, 1003, 1004, -1, -1, -1,
5935 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
5936 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
5937 256, -1, -1, -1, 101, 390, -1, -1, -1, 921,
5938 922, 396, 397, 1288, -1, 927, 928, 273, -1, -1,
5939 -1, -1, -1, -1, 936, -1, -1, -1, -1, -1,
5940 1058, 1059, -1, -1, 1062, 55, -1, 293, -1, 136,
5941 952, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5942 147, 1079, -1, -1, -1, -1, -1, -1, 1268, 971,
5943 -1, -1, 1272, 1273, -1, -1, -1, 323, -1, -1,
5944 -1, -1, -1, -1, -1, -1, -1, 834, -1, 836,
5945 837, -1, 994, 995, 996, -1, 1114, -1, -1, -1,
5946 -1, -1, -1, -1, -1, 351, 352, -1, -1, 1011,
5947 -1, -1, -1, -1, -1, -1, -1, 492, 1136, -1,
5948 -1, 1139, -1, -1, -1, -1, 1028, -1, -1, -1,
5949 -1, -1, 1332, -1, 509, 1153, 1154, 1155, -1, -1,
5950 1158, 1159, -1, -1, 390, 1163, 1164, -1, -1, -1,
5951 396, 397, -1, 900, -1, -1, -1, 532, -1, -1,
5952 -1, -1, -1, 538, -1, -1, 1003, 1004, -1, 916,
5953 -1, -1, -1, -1, 921, 922, -1, -1, -1, -1,
5954 927, 928, -1, -1, -1, -1, -1, -1, -1, 936,
5955 937, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5956 1102, -1, -1, 578, 1106, 952, 581, 1109, 1110, 219,
5957 -1, -1, 222, 223, 224, -1, 591, -1, -1, 594,
5958 -1, 1058, 1059, -1, 971, 1062, 1128, -1, -1, 1131,
5959 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5960 -1, -1, 1079, -1, -1, -1, 492, 994, 995, 996,
5961 1268, -1, -1, 1, 1272, 1273, -1, -1, -1, -1,
5962 -1, -1, -1, 509, 1011, 640, -1, 642, -1, -1,
5963 1172, -1, -1, -1, -1, -1, -1, 1114, -1, -1,
5964 -1, 1028, -1, 1185, -1, -1, 532, 662, -1, -1,
5965 -1, -1, 538, -1, -1, 1197, -1, 672, 673, 1136,
5966 -1, -1, 1139, -1, 52, 53, -1, -1, 56, 1,
5967 -1, -1, -1, -1, 1332, -1, 1153, 1154, 1155, -1,
5968 -1, 1158, 1159, -1, -1, -1, 1163, 1164, -1, -1,
5969 -1, -1, 578, -1, -1, 581, 711, 85, -1, -1,
5970 -1, -1, -1, -1, -1, 591, -1, 1249, 594, -1,
5971 98, 99, 100, 101, -1, -1, -1, 1259, -1, 1106,
5972 52, 53, 1109, 1110, -1, -1, -1, -1, -1, -1,
5973 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5974 -1, 1128, -1, -1, 1131, -1, 1288, -1, -1, -1,
5975 -1, -1, -1, -1, 640, -1, 642, -1, -1, 1003,
5976 1004, -1, -1, 1150, -1, -1, -1, -1, -1, -1,
5977 785, -1, -1, -1, -1, -1, 662, -1, -1, -1,
5978 -1, -1, -1, -1, -1, 1172, 672, 673, -1, -1,
5979 -1, 1268, -1, -1, -1, 1272, 1273, -1, 1185, -1,
5980 -1, -1, -1, -1, 454, 455, -1, -1, -1, -1,
5981 -1, -1, -1, 463, 1058, 1059, -1, -1, 1062, 834,
5982 -1, -1, 837, -1, -1, 711, -1, -1, -1, -1,
5983 -1, -1, -1, 221, -1, 1079, -1, -1, -1, -1,
5984 -1, -1, -1, -1, -1, -1, 496, -1, -1, 499,
5985 -1, 1238, -1, -1, -1, 1332, -1, -1, 1245, 1246,
5986 -1, -1, 1249, -1, -1, -1, -1, -1, 256, -1,
5987 1114, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5988 -1, -1, -1, -1, -1, 273, -1, -1, -1, 221,
5989 -1, -1, 1136, -1, -1, 1139, -1, -1, -1, 785,
5990 -1, 1288, -1, -1, -1, 293, 921, 922, -1, 1153,
5991 1154, 1155, 927, 928, 1158, 1159, -1, -1, 568, 1163,
5992 1164, 936, -1, -1, 256, -1, -1, -1, -1, -1,
5993 -1, -1, -1, -1, -1, 323, -1, 952, -1, 589,
5994 -1, 273, -1, -1, 594, -1, -1, -1, 834, -1,
5995 -1, 837, -1, -1, -1, -1, 971, -1, -1, -1,
5996 -1, -1, -1, 351, 352, -1, -1, -1, -1, -1,
5997 -1, -1, -1, -1, -1, -1, -1, -1, -1, 994,
5998 995, 996, -1, -1, -1, -1, -1, -1, -1, -1,
5999 -1, 323, -1, -1, -1, -1, 1011, -1, -1, -1,
6000 -1, -1, 390, -1, -1, -1, -1, -1, 396, 397,
6001 -1, -1, -1, 1028, -1, -1, -1, -1, -1, 351,
6002 -1, -1, -1, -1, 1268, 675, -1, -1, 1272, 1273,
6003 -1, -1, -1, -1, -1, 921, 922, -1, -1, -1,
6004 -1, 927, 928, 693, -1, 695, -1, -1, -1, -1,
6005 936, 33, 34, 35, 36, -1, -1, -1, 390, -1,
6006 -1, -1, -1, -1, 396, 397, 952, 49, 50, 51,
6007 -1, -1, -1, -1, -1, -1, -1, 59, 60, 61,
6008 62, 63, -1, -1, -1, 971, -1, 1102, 1332, -1,
6009 -1, 1106, -1, -1, 1109, 1110, -1, -1, -1, 749,
6010 -1, -1, -1, -1, 492, -1, -1, -1, 994, 995,
6011 996, -1, -1, 1128, -1, -1, 1131, -1, -1, -1,
6012 -1, 509, -1, -1, -1, 1011, -1, 777, -1, 111,
6013 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6014 -1, -1, 1028, -1, 532, -1, 1003, 1004, -1, -1,
6015 538, -1, -1, -1, -1, -1, 806, 1172, -1, -1,
6016 492, -1, -1, -1, -1, -1, 148, -1, -1, -1,
6017 1185, -1, -1, -1, 824, -1, -1, -1, -1, -1,
6018 -1, -1, 1197, -1, -1, -1, -1, -1, -1, -1,
6019 578, -1, -1, 581, -1, -1, -1, -1, -1, -1,
6020 532, 1058, 1059, 591, -1, 1062, 538, -1, -1, -1,
6021 -1, -1, -1, -1, -1, -1, 1102, -1, -1, -1,
6022 1106, -1, 1079, 1109, 1110, -1, -1, -1, 1003, 1004,
6023 -1, -1, -1, -1, 1249, -1, -1, -1, -1, -1,
6024 -1, -1, 1128, -1, 1259, 1131, 578, -1, -1, 581,
6025 -1, -1, 640, -1, 642, -1, -1, 1114, -1, 909,
6026 -1, -1, 594, -1, -1, -1, -1, -1, -1, -1,
6027 -1, -1, -1, 1288, 662, -1, -1, -1, -1, 1136,
6028 -1, 931, 1139, 1058, 1059, -1, 1172, 1062, -1, -1,
6029 -1, -1, -1, 943, -1, -1, 1153, 1154, 1155, 1185,
6030 -1, 1158, 1159, -1, 1079, -1, 1163, 1164, 640, -1,
6031 642, 1197, -1, -1, -1, -1, -1, -1, 968, -1,
6032 -1, -1, -1, 711, -1, -1, -1, -1, -1, -1,
6033 662, -1, -1, -1, -1, -1, -1, -1, -1, 1114,
6034 672, 673, 992, -1, -1, -1, -1, -1, -1, -1,
6035 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6036 -1, 1136, -1, 1249, 1139, -1, -1, -1, -1, -1,
6037 -1, -1, -1, 1259, -1, -1, -1, 1027, 1153, 1154,
6038 1155, -1, -1, 1158, 1159, -1, -1, -1, 1163, 1164,
6039 -1, -1, -1, -1, -1, -1, -1, 785, -1, -1,
6040 -1, -1, 1288, -1, -1, -1, -1, -1, -1, -1,
6041 -1, 1268, -1, -1, -1, 1272, 1273, -1, -1, -1,
6042 -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
6043 -1, -1, -1, -1, 8, 9, 10, -1, -1, 13,
6044 14, 15, -1, 17, -1, -1, 834, -1, -1, 837,
6045 -1, 25, 26, 27, -1, -1, -1, -1, -1, -1,
6046 -1, 1111, -1, 37, 38, -1, 40, 41, 42, 43,
6047 44, -1, -1, -1, -1, 1332, -1, -1, -1, -1,
6048 -1, 15, 16, -1, -1, -1, -1, -1, -1, -1,
6049 -1, -1, -1, 1268, 68, 69, -1, 1272, 1273, -1,
6050 -1, -1, 834, -1, -1, 837, -1, -1, -1, -1,
6051 -1, -1, -1, 47, 48, 49, 50, -1, -1, -1,
6052 54, 55, -1, 97, 98, -1, -1, -1, -1, -1,
6053 -1, -1, -1, 67, 68, -1, -1, -1, -1, -1,
6054 -1, -1, -1, 33, 34, 35, 36, 121, 936, -1,
6055 -1, -1, -1, -1, -1, -1, -1, 1332, -1, 49,
6056 50, 51, 52, -1, 952, -1, 56, -1, 102, 59,
6057 60, 61, 62, 63, -1, -1, -1, -1, 152, 153,
6058 -1, 155, -1, 971, 158, 159, -1, 161, -1, 921,
6059 922, -1, -1, -1, -1, 927, 928, -1, -1, -1,
6060 -1, 91, 92, -1, 936, -1, 994, 995, -1, 99,
6061 -1, -1, 102, -1, -1, 105, 106, -1, 108, -1,
6062 952, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6063 -1, -1, 44, -1, -1, -1, -1, -1, -1, 971,
6064 1028, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6065 -1, 141, -1, -1, -1, -1, -1, -1, 148, -1,
6066 -1, -1, 994, 995, 996, 155, 78, 79, 80, 81,
6067 82, 83, 84, 85, 86, 87, 88, 89, 90, 1011,
6068 -1, -1, -1, 95, 96, 219, -1, -1, 222, 223,
6069 224, -1, 226, -1, -1, -1, 1028, -1, -1, -1,
6070 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6071 -1, 245, -1, 247, 1102, -1, 44, -1, 1106, -1,
6072 -1, 1109, 1110, -1, 136, -1, 138, 139, 140, 141,
6073 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
6074 1128, -1, -1, 1131, 156, -1, -1, -1, -1, -1,
6075 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
6076 88, 89, 90, -1, -1, -1, -1, 95, 96, -1,
6077 -1, -1, -1, -1, 1106, -1, -1, 1109, 1110, -1,
6078 -1, -1, -1, -1, 1172, -1, -1, -1, -1, -1,
6079 -1, -1, -1, -1, -1, -1, 1128, 1185, -1, 1131,
6080 -1, -1, -1, -1, -1, -1, -1, -1, 136, 1197,
6081 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6082 -1, -1, 356, 357, 358, 359, 360, -1, -1, 363,
6083 364, 365, 366, 367, 368, 369, 370, -1, 372, -1,
6084 1172, 375, 376, 377, 378, 379, 380, 381, 382, 383,
6085 384, -1, -1, 1185, 388, -1, -1, -1, -1, -1,
6086 -1, 1249, -1, -1, -1, -1, -1, -1, -1, -1,
6087 -1, 1259, -1, -1, -1, -1, -1, -1, -1, -1,
6088 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6089 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6090 1288, 435, -1, -1, -1, -1, -1, -1, -1, -1,
6091 -1, -1, -1, -1, -1, -1, -1, 1249, -1, -1,
6092 454, 455, -1, -1, -1, 459, -1, -1, -1, 463,
6093 0, 465, -1, -1, -1, -1, -1, -1, 8, 9,
6094 10, -1, -1, 13, 14, 15, -1, 17, -1, 483,
6095 -1, -1, -1, -1, -1, 25, 1288, 27, 28, 29,
6096 -1, -1, 496, -1, -1, 499, -1, 37, 38, -1,
6097 40, 41, 42, 43, 44, -1, -1, 511, -1, -1,
6098 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6099 -1, -1, -1, -1, -1, 529, -1, -1, 68, 69,
6100 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
6101 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
6102 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
6103 100, 101, -1, -1, 568, -1, -1, 107, -1, -1,
6104 -1, -1, -1, 577, -1, -1, 580, -1, -1, -1,
6105 -1, 121, -1, -1, 124, 589, -1, -1, -1, -1,
6106 594, -1, -1, -1, -1, 135, 136, 137, 138, 139,
6107 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
6108 -1, -1, -1, 153, 154, 155, 156, -1, -1, 159,
6109 160, 161, -1, 52, 53, -1, -1, 56, -1, -1,
6110 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6111 -1, -1, -1, -1, -1, -1, 650, 76, 77, 78,
6112 79, 80, 81, 82, 83, 84, 660, -1, 87, 88,
6113 -1, -1, -1, -1, 93, 94, 95, 96, 672, 673,
6114 -1, 675, 676, 677, 678, -1, -1, -1, -1, 108,
6115 109, -1, -1, -1, -1, 689, 690, -1, -1, 693,
6116 -1, 695, -1, -1, -1, -1, -1, -1, -1, -1,
6117 -1, 705, -1, -1, -1, -1, -1, -1, -1, 138,
6118 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6119 149, 150, -1, -1, -1, -1, -1, -1, 157, 158,
6120 -1, -1, 0, 1, -1, 3, 4, 5, 6, 7,
6121 8, 9, 10, 11, 12, 749, 14, 15, 16, 17,
6122 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
6123 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
6124 -1, 39, -1, 777, -1, -1, -1, 45, 46, 47,
6125 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6126 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6127 68, -1, 806, -1, -1, -1, -1, -1, 76, 77,
6128 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6129 824, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6130 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6131 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6132 118, 119, -1, 121, -1, -1, -1, -1, -1, -1,
6133 -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
6134 79, 80, 81, 82, 83, 84, 85, -1, 87, 88,
6135 148, 149, 150, -1, -1, 153, 95, 96, -1, -1,
6136 -1, 159, -1, 161, -1, -1, 900, -1, -1, -1,
6137 -1, -1, -1, -1, -1, 909, -1, -1, -1, -1,
6138 -1, -1, 916, -1, -1, -1, 920, 921, 922, -1,
6139 -1, -1, -1, 927, 928, -1, -1, 931, -1, 138,
6140 139, 140, 141, 142, 143, 144, 145, 146, 147, 943,
6141 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6142 -1, -1, -1, -1, -1, -1, -1, 961, 962, 963,
6143 -1, 965, 966, -1, 968, -1, -1, -1, -1, -1,
6144 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6145 -1, -1, -1, -1, 988, 989, -1, -1, 992, -1,
6146 -1, -1, 996, 997, -1, -1, -1, -1, -1, -1,
6147 -1, -1, -1, -1, -1, -1, -1, 1011, -1, -1,
6148 -1, -1, -1, -1, 0, 1, -1, 3, 4, 5,
6149 6, 7, -1, 1027, -1, 11, 12, -1, -1, -1,
6150 16, 1035, 18, 19, 20, 21, 22, 23, 24, -1,
6151 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
6152 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
6153 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
6154 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6155 -1, -1, -1, 78, 79, 80, 81, 82, 83, 84,
6156 76, 77, 87, 88, -1, -1, -1, -1, -1, -1,
6157 95, 96, -1, -1, -1, 91, 92, 1111, -1, -1,
6158 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6159 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6160 116, 117, 118, 119, -1, 121, -1, -1, -1, -1,
6161 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
6162 145, 146, 147, -1, -1, -1, -1, -1, -1, -1,
6163 -1, -1, 148, 149, 150, -1, -1, 0, 1, 155,
6164 3, 4, 5, 6, 7, 161, -1, -1, 11, 12,
6165 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6166 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
6167 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6168 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6169 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6170 63, 64, 65, -1, 1238, -1, 78, 79, 80, 81,
6171 82, 83, 84, 76, 77, 87, 88, -1, -1, -1,
6172 -1, -1, -1, 95, 96, -1, -1, -1, 91, 92,
6173 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6174 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
6175 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6176 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
6177 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
6178 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
6179 0, 1, 155, 3, 4, 5, 6, 7, 161, -1,
6180 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6181 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
6182 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6183 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
6184 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6185 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6186 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6187 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6188 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6189 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
6190 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6191 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
6192 -1, -1, -1, -1, -1, -1, -1, 8, 9, 10,
6193 -1, -1, 13, 14, 15, -1, 17, -1, 148, 149,
6194 150, -1, -1, 153, 25, 26, 27, 28, 29, -1,
6195 -1, 161, -1, -1, -1, -1, 37, 38, -1, 40,
6196 41, 42, 43, 44, -1, -1, -1, 78, 79, 80,
6197 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
6198 -1, -1, -1, -1, 95, 96, -1, 68, 69, -1,
6199 -1, -1, -1, -1, -1, -1, -1, 78, 79, 80,
6200 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
6201 -1, -1, -1, -1, 95, 96, 97, 98, -1, 100,
6202 101, -1, -1, -1, -1, 136, 107, 138, 139, 140,
6203 141, 142, 143, 144, 145, 146, 147, -1, -1, -1,
6204 121, -1, -1, 124, 155, -1, -1, -1, -1, -1,
6205 -1, -1, -1, -1, 135, 136, 137, 138, 139, 140,
6206 141, 142, 143, 144, 145, 146, 147, -1, -1, -1,
6207 -1, 152, 153, 154, 155, 156, 0, -1, 159, 160,
6208 161, -1, -1, -1, 8, 9, 10, -1, -1, 13,
6209 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
6210 -1, 25, -1, 27, 28, 29, -1, -1, -1, -1,
6211 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
6212 44, -1, -1, -1, 78, 79, 80, 81, 82, 83,
6213 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
6214 -1, 95, 96, -1, 68, 69, -1, -1, -1, -1,
6215 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
6216 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
6217 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
6218 -1, -1, 136, 107, 138, 139, 140, 141, 142, 143,
6219 144, 145, 146, 147, -1, -1, -1, 121, -1, -1,
6220 124, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6221 -1, 135, 136, 137, 138, 139, 140, 141, 142, 143,
6222 144, 145, 146, 147, -1, -1, -1, -1, -1, 153,
6223 154, 155, 156, 0, -1, 159, 160, 161, -1, -1,
6224 -1, 8, 9, 10, -1, -1, 13, 14, 15, -1,
6225 17, -1, -1, -1, -1, -1, -1, -1, 25, 26,
6226 27, 28, 29, -1, -1, -1, -1, -1, -1, -1,
6227 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
6228 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
6229 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
6230 -1, 68, 69, -1, -1, -1, -1, -1, -1, -1,
6231 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
6232 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
6233 97, 98, -1, -1, 101, -1, -1, -1, -1, -1,
6234 107, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6235 147, -1, -1, -1, 121, -1, -1, 124, -1, -1,
6236 -1, -1, -1, -1, -1, -1, -1, -1, -1, 136,
6237 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6238 147, -1, -1, -1, -1, 152, 153, 154, 155, 156,
6239 0, -1, 159, 160, 161, -1, -1, -1, 8, 9,
6240 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
6241 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
6242 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
6243 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
6244 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6245 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
6246 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
6247 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
6248 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
6249 -1, 101, -1, -1, -1, -1, -1, 107, -1, -1,
6250 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6251 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
6252 -1, -1, -1, -1, -1, -1, 136, 137, 138, 139,
6253 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
6254 -1, -1, 152, 153, 154, 155, 156, 0, -1, 159,
6255 160, 161, -1, -1, -1, 8, 9, 10, -1, -1,
6256 13, 14, 15, -1, 17, -1, -1, -1, -1, -1,
6257 -1, -1, 25, 26, 27, 28, -1, -1, -1, -1,
6258 -1, -1, -1, -1, 37, 38, -1, 40, 41, 42,
6259 43, 44, -1, -1, -1, -1, -1, -1, -1, -1,
6260 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6261 -1, -1, -1, -1, -1, 68, 69, -1, -1, -1,
6262 -1, -1, -1, -1, -1, 78, 79, 80, 81, 82,
6263 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
6264 -1, -1, 95, 96, 97, 98, -1, -1, 101, -1,
6265 -1, -1, -1, -1, 107, -1, -1, -1, -1, -1,
6266 -1, -1, -1, -1, -1, -1, -1, -1, 121, -1,
6267 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6268 -1, -1, -1, 136, -1, 138, 139, 140, 141, 142,
6269 143, 144, 145, 146, 147, -1, -1, -1, -1, 152,
6270 153, 154, 155, 156, 0, 158, 159, 160, 161, -1,
6271 -1, -1, 8, 9, 10, -1, -1, 13, 14, 15,
6272 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
6273 -1, 27, 28, 29, -1, -1, -1, -1, -1, -1,
6274 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
6275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6277 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
6278 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
6279 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
6280 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
6281 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
6282 -1, -1, -1, -1, -1, 121, -1, -1, 124, -1,
6283 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6284 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
6285 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
6286 156, 0, -1, 159, 160, 161, -1, -1, -1, 8,
6287 9, 10, -1, -1, 13, 14, 15, -1, 17, -1,
6288 -1, -1, -1, -1, -1, -1, 25, 26, 27, 28,
6289 -1, -1, -1, -1, -1, -1, -1, -1, 37, 38,
6290 -1, 40, 41, 42, 43, 44, -1, -1, -1, -1,
6291 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6292 -1, -1, -1, -1, -1, -1, -1, -1, -1, 68,
6293 69, -1, -1, -1, -1, -1, -1, -1, -1, 78,
6294 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
6295 89, 90, -1, -1, -1, -1, 95, 96, 97, 98,
6296 -1, -1, 101, -1, -1, -1, -1, -1, 107, -1,
6297 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6298 -1, -1, 121, -1, -1, -1, -1, -1, -1, -1,
6299 -1, -1, -1, -1, -1, -1, -1, 136, -1, 138,
6300 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6301 -1, -1, -1, 152, 153, 154, 155, 156, 0, 158,
6302 159, 160, 161, -1, -1, -1, 8, 9, 10, -1,
6303 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
6304 -1, -1, -1, 25, -1, 27, 28, -1, -1, -1,
6305 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
6306 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
6307 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6308 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
6309 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
6310 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
6311 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
6312 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
6313 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
6314 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6315 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
6316 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
6317 152, 153, 154, 155, 156, 0, -1, 159, 160, 161,
6318 -1, -1, -1, 8, 9, 10, -1, -1, 13, 14,
6319 15, -1, 17, -1, -1, -1, -1, -1, -1, -1,
6320 25, -1, 27, 28, -1, -1, -1, -1, -1, -1,
6321 -1, -1, 37, 38, -1, 40, 41, 42, 43, 44,
6322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6324 -1, -1, -1, 68, 69, -1, -1, -1, -1, -1,
6325 -1, -1, -1, 78, 79, 80, 81, 82, 83, 84,
6326 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
6327 95, 96, 97, 98, -1, -1, 101, -1, -1, -1,
6328 -1, -1, 107, -1, -1, -1, -1, -1, -1, -1,
6329 -1, -1, -1, -1, -1, -1, 121, -1, -1, -1,
6330 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6331 -1, 136, -1, 138, 139, 140, 141, 142, 143, 144,
6332 145, 146, 147, -1, -1, -1, -1, -1, 153, 154,
6333 155, 156, 0, 158, 159, 160, 161, -1, -1, -1,
6334 8, 9, 10, -1, -1, -1, 14, 15, -1, 17,
6335 -1, -1, -1, -1, -1, -1, -1, 25, 26, -1,
6336 -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
6337 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
6338 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6339 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6340 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
6341 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
6342 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
6343 98, -1, 100, 101, -1, -1, -1, -1, -1, -1,
6344 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6345 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
6346 -1, -1, -1, -1, -1, -1, -1, 135, 136, -1,
6347 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6348 -1, -1, -1, -1, 152, 153, 154, 155, 156, 0,
6349 -1, 159, -1, 161, -1, -1, -1, 8, 9, 10,
6350 -1, -1, -1, 14, 15, -1, 17, -1, -1, -1,
6351 -1, -1, -1, -1, 25, 26, -1, -1, -1, -1,
6352 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
6353 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
6354 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6355 -1, -1, -1, -1, -1, -1, -1, 68, 69, -1,
6356 -1, -1, -1, -1, -1, -1, -1, 78, 79, 80,
6357 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
6358 -1, -1, -1, -1, 95, 96, 97, 98, -1, 100,
6359 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6360 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6361 121, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6362 -1, -1, -1, -1, 135, 136, -1, 138, 139, 140,
6363 141, 142, 143, 144, 145, 146, 147, -1, -1, -1,
6364 -1, 152, 153, 154, 155, 156, 0, -1, 159, -1,
6365 161, -1, -1, -1, 8, 9, 10, -1, -1, -1,
6366 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
6367 -1, 25, -1, -1, -1, -1, -1, -1, -1, -1,
6368 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
6369 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6370 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6371 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
6372 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
6373 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
6374 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
6375 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6376 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
6377 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6378 -1, 135, 136, -1, 138, 139, 140, 141, 142, 143,
6379 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
6380 154, 155, 156, 0, -1, 159, -1, 161, -1, -1,
6381 -1, 8, 9, 10, -1, -1, -1, 14, 15, -1,
6382 17, -1, -1, -1, -1, -1, -1, -1, 25, -1,
6383 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6384 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
6385 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6386 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6387 -1, 68, 69, -1, -1, -1, -1, -1, -1, -1,
6388 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
6389 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
6390 97, 98, -1, 100, 101, -1, -1, -1, -1, -1,
6391 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6392 -1, -1, -1, -1, 121, -1, -1, -1, -1, -1,
6393 -1, -1, -1, -1, -1, -1, -1, -1, 135, 136,
6394 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6395 147, -1, -1, -1, -1, 152, 153, 154, 155, 156,
6396 -1, -1, 159, 1, 161, 3, 4, 5, 6, 7,
6397 8, 9, 10, 11, 12, -1, -1, 15, 16, -1,
6398 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
6399 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
6400 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6401 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6402 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6403 68, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6404 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6405 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6406 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6407 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6408 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
6409 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6410 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6411 148, 149, 150, -1, -1, -1, 1, 155, 3, 4,
6412 5, 6, 7, 161, -1, 10, 11, 12, -1, 14,
6413 15, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6414 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
6415 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6416 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
6417 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6418 65, -1, -1, 68, -1, -1, -1, -1, -1, -1,
6419 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6420 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6421 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6422 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
6423 115, 116, 117, 118, 119, -1, -1, -1, -1, -1,
6424 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6425 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6426 -1, -1, -1, 148, 149, 150, -1, -1, -1, 1,
6427 155, 3, 4, 5, 6, 7, 161, -1, 10, 11,
6428 12, -1, -1, 15, 16, 17, 18, 19, 20, 21,
6429 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
6430 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6431 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
6432 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6433 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
6434 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6435 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6436 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6437 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
6438 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6439 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6440 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6441 -1, -1, -1, -1, -1, -1, 148, 149, 150, -1,
6442 -1, -1, 1, 155, 3, 4, 5, 6, 7, 161,
6443 -1, 10, 11, 12, -1, -1, 15, 16, -1, 18,
6444 19, 20, 21, 22, 23, 24, 25, -1, -1, -1,
6445 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6446 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
6447 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6448 59, 60, 61, 62, 63, 64, 65, -1, -1, 68,
6449 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6450 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6451 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6452 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6453 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6454 119, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6455 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6456 -1, -1, -1, -1, -1, -1, -1, -1, -1, 148,
6457 149, 150, -1, -1, -1, 1, 155, 3, 4, 5,
6458 6, 7, 161, -1, 10, 11, 12, -1, -1, 15,
6459 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6460 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
6461 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
6462 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
6463 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6464 -1, -1, 68, -1, -1, -1, -1, -1, -1, -1,
6465 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6466 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6467 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6468 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6469 116, 117, 118, 119, -1, -1, -1, -1, -1, -1,
6470 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6471 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6472 -1, -1, 148, 149, 150, -1, -1, -1, 1, 155,
6473 3, 4, 5, 6, 7, 161, 9, 10, 11, 12,
6474 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6475 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
6476 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6477 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6478 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6479 63, 64, 65, -1, -1, 68, -1, -1, -1, -1,
6480 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6481 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6482 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6483 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
6484 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6485 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6486 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6487 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
6488 -1, 1, 155, 3, 4, 5, 6, 7, 161, -1,
6489 10, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6490 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
6491 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6492 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
6493 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6494 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
6495 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6496 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6497 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6498 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
6499 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6500 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6501 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6502 -1, -1, -1, -1, -1, -1, -1, -1, 148, 149,
6503 150, -1, -1, -1, 1, 155, 3, 4, 5, 6,
6504 7, 161, -1, -1, 11, 12, -1, -1, -1, 16,
6505 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6506 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6507 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
6508 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6509 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6510 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6511 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6512 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6513 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6514 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6515 117, 118, 119, -1, -1, -1, -1, -1, -1, -1,
6516 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6517 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6518 -1, 148, 149, 150, -1, -1, -1, -1, 155, -1,
6519 -1, -1, 159, 1, 161, 3, 4, 5, 6, 7,
6520 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6521 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
6522 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
6523 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6524 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6525 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6526 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6527 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6528 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6529 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6530 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6531 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
6532 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6533 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6534 148, 149, 150, -1, -1, -1, -1, 155, -1, -1,
6535 -1, 159, 1, 161, 3, 4, 5, 6, 7, -1,
6536 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6537 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
6538 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6539 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
6540 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6541 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6542 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6543 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6544 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6545 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6546 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6547 119, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6548 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6549 -1, -1, -1, -1, -1, -1, -1, -1, -1, 148,
6550 149, 150, -1, -1, 153, 1, 155, 3, 4, 5,
6551 6, 7, 161, -1, -1, 11, 12, -1, -1, -1,
6552 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6553 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
6554 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
6555 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
6556 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6557 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6558 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6559 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6560 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6561 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6562 116, 117, 118, 119, -1, -1, -1, -1, -1, -1,
6563 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6564 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6565 -1, -1, 148, 149, 150, -1, -1, 153, 1, 155,
6566 3, 4, 5, -1, 7, 161, -1, -1, 11, 12,
6567 -1, -1, -1, 16, 17, 18, 19, 20, 21, 22,
6568 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
6569 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6570 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6571 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6572 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6573 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6574 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6575 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6576 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6577 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6578 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6579 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6580 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
6581 -1, -1, 155, -1, -1, -1, -1, -1, 161, 3,
6582 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
6583 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
6584 24, 25, 26, -1, -1, -1, 30, 31, 32, 33,
6585 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
6586 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
6587 54, 55, 56, 57, -1, -1, -1, -1, -1, -1,
6588 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6589 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
6590 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
6591 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
6592 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
6593 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6594 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6595 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
6596 144, 145, 146, 147, -1, 149, 150, -1, -1, -1,
6597 -1, -1, -1, 157, 158, 3, 4, 5, 6, 7,
6598 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
6599 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
6600 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
6601 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6602 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6603 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6604 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6605 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6606 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6607 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6608 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
6609 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6610 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6611 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6612 -1, 149, 150, -1, -1, -1, -1, -1, -1, 157,
6613 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
6614 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
6615 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
6616 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
6617 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6618 53, 54, -1, 56, -1, -1, -1, -1, -1, -1,
6619 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6620 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
6621 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
6622 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
6623 -1, -1, -1, -1, -1, 108, 109, -1, -1, 112,
6624 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6625 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6626 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
6627 143, 144, 145, 146, 147, -1, 149, 150, -1, -1,
6628 -1, -1, -1, -1, 157, 3, 4, 5, 6, 7,
6629 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
6630 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
6631 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
6632 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6633 48, 49, 50, 51, 52, 53, -1, -1, 56, -1,
6634 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6635 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6636 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6637 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6638 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6639 108, 109, -1, -1, 112, -1, -1, -1, -1, -1,
6640 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6642 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6643 -1, 149, 150, -1, -1, -1, -1, -1, -1, 157,
6644 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
6645 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
6646 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
6647 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
6648 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6649 53, -1, -1, 56, -1, -1, -1, -1, -1, -1,
6650 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6651 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
6652 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
6653 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
6654 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
6655 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6656 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6657 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
6658 143, 144, 145, 146, 147, -1, 149, 150, 3, 4,
6659 5, -1, 7, -1, 157, -1, 11, 12, -1, -1,
6660 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6661 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
6662 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6663 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6664 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6665 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6667 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6668 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6669 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
6670 115, 116, 117, 118, 119, -1, -1, 3, 4, 5,
6671 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6672 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6673 -1, -1, -1, 148, 30, 31, 32, 33, 34, 35,
6674 36, 156, -1, 39, -1, -1, -1, -1, -1, -1,
6675 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6676 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6677 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6678 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6680 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6681 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
6682 116, 117, 118, 119, -1, -1, 3, 4, 5, -1,
6683 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
6684 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6685 -1, -1, 148, 30, 31, 32, 33, 34, 35, 36,
6686 156, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6687 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6688 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
6689 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6690 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6691 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6692 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6693 -1, 108, 109, 110, 111, 112, 113, 114, 115, 116,
6694 117, 118, 119, -1, -1, -1, -1, -1, -1, -1,
6695 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6696 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
6697 7, 148, 149, 150, 11, 12, -1, -1, 155, 16,
6698 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6699 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6700 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6701 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6702 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6703 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6704 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6705 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6706 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6707 -1, -1, -1, -1, 111, 112, 113, 114, 115, 116,
6708 117, 118, 119, -1, -1, -1, -1, -1, -1, -1,
6709 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6710 -1, -1, -1, -1, 1, -1, 3, 4, 5, 6,
6711 7, 148, 149, 150, 11, 12, -1, -1, 155, 16,
6712 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6713 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6714 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
6715 -1, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6716 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6717 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6718 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6719 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6720 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6721 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6722 117, 118, 119, -1, -1, 1, -1, 3, 4, 5,
6723 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6724 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6725 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6726 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6727 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6728 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6729 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6730 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6731 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6732 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6733 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
6734 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6735 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6736 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6737 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6738 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6739 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6740 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
6741 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6742 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6743 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6744 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6745 105, 106, -1, 108, 109, 110, 111, 112, 113, 114,
6746 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6747 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6748 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6749 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6750 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6751 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6752 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
6753 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6754 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6755 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6756 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6757 -1, 105, 106, -1, 108, 109, 110, 111, 112, 113,
6758 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6759 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6760 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6761 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6762 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6763 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6764 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
6765 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6766 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6767 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6768 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6769 103, -1, 105, 106, -1, 108, 109, 110, 111, 112,
6770 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6771 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6772 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6773 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6774 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6775 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6776 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
6777 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6778 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6779 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6780 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6781 102, 103, -1, 105, 106, -1, 108, 109, 110, 111,
6782 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6783 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6784 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6785 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6786 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6787 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6788 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
6789 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6790 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6791 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6792 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6793 -1, 102, 103, -1, 105, 106, -1, 108, 109, -1,
6794 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6795 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6796 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6797 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6798 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6799 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6800 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
6801 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6802 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6803 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6804 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6805 -1, -1, 102, 103, -1, 105, 106, -1, -1, 109,
6806 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6807 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6808 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6809 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6810 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6811 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6812 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
6813 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6814 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6815 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6816 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6817 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6818 109, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6819 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6820 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6821 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6822 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6823 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6824 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6825 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6826 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6827 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6828 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6829 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6830 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6831 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
6832 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
6833 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6834 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
6835 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6836 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6837 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6838 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6839 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6840 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6841 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6842 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6843 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
6844 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6845 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6846 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6847 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6848 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6849 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6850 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6851 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6852 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6853 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6854 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6855 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6856 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6857 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6858 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6859 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6860 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6861 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6862 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6863 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6864 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6865 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6866 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
6867 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6868 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6869 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6870 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6871 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6872 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6873 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
6874 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6875 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6876 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6877 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6878 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
6879 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6880 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6881 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6882 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6883 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6884 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6885 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6886 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6887 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6888 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6889 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6890 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6891 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6892 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6893 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6894 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6895 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6896 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6897 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6898 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6899 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6900 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6901 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6902 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
6903 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6904 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6905 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6906 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6907 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6908 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6909 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6910 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6911 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6912 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6913 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6914 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6915 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6916 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6917 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6918 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6919 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6920 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6921 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6922 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6923 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6924 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6925 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6926 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6927 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6928 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6929 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6930 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6931 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6932 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6933 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6934 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6935 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6936 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6937 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6938 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6939 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6940 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6941 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6942 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6943 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6944 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6945 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6946 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6947 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6948 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6949 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6950 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6951 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6952 118, 119, -1, -1, 3, 4, 5, -1, 7, -1,
6953 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6954 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
6955 148, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6956 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6957 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6958 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6959 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6960 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6961 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6962 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6963 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6964 119, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6965 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6966 20, 21, 22, 23, 24, -1, -1, -1, -1, 148,
6967 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6968 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6969 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6970 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6971 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6972 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6973 -1, -1, -1, -1, -1, 95, -1, -1, -1, 99,
6974 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6975 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6976 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6977 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6978 21, 22, 23, 24, -1, -1, -1, -1, 148, 30,
6979 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6980 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6981 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6982 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6983 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6984 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6985 -1, -1, -1, -1, -1, -1, -1, -1, 99, -1,
6986 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6987 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6988 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6989 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6990 22, 23, 24, -1, -1, -1, -1, 148, 30, 31,
6991 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6992 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6993 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6994 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6995 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6996 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6997 -1, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6998 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
6999 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
7000 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
7001 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
7002 23, 24, -1, -1, -1, -1, 148, 30, 31, 32,
7003 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
7004 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
7005 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
7006 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
7007 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7008 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7009 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
7010 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
7011 113, 114, 115, 116, 117, 118, 119, -1, -1, 3,
7012 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
7013 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
7014 24, -1, -1, -1, -1, 148, 30, 31, 32, 33,
7015 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
7016 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
7017 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
7018 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
7019 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7020 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7021 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
7022 -1, 105, 106, 33, 34, 35, 36, 111, 112, 113,
7023 114, 115, 116, 117, 118, 119, -1, -1, -1, 49,
7024 50, 51, 52, -1, -1, -1, 56, -1, 58, 59,
7025 60, 61, 62, 63, -1, -1, -1, -1, -1, -1,
7026 -1, -1, -1, -1, 148, -1, -1, -1, 78, -1,
7027 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7028 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
7029 -1, -1, 102, -1, -1, 105, 106, -1, 108, 109,
7030 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
7031 -1, -1, -1, -1, -1, -1, 33, 34, 35, 36,
7032 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7033 -1, 141, 49, 50, 51, 52, -1, -1, 148, 56,
7034 -1, -1, 59, 60, 61, 62, 63, -1, -1, -1,
7035 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7036 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7037 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
7038 -1, -1, 99, -1, -1, 102, -1, -1, 105, 106,
7039 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
7040 117, 118, 119, -1, -1, -1, -1, -1, -1, 33,
7041 34, 35, 36, -1, -1, -1, 52, 53, -1, -1,
7042 56, -1, -1, -1, 141, 49, 50, 51, 52, -1,
7043 -1, 148, 56, -1, -1, 59, 60, 61, 62, 63,
7044 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
7045 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
7046 96, -1, -1, -1, -1, -1, -1, 91, 92, -1,
7047 -1, -1, 108, 109, -1, 99, -1, -1, 102, -1,
7048 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
7049 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
7050 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
7051 146, 147, -1, 149, 150, 52, 53, 141, -1, 56,
7052 -1, 157, 158, -1, 148, -1, -1, -1, -1, -1,
7053 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
7054 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
7055 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
7056 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7057 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
7058 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7059 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7060 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
7061 147, -1, 149, 150, 52, 53, -1, -1, 56, -1,
7062 157, 158, -1, -1, -1, -1, -1, -1, -1, -1,
7063 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
7064 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
7065 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
7066 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7067 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
7068 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7069 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7070 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
7071 -1, 149, 150, 52, 53, -1, -1, 56, -1, 157,
7072 158, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7073 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
7074 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
7075 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
7076 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
7077 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7078 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7079 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
7080 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
7081 149, 150, 52, 53, -1, -1, 56, -1, 157, 158,
7082 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7083 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
7084 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
7085 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
7086 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
7087 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7088 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7089 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
7090 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
7091 150, 52, 53, -1, -1, 56, -1, 157, 158, -1,
7092 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7093 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
7094 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
7095 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
7096 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
7097 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7098 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7099 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
7100 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
7101 52, 53, -1, -1, 56, -1, 157, 158, -1, -1,
7102 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7103 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
7104 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
7105 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
7106 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
7107 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7108 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7109 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
7110 142, 143, 144, 145, 146, 147, -1, 149, 150, 52,
7111 53, -1, -1, 56, -1, 157, 158, -1, -1, -1,
7112 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7113 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
7114 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
7115 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
7116 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
7117 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7118 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7119 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
7120 143, 144, 145, 146, 147, -1, 149, 150, 52, 53,
7121 -1, -1, 56, -1, 157, 158, -1, -1, -1, -1,
7122 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7123 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
7124 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
7125 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
7126 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
7127 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7128 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7129 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
7130 144, 145, 146, 147, -1, 149, 150, 52, 53, -1,
7131 -1, 56, -1, 157, 158, -1, -1, -1, -1, -1,
7132 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7133 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
7134 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
7135 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
7136 -1, -1, -1, 108, 109, -1, -1, -1, -1, -1,
7137 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7138 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7139 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
7140 145, 146, 147, -1, 149, 150, 52, 53, -1, -1,
7141 56, -1, 157, 158, -1, -1, -1, -1, -1, -1,
7142 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7143 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
7144 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
7145 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7146 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
7147 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7148 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7149 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
7150 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
7151 -1, 157, 158, -1, -1, -1, -1, -1, -1, -1,
7152 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
7153 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
7154 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
7155 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7156 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
7157 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7158 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7159 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
7160 147, -1, 149, 150, 52, 53, -1, -1, 56, -1,
7161 157, 158, -1, -1, -1, -1, -1, -1, -1, -1,
7162 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
7163 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
7164 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
7165 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7166 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
7167 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7168 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7169 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
7170 -1, 149, 150, 52, 53, -1, -1, 56, -1, 157,
7171 158, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7172 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
7173 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
7174 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
7175 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
7176 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7177 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7178 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
7179 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
7180 149, 150, 52, 53, -1, -1, 56, -1, 157, 158,
7181 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7182 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
7183 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
7184 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
7185 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
7186 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7187 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7188 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
7189 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
7190 150, 52, 53, -1, -1, 56, -1, 157, 158, -1,
7191 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7192 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
7193 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
7194 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
7195 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
7196 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7197 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7198 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
7199 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
7200 -1, -1, -1, -1, -1, -1, 157
7201};
7202
7203/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
7204 state STATE-NUM. */
7205static const yytype_int16 yystos[] =
7206{
7207 0, 164, 165, 1, 3, 4, 5, 6, 7, 11,
7208 12, 16, 18, 19, 20, 21, 22, 23, 24, 30,
7209 31, 32, 33, 34, 35, 36, 39, 45, 46, 47,
7210 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
7211 59, 60, 61, 62, 63, 64, 65, 76, 77, 91,
7212 92, 99, 102, 103, 105, 106, 108, 111, 112, 113,
7213 114, 115, 116, 117, 118, 119, 148, 149, 150, 167,
7214 168, 169, 181, 183, 184, 188, 192, 194, 199, 200,
7215 202, 203, 204, 206, 207, 208, 210, 211, 220, 223,
7216 242, 252, 253, 254, 255, 256, 257, 258, 259, 260,
7217 261, 262, 271, 272, 302, 307, 308, 356, 357, 358,
7218 359, 360, 361, 363, 364, 367, 368, 370, 371, 372,
7219 373, 386, 387, 389, 390, 391, 392, 393, 394, 395,
7220 396, 397, 432, 444, 0, 3, 4, 5, 6, 7,
7221 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
7222 18, 19, 20, 21, 22, 23, 24, 25, 26, 30,
7223 31, 32, 33, 34, 35, 36, 37, 38, 39, 45,
7224 46, 47, 48, 49, 50, 51, 52, 53, 56, 76,
7225 77, 78, 79, 80, 81, 82, 83, 84, 87, 88,
7226 93, 94, 95, 96, 108, 109, 138, 139, 140, 141,
7227 142, 143, 144, 145, 146, 147, 149, 150, 157, 214,
7228 215, 216, 218, 219, 386, 180, 180, 180, 39, 58,
7229 99, 102, 108, 109, 110, 113, 149, 192, 194, 203,
7230 211, 220, 227, 233, 236, 238, 239, 252, 393, 394,
7231 396, 397, 430, 431, 233, 158, 230, 234, 235, 155,
7232 158, 186, 54, 215, 186, 152, 170, 171, 224, 444,
7233 21, 22, 32, 202, 220, 252, 271, 272, 220, 220,
7234 220, 56, 47, 102, 176, 177, 178, 183, 205, 206,
7235 444, 176, 228, 238, 430, 444, 227, 429, 430, 444,
7236 46, 99, 148, 156, 192, 194, 210, 242, 252, 393,
7237 394, 397, 300, 214, 376, 388, 392, 376, 377, 378,
7238 162, 362, 362, 362, 362, 391, 199, 220, 220, 155,
7239 161, 166, 442, 443, 180, 40, 41, 42, 43, 44,
7240 37, 38, 158, 400, 401, 402, 403, 444, 400, 402,
7241 26, 152, 230, 235, 263, 309, 28, 264, 306, 135,
7242 156, 102, 108, 207, 135, 25, 78, 79, 80, 81,
7243 82, 83, 84, 85, 86, 87, 88, 89, 90, 95,
7244 96, 101, 136, 138, 139, 140, 141, 142, 143, 144,
7245 145, 146, 147, 222, 222, 69, 97, 98, 154, 436,
7246 243, 1, 188, 195, 195, 196, 198, 198, 166, 195,
7247 443, 99, 204, 211, 252, 277, 393, 394, 397, 52,
7248 56, 95, 99, 212, 213, 252, 393, 394, 397, 213,
7249 33, 34, 35, 36, 49, 50, 51, 52, 56, 158,
7250 191, 214, 395, 427, 233, 158, 235, 98, 436, 437,
7251 309, 359, 100, 100, 156, 227, 56, 227, 227, 227,
7252 376, 400, 400, 135, 101, 156, 237, 444, 98, 154,
7253 436, 100, 100, 156, 237, 92, 232, 233, 238, 410,
7254 430, 444, 233, 186, 188, 438, 188, 54, 64, 65,
7255 182, 158, 224, 225, 167, 98, 436, 100, 179, 205,
7256 159, 166, 443, 438, 244, 160, 156, 186, 441, 156,
7257 441, 153, 441, 186, 56, 391, 207, 209, 401, 156,
7258 98, 154, 436, 297, 66, 120, 122, 123, 379, 120,
7259 120, 379, 67, 379, 162, 365, 374, 369, 375, 78,
7260 161, 169, 152, 195, 195, 195, 195, 224, 226, 188,
7261 188, 52, 54, 55, 56, 57, 58, 78, 92, 102,
7262 108, 109, 110, 142, 145, 282, 344, 404, 405, 406,
7263 407, 409, 410, 411, 412, 413, 414, 415, 416, 417,
7264 419, 420, 421, 422, 423, 424, 425, 135, 250, 409,
7265 135, 251, 310, 311, 107, 201, 312, 313, 313, 224,
7266 205, 156, 210, 156, 224, 190, 220, 220, 220, 220,
7267 220, 220, 220, 220, 220, 220, 220, 220, 220, 189,
7268 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
7269 220, 52, 53, 56, 218, 230, 432, 433, 434, 232,
7270 238, 52, 53, 56, 218, 230, 433, 174, 176, 13,
7271 273, 442, 273, 195, 176, 176, 246, 166, 56, 98,
7272 154, 436, 25, 195, 52, 56, 212, 139, 399, 98,
7273 154, 436, 249, 428, 69, 98, 435, 233, 438, 52,
7274 56, 433, 224, 224, 217, 125, 135, 135, 224, 227,
7275 227, 236, 239, 430, 52, 56, 232, 52, 56, 224,
7276 224, 431, 438, 156, 438, 156, 159, 438, 215, 225,
7277 220, 153, 56, 433, 433, 224, 171, 438, 178, 159,
7278 430, 156, 209, 52, 56, 232, 52, 56, 298, 381,
7279 380, 120, 366, 379, 66, 120, 120, 366, 66, 120,
7280 220, 176, 183, 102, 108, 278, 279, 280, 281, 412,
7281 156, 426, 444, 156, 426, 156, 408, 438, 283, 284,
7282 156, 408, 227, 34, 52, 52, 156, 408, 52, 39,
7283 185, 203, 220, 221, 174, 442, 185, 221, 174, 297,
7284 153, 311, 297, 10, 68, 270, 270, 108, 199, 227,
7285 238, 240, 241, 438, 209, 156, 184, 187, 199, 211,
7286 220, 227, 229, 241, 252, 397, 319, 319, 186, 100,
7287 100, 152, 230, 235, 186, 439, 156, 100, 100, 230,
7288 231, 235, 444, 270, 224, 176, 13, 176, 27, 274,
7289 442, 270, 270, 17, 267, 315, 25, 245, 321, 52,
7290 56, 232, 52, 56, 198, 248, 398, 247, 52, 56,
7291 212, 232, 174, 188, 193, 438, 231, 235, 187, 220,
7292 229, 187, 229, 215, 227, 39, 237, 100, 100, 439,
7293 100, 100, 410, 430, 188, 229, 441, 207, 439, 299,
7294 382, 385, 392, 397, 362, 379, 362, 362, 362, 153,
7295 280, 412, 156, 438, 156, 425, 417, 419, 421, 405,
7296 406, 415, 423, 135, 227, 407, 414, 423, 413, 415,
7297 186, 44, 44, 270, 270, 298, 153, 298, 227, 156,
7298 44, 209, 44, 135, 44, 98, 154, 436, 317, 317,
7299 137, 224, 224, 311, 201, 160, 100, 224, 224, 201,
7300 8, 265, 352, 444, 14, 15, 268, 269, 275, 276,
7301 444, 276, 197, 108, 227, 314, 270, 319, 315, 270,
7302 439, 176, 442, 195, 174, 439, 270, 438, 191, 309,
7303 306, 186, 224, 224, 100, 224, 224, 438, 156, 438,
7304 180, 383, 438, 278, 281, 279, 426, 156, 408, 156,
7305 408, 156, 408, 156, 408, 408, 185, 221, 226, 226,
7306 299, 299, 108, 227, 226, 226, 224, 226, 52, 56,
7307 232, 52, 56, 318, 318, 220, 187, 229, 187, 229,
7308 153, 224, 187, 229, 187, 229, 227, 241, 353, 444,
7309 175, 268, 176, 195, 270, 270, 227, 156, 273, 317,
7310 270, 270, 174, 442, 270, 224, 158, 303, 409, 176,
7311 156, 156, 415, 415, 423, 415, 220, 220, 180, 180,
7312 227, 183, 183, 220, 439, 52, 56, 58, 91, 92,
7313 99, 102, 105, 106, 108, 113, 141, 302, 324, 325,
7314 326, 327, 330, 334, 335, 336, 339, 340, 341, 342,
7315 343, 344, 345, 346, 347, 348, 349, 350, 351, 356,
7316 357, 360, 361, 364, 368, 371, 373, 394, 419, 324,
7317 187, 229, 101, 354, 444, 9, 266, 355, 444, 172,
7318 273, 108, 227, 176, 318, 270, 409, 301, 0, 121,
7319 384, 279, 408, 408, 156, 408, 408, 140, 292, 293,
7320 444, 292, 347, 347, 56, 212, 318, 325, 332, 333,
7321 334, 335, 338, 439, 186, 318, 440, 52, 376, 52,
7322 102, 392, 101, 156, 140, 156, 156, 325, 89, 90,
7323 98, 154, 158, 328, 329, 52, 99, 211, 252, 393,
7324 394, 397, 273, 177, 176, 176, 227, 276, 315, 316,
7325 323, 324, 186, 294, 29, 124, 304, 415, 282, 285,
7326 286, 288, 289, 291, 294, 413, 415, 416, 418, 423,
7327 425, 176, 174, 325, 439, 325, 336, 338, 439, 156,
7328 153, 224, 125, 195, 348, 332, 336, 330, 337, 338,
7329 113, 341, 345, 347, 347, 212, 318, 439, 318, 438,
7330 332, 335, 339, 332, 335, 339, 56, 98, 154, 436,
7331 176, 166, 173, 275, 273, 40, 41, 161, 159, 305,
7332 176, 408, 426, 156, 426, 156, 290, 294, 140, 284,
7333 156, 287, 290, 99, 252, 156, 290, 438, 156, 156,
7334 331, 438, 156, 156, 376, 438, 438, 438, 439, 439,
7335 439, 52, 56, 232, 52, 56, 352, 355, 320, 195,
7336 195, 52, 295, 296, 411, 174, 153, 418, 421, 286,
7337 288, 415, 423, 140, 252, 289, 423, 56, 98, 415,
7338 337, 339, 337, 336, 338, 439, 176, 156, 186, 270,
7339 426, 156, 290, 156, 290, 156, 290, 156, 290, 52,
7340 56, 290, 156, 440, 276, 321, 322, 296, 415, 415,
7341 423, 415, 290, 290, 156, 290, 290, 415, 290
7342};
7343
7344/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
7345static const yytype_int16 yyr1[] =
7346{
7347 0, 163, 164, 165, 166, 166, 167, 168, 168, 168,
7348 169, 169, 170, 171, 172, 173, 174, 175, 174, 176,
7349 177, 177, 177, 178, 179, 178, 180, 181, 182, 183,
7350 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
7351 183, 183, 183, 183, 183, 183, 183, 184, 184, 184,
7352 184, 184, 184, 184, 184, 184, 184, 185, 185, 186,
7353 186, 185, 187, 187, 187, 188, 188, 188, 188, 188,
7354 189, 188, 190, 188, 188, 191, 192, 193, 194, 195,
7355 195, 196, 197, 198, 199, 199, 200, 200, 201, 202,
7356 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
7357 203, 203, 204, 204, 205, 205, 206, 206, 206, 206,
7358 206, 206, 206, 206, 206, 206, 207, 207, 208, 208,
7359 209, 209, 210, 210, 210, 210, 210, 210, 210, 210,
7360 210, 211, 211, 211, 211, 211, 211, 211, 211, 211,
7361 212, 212, 213, 213, 213, 214, 214, 214, 214, 214,
7362 215, 215, 216, 217, 216, 218, 218, 218, 218, 218,
7363 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
7364 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
7365 218, 218, 218, 218, 218, 219, 219, 219, 219, 219,
7366 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
7367 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
7368 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
7369 219, 219, 219, 219, 219, 219, 220, 220, 220, 220,
7370 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
7371 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
7372 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
7373 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
7374 220, 221, 221, 221, 222, 222, 222, 222, 223, 223,
7375 224, 225, 226, 227, 228, 228, 228, 228, 229, 229,
7376 230, 230, 230, 231, 231, 232, 232, 232, 232, 232,
7377 233, 233, 233, 233, 233, 234, 235, 236, 236, 237,
7378 237, 238, 238, 238, 238, 239, 239, 240, 240, 241,
7379 241, 241, 242, 242, 242, 242, 242, 242, 242, 242,
7380 242, 242, 242, 243, 242, 244, 242, 242, 242, 242,
7381 242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
7382 242, 242, 242, 242, 242, 242, 242, 245, 242, 246,
7383 242, 242, 242, 247, 242, 248, 242, 249, 242, 250,
7384 242, 251, 242, 242, 242, 242, 242, 252, 253, 254,
7385 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
7386 265, 266, 267, 268, 269, 270, 270, 271, 272, 273,
7387 273, 273, 274, 274, 275, 275, 276, 276, 277, 277,
7388 278, 278, 279, 279, 280, 280, 280, 280, 280, 281,
7389 281, 282, 282, 283, 284, 285, 285, 286, 286, 286,
7390 286, 287, 288, 289, 289, 290, 290, 291, 291, 291,
7391 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
7392 291, 291, 292, 292, 293, 293, 294, 294, 295, 295,
7393 296, 296, 297, 298, 299, 300, 301, 302, 303, 303,
7394 304, 305, 304, 306, 307, 307, 307, 307, 308, 308,
7395 308, 308, 308, 308, 308, 308, 308, 309, 309, 310,
7396 311, 312, 313, 314, 314, 314, 314, 315, 316, 316,
7397 317, 318, 319, 320, 321, 322, 322, 323, 323, 323,
7398 324, 324, 324, 324, 324, 324, 325, 326, 326, 327,
7399 327, 328, 329, 330, 330, 330, 330, 330, 330, 330,
7400 330, 330, 330, 330, 330, 330, 331, 330, 330, 330,
7401 332, 332, 332, 332, 332, 332, 333, 333, 334, 334,
7402 335, 336, 336, 337, 337, 338, 339, 339, 339, 339,
7403 340, 340, 341, 341, 342, 342, 343, 343, 344, 345,
7404 345, 346, 346, 346, 346, 346, 346, 346, 346, 346,
7405 346, 347, 347, 347, 347, 347, 347, 347, 347, 347,
7406 347, 348, 349, 349, 350, 351, 351, 351, 352, 352,
7407 353, 353, 353, 354, 354, 355, 355, 356, 356, 357,
7408 358, 358, 358, 359, 360, 361, 362, 362, 363, 364,
7409 365, 365, 366, 366, 367, 368, 369, 369, 370, 371,
7410 372, 373, 374, 374, 375, 375, 376, 376, 377, 377,
7411 378, 378, 379, 380, 379, 381, 382, 383, 379, 384,
7412 384, 385, 385, 386, 386, 387, 388, 388, 389, 390,
7413 390, 391, 391, 391, 391, 392, 392, 392, 393, 393,
7414 393, 394, 394, 394, 394, 394, 394, 394, 395, 395,
7415 396, 396, 397, 397, 398, 399, 399, 400, 400, 401,
7416 402, 403, 402, 404, 404, 405, 405, 405, 405, 405,
7417 406, 407, 407, 408, 408, 409, 409, 409, 409, 409,
7418 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
7419 410, 411, 411, 411, 411, 412, 412, 413, 414, 414,
7420 415, 415, 416, 417, 417, 418, 418, 419, 419, 420,
7421 421, 421, 422, 422, 423, 423, 424, 424, 425, 425,
7422 426, 426, 427, 428, 427, 429, 429, 430, 430, 431,
7423 431, 431, 431, 431, 431, 432, 432, 432, 433, 433,
7424 434, 434, 434, 435, 435, 436, 436, 437, 437, 438,
7425 439, 440, 441, 441, 442, 442, 443, 443, 444
7426};
7427
7428/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
7429static const yytype_int8 yyr2[] =
7430{
7431 0, 2, 0, 2, 0, 1, 2, 1, 1, 3,
7432 1, 2, 1, 3, 0, 0, 8, 0, 5, 2,
7433 1, 1, 3, 1, 0, 3, 0, 2, 0, 4,
7434 3, 3, 3, 2, 3, 3, 3, 3, 4, 5,
7435 1, 4, 4, 7, 4, 1, 1, 4, 4, 7,
7436 6, 6, 6, 6, 4, 4, 4, 1, 4, 0,
7437 1, 3, 1, 4, 1, 1, 3, 3, 3, 2,
7438 0, 7, 0, 7, 1, 1, 2, 0, 5, 1,
7439 1, 0, 0, 4, 1, 1, 1, 4, 3, 1,
7440 2, 3, 4, 5, 4, 5, 6, 2, 2, 2,
7441 2, 2, 1, 3, 1, 3, 1, 2, 3, 5,
7442 2, 4, 2, 4, 1, 3, 1, 3, 2, 3,
7443 1, 3, 1, 1, 4, 3, 3, 3, 3, 2,
7444 1, 1, 1, 4, 3, 3, 3, 3, 2, 1,
7445 1, 1, 2, 1, 3, 1, 1, 1, 1, 1,
7446 1, 1, 1, 0, 4, 1, 1, 1, 1, 1,
7447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7453 1, 1, 1, 1, 1, 1, 4, 4, 7, 6,
7454 6, 6, 6, 5, 4, 3, 3, 2, 2, 2,
7455 2, 3, 3, 3, 3, 3, 3, 4, 2, 2,
7456 3, 3, 3, 3, 1, 3, 3, 3, 3, 3,
7457 2, 2, 3, 3, 3, 3, 4, 6, 4, 4,
7458 1, 1, 4, 3, 1, 1, 1, 1, 3, 3,
7459 1, 1, 1, 1, 1, 2, 4, 2, 1, 4,
7460 3, 5, 3, 1, 1, 1, 1, 2, 4, 2,
7461 1, 2, 2, 4, 1, 0, 2, 2, 1, 2,
7462 1, 1, 1, 3, 3, 2, 1, 1, 1, 3,
7463 4, 2, 1, 1, 1, 1, 1, 1, 1, 1,
7464 1, 1, 1, 0, 4, 0, 4, 3, 3, 2,
7465 3, 3, 1, 4, 3, 1, 6, 4, 3, 2,
7466 1, 2, 1, 6, 6, 4, 4, 0, 6, 0,
7467 5, 5, 6, 0, 6, 0, 7, 0, 5, 0,
7468 5, 0, 5, 1, 1, 1, 1, 1, 1, 1,
7469 1, 2, 2, 1, 2, 1, 1, 1, 1, 1,
7470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7471 1, 2, 1, 1, 1, 5, 1, 2, 1, 1,
7472 1, 3, 1, 3, 1, 3, 5, 1, 3, 2,
7473 1, 1, 1, 0, 2, 1, 3, 4, 2, 2,
7474 1, 1, 3, 1, 3, 2, 0, 6, 8, 4,
7475 6, 4, 2, 6, 2, 4, 6, 2, 4, 2,
7476 4, 1, 1, 1, 3, 4, 1, 4, 1, 3,
7477 1, 1, 0, 0, 0, 0, 0, 9, 4, 1,
7478 3, 0, 4, 3, 2, 4, 5, 5, 2, 4,
7479 4, 3, 3, 3, 2, 1, 4, 3, 3, 0,
7480 7, 0, 7, 1, 2, 3, 4, 5, 1, 1,
7481 0, 0, 0, 0, 9, 1, 1, 1, 3, 3,
7482 1, 2, 3, 1, 1, 1, 1, 3, 1, 3,
7483 1, 2, 2, 1, 1, 4, 4, 4, 3, 4,
7484 4, 4, 3, 3, 3, 2, 0, 6, 2, 4,
7485 1, 1, 2, 2, 4, 1, 2, 3, 1, 3,
7486 5, 2, 1, 1, 3, 1, 3, 1, 2, 1,
7487 1, 3, 2, 1, 1, 3, 2, 1, 2, 1,
7488 1, 1, 3, 3, 2, 2, 1, 1, 1, 2,
7489 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7490 1, 1, 2, 2, 4, 2, 3, 1, 6, 1,
7491 1, 1, 1, 2, 1, 3, 1, 1, 1, 1,
7492 1, 1, 2, 3, 3, 3, 1, 2, 4, 1,
7493 0, 3, 1, 2, 4, 1, 0, 3, 4, 1,
7494 4, 1, 0, 3, 0, 3, 0, 2, 0, 2,
7495 0, 2, 1, 0, 3, 0, 0, 0, 6, 1,
7496 1, 1, 1, 1, 1, 2, 1, 1, 3, 1,
7497 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7498 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7499 1, 1, 1, 1, 0, 4, 0, 1, 1, 3,
7500 1, 0, 3, 1, 3, 4, 2, 2, 1, 1,
7501 3, 1, 3, 2, 0, 6, 8, 4, 6, 4,
7502 6, 2, 4, 6, 2, 4, 2, 4, 1, 0,
7503 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
7504 1, 3, 1, 2, 1, 2, 1, 1, 1, 1,
7505 2, 1, 1, 1, 2, 1, 1, 1, 2, 1,
7506 2, 1, 1, 0, 4, 1, 2, 1, 3, 3,
7507 2, 1, 4, 2, 1, 1, 1, 1, 1, 1,
7508 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
7509 2, 2, 1, 1, 1, 1, 1, 2, 0
7510};
7511
7512
7513enum { YYENOMEM = -2 };
7514
7515#define yyerrok (yyerrstatus = 0)
7516#define yyclearin (yychar = YYEMPTY)
7517
7518#define YYACCEPT goto yyacceptlab
7519#define YYABORT goto yyabortlab
7520#define YYERROR goto yyerrorlab
7521#define YYNOMEM goto yyexhaustedlab
7522
7523
7524#define YYRECOVERING() (!!yyerrstatus)
7525
7526#define YYBACKUP(Token, Value) \
7527 do \
7528 if (yychar == YYEMPTY) \
7529 { \
7530 yychar = (Token); \
7531 yylval = (Value); \
7532 YYPOPSTACK (yylen); \
7533 yystate = *yyssp; \
7534 goto yybackup; \
7535 } \
7536 else \
7537 { \
7538 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
7539 YYERROR; \
7540 } \
7541 while (0)
7542
7543/* Backward compatibility with an undocumented macro.
7544 Use YYerror or YYUNDEF. */
7545#define YYERRCODE YYUNDEF
7546
7547/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
7548 If N is 0, then set CURRENT to the empty location which ends
7549 the previous symbol: RHS[0] (always defined). */
7550
7551#ifndef YYLLOC_DEFAULT
7552# define YYLLOC_DEFAULT(Current, Rhs, N) \
7553 do \
7554 if (N) \
7555 { \
7556 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
7557 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
7558 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
7559 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
7560 } \
7561 else \
7562 { \
7563 (Current).first_line = (Current).last_line = \
7564 YYRHSLOC (Rhs, 0).last_line; \
7565 (Current).first_column = (Current).last_column = \
7566 YYRHSLOC (Rhs, 0).last_column; \
7567 } \
7568 while (0)
7569#endif
7570
7571#define YYRHSLOC(Rhs, K) ((Rhs)[K])
7572
7573
7574/* Enable debugging if requested. */
7575#if YYDEBUG
7576
7577# ifndef YYFPRINTF
7578# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
7579# define YYFPRINTF fprintf
7580# endif
7581
7582# define YYDPRINTF(Args) \
7583do { \
7584 if (yydebug) \
7585 YYFPRINTF Args; \
7586} while (0)
7587
7588
7589/* YYLOCATION_PRINT -- Print the location on the stream.
7590 This macro was not mandated originally: define only if we know
7591 we won't break user code: when these are the locations we know. */
7592
7593# ifndef YYLOCATION_PRINT
7594
7595# if defined YY_LOCATION_PRINT
7596
7597 /* Temporary convenience wrapper in case some people defined the
7598 undocumented and private YY_LOCATION_PRINT macros. */
7599# define YYLOCATION_PRINT(File, Loc, p) YY_LOCATION_PRINT(File, *(Loc), p)
7600
7601# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
7602
7603/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
7604
7605YY_ATTRIBUTE_UNUSED
7606static int
7607yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
7608{
7609 int res = 0;
7610 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
7611 if (0 <= yylocp->first_line)
7612 {
7613 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
7614 if (0 <= yylocp->first_column)
7615 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
7616 }
7617 if (0 <= yylocp->last_line)
7618 {
7619 if (yylocp->first_line < yylocp->last_line)
7620 {
7621 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
7622 if (0 <= end_col)
7623 res += YYFPRINTF (yyo, ".%d", end_col);
7624 }
7625 else if (0 <= end_col && yylocp->first_column < end_col)
7626 res += YYFPRINTF (yyo, "-%d", end_col);
7627 }
7628 return res;
7629}
7630
7631# define YYLOCATION_PRINT yy_location_print_
7632
7633 /* Temporary convenience wrapper in case some people defined the
7634 undocumented and private YY_LOCATION_PRINT macros. */
7635# define YY_LOCATION_PRINT(File, Loc, p) YYLOCATION_PRINT(File, &(Loc), p)
7636
7637# else
7638
7639# define YYLOCATION_PRINT(File, Loc, p) ((void) 0)
7640 /* Temporary convenience wrapper in case some people defined the
7641 undocumented and private YY_LOCATION_PRINT macros. */
7642# define YY_LOCATION_PRINT YYLOCATION_PRINT
7643
7644# endif
7645# endif /* !defined YYLOCATION_PRINT */
7646
7647
7648# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p) \
7649do { \
7650 if (yydebug) \
7651 { \
7652 YYFPRINTF (stderr, "%s ", Title); \
7653 yy_symbol_print (stderr, \
7654 Kind, Value, Location, p); \
7655 YYFPRINTF (stderr, "\n"); \
7656 } \
7657} while (0)
7658
7659
7660/*-----------------------------------.
7661| Print this symbol's value on YYO. |
7662`-----------------------------------*/
7663
7664static void
7665yy_symbol_value_print (FILE *yyo,
7666 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
7667{
7668 FILE *yyoutput = yyo;
7669 YY_USE (yyoutput);
7670 YY_USE (yylocationp);
7671 YY_USE (p);
7672 if (!yyvaluep)
7673 return;
7674 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
7675switch (yykind)
7676 {
7677 case YYSYMBOL_keyword_class: /* "'class'" */
7678#line 2620 "parse.y"
7679 {
7680 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7681}
7682#line 7683 "parse.c"
7683 break;
7684
7685 case YYSYMBOL_keyword_module: /* "'module'" */
7686#line 2620 "parse.y"
7687 {
7688 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7689}
7690#line 7691 "parse.c"
7691 break;
7692
7693 case YYSYMBOL_keyword_def: /* "'def'" */
7694#line 2620 "parse.y"
7695 {
7696 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7697}
7698#line 7699 "parse.c"
7699 break;
7700
7701 case YYSYMBOL_keyword_undef: /* "'undef'" */
7702#line 2620 "parse.y"
7703 {
7704 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7705}
7706#line 7707 "parse.c"
7707 break;
7708
7709 case YYSYMBOL_keyword_begin: /* "'begin'" */
7710#line 2620 "parse.y"
7711 {
7712 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7713}
7714#line 7715 "parse.c"
7715 break;
7716
7717 case YYSYMBOL_keyword_rescue: /* "'rescue'" */
7718#line 2620 "parse.y"
7719 {
7720 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7721}
7722#line 7723 "parse.c"
7723 break;
7724
7725 case YYSYMBOL_keyword_ensure: /* "'ensure'" */
7726#line 2620 "parse.y"
7727 {
7728 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7729}
7730#line 7731 "parse.c"
7731 break;
7732
7733 case YYSYMBOL_keyword_end: /* "'end'" */
7734#line 2620 "parse.y"
7735 {
7736 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7737}
7738#line 7739 "parse.c"
7739 break;
7740
7741 case YYSYMBOL_keyword_if: /* "'if'" */
7742#line 2620 "parse.y"
7743 {
7744 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7745}
7746#line 7747 "parse.c"
7747 break;
7748
7749 case YYSYMBOL_keyword_unless: /* "'unless'" */
7750#line 2620 "parse.y"
7751 {
7752 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7753}
7754#line 7755 "parse.c"
7755 break;
7756
7757 case YYSYMBOL_keyword_then: /* "'then'" */
7758#line 2620 "parse.y"
7759 {
7760 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7761}
7762#line 7763 "parse.c"
7763 break;
7764
7765 case YYSYMBOL_keyword_elsif: /* "'elsif'" */
7766#line 2620 "parse.y"
7767 {
7768 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7769}
7770#line 7771 "parse.c"
7771 break;
7772
7773 case YYSYMBOL_keyword_else: /* "'else'" */
7774#line 2620 "parse.y"
7775 {
7776 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7777}
7778#line 7779 "parse.c"
7779 break;
7780
7781 case YYSYMBOL_keyword_case: /* "'case'" */
7782#line 2620 "parse.y"
7783 {
7784 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7785}
7786#line 7787 "parse.c"
7787 break;
7788
7789 case YYSYMBOL_keyword_when: /* "'when'" */
7790#line 2620 "parse.y"
7791 {
7792 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7793}
7794#line 7795 "parse.c"
7795 break;
7796
7797 case YYSYMBOL_keyword_while: /* "'while'" */
7798#line 2620 "parse.y"
7799 {
7800 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7801}
7802#line 7803 "parse.c"
7803 break;
7804
7805 case YYSYMBOL_keyword_until: /* "'until'" */
7806#line 2620 "parse.y"
7807 {
7808 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7809}
7810#line 7811 "parse.c"
7811 break;
7812
7813 case YYSYMBOL_keyword_for: /* "'for'" */
7814#line 2620 "parse.y"
7815 {
7816 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7817}
7818#line 7819 "parse.c"
7819 break;
7820
7821 case YYSYMBOL_keyword_break: /* "'break'" */
7822#line 2620 "parse.y"
7823 {
7824 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7825}
7826#line 7827 "parse.c"
7827 break;
7828
7829 case YYSYMBOL_keyword_next: /* "'next'" */
7830#line 2620 "parse.y"
7831 {
7832 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7833}
7834#line 7835 "parse.c"
7835 break;
7836
7837 case YYSYMBOL_keyword_redo: /* "'redo'" */
7838#line 2620 "parse.y"
7839 {
7840 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7841}
7842#line 7843 "parse.c"
7843 break;
7844
7845 case YYSYMBOL_keyword_retry: /* "'retry'" */
7846#line 2620 "parse.y"
7847 {
7848 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7849}
7850#line 7851 "parse.c"
7851 break;
7852
7853 case YYSYMBOL_keyword_in: /* "'in'" */
7854#line 2620 "parse.y"
7855 {
7856 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7857}
7858#line 7859 "parse.c"
7859 break;
7860
7861 case YYSYMBOL_keyword_do: /* "'do'" */
7862#line 2620 "parse.y"
7863 {
7864 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7865}
7866#line 7867 "parse.c"
7867 break;
7868
7869 case YYSYMBOL_keyword_do_cond: /* "'do' for condition" */
7870#line 2620 "parse.y"
7871 {
7872 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7873}
7874#line 7875 "parse.c"
7875 break;
7876
7877 case YYSYMBOL_keyword_do_block: /* "'do' for block" */
7878#line 2620 "parse.y"
7879 {
7880 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7881}
7882#line 7883 "parse.c"
7883 break;
7884
7885 case YYSYMBOL_keyword_do_LAMBDA: /* "'do' for lambda" */
7886#line 2620 "parse.y"
7887 {
7888 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7889}
7890#line 7891 "parse.c"
7891 break;
7892
7893 case YYSYMBOL_keyword_return: /* "'return'" */
7894#line 2620 "parse.y"
7895 {
7896 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7897}
7898#line 7899 "parse.c"
7899 break;
7900
7901 case YYSYMBOL_keyword_yield: /* "'yield'" */
7902#line 2620 "parse.y"
7903 {
7904 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7905}
7906#line 7907 "parse.c"
7907 break;
7908
7909 case YYSYMBOL_keyword_super: /* "'super'" */
7910#line 2620 "parse.y"
7911 {
7912 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7913}
7914#line 7915 "parse.c"
7915 break;
7916
7917 case YYSYMBOL_keyword_self: /* "'self'" */
7918#line 2620 "parse.y"
7919 {
7920 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7921}
7922#line 7923 "parse.c"
7923 break;
7924
7925 case YYSYMBOL_keyword_nil: /* "'nil'" */
7926#line 2620 "parse.y"
7927 {
7928 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7929}
7930#line 7931 "parse.c"
7931 break;
7932
7933 case YYSYMBOL_keyword_true: /* "'true'" */
7934#line 2620 "parse.y"
7935 {
7936 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7937}
7938#line 7939 "parse.c"
7939 break;
7940
7941 case YYSYMBOL_keyword_false: /* "'false'" */
7942#line 2620 "parse.y"
7943 {
7944 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7945}
7946#line 7947 "parse.c"
7947 break;
7948
7949 case YYSYMBOL_keyword_and: /* "'and'" */
7950#line 2620 "parse.y"
7951 {
7952 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7953}
7954#line 7955 "parse.c"
7955 break;
7956
7957 case YYSYMBOL_keyword_or: /* "'or'" */
7958#line 2620 "parse.y"
7959 {
7960 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7961}
7962#line 7963 "parse.c"
7963 break;
7964
7965 case YYSYMBOL_keyword_not: /* "'not'" */
7966#line 2620 "parse.y"
7967 {
7968 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7969}
7970#line 7971 "parse.c"
7971 break;
7972
7973 case YYSYMBOL_modifier_if: /* "'if' modifier" */
7974#line 2620 "parse.y"
7975 {
7976 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7977}
7978#line 7979 "parse.c"
7979 break;
7980
7981 case YYSYMBOL_modifier_unless: /* "'unless' modifier" */
7982#line 2620 "parse.y"
7983 {
7984 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7985}
7986#line 7987 "parse.c"
7987 break;
7988
7989 case YYSYMBOL_modifier_while: /* "'while' modifier" */
7990#line 2620 "parse.y"
7991 {
7992 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7993}
7994#line 7995 "parse.c"
7995 break;
7996
7997 case YYSYMBOL_modifier_until: /* "'until' modifier" */
7998#line 2620 "parse.y"
7999 {
8000 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8001}
8002#line 8003 "parse.c"
8003 break;
8004
8005 case YYSYMBOL_modifier_rescue: /* "'rescue' modifier" */
8006#line 2620 "parse.y"
8007 {
8008 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8009}
8010#line 8011 "parse.c"
8011 break;
8012
8013 case YYSYMBOL_keyword_alias: /* "'alias'" */
8014#line 2620 "parse.y"
8015 {
8016 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8017}
8018#line 8019 "parse.c"
8019 break;
8020
8021 case YYSYMBOL_keyword_defined: /* "'defined?'" */
8022#line 2620 "parse.y"
8023 {
8024 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8025}
8026#line 8027 "parse.c"
8027 break;
8028
8029 case YYSYMBOL_keyword_BEGIN: /* "'BEGIN'" */
8030#line 2620 "parse.y"
8031 {
8032 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8033}
8034#line 8035 "parse.c"
8035 break;
8036
8037 case YYSYMBOL_keyword_END: /* "'END'" */
8038#line 2620 "parse.y"
8039 {
8040 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8041}
8042#line 8043 "parse.c"
8043 break;
8044
8045 case YYSYMBOL_keyword__LINE__: /* "'__LINE__'" */
8046#line 2620 "parse.y"
8047 {
8048 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8049}
8050#line 8051 "parse.c"
8051 break;
8052
8053 case YYSYMBOL_keyword__FILE__: /* "'__FILE__'" */
8054#line 2620 "parse.y"
8055 {
8056 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8057}
8058#line 8059 "parse.c"
8059 break;
8060
8061 case YYSYMBOL_keyword__ENCODING__: /* "'__ENCODING__'" */
8062#line 2620 "parse.y"
8063 {
8064 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8065}
8066#line 8067 "parse.c"
8067 break;
8068
8069 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
8070#line 2620 "parse.y"
8071 {
8072 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8073}
8074#line 8075 "parse.c"
8075 break;
8076
8077 case YYSYMBOL_tFID: /* "method" */
8078#line 2620 "parse.y"
8079 {
8080 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8081}
8082#line 8083 "parse.c"
8083 break;
8084
8085 case YYSYMBOL_tGVAR: /* "global variable" */
8086#line 2620 "parse.y"
8087 {
8088 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8089}
8090#line 8091 "parse.c"
8091 break;
8092
8093 case YYSYMBOL_tIVAR: /* "instance variable" */
8094#line 2620 "parse.y"
8095 {
8096 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8097}
8098#line 8099 "parse.c"
8099 break;
8100
8101 case YYSYMBOL_tCONSTANT: /* "constant" */
8102#line 2620 "parse.y"
8103 {
8104 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8105}
8106#line 8107 "parse.c"
8107 break;
8108
8109 case YYSYMBOL_tCVAR: /* "class variable" */
8110#line 2620 "parse.y"
8111 {
8112 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8113}
8114#line 8115 "parse.c"
8115 break;
8116
8117 case YYSYMBOL_tLABEL: /* "label" */
8118#line 2620 "parse.y"
8119 {
8120 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8121}
8122#line 8123 "parse.c"
8123 break;
8124
8125 case YYSYMBOL_tINTEGER: /* "integer literal" */
8126#line 2623 "parse.y"
8127 {
8128 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8129 case NODE_INTEGER:
8130 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8131 break;
8132 case NODE_FLOAT:
8133 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8134 break;
8135 case NODE_RATIONAL:
8136 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8137 break;
8138 case NODE_IMAGINARY:
8139 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8140 break;
8141 default:
8142 break;
8143 }
8144}
8145#line 8146 "parse.c"
8146 break;
8147
8148 case YYSYMBOL_tFLOAT: /* "float literal" */
8149#line 2623 "parse.y"
8150 {
8151 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8152 case NODE_INTEGER:
8153 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8154 break;
8155 case NODE_FLOAT:
8156 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8157 break;
8158 case NODE_RATIONAL:
8159 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8160 break;
8161 case NODE_IMAGINARY:
8162 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8163 break;
8164 default:
8165 break;
8166 }
8167}
8168#line 8169 "parse.c"
8169 break;
8170
8171 case YYSYMBOL_tRATIONAL: /* "rational literal" */
8172#line 2623 "parse.y"
8173 {
8174 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8175 case NODE_INTEGER:
8176 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8177 break;
8178 case NODE_FLOAT:
8179 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8180 break;
8181 case NODE_RATIONAL:
8182 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8183 break;
8184 case NODE_IMAGINARY:
8185 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8186 break;
8187 default:
8188 break;
8189 }
8190}
8191#line 8192 "parse.c"
8192 break;
8193
8194 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
8195#line 2623 "parse.y"
8196 {
8197 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8198 case NODE_INTEGER:
8199 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8200 break;
8201 case NODE_FLOAT:
8202 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8203 break;
8204 case NODE_RATIONAL:
8205 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8206 break;
8207 case NODE_IMAGINARY:
8208 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8209 break;
8210 default:
8211 break;
8212 }
8213}
8214#line 8215 "parse.c"
8215 break;
8216
8217 case YYSYMBOL_tCHAR: /* "char literal" */
8218#line 2623 "parse.y"
8219 {
8220 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8221 case NODE_INTEGER:
8222 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8223 break;
8224 case NODE_FLOAT:
8225 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8226 break;
8227 case NODE_RATIONAL:
8228 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8229 break;
8230 case NODE_IMAGINARY:
8231 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8232 break;
8233 default:
8234 break;
8235 }
8236}
8237#line 8238 "parse.c"
8238 break;
8239
8240 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
8241#line 2641 "parse.y"
8242 {
8243 rb_parser_printf(p, "$%ld", RNODE_NTH_REF(((*yyvaluep).node))->nd_nth);
8244}
8245#line 8246 "parse.c"
8246 break;
8247
8248 case YYSYMBOL_tBACK_REF: /* "back reference" */
8249#line 2644 "parse.y"
8250 {
8251 rb_parser_printf(p, "$%c", (int)RNODE_BACK_REF(((*yyvaluep).node))->nd_nth);
8252}
8253#line 8254 "parse.c"
8254 break;
8255
8256 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
8257#line 2623 "parse.y"
8258 {
8259 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8260 case NODE_INTEGER:
8261 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8262 break;
8263 case NODE_FLOAT:
8264 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8265 break;
8266 case NODE_RATIONAL:
8267 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8268 break;
8269 case NODE_IMAGINARY:
8270 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8271 break;
8272 default:
8273 break;
8274 }
8275}
8276#line 8277 "parse.c"
8277 break;
8278
8279 case YYSYMBOL_69_: /* '.' */
8280#line 2620 "parse.y"
8281 {
8282 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8283}
8284#line 8285 "parse.c"
8285 break;
8286
8287 case YYSYMBOL_70_backslash_: /* "backslash" */
8288#line 2620 "parse.y"
8289 {
8290 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8291}
8292#line 8293 "parse.c"
8293 break;
8294
8295 case YYSYMBOL_72_escaped_horizontal_tab_: /* "escaped horizontal tab" */
8296#line 2620 "parse.y"
8297 {
8298 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8299}
8300#line 8301 "parse.c"
8301 break;
8302
8303 case YYSYMBOL_73_escaped_form_feed_: /* "escaped form feed" */
8304#line 2620 "parse.y"
8305 {
8306 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8307}
8308#line 8309 "parse.c"
8309 break;
8310
8311 case YYSYMBOL_74_escaped_carriage_return_: /* "escaped carriage return" */
8312#line 2620 "parse.y"
8313 {
8314 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8315}
8316#line 8317 "parse.c"
8317 break;
8318
8319 case YYSYMBOL_75_escaped_vertical_tab_: /* "escaped vertical tab" */
8320#line 2620 "parse.y"
8321 {
8322 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8323}
8324#line 8325 "parse.c"
8325 break;
8326
8327 case YYSYMBOL_tANDDOT: /* "&." */
8328#line 2620 "parse.y"
8329 {
8330 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8331}
8332#line 8333 "parse.c"
8333 break;
8334
8335 case YYSYMBOL_tCOLON2: /* "::" */
8336#line 2620 "parse.y"
8337 {
8338 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8339}
8340#line 8341 "parse.c"
8341 break;
8342
8343 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
8344#line 2620 "parse.y"
8345 {
8346 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8347}
8348#line 8349 "parse.c"
8349 break;
8350
8351 case YYSYMBOL_top_compstmt: /* top_compstmt */
8352#line 2611 "parse.y"
8353 {
8354 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8355 rb_parser_printf(p, "NODE_SPECIAL");
8356 }
8357 else if (((*yyvaluep).node)) {
8358 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8359 }
8360}
8361#line 8362 "parse.c"
8362 break;
8363
8364 case YYSYMBOL_top_stmts: /* top_stmts */
8365#line 2611 "parse.y"
8366 {
8367 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8368 rb_parser_printf(p, "NODE_SPECIAL");
8369 }
8370 else if (((*yyvaluep).node)) {
8371 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8372 }
8373}
8374#line 8375 "parse.c"
8375 break;
8376
8377 case YYSYMBOL_top_stmt: /* top_stmt */
8378#line 2611 "parse.y"
8379 {
8380 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8381 rb_parser_printf(p, "NODE_SPECIAL");
8382 }
8383 else if (((*yyvaluep).node)) {
8384 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8385 }
8386}
8387#line 8388 "parse.c"
8388 break;
8389
8390 case YYSYMBOL_block_open: /* block_open */
8391#line 2611 "parse.y"
8392 {
8393 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
8394 rb_parser_printf(p, "NODE_SPECIAL");
8395 }
8396 else if (((*yyvaluep).node_exits)) {
8397 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
8398 }
8399}
8400#line 8401 "parse.c"
8401 break;
8402
8403 case YYSYMBOL_begin_block: /* begin_block */
8404#line 2611 "parse.y"
8405 {
8406 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8407 rb_parser_printf(p, "NODE_SPECIAL");
8408 }
8409 else if (((*yyvaluep).node)) {
8410 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8411 }
8412}
8413#line 8414 "parse.c"
8414 break;
8415
8416 case YYSYMBOL_bodystmt: /* bodystmt */
8417#line 2611 "parse.y"
8418 {
8419 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8420 rb_parser_printf(p, "NODE_SPECIAL");
8421 }
8422 else if (((*yyvaluep).node)) {
8423 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8424 }
8425}
8426#line 8427 "parse.c"
8427 break;
8428
8429 case YYSYMBOL_compstmt: /* compstmt */
8430#line 2611 "parse.y"
8431 {
8432 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8433 rb_parser_printf(p, "NODE_SPECIAL");
8434 }
8435 else if (((*yyvaluep).node)) {
8436 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8437 }
8438}
8439#line 8440 "parse.c"
8440 break;
8441
8442 case YYSYMBOL_stmts: /* stmts */
8443#line 2611 "parse.y"
8444 {
8445 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8446 rb_parser_printf(p, "NODE_SPECIAL");
8447 }
8448 else if (((*yyvaluep).node)) {
8449 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8450 }
8451}
8452#line 8453 "parse.c"
8453 break;
8454
8455 case YYSYMBOL_stmt_or_begin: /* stmt_or_begin */
8456#line 2611 "parse.y"
8457 {
8458 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8459 rb_parser_printf(p, "NODE_SPECIAL");
8460 }
8461 else if (((*yyvaluep).node)) {
8462 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8463 }
8464}
8465#line 8466 "parse.c"
8466 break;
8467
8468 case YYSYMBOL_allow_exits: /* allow_exits */
8469#line 2611 "parse.y"
8470 {
8471 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
8472 rb_parser_printf(p, "NODE_SPECIAL");
8473 }
8474 else if (((*yyvaluep).node_exits)) {
8475 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
8476 }
8477}
8478#line 8479 "parse.c"
8479 break;
8480
8481 case YYSYMBOL_stmt: /* stmt */
8482#line 2611 "parse.y"
8483 {
8484 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8485 rb_parser_printf(p, "NODE_SPECIAL");
8486 }
8487 else if (((*yyvaluep).node)) {
8488 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8489 }
8490}
8491#line 8492 "parse.c"
8492 break;
8493
8494 case YYSYMBOL_command_asgn: /* command_asgn */
8495#line 2611 "parse.y"
8496 {
8497 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8498 rb_parser_printf(p, "NODE_SPECIAL");
8499 }
8500 else if (((*yyvaluep).node)) {
8501 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8502 }
8503}
8504#line 8505 "parse.c"
8505 break;
8506
8507 case YYSYMBOL_endless_command: /* endless_command */
8508#line 2611 "parse.y"
8509 {
8510 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8511 rb_parser_printf(p, "NODE_SPECIAL");
8512 }
8513 else if (((*yyvaluep).node)) {
8514 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8515 }
8516}
8517#line 8518 "parse.c"
8518 break;
8519
8520 case YYSYMBOL_command_rhs: /* command_rhs */
8521#line 2611 "parse.y"
8522 {
8523 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8524 rb_parser_printf(p, "NODE_SPECIAL");
8525 }
8526 else if (((*yyvaluep).node)) {
8527 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8528 }
8529}
8530#line 8531 "parse.c"
8531 break;
8532
8533 case YYSYMBOL_expr: /* expr */
8534#line 2611 "parse.y"
8535 {
8536 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8537 rb_parser_printf(p, "NODE_SPECIAL");
8538 }
8539 else if (((*yyvaluep).node)) {
8540 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8541 }
8542}
8543#line 8544 "parse.c"
8544 break;
8545
8546 case YYSYMBOL_def_name: /* def_name */
8547#line 2620 "parse.y"
8548 {
8549 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8550}
8551#line 8552 "parse.c"
8552 break;
8553
8554 case YYSYMBOL_defn_head: /* defn_head */
8555#line 2611 "parse.y"
8556 {
8557 if ((NODE *)((*yyvaluep).node_def_temp) == (NODE *)-1) {
8558 rb_parser_printf(p, "NODE_SPECIAL");
8559 }
8560 else if (((*yyvaluep).node_def_temp)) {
8561 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_def_temp)))));
8562 }
8563}
8564#line 8565 "parse.c"
8565 break;
8566
8567 case YYSYMBOL_defs_head: /* defs_head */
8568#line 2611 "parse.y"
8569 {
8570 if ((NODE *)((*yyvaluep).node_def_temp) == (NODE *)-1) {
8571 rb_parser_printf(p, "NODE_SPECIAL");
8572 }
8573 else if (((*yyvaluep).node_def_temp)) {
8574 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_def_temp)))));
8575 }
8576}
8577#line 8578 "parse.c"
8578 break;
8579
8580 case YYSYMBOL_expr_value: /* expr_value */
8581#line 2611 "parse.y"
8582 {
8583 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8584 rb_parser_printf(p, "NODE_SPECIAL");
8585 }
8586 else if (((*yyvaluep).node)) {
8587 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8588 }
8589}
8590#line 8591 "parse.c"
8591 break;
8592
8593 case YYSYMBOL_expr_value_do: /* expr_value_do */
8594#line 2611 "parse.y"
8595 {
8596 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8597 rb_parser_printf(p, "NODE_SPECIAL");
8598 }
8599 else if (((*yyvaluep).node)) {
8600 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8601 }
8602}
8603#line 8604 "parse.c"
8604 break;
8605
8606 case YYSYMBOL_command_call: /* command_call */
8607#line 2611 "parse.y"
8608 {
8609 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8610 rb_parser_printf(p, "NODE_SPECIAL");
8611 }
8612 else if (((*yyvaluep).node)) {
8613 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8614 }
8615}
8616#line 8617 "parse.c"
8617 break;
8618
8619 case YYSYMBOL_block_command: /* block_command */
8620#line 2611 "parse.y"
8621 {
8622 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8623 rb_parser_printf(p, "NODE_SPECIAL");
8624 }
8625 else if (((*yyvaluep).node)) {
8626 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8627 }
8628}
8629#line 8630 "parse.c"
8630 break;
8631
8632 case YYSYMBOL_cmd_brace_block: /* cmd_brace_block */
8633#line 2611 "parse.y"
8634 {
8635 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8636 rb_parser_printf(p, "NODE_SPECIAL");
8637 }
8638 else if (((*yyvaluep).node)) {
8639 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8640 }
8641}
8642#line 8643 "parse.c"
8643 break;
8644
8645 case YYSYMBOL_fcall: /* fcall */
8646#line 2611 "parse.y"
8647 {
8648 if ((NODE *)((*yyvaluep).node_fcall) == (NODE *)-1) {
8649 rb_parser_printf(p, "NODE_SPECIAL");
8650 }
8651 else if (((*yyvaluep).node_fcall)) {
8652 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_fcall)))));
8653 }
8654}
8655#line 8656 "parse.c"
8656 break;
8657
8658 case YYSYMBOL_command: /* command */
8659#line 2611 "parse.y"
8660 {
8661 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8662 rb_parser_printf(p, "NODE_SPECIAL");
8663 }
8664 else if (((*yyvaluep).node)) {
8665 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8666 }
8667}
8668#line 8669 "parse.c"
8669 break;
8670
8671 case YYSYMBOL_mlhs: /* mlhs */
8672#line 2611 "parse.y"
8673 {
8674 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
8675 rb_parser_printf(p, "NODE_SPECIAL");
8676 }
8677 else if (((*yyvaluep).node_masgn)) {
8678 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
8679 }
8680}
8681#line 8682 "parse.c"
8682 break;
8683
8684 case YYSYMBOL_mlhs_inner: /* mlhs_inner */
8685#line 2611 "parse.y"
8686 {
8687 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
8688 rb_parser_printf(p, "NODE_SPECIAL");
8689 }
8690 else if (((*yyvaluep).node_masgn)) {
8691 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
8692 }
8693}
8694#line 8695 "parse.c"
8695 break;
8696
8697 case YYSYMBOL_mlhs_basic: /* mlhs_basic */
8698#line 2611 "parse.y"
8699 {
8700 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
8701 rb_parser_printf(p, "NODE_SPECIAL");
8702 }
8703 else if (((*yyvaluep).node_masgn)) {
8704 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
8705 }
8706}
8707#line 8708 "parse.c"
8708 break;
8709
8710 case YYSYMBOL_mlhs_item: /* mlhs_item */
8711#line 2611 "parse.y"
8712 {
8713 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8714 rb_parser_printf(p, "NODE_SPECIAL");
8715 }
8716 else if (((*yyvaluep).node)) {
8717 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8718 }
8719}
8720#line 8721 "parse.c"
8721 break;
8722
8723 case YYSYMBOL_mlhs_head: /* mlhs_head */
8724#line 2611 "parse.y"
8725 {
8726 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8727 rb_parser_printf(p, "NODE_SPECIAL");
8728 }
8729 else if (((*yyvaluep).node)) {
8730 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8731 }
8732}
8733#line 8734 "parse.c"
8734 break;
8735
8736 case YYSYMBOL_mlhs_post: /* mlhs_post */
8737#line 2611 "parse.y"
8738 {
8739 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8740 rb_parser_printf(p, "NODE_SPECIAL");
8741 }
8742 else if (((*yyvaluep).node)) {
8743 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8744 }
8745}
8746#line 8747 "parse.c"
8747 break;
8748
8749 case YYSYMBOL_mlhs_node: /* mlhs_node */
8750#line 2611 "parse.y"
8751 {
8752 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8753 rb_parser_printf(p, "NODE_SPECIAL");
8754 }
8755 else if (((*yyvaluep).node)) {
8756 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8757 }
8758}
8759#line 8760 "parse.c"
8760 break;
8761
8762 case YYSYMBOL_lhs: /* lhs */
8763#line 2611 "parse.y"
8764 {
8765 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8766 rb_parser_printf(p, "NODE_SPECIAL");
8767 }
8768 else if (((*yyvaluep).node)) {
8769 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8770 }
8771}
8772#line 8773 "parse.c"
8773 break;
8774
8775 case YYSYMBOL_cname: /* cname */
8776#line 2620 "parse.y"
8777 {
8778 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8779}
8780#line 8781 "parse.c"
8781 break;
8782
8783 case YYSYMBOL_cpath: /* cpath */
8784#line 2611 "parse.y"
8785 {
8786 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8787 rb_parser_printf(p, "NODE_SPECIAL");
8788 }
8789 else if (((*yyvaluep).node)) {
8790 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8791 }
8792}
8793#line 8794 "parse.c"
8794 break;
8795
8796 case YYSYMBOL_fname: /* fname */
8797#line 2620 "parse.y"
8798 {
8799 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8800}
8801#line 8802 "parse.c"
8802 break;
8803
8804 case YYSYMBOL_fitem: /* fitem */
8805#line 2611 "parse.y"
8806 {
8807 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8808 rb_parser_printf(p, "NODE_SPECIAL");
8809 }
8810 else if (((*yyvaluep).node)) {
8811 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8812 }
8813}
8814#line 8815 "parse.c"
8815 break;
8816
8817 case YYSYMBOL_undef_list: /* undef_list */
8818#line 2611 "parse.y"
8819 {
8820 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8821 rb_parser_printf(p, "NODE_SPECIAL");
8822 }
8823 else if (((*yyvaluep).node)) {
8824 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8825 }
8826}
8827#line 8828 "parse.c"
8828 break;
8829
8830 case YYSYMBOL_op: /* op */
8831#line 2620 "parse.y"
8832 {
8833 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8834}
8835#line 8836 "parse.c"
8836 break;
8837
8838 case YYSYMBOL_reswords: /* reswords */
8839#line 2620 "parse.y"
8840 {
8841 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8842}
8843#line 8844 "parse.c"
8844 break;
8845
8846 case YYSYMBOL_arg: /* arg */
8847#line 2611 "parse.y"
8848 {
8849 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8850 rb_parser_printf(p, "NODE_SPECIAL");
8851 }
8852 else if (((*yyvaluep).node)) {
8853 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8854 }
8855}
8856#line 8857 "parse.c"
8857 break;
8858
8859 case YYSYMBOL_endless_arg: /* endless_arg */
8860#line 2611 "parse.y"
8861 {
8862 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8863 rb_parser_printf(p, "NODE_SPECIAL");
8864 }
8865 else if (((*yyvaluep).node)) {
8866 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8867 }
8868}
8869#line 8870 "parse.c"
8870 break;
8871
8872 case YYSYMBOL_relop: /* relop */
8873#line 2620 "parse.y"
8874 {
8875 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8876}
8877#line 8878 "parse.c"
8878 break;
8879
8880 case YYSYMBOL_rel_expr: /* rel_expr */
8881#line 2611 "parse.y"
8882 {
8883 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8884 rb_parser_printf(p, "NODE_SPECIAL");
8885 }
8886 else if (((*yyvaluep).node)) {
8887 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8888 }
8889}
8890#line 8891 "parse.c"
8891 break;
8892
8893 case YYSYMBOL_arg_value: /* arg_value */
8894#line 2611 "parse.y"
8895 {
8896 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8897 rb_parser_printf(p, "NODE_SPECIAL");
8898 }
8899 else if (((*yyvaluep).node)) {
8900 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8901 }
8902}
8903#line 8904 "parse.c"
8904 break;
8905
8906 case YYSYMBOL_aref_args: /* aref_args */
8907#line 2611 "parse.y"
8908 {
8909 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8910 rb_parser_printf(p, "NODE_SPECIAL");
8911 }
8912 else if (((*yyvaluep).node)) {
8913 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8914 }
8915}
8916#line 8917 "parse.c"
8917 break;
8918
8919 case YYSYMBOL_arg_rhs: /* arg_rhs */
8920#line 2611 "parse.y"
8921 {
8922 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8923 rb_parser_printf(p, "NODE_SPECIAL");
8924 }
8925 else if (((*yyvaluep).node)) {
8926 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8927 }
8928}
8929#line 8930 "parse.c"
8930 break;
8931
8932 case YYSYMBOL_paren_args: /* paren_args */
8933#line 2611 "parse.y"
8934 {
8935 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8936 rb_parser_printf(p, "NODE_SPECIAL");
8937 }
8938 else if (((*yyvaluep).node)) {
8939 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8940 }
8941}
8942#line 8943 "parse.c"
8943 break;
8944
8945 case YYSYMBOL_opt_paren_args: /* opt_paren_args */
8946#line 2611 "parse.y"
8947 {
8948 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8949 rb_parser_printf(p, "NODE_SPECIAL");
8950 }
8951 else if (((*yyvaluep).node)) {
8952 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8953 }
8954}
8955#line 8956 "parse.c"
8956 break;
8957
8958 case YYSYMBOL_opt_call_args: /* opt_call_args */
8959#line 2611 "parse.y"
8960 {
8961 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8962 rb_parser_printf(p, "NODE_SPECIAL");
8963 }
8964 else if (((*yyvaluep).node)) {
8965 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8966 }
8967}
8968#line 8969 "parse.c"
8969 break;
8970
8971 case YYSYMBOL_call_args: /* call_args */
8972#line 2611 "parse.y"
8973 {
8974 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8975 rb_parser_printf(p, "NODE_SPECIAL");
8976 }
8977 else if (((*yyvaluep).node)) {
8978 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8979 }
8980}
8981#line 8982 "parse.c"
8982 break;
8983
8984 case YYSYMBOL_command_args: /* command_args */
8985#line 2611 "parse.y"
8986 {
8987 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8988 rb_parser_printf(p, "NODE_SPECIAL");
8989 }
8990 else if (((*yyvaluep).node)) {
8991 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8992 }
8993}
8994#line 8995 "parse.c"
8995 break;
8996
8997 case YYSYMBOL_block_arg: /* block_arg */
8998#line 2611 "parse.y"
8999 {
9000 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
9001 rb_parser_printf(p, "NODE_SPECIAL");
9002 }
9003 else if (((*yyvaluep).node_block_pass)) {
9004 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
9005 }
9006}
9007#line 9008 "parse.c"
9008 break;
9009
9010 case YYSYMBOL_opt_block_arg: /* opt_block_arg */
9011#line 2611 "parse.y"
9012 {
9013 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
9014 rb_parser_printf(p, "NODE_SPECIAL");
9015 }
9016 else if (((*yyvaluep).node_block_pass)) {
9017 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
9018 }
9019}
9020#line 9021 "parse.c"
9021 break;
9022
9023 case YYSYMBOL_args: /* args */
9024#line 2611 "parse.y"
9025 {
9026 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9027 rb_parser_printf(p, "NODE_SPECIAL");
9028 }
9029 else if (((*yyvaluep).node)) {
9030 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9031 }
9032}
9033#line 9034 "parse.c"
9034 break;
9035
9036 case YYSYMBOL_arg_splat: /* arg_splat */
9037#line 2611 "parse.y"
9038 {
9039 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9040 rb_parser_printf(p, "NODE_SPECIAL");
9041 }
9042 else if (((*yyvaluep).node)) {
9043 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9044 }
9045}
9046#line 9047 "parse.c"
9047 break;
9048
9049 case YYSYMBOL_mrhs_arg: /* mrhs_arg */
9050#line 2611 "parse.y"
9051 {
9052 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9053 rb_parser_printf(p, "NODE_SPECIAL");
9054 }
9055 else if (((*yyvaluep).node)) {
9056 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9057 }
9058}
9059#line 9060 "parse.c"
9060 break;
9061
9062 case YYSYMBOL_mrhs: /* mrhs */
9063#line 2611 "parse.y"
9064 {
9065 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9066 rb_parser_printf(p, "NODE_SPECIAL");
9067 }
9068 else if (((*yyvaluep).node)) {
9069 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9070 }
9071}
9072#line 9073 "parse.c"
9073 break;
9074
9075 case YYSYMBOL_primary: /* primary */
9076#line 2611 "parse.y"
9077 {
9078 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9079 rb_parser_printf(p, "NODE_SPECIAL");
9080 }
9081 else if (((*yyvaluep).node)) {
9082 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9083 }
9084}
9085#line 9086 "parse.c"
9086 break;
9087
9088 case YYSYMBOL_primary_value: /* primary_value */
9089#line 2611 "parse.y"
9090 {
9091 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9092 rb_parser_printf(p, "NODE_SPECIAL");
9093 }
9094 else if (((*yyvaluep).node)) {
9095 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9096 }
9097}
9098#line 9099 "parse.c"
9099 break;
9100
9101 case YYSYMBOL_k_while: /* k_while */
9102#line 2611 "parse.y"
9103 {
9104 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
9105 rb_parser_printf(p, "NODE_SPECIAL");
9106 }
9107 else if (((*yyvaluep).node_exits)) {
9108 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
9109 }
9110}
9111#line 9112 "parse.c"
9112 break;
9113
9114 case YYSYMBOL_k_until: /* k_until */
9115#line 2611 "parse.y"
9116 {
9117 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
9118 rb_parser_printf(p, "NODE_SPECIAL");
9119 }
9120 else if (((*yyvaluep).node_exits)) {
9121 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
9122 }
9123}
9124#line 9125 "parse.c"
9125 break;
9126
9127 case YYSYMBOL_k_for: /* k_for */
9128#line 2611 "parse.y"
9129 {
9130 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
9131 rb_parser_printf(p, "NODE_SPECIAL");
9132 }
9133 else if (((*yyvaluep).node_exits)) {
9134 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
9135 }
9136}
9137#line 9138 "parse.c"
9138 break;
9139
9140 case YYSYMBOL_k_def: /* k_def */
9141#line 2611 "parse.y"
9142 {
9143 if ((NODE *)((*yyvaluep).node_def_temp) == (NODE *)-1) {
9144 rb_parser_printf(p, "NODE_SPECIAL");
9145 }
9146 else if (((*yyvaluep).node_def_temp)) {
9147 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_def_temp)))));
9148 }
9149}
9150#line 9151 "parse.c"
9151 break;
9152
9153 case YYSYMBOL_if_tail: /* if_tail */
9154#line 2611 "parse.y"
9155 {
9156 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9157 rb_parser_printf(p, "NODE_SPECIAL");
9158 }
9159 else if (((*yyvaluep).node)) {
9160 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9161 }
9162}
9163#line 9164 "parse.c"
9164 break;
9165
9166 case YYSYMBOL_opt_else: /* opt_else */
9167#line 2611 "parse.y"
9168 {
9169 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9170 rb_parser_printf(p, "NODE_SPECIAL");
9171 }
9172 else if (((*yyvaluep).node)) {
9173 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9174 }
9175}
9176#line 9177 "parse.c"
9177 break;
9178
9179 case YYSYMBOL_for_var: /* for_var */
9180#line 2611 "parse.y"
9181 {
9182 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9183 rb_parser_printf(p, "NODE_SPECIAL");
9184 }
9185 else if (((*yyvaluep).node)) {
9186 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9187 }
9188}
9189#line 9190 "parse.c"
9190 break;
9191
9192 case YYSYMBOL_f_marg: /* f_marg */
9193#line 2611 "parse.y"
9194 {
9195 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9196 rb_parser_printf(p, "NODE_SPECIAL");
9197 }
9198 else if (((*yyvaluep).node)) {
9199 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9200 }
9201}
9202#line 9203 "parse.c"
9203 break;
9204
9205 case YYSYMBOL_f_marg_list: /* f_marg_list */
9206#line 2611 "parse.y"
9207 {
9208 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9209 rb_parser_printf(p, "NODE_SPECIAL");
9210 }
9211 else if (((*yyvaluep).node)) {
9212 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9213 }
9214}
9215#line 9216 "parse.c"
9216 break;
9217
9218 case YYSYMBOL_f_margs: /* f_margs */
9219#line 2611 "parse.y"
9220 {
9221 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
9222 rb_parser_printf(p, "NODE_SPECIAL");
9223 }
9224 else if (((*yyvaluep).node_masgn)) {
9225 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
9226 }
9227}
9228#line 9229 "parse.c"
9229 break;
9230
9231 case YYSYMBOL_f_rest_marg: /* f_rest_marg */
9232#line 2611 "parse.y"
9233 {
9234 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9235 rb_parser_printf(p, "NODE_SPECIAL");
9236 }
9237 else if (((*yyvaluep).node)) {
9238 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9239 }
9240}
9241#line 9242 "parse.c"
9242 break;
9243
9244 case YYSYMBOL_f_any_kwrest: /* f_any_kwrest */
9245#line 2620 "parse.y"
9246 {
9247 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9248}
9249#line 9250 "parse.c"
9250 break;
9251
9252 case YYSYMBOL_f_kwarg_f_block_kw: /* f_kwarg_f_block_kw */
9253#line 2611 "parse.y"
9254 {
9255 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9256 rb_parser_printf(p, "NODE_SPECIAL");
9257 }
9258 else if (((*yyvaluep).node_kw_arg)) {
9259 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9260 }
9261}
9262#line 9263 "parse.c"
9263 break;
9264
9265 case YYSYMBOL_block_args_tail: /* block_args_tail */
9266#line 2611 "parse.y"
9267 {
9268 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9269 rb_parser_printf(p, "NODE_SPECIAL");
9270 }
9271 else if (((*yyvaluep).node_args)) {
9272 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9273 }
9274}
9275#line 9276 "parse.c"
9276 break;
9277
9278 case YYSYMBOL_excessed_comma: /* excessed_comma */
9279#line 2620 "parse.y"
9280 {
9281 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9282}
9283#line 9284 "parse.c"
9284 break;
9285
9286 case YYSYMBOL_f_opt_primary_value: /* f_opt_primary_value */
9287#line 2611 "parse.y"
9288 {
9289 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9290 rb_parser_printf(p, "NODE_SPECIAL");
9291 }
9292 else if (((*yyvaluep).node_opt_arg)) {
9293 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9294 }
9295}
9296#line 9297 "parse.c"
9297 break;
9298
9299 case YYSYMBOL_f_optarg_primary_value: /* f_optarg_primary_value */
9300#line 2611 "parse.y"
9301 {
9302 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9303 rb_parser_printf(p, "NODE_SPECIAL");
9304 }
9305 else if (((*yyvaluep).node_opt_arg)) {
9306 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9307 }
9308}
9309#line 9310 "parse.c"
9310 break;
9311
9312 case YYSYMBOL_opt_args_tail_block_args_tail: /* opt_args_tail_block_args_tail */
9313#line 2611 "parse.y"
9314 {
9315 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9316 rb_parser_printf(p, "NODE_SPECIAL");
9317 }
9318 else if (((*yyvaluep).node_args)) {
9319 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9320 }
9321}
9322#line 9323 "parse.c"
9323 break;
9324
9325 case YYSYMBOL_block_param: /* block_param */
9326#line 2611 "parse.y"
9327 {
9328 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9329 rb_parser_printf(p, "NODE_SPECIAL");
9330 }
9331 else if (((*yyvaluep).node_args)) {
9332 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9333 }
9334}
9335#line 9336 "parse.c"
9336 break;
9337
9338 case YYSYMBOL_opt_block_param: /* opt_block_param */
9339#line 2611 "parse.y"
9340 {
9341 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9342 rb_parser_printf(p, "NODE_SPECIAL");
9343 }
9344 else if (((*yyvaluep).node_args)) {
9345 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9346 }
9347}
9348#line 9349 "parse.c"
9349 break;
9350
9351 case YYSYMBOL_block_param_def: /* block_param_def */
9352#line 2611 "parse.y"
9353 {
9354 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9355 rb_parser_printf(p, "NODE_SPECIAL");
9356 }
9357 else if (((*yyvaluep).node_args)) {
9358 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9359 }
9360}
9361#line 9362 "parse.c"
9362 break;
9363
9364 case YYSYMBOL_opt_bv_decl: /* opt_bv_decl */
9365#line 2620 "parse.y"
9366 {
9367 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9368}
9369#line 9370 "parse.c"
9370 break;
9371
9372 case YYSYMBOL_bv_decls: /* bv_decls */
9373#line 2620 "parse.y"
9374 {
9375 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9376}
9377#line 9378 "parse.c"
9378 break;
9379
9380 case YYSYMBOL_bvar: /* bvar */
9381#line 2620 "parse.y"
9382 {
9383 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9384}
9385#line 9386 "parse.c"
9386 break;
9387
9388 case YYSYMBOL_numparam: /* numparam */
9389#line 2611 "parse.y"
9390 {
9391 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9392 rb_parser_printf(p, "NODE_SPECIAL");
9393 }
9394 else if (((*yyvaluep).node)) {
9395 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9396 }
9397}
9398#line 9399 "parse.c"
9399 break;
9400
9401 case YYSYMBOL_it_id: /* it_id */
9402#line 2620 "parse.y"
9403 {
9404 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9405}
9406#line 9407 "parse.c"
9407 break;
9408
9409 case YYSYMBOL_lambda: /* lambda */
9410#line 2611 "parse.y"
9411 {
9412 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9413 rb_parser_printf(p, "NODE_SPECIAL");
9414 }
9415 else if (((*yyvaluep).node)) {
9416 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9417 }
9418}
9419#line 9420 "parse.c"
9420 break;
9421
9422 case YYSYMBOL_f_larglist: /* f_larglist */
9423#line 2611 "parse.y"
9424 {
9425 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9426 rb_parser_printf(p, "NODE_SPECIAL");
9427 }
9428 else if (((*yyvaluep).node_args)) {
9429 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9430 }
9431}
9432#line 9433 "parse.c"
9433 break;
9434
9435 case YYSYMBOL_lambda_body: /* lambda_body */
9436#line 2611 "parse.y"
9437 {
9438 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9439 rb_parser_printf(p, "NODE_SPECIAL");
9440 }
9441 else if (((*yyvaluep).node)) {
9442 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9443 }
9444}
9445#line 9446 "parse.c"
9446 break;
9447
9448 case YYSYMBOL_do_block: /* do_block */
9449#line 2611 "parse.y"
9450 {
9451 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9452 rb_parser_printf(p, "NODE_SPECIAL");
9453 }
9454 else if (((*yyvaluep).node)) {
9455 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9456 }
9457}
9458#line 9459 "parse.c"
9459 break;
9460
9461 case YYSYMBOL_block_call: /* block_call */
9462#line 2611 "parse.y"
9463 {
9464 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9465 rb_parser_printf(p, "NODE_SPECIAL");
9466 }
9467 else if (((*yyvaluep).node)) {
9468 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9469 }
9470}
9471#line 9472 "parse.c"
9472 break;
9473
9474 case YYSYMBOL_method_call: /* method_call */
9475#line 2611 "parse.y"
9476 {
9477 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9478 rb_parser_printf(p, "NODE_SPECIAL");
9479 }
9480 else if (((*yyvaluep).node)) {
9481 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9482 }
9483}
9484#line 9485 "parse.c"
9485 break;
9486
9487 case YYSYMBOL_brace_block: /* brace_block */
9488#line 2611 "parse.y"
9489 {
9490 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9491 rb_parser_printf(p, "NODE_SPECIAL");
9492 }
9493 else if (((*yyvaluep).node)) {
9494 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9495 }
9496}
9497#line 9498 "parse.c"
9498 break;
9499
9500 case YYSYMBOL_brace_body: /* brace_body */
9501#line 2611 "parse.y"
9502 {
9503 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9504 rb_parser_printf(p, "NODE_SPECIAL");
9505 }
9506 else if (((*yyvaluep).node)) {
9507 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9508 }
9509}
9510#line 9511 "parse.c"
9511 break;
9512
9513 case YYSYMBOL_do_body: /* do_body */
9514#line 2611 "parse.y"
9515 {
9516 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9517 rb_parser_printf(p, "NODE_SPECIAL");
9518 }
9519 else if (((*yyvaluep).node)) {
9520 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9521 }
9522}
9523#line 9524 "parse.c"
9524 break;
9525
9526 case YYSYMBOL_case_args: /* case_args */
9527#line 2611 "parse.y"
9528 {
9529 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9530 rb_parser_printf(p, "NODE_SPECIAL");
9531 }
9532 else if (((*yyvaluep).node)) {
9533 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9534 }
9535}
9536#line 9537 "parse.c"
9537 break;
9538
9539 case YYSYMBOL_case_body: /* case_body */
9540#line 2611 "parse.y"
9541 {
9542 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9543 rb_parser_printf(p, "NODE_SPECIAL");
9544 }
9545 else if (((*yyvaluep).node)) {
9546 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9547 }
9548}
9549#line 9550 "parse.c"
9550 break;
9551
9552 case YYSYMBOL_cases: /* cases */
9553#line 2611 "parse.y"
9554 {
9555 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9556 rb_parser_printf(p, "NODE_SPECIAL");
9557 }
9558 else if (((*yyvaluep).node)) {
9559 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9560 }
9561}
9562#line 9563 "parse.c"
9563 break;
9564
9565 case YYSYMBOL_p_case_body: /* p_case_body */
9566#line 2611 "parse.y"
9567 {
9568 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9569 rb_parser_printf(p, "NODE_SPECIAL");
9570 }
9571 else if (((*yyvaluep).node)) {
9572 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9573 }
9574}
9575#line 9576 "parse.c"
9576 break;
9577
9578 case YYSYMBOL_p_cases: /* p_cases */
9579#line 2611 "parse.y"
9580 {
9581 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9582 rb_parser_printf(p, "NODE_SPECIAL");
9583 }
9584 else if (((*yyvaluep).node)) {
9585 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9586 }
9587}
9588#line 9589 "parse.c"
9589 break;
9590
9591 case YYSYMBOL_p_top_expr: /* p_top_expr */
9592#line 2611 "parse.y"
9593 {
9594 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9595 rb_parser_printf(p, "NODE_SPECIAL");
9596 }
9597 else if (((*yyvaluep).node)) {
9598 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9599 }
9600}
9601#line 9602 "parse.c"
9602 break;
9603
9604 case YYSYMBOL_p_top_expr_body: /* p_top_expr_body */
9605#line 2611 "parse.y"
9606 {
9607 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9608 rb_parser_printf(p, "NODE_SPECIAL");
9609 }
9610 else if (((*yyvaluep).node)) {
9611 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9612 }
9613}
9614#line 9615 "parse.c"
9615 break;
9616
9617 case YYSYMBOL_p_expr: /* p_expr */
9618#line 2611 "parse.y"
9619 {
9620 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9621 rb_parser_printf(p, "NODE_SPECIAL");
9622 }
9623 else if (((*yyvaluep).node)) {
9624 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9625 }
9626}
9627#line 9628 "parse.c"
9628 break;
9629
9630 case YYSYMBOL_p_as: /* p_as */
9631#line 2611 "parse.y"
9632 {
9633 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9634 rb_parser_printf(p, "NODE_SPECIAL");
9635 }
9636 else if (((*yyvaluep).node)) {
9637 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9638 }
9639}
9640#line 9641 "parse.c"
9641 break;
9642
9643 case YYSYMBOL_p_alt: /* p_alt */
9644#line 2611 "parse.y"
9645 {
9646 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9647 rb_parser_printf(p, "NODE_SPECIAL");
9648 }
9649 else if (((*yyvaluep).node)) {
9650 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9651 }
9652}
9653#line 9654 "parse.c"
9654 break;
9655
9656 case YYSYMBOL_p_expr_basic: /* p_expr_basic */
9657#line 2611 "parse.y"
9658 {
9659 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9660 rb_parser_printf(p, "NODE_SPECIAL");
9661 }
9662 else if (((*yyvaluep).node)) {
9663 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9664 }
9665}
9666#line 9667 "parse.c"
9667 break;
9668
9669 case YYSYMBOL_p_args: /* p_args */
9670#line 2611 "parse.y"
9671 {
9672 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9673 rb_parser_printf(p, "NODE_SPECIAL");
9674 }
9675 else if (((*yyvaluep).node)) {
9676 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9677 }
9678}
9679#line 9680 "parse.c"
9680 break;
9681
9682 case YYSYMBOL_p_args_head: /* p_args_head */
9683#line 2611 "parse.y"
9684 {
9685 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9686 rb_parser_printf(p, "NODE_SPECIAL");
9687 }
9688 else if (((*yyvaluep).node)) {
9689 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9690 }
9691}
9692#line 9693 "parse.c"
9693 break;
9694
9695 case YYSYMBOL_p_args_tail: /* p_args_tail */
9696#line 2611 "parse.y"
9697 {
9698 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9699 rb_parser_printf(p, "NODE_SPECIAL");
9700 }
9701 else if (((*yyvaluep).node)) {
9702 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9703 }
9704}
9705#line 9706 "parse.c"
9706 break;
9707
9708 case YYSYMBOL_p_find: /* p_find */
9709#line 2611 "parse.y"
9710 {
9711 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9712 rb_parser_printf(p, "NODE_SPECIAL");
9713 }
9714 else if (((*yyvaluep).node)) {
9715 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9716 }
9717}
9718#line 9719 "parse.c"
9719 break;
9720
9721 case YYSYMBOL_p_rest: /* p_rest */
9722#line 2611 "parse.y"
9723 {
9724 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9725 rb_parser_printf(p, "NODE_SPECIAL");
9726 }
9727 else if (((*yyvaluep).node)) {
9728 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9729 }
9730}
9731#line 9732 "parse.c"
9732 break;
9733
9734 case YYSYMBOL_p_args_post: /* p_args_post */
9735#line 2611 "parse.y"
9736 {
9737 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9738 rb_parser_printf(p, "NODE_SPECIAL");
9739 }
9740 else if (((*yyvaluep).node)) {
9741 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9742 }
9743}
9744#line 9745 "parse.c"
9745 break;
9746
9747 case YYSYMBOL_p_arg: /* p_arg */
9748#line 2611 "parse.y"
9749 {
9750 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9751 rb_parser_printf(p, "NODE_SPECIAL");
9752 }
9753 else if (((*yyvaluep).node)) {
9754 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9755 }
9756}
9757#line 9758 "parse.c"
9758 break;
9759
9760 case YYSYMBOL_p_kwargs: /* p_kwargs */
9761#line 2611 "parse.y"
9762 {
9763 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9764 rb_parser_printf(p, "NODE_SPECIAL");
9765 }
9766 else if (((*yyvaluep).node)) {
9767 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9768 }
9769}
9770#line 9771 "parse.c"
9771 break;
9772
9773 case YYSYMBOL_p_kwarg: /* p_kwarg */
9774#line 2611 "parse.y"
9775 {
9776 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9777 rb_parser_printf(p, "NODE_SPECIAL");
9778 }
9779 else if (((*yyvaluep).node)) {
9780 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9781 }
9782}
9783#line 9784 "parse.c"
9784 break;
9785
9786 case YYSYMBOL_p_kw: /* p_kw */
9787#line 2611 "parse.y"
9788 {
9789 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9790 rb_parser_printf(p, "NODE_SPECIAL");
9791 }
9792 else if (((*yyvaluep).node)) {
9793 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9794 }
9795}
9796#line 9797 "parse.c"
9797 break;
9798
9799 case YYSYMBOL_p_kw_label: /* p_kw_label */
9800#line 2620 "parse.y"
9801 {
9802 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9803}
9804#line 9805 "parse.c"
9805 break;
9806
9807 case YYSYMBOL_p_kwrest: /* p_kwrest */
9808#line 2620 "parse.y"
9809 {
9810 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9811}
9812#line 9813 "parse.c"
9813 break;
9814
9815 case YYSYMBOL_p_kwnorest: /* p_kwnorest */
9816#line 2620 "parse.y"
9817 {
9818 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9819}
9820#line 9821 "parse.c"
9821 break;
9822
9823 case YYSYMBOL_p_any_kwrest: /* p_any_kwrest */
9824#line 2620 "parse.y"
9825 {
9826 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9827}
9828#line 9829 "parse.c"
9829 break;
9830
9831 case YYSYMBOL_p_value: /* p_value */
9832#line 2611 "parse.y"
9833 {
9834 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9835 rb_parser_printf(p, "NODE_SPECIAL");
9836 }
9837 else if (((*yyvaluep).node)) {
9838 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9839 }
9840}
9841#line 9842 "parse.c"
9842 break;
9843
9844 case YYSYMBOL_p_primitive: /* p_primitive */
9845#line 2611 "parse.y"
9846 {
9847 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9848 rb_parser_printf(p, "NODE_SPECIAL");
9849 }
9850 else if (((*yyvaluep).node)) {
9851 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9852 }
9853}
9854#line 9855 "parse.c"
9855 break;
9856
9857 case YYSYMBOL_p_variable: /* p_variable */
9858#line 2611 "parse.y"
9859 {
9860 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9861 rb_parser_printf(p, "NODE_SPECIAL");
9862 }
9863 else if (((*yyvaluep).node)) {
9864 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9865 }
9866}
9867#line 9868 "parse.c"
9868 break;
9869
9870 case YYSYMBOL_p_var_ref: /* p_var_ref */
9871#line 2611 "parse.y"
9872 {
9873 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9874 rb_parser_printf(p, "NODE_SPECIAL");
9875 }
9876 else if (((*yyvaluep).node)) {
9877 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9878 }
9879}
9880#line 9881 "parse.c"
9881 break;
9882
9883 case YYSYMBOL_p_expr_ref: /* p_expr_ref */
9884#line 2611 "parse.y"
9885 {
9886 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9887 rb_parser_printf(p, "NODE_SPECIAL");
9888 }
9889 else if (((*yyvaluep).node)) {
9890 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9891 }
9892}
9893#line 9894 "parse.c"
9894 break;
9895
9896 case YYSYMBOL_p_const: /* p_const */
9897#line 2611 "parse.y"
9898 {
9899 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9900 rb_parser_printf(p, "NODE_SPECIAL");
9901 }
9902 else if (((*yyvaluep).node)) {
9903 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9904 }
9905}
9906#line 9907 "parse.c"
9907 break;
9908
9909 case YYSYMBOL_opt_rescue: /* opt_rescue */
9910#line 2611 "parse.y"
9911 {
9912 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9913 rb_parser_printf(p, "NODE_SPECIAL");
9914 }
9915 else if (((*yyvaluep).node)) {
9916 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9917 }
9918}
9919#line 9920 "parse.c"
9920 break;
9921
9922 case YYSYMBOL_exc_list: /* exc_list */
9923#line 2611 "parse.y"
9924 {
9925 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9926 rb_parser_printf(p, "NODE_SPECIAL");
9927 }
9928 else if (((*yyvaluep).node)) {
9929 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9930 }
9931}
9932#line 9933 "parse.c"
9933 break;
9934
9935 case YYSYMBOL_exc_var: /* exc_var */
9936#line 2611 "parse.y"
9937 {
9938 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9939 rb_parser_printf(p, "NODE_SPECIAL");
9940 }
9941 else if (((*yyvaluep).node)) {
9942 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9943 }
9944}
9945#line 9946 "parse.c"
9946 break;
9947
9948 case YYSYMBOL_opt_ensure: /* opt_ensure */
9949#line 2611 "parse.y"
9950 {
9951 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9952 rb_parser_printf(p, "NODE_SPECIAL");
9953 }
9954 else if (((*yyvaluep).node)) {
9955 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9956 }
9957}
9958#line 9959 "parse.c"
9959 break;
9960
9961 case YYSYMBOL_literal: /* literal */
9962#line 2611 "parse.y"
9963 {
9964 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9965 rb_parser_printf(p, "NODE_SPECIAL");
9966 }
9967 else if (((*yyvaluep).node)) {
9968 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9969 }
9970}
9971#line 9972 "parse.c"
9972 break;
9973
9974 case YYSYMBOL_strings: /* strings */
9975#line 2611 "parse.y"
9976 {
9977 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9978 rb_parser_printf(p, "NODE_SPECIAL");
9979 }
9980 else if (((*yyvaluep).node)) {
9981 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9982 }
9983}
9984#line 9985 "parse.c"
9985 break;
9986
9987 case YYSYMBOL_string: /* string */
9988#line 2611 "parse.y"
9989 {
9990 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9991 rb_parser_printf(p, "NODE_SPECIAL");
9992 }
9993 else if (((*yyvaluep).node)) {
9994 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9995 }
9996}
9997#line 9998 "parse.c"
9998 break;
9999
10000 case YYSYMBOL_string1: /* string1 */
10001#line 2611 "parse.y"
10002 {
10003 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10004 rb_parser_printf(p, "NODE_SPECIAL");
10005 }
10006 else if (((*yyvaluep).node)) {
10007 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10008 }
10009}
10010#line 10011 "parse.c"
10011 break;
10012
10013 case YYSYMBOL_xstring: /* xstring */
10014#line 2611 "parse.y"
10015 {
10016 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10017 rb_parser_printf(p, "NODE_SPECIAL");
10018 }
10019 else if (((*yyvaluep).node)) {
10020 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10021 }
10022}
10023#line 10024 "parse.c"
10024 break;
10025
10026 case YYSYMBOL_regexp: /* regexp */
10027#line 2611 "parse.y"
10028 {
10029 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10030 rb_parser_printf(p, "NODE_SPECIAL");
10031 }
10032 else if (((*yyvaluep).node)) {
10033 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10034 }
10035}
10036#line 10037 "parse.c"
10037 break;
10038
10039 case YYSYMBOL_words_tWORDS_BEG_word_list: /* words_tWORDS_BEG_word_list */
10040#line 2611 "parse.y"
10041 {
10042 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10043 rb_parser_printf(p, "NODE_SPECIAL");
10044 }
10045 else if (((*yyvaluep).node)) {
10046 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10047 }
10048}
10049#line 10050 "parse.c"
10050 break;
10051
10052 case YYSYMBOL_words: /* words */
10053#line 2611 "parse.y"
10054 {
10055 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10056 rb_parser_printf(p, "NODE_SPECIAL");
10057 }
10058 else if (((*yyvaluep).node)) {
10059 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10060 }
10061}
10062#line 10063 "parse.c"
10063 break;
10064
10065 case YYSYMBOL_word_list: /* word_list */
10066#line 2611 "parse.y"
10067 {
10068 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10069 rb_parser_printf(p, "NODE_SPECIAL");
10070 }
10071 else if (((*yyvaluep).node)) {
10072 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10073 }
10074}
10075#line 10076 "parse.c"
10076 break;
10077
10078 case YYSYMBOL_word: /* word */
10079#line 2611 "parse.y"
10080 {
10081 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10082 rb_parser_printf(p, "NODE_SPECIAL");
10083 }
10084 else if (((*yyvaluep).node)) {
10085 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10086 }
10087}
10088#line 10089 "parse.c"
10089 break;
10090
10091 case YYSYMBOL_words_tSYMBOLS_BEG_symbol_list: /* words_tSYMBOLS_BEG_symbol_list */
10092#line 2611 "parse.y"
10093 {
10094 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10095 rb_parser_printf(p, "NODE_SPECIAL");
10096 }
10097 else if (((*yyvaluep).node)) {
10098 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10099 }
10100}
10101#line 10102 "parse.c"
10102 break;
10103
10104 case YYSYMBOL_symbols: /* symbols */
10105#line 2611 "parse.y"
10106 {
10107 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10108 rb_parser_printf(p, "NODE_SPECIAL");
10109 }
10110 else if (((*yyvaluep).node)) {
10111 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10112 }
10113}
10114#line 10115 "parse.c"
10115 break;
10116
10117 case YYSYMBOL_symbol_list: /* symbol_list */
10118#line 2611 "parse.y"
10119 {
10120 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10121 rb_parser_printf(p, "NODE_SPECIAL");
10122 }
10123 else if (((*yyvaluep).node)) {
10124 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10125 }
10126}
10127#line 10128 "parse.c"
10128 break;
10129
10130 case YYSYMBOL_words_tQWORDS_BEG_qword_list: /* words_tQWORDS_BEG_qword_list */
10131#line 2611 "parse.y"
10132 {
10133 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10134 rb_parser_printf(p, "NODE_SPECIAL");
10135 }
10136 else if (((*yyvaluep).node)) {
10137 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10138 }
10139}
10140#line 10141 "parse.c"
10141 break;
10142
10143 case YYSYMBOL_qwords: /* qwords */
10144#line 2611 "parse.y"
10145 {
10146 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10147 rb_parser_printf(p, "NODE_SPECIAL");
10148 }
10149 else if (((*yyvaluep).node)) {
10150 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10151 }
10152}
10153#line 10154 "parse.c"
10154 break;
10155
10156 case YYSYMBOL_words_tQSYMBOLS_BEG_qsym_list: /* words_tQSYMBOLS_BEG_qsym_list */
10157#line 2611 "parse.y"
10158 {
10159 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10160 rb_parser_printf(p, "NODE_SPECIAL");
10161 }
10162 else if (((*yyvaluep).node)) {
10163 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10164 }
10165}
10166#line 10167 "parse.c"
10167 break;
10168
10169 case YYSYMBOL_qsymbols: /* qsymbols */
10170#line 2611 "parse.y"
10171 {
10172 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10173 rb_parser_printf(p, "NODE_SPECIAL");
10174 }
10175 else if (((*yyvaluep).node)) {
10176 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10177 }
10178}
10179#line 10180 "parse.c"
10180 break;
10181
10182 case YYSYMBOL_qword_list: /* qword_list */
10183#line 2611 "parse.y"
10184 {
10185 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10186 rb_parser_printf(p, "NODE_SPECIAL");
10187 }
10188 else if (((*yyvaluep).node)) {
10189 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10190 }
10191}
10192#line 10193 "parse.c"
10193 break;
10194
10195 case YYSYMBOL_qsym_list: /* qsym_list */
10196#line 2611 "parse.y"
10197 {
10198 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10199 rb_parser_printf(p, "NODE_SPECIAL");
10200 }
10201 else if (((*yyvaluep).node)) {
10202 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10203 }
10204}
10205#line 10206 "parse.c"
10206 break;
10207
10208 case YYSYMBOL_string_contents: /* string_contents */
10209#line 2611 "parse.y"
10210 {
10211 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10212 rb_parser_printf(p, "NODE_SPECIAL");
10213 }
10214 else if (((*yyvaluep).node)) {
10215 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10216 }
10217}
10218#line 10219 "parse.c"
10219 break;
10220
10221 case YYSYMBOL_xstring_contents: /* xstring_contents */
10222#line 2611 "parse.y"
10223 {
10224 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10225 rb_parser_printf(p, "NODE_SPECIAL");
10226 }
10227 else if (((*yyvaluep).node)) {
10228 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10229 }
10230}
10231#line 10232 "parse.c"
10232 break;
10233
10234 case YYSYMBOL_regexp_contents: /* regexp_contents */
10235#line 2611 "parse.y"
10236 {
10237 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10238 rb_parser_printf(p, "NODE_SPECIAL");
10239 }
10240 else if (((*yyvaluep).node)) {
10241 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10242 }
10243}
10244#line 10245 "parse.c"
10245 break;
10246
10247 case YYSYMBOL_string_content: /* string_content */
10248#line 2611 "parse.y"
10249 {
10250 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10251 rb_parser_printf(p, "NODE_SPECIAL");
10252 }
10253 else if (((*yyvaluep).node)) {
10254 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10255 }
10256}
10257#line 10258 "parse.c"
10258 break;
10259
10260 case YYSYMBOL_string_dvar: /* string_dvar */
10261#line 2611 "parse.y"
10262 {
10263 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10264 rb_parser_printf(p, "NODE_SPECIAL");
10265 }
10266 else if (((*yyvaluep).node)) {
10267 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10268 }
10269}
10270#line 10271 "parse.c"
10271 break;
10272
10273 case YYSYMBOL_symbol: /* symbol */
10274#line 2611 "parse.y"
10275 {
10276 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10277 rb_parser_printf(p, "NODE_SPECIAL");
10278 }
10279 else if (((*yyvaluep).node)) {
10280 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10281 }
10282}
10283#line 10284 "parse.c"
10284 break;
10285
10286 case YYSYMBOL_ssym: /* ssym */
10287#line 2611 "parse.y"
10288 {
10289 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10290 rb_parser_printf(p, "NODE_SPECIAL");
10291 }
10292 else if (((*yyvaluep).node)) {
10293 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10294 }
10295}
10296#line 10297 "parse.c"
10297 break;
10298
10299 case YYSYMBOL_sym: /* sym */
10300#line 2620 "parse.y"
10301 {
10302 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10303}
10304#line 10305 "parse.c"
10305 break;
10306
10307 case YYSYMBOL_dsym: /* dsym */
10308#line 2611 "parse.y"
10309 {
10310 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10311 rb_parser_printf(p, "NODE_SPECIAL");
10312 }
10313 else if (((*yyvaluep).node)) {
10314 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10315 }
10316}
10317#line 10318 "parse.c"
10318 break;
10319
10320 case YYSYMBOL_numeric: /* numeric */
10321#line 2611 "parse.y"
10322 {
10323 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10324 rb_parser_printf(p, "NODE_SPECIAL");
10325 }
10326 else if (((*yyvaluep).node)) {
10327 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10328 }
10329}
10330#line 10331 "parse.c"
10331 break;
10332
10333 case YYSYMBOL_simple_numeric: /* simple_numeric */
10334#line 2611 "parse.y"
10335 {
10336 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10337 rb_parser_printf(p, "NODE_SPECIAL");
10338 }
10339 else if (((*yyvaluep).node)) {
10340 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10341 }
10342}
10343#line 10344 "parse.c"
10344 break;
10345
10346 case YYSYMBOL_nonlocal_var: /* nonlocal_var */
10347#line 2620 "parse.y"
10348 {
10349 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10350}
10351#line 10352 "parse.c"
10352 break;
10353
10354 case YYSYMBOL_user_variable: /* user_variable */
10355#line 2620 "parse.y"
10356 {
10357 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10358}
10359#line 10360 "parse.c"
10360 break;
10361
10362 case YYSYMBOL_keyword_variable: /* keyword_variable */
10363#line 2620 "parse.y"
10364 {
10365 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10366}
10367#line 10368 "parse.c"
10368 break;
10369
10370 case YYSYMBOL_var_ref: /* var_ref */
10371#line 2611 "parse.y"
10372 {
10373 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10374 rb_parser_printf(p, "NODE_SPECIAL");
10375 }
10376 else if (((*yyvaluep).node)) {
10377 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10378 }
10379}
10380#line 10381 "parse.c"
10381 break;
10382
10383 case YYSYMBOL_var_lhs: /* var_lhs */
10384#line 2611 "parse.y"
10385 {
10386 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10387 rb_parser_printf(p, "NODE_SPECIAL");
10388 }
10389 else if (((*yyvaluep).node)) {
10390 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10391 }
10392}
10393#line 10394 "parse.c"
10394 break;
10395
10396 case YYSYMBOL_backref: /* backref */
10397#line 2611 "parse.y"
10398 {
10399 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10400 rb_parser_printf(p, "NODE_SPECIAL");
10401 }
10402 else if (((*yyvaluep).node)) {
10403 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10404 }
10405}
10406#line 10407 "parse.c"
10407 break;
10408
10409 case YYSYMBOL_superclass: /* superclass */
10410#line 2611 "parse.y"
10411 {
10412 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10413 rb_parser_printf(p, "NODE_SPECIAL");
10414 }
10415 else if (((*yyvaluep).node)) {
10416 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10417 }
10418}
10419#line 10420 "parse.c"
10420 break;
10421
10422 case YYSYMBOL_f_opt_paren_args: /* f_opt_paren_args */
10423#line 2611 "parse.y"
10424 {
10425 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10426 rb_parser_printf(p, "NODE_SPECIAL");
10427 }
10428 else if (((*yyvaluep).node_args)) {
10429 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10430 }
10431}
10432#line 10433 "parse.c"
10433 break;
10434
10435 case YYSYMBOL_f_paren_args: /* f_paren_args */
10436#line 2611 "parse.y"
10437 {
10438 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10439 rb_parser_printf(p, "NODE_SPECIAL");
10440 }
10441 else if (((*yyvaluep).node_args)) {
10442 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10443 }
10444}
10445#line 10446 "parse.c"
10446 break;
10447
10448 case YYSYMBOL_f_arglist: /* f_arglist */
10449#line 2611 "parse.y"
10450 {
10451 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10452 rb_parser_printf(p, "NODE_SPECIAL");
10453 }
10454 else if (((*yyvaluep).node_args)) {
10455 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10456 }
10457}
10458#line 10459 "parse.c"
10459 break;
10460
10461 case YYSYMBOL_f_kwarg_f_kw: /* f_kwarg_f_kw */
10462#line 2611 "parse.y"
10463 {
10464 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
10465 rb_parser_printf(p, "NODE_SPECIAL");
10466 }
10467 else if (((*yyvaluep).node_kw_arg)) {
10468 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
10469 }
10470}
10471#line 10472 "parse.c"
10472 break;
10473
10474 case YYSYMBOL_args_tail: /* args_tail */
10475#line 2611 "parse.y"
10476 {
10477 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10478 rb_parser_printf(p, "NODE_SPECIAL");
10479 }
10480 else if (((*yyvaluep).node_args)) {
10481 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10482 }
10483}
10484#line 10485 "parse.c"
10485 break;
10486
10487 case YYSYMBOL_f_opt_arg_value: /* f_opt_arg_value */
10488#line 2611 "parse.y"
10489 {
10490 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
10491 rb_parser_printf(p, "NODE_SPECIAL");
10492 }
10493 else if (((*yyvaluep).node_opt_arg)) {
10494 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
10495 }
10496}
10497#line 10498 "parse.c"
10498 break;
10499
10500 case YYSYMBOL_f_optarg_arg_value: /* f_optarg_arg_value */
10501#line 2611 "parse.y"
10502 {
10503 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
10504 rb_parser_printf(p, "NODE_SPECIAL");
10505 }
10506 else if (((*yyvaluep).node_opt_arg)) {
10507 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
10508 }
10509}
10510#line 10511 "parse.c"
10511 break;
10512
10513 case YYSYMBOL_opt_args_tail_args_tail: /* opt_args_tail_args_tail */
10514#line 2611 "parse.y"
10515 {
10516 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10517 rb_parser_printf(p, "NODE_SPECIAL");
10518 }
10519 else if (((*yyvaluep).node_args)) {
10520 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10521 }
10522}
10523#line 10524 "parse.c"
10524 break;
10525
10526 case YYSYMBOL_f_args: /* f_args */
10527#line 2611 "parse.y"
10528 {
10529 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10530 rb_parser_printf(p, "NODE_SPECIAL");
10531 }
10532 else if (((*yyvaluep).node_args)) {
10533 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10534 }
10535}
10536#line 10537 "parse.c"
10537 break;
10538
10539 case YYSYMBOL_args_forward: /* args_forward */
10540#line 2620 "parse.y"
10541 {
10542 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10543}
10544#line 10545 "parse.c"
10545 break;
10546
10547 case YYSYMBOL_f_bad_arg: /* f_bad_arg */
10548#line 2620 "parse.y"
10549 {
10550 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10551}
10552#line 10553 "parse.c"
10553 break;
10554
10555 case YYSYMBOL_f_norm_arg: /* f_norm_arg */
10556#line 2620 "parse.y"
10557 {
10558 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10559}
10560#line 10561 "parse.c"
10561 break;
10562
10563 case YYSYMBOL_f_arg_asgn: /* f_arg_asgn */
10564#line 2620 "parse.y"
10565 {
10566 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10567}
10568#line 10569 "parse.c"
10569 break;
10570
10571 case YYSYMBOL_f_arg_item: /* f_arg_item */
10572#line 2611 "parse.y"
10573 {
10574 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
10575 rb_parser_printf(p, "NODE_SPECIAL");
10576 }
10577 else if (((*yyvaluep).node_args_aux)) {
10578 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
10579 }
10580}
10581#line 10582 "parse.c"
10582 break;
10583
10584 case YYSYMBOL_f_arg: /* f_arg */
10585#line 2611 "parse.y"
10586 {
10587 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
10588 rb_parser_printf(p, "NODE_SPECIAL");
10589 }
10590 else if (((*yyvaluep).node_args_aux)) {
10591 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
10592 }
10593}
10594#line 10595 "parse.c"
10595 break;
10596
10597 case YYSYMBOL_f_label: /* f_label */
10598#line 2620 "parse.y"
10599 {
10600 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10601}
10602#line 10603 "parse.c"
10603 break;
10604
10605 case YYSYMBOL_f_kw: /* f_kw */
10606#line 2611 "parse.y"
10607 {
10608 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
10609 rb_parser_printf(p, "NODE_SPECIAL");
10610 }
10611 else if (((*yyvaluep).node_kw_arg)) {
10612 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
10613 }
10614}
10615#line 10616 "parse.c"
10616 break;
10617
10618 case YYSYMBOL_f_block_kw: /* f_block_kw */
10619#line 2611 "parse.y"
10620 {
10621 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
10622 rb_parser_printf(p, "NODE_SPECIAL");
10623 }
10624 else if (((*yyvaluep).node_kw_arg)) {
10625 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
10626 }
10627}
10628#line 10629 "parse.c"
10629 break;
10630
10631 case YYSYMBOL_f_no_kwarg: /* f_no_kwarg */
10632#line 2620 "parse.y"
10633 {
10634 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10635}
10636#line 10637 "parse.c"
10637 break;
10638
10639 case YYSYMBOL_f_kwrest: /* f_kwrest */
10640#line 2620 "parse.y"
10641 {
10642 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10643}
10644#line 10645 "parse.c"
10645 break;
10646
10647 case YYSYMBOL_f_rest_arg: /* f_rest_arg */
10648#line 2620 "parse.y"
10649 {
10650 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10651}
10652#line 10653 "parse.c"
10653 break;
10654
10655 case YYSYMBOL_f_block_arg: /* f_block_arg */
10656#line 2620 "parse.y"
10657 {
10658 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10659}
10660#line 10661 "parse.c"
10661 break;
10662
10663 case YYSYMBOL_opt_f_block_arg: /* opt_f_block_arg */
10664#line 2620 "parse.y"
10665 {
10666 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10667}
10668#line 10669 "parse.c"
10669 break;
10670
10671 case YYSYMBOL_singleton: /* singleton */
10672#line 2611 "parse.y"
10673 {
10674 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10675 rb_parser_printf(p, "NODE_SPECIAL");
10676 }
10677 else if (((*yyvaluep).node)) {
10678 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10679 }
10680}
10681#line 10682 "parse.c"
10682 break;
10683
10684 case YYSYMBOL_assoc_list: /* assoc_list */
10685#line 2611 "parse.y"
10686 {
10687 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10688 rb_parser_printf(p, "NODE_SPECIAL");
10689 }
10690 else if (((*yyvaluep).node)) {
10691 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10692 }
10693}
10694#line 10695 "parse.c"
10695 break;
10696
10697 case YYSYMBOL_assocs: /* assocs */
10698#line 2611 "parse.y"
10699 {
10700 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10701 rb_parser_printf(p, "NODE_SPECIAL");
10702 }
10703 else if (((*yyvaluep).node)) {
10704 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10705 }
10706}
10707#line 10708 "parse.c"
10708 break;
10709
10710 case YYSYMBOL_assoc: /* assoc */
10711#line 2611 "parse.y"
10712 {
10713 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10714 rb_parser_printf(p, "NODE_SPECIAL");
10715 }
10716 else if (((*yyvaluep).node)) {
10717 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10718 }
10719}
10720#line 10721 "parse.c"
10721 break;
10722
10723 case YYSYMBOL_operation: /* operation */
10724#line 2620 "parse.y"
10725 {
10726 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10727}
10728#line 10729 "parse.c"
10729 break;
10730
10731 case YYSYMBOL_operation2: /* operation2 */
10732#line 2620 "parse.y"
10733 {
10734 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10735}
10736#line 10737 "parse.c"
10737 break;
10738
10739 case YYSYMBOL_operation3: /* operation3 */
10740#line 2620 "parse.y"
10741 {
10742 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10743}
10744#line 10745 "parse.c"
10745 break;
10746
10747 case YYSYMBOL_dot_or_colon: /* dot_or_colon */
10748#line 2620 "parse.y"
10749 {
10750 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10751}
10752#line 10753 "parse.c"
10753 break;
10754
10755 case YYSYMBOL_call_op: /* call_op */
10756#line 2620 "parse.y"
10757 {
10758 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10759}
10760#line 10761 "parse.c"
10761 break;
10762
10763 case YYSYMBOL_call_op2: /* call_op2 */
10764#line 2620 "parse.y"
10765 {
10766 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10767}
10768#line 10769 "parse.c"
10769 break;
10770
10771 case YYSYMBOL_none: /* none */
10772#line 2611 "parse.y"
10773 {
10774 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10775 rb_parser_printf(p, "NODE_SPECIAL");
10776 }
10777 else if (((*yyvaluep).node)) {
10778 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10779 }
10780}
10781#line 10782 "parse.c"
10782 break;
10783
10784 default:
10785 break;
10786 }
10787 YY_IGNORE_MAYBE_UNINITIALIZED_END
10788}
10789
10790
10791/*---------------------------.
10792| Print this symbol on YYO. |
10793`---------------------------*/
10794
10795static void
10796yy_symbol_print (FILE *yyo,
10797 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
10798{
10799 YYFPRINTF (yyo, "%s %s (",
10800 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
10801
10802 YYLOCATION_PRINT (yyo, yylocationp, p);
10803 YYFPRINTF (yyo, ": ");
10804 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
10805 YYFPRINTF (yyo, ")");
10806}
10807
10808/*------------------------------------------------------------------.
10809| yy_stack_print -- Print the state stack from its BOTTOM up to its |
10810| TOP (included). |
10811`------------------------------------------------------------------*/
10812
10813static void
10814yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
10815{
10816 YYFPRINTF (stderr, "Stack now");
10817 for (; yybottom <= yytop; yybottom++)
10818 {
10819 int yybot = *yybottom;
10820 YYFPRINTF (stderr, " %d", yybot);
10821 }
10822 YYFPRINTF (stderr, "\n");
10823}
10824
10825# define YY_STACK_PRINT(Bottom, Top, p) \
10826do { \
10827 if (yydebug) \
10828 yy_stack_print ((Bottom), (Top), p); \
10829} while (0)
10830
10831
10832/*------------------------------------------------.
10833| Report that the YYRULE is going to be reduced. |
10834`------------------------------------------------*/
10835
10836static void
10837yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
10838 int yyrule, struct parser_params *p)
10839{
10840 int yylno = yyrline[yyrule];
10841 int yynrhs = yyr2[yyrule];
10842 int yyi;
10843 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
10844 yyrule - 1, yylno);
10845 /* The symbols being reduced. */
10846 for (yyi = 0; yyi < yynrhs; yyi++)
10847 {
10848 YYFPRINTF (stderr, " $%d = ", yyi + 1);
10849 yy_symbol_print (stderr,
10850 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
10851 &yyvsp[(yyi + 1) - (yynrhs)],
10852 &(yylsp[(yyi + 1) - (yynrhs)]), p);
10853 YYFPRINTF (stderr, "\n");
10854 }
10855}
10856
10857# define YY_REDUCE_PRINT(Rule, p) \
10858do { \
10859 if (yydebug) \
10860 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
10861} while (0)
10862
10863/* Nonzero means print parse trace. It is left uninitialized so that
10864 multiple parsers can coexist. */
10865#ifndef yydebug
10866int yydebug;
10867#endif
10868#else /* !YYDEBUG */
10869# define YYDPRINTF(Args) ((void) 0)
10870# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p)
10871# define YY_STACK_PRINT(Bottom, Top, p)
10872# define YY_REDUCE_PRINT(Rule, p)
10873#endif /* !YYDEBUG */
10874
10875
10876/* YYINITDEPTH -- initial size of the parser's stacks. */
10877#ifndef YYINITDEPTH
10878# define YYINITDEPTH 200
10879#endif
10880
10881/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
10882 if the built-in stack extension method is used).
10883
10884 Do not make this value too large; the results are undefined if
10885 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
10886 evaluated with infinite-precision integer arithmetic. */
10887
10888#ifndef YYMAXDEPTH
10889# define YYMAXDEPTH 10000
10890#endif
10891
10892
10893/* Context of a parse error. */
10894typedef struct
10895{
10896 yy_state_t *yyssp;
10897 yysymbol_kind_t yytoken;
10898 YYLTYPE *yylloc;
10899} yypcontext_t;
10900
10901/* Put in YYARG at most YYARGN of the expected tokens given the
10902 current YYCTX, and return the number of tokens stored in YYARG. If
10903 YYARG is null, return the number of expected tokens (guaranteed to
10904 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
10905 Return 0 if there are more than YYARGN expected tokens, yet fill
10906 YYARG up to YYARGN. */
10907static int
10908yypcontext_expected_tokens (const yypcontext_t *yyctx,
10909 yysymbol_kind_t yyarg[], int yyargn)
10910{
10911 /* Actual size of YYARG. */
10912 int yycount = 0;
10913 int yyn = yypact[+*yyctx->yyssp];
10914 if (!yypact_value_is_default (yyn))
10915 {
10916 /* Start YYX at -YYN if negative to avoid negative indexes in
10917 YYCHECK. In other words, skip the first -YYN actions for
10918 this state because they are default actions. */
10919 int yyxbegin = yyn < 0 ? -yyn : 0;
10920 /* Stay within bounds of both yycheck and yytname. */
10921 int yychecklim = YYLAST - yyn + 1;
10922 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
10923 int yyx;
10924 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
10925 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
10926 && !yytable_value_is_error (yytable[yyx + yyn]))
10927 {
10928 if (!yyarg)
10929 ++yycount;
10930 else if (yycount == yyargn)
10931 return 0;
10932 else
10933 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
10934 }
10935 }
10936 if (yyarg && yycount == 0 && 0 < yyargn)
10937 yyarg[0] = YYSYMBOL_YYEMPTY;
10938 return yycount;
10939}
10940
10941
10942
10943
10944#ifndef yystrlen
10945# if defined __GLIBC__ && defined _STRING_H
10946# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
10947# else
10948/* Return the length of YYSTR. */
10949static YYPTRDIFF_T
10950yystrlen (const char *yystr)
10951{
10952 YYPTRDIFF_T yylen;
10953 for (yylen = 0; yystr[yylen]; yylen++)
10954 continue;
10955 return yylen;
10956}
10957# endif
10958#endif
10959
10960#ifndef yystpcpy
10961# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
10962# define yystpcpy stpcpy
10963# else
10964/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
10965 YYDEST. */
10966static char *
10967yystpcpy (char *yydest, const char *yysrc)
10968{
10969 char *yyd = yydest;
10970 const char *yys = yysrc;
10971
10972 while ((*yyd++ = *yys++) != '\0')
10973 continue;
10974
10975 return yyd - 1;
10976}
10977# endif
10978#endif
10979
10980#ifndef yytnamerr
10981/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
10982 quotes and backslashes, so that it's suitable for yyerror. The
10983 heuristic is that double-quoting is unnecessary unless the string
10984 contains an apostrophe, a comma, or backslash (other than
10985 backslash-backslash). YYSTR is taken from yytname. If YYRES is
10986 null, do not copy; instead, return the length of what the result
10987 would have been. */
10988static YYPTRDIFF_T
10989yytnamerr (char *yyres, const char *yystr)
10990{
10991 if (*yystr == '"')
10992 {
10993 YYPTRDIFF_T yyn = 0;
10994 char const *yyp = yystr;
10995 for (;;)
10996 switch (*++yyp)
10997 {
10998 case '\'':
10999 case ',':
11000 goto do_not_strip_quotes;
11001
11002 case '\\':
11003 if (*++yyp != '\\')
11004 goto do_not_strip_quotes;
11005 else
11006 goto append;
11007
11008 append:
11009 default:
11010 if (yyres)
11011 yyres[yyn] = *yyp;
11012 yyn++;
11013 break;
11014
11015 case '"':
11016 if (yyres)
11017 yyres[yyn] = '\0';
11018 return yyn;
11019 }
11020 do_not_strip_quotes: ;
11021 }
11022
11023 if (yyres)
11024 return yystpcpy (yyres, yystr) - yyres;
11025 else
11026 return yystrlen (yystr);
11027}
11028#endif
11029
11030
11031static int
11032yy_syntax_error_arguments (const yypcontext_t *yyctx,
11033 yysymbol_kind_t yyarg[], int yyargn)
11034{
11035 /* Actual size of YYARG. */
11036 int yycount = 0;
11037 /* There are many possibilities here to consider:
11038 - If this state is a consistent state with a default action, then
11039 the only way this function was invoked is if the default action
11040 is an error action. In that case, don't check for expected
11041 tokens because there are none.
11042 - The only way there can be no lookahead present (in yychar) is if
11043 this state is a consistent state with a default action. Thus,
11044 detecting the absence of a lookahead is sufficient to determine
11045 that there is no unexpected or expected token to report. In that
11046 case, just report a simple "syntax error".
11047 - Don't assume there isn't a lookahead just because this state is a
11048 consistent state with a default action. There might have been a
11049 previous inconsistent state, consistent state with a non-default
11050 action, or user semantic action that manipulated yychar.
11051 - Of course, the expected token list depends on states to have
11052 correct lookahead information, and it depends on the parser not
11053 to perform extra reductions after fetching a lookahead from the
11054 scanner and before detecting a syntax error. Thus, state merging
11055 (from LALR or IELR) and default reductions corrupt the expected
11056 token list. However, the list is correct for canonical LR with
11057 one exception: it will still contain any token that will not be
11058 accepted due to an error action in a later state.
11059 */
11060 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
11061 {
11062 int yyn;
11063 if (yyarg)
11064 yyarg[yycount] = yyctx->yytoken;
11065 ++yycount;
11066 yyn = yypcontext_expected_tokens (yyctx,
11067 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
11068 if (yyn == YYENOMEM)
11069 return YYENOMEM;
11070 else
11071 yycount += yyn;
11072 }
11073 return yycount;
11074}
11075
11076/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
11077 about the unexpected token YYTOKEN for the state stack whose top is
11078 YYSSP.
11079
11080 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
11081 not large enough to hold the message. In that case, also set
11082 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
11083 required number of bytes is too large to store. */
11084static int
11085yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
11086 const yypcontext_t *yyctx, struct parser_params *p)
11087{
11088 enum { YYARGS_MAX = 5 };
11089 /* Internationalized format string. */
11090 const char *yyformat = YY_NULLPTR;
11091 /* Arguments of yyformat: reported tokens (one for the "unexpected",
11092 one per "expected"). */
11093 yysymbol_kind_t yyarg[YYARGS_MAX];
11094 /* Cumulated lengths of YYARG. */
11095 YYPTRDIFF_T yysize = 0;
11096
11097 /* Actual size of YYARG. */
11098 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
11099 if (yycount == YYENOMEM)
11100 return YYENOMEM;
11101
11102 switch (yycount)
11103 {
11104#define YYCASE_(N, S) \
11105 case N: \
11106 yyformat = S; \
11107 break
11108 default: /* Avoid compiler warnings. */
11109 YYCASE_(0, YY_("syntax error"));
11110 YYCASE_(1, YY_("syntax error, unexpected %s"));
11111 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
11112 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
11113 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
11114 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
11115#undef YYCASE_
11116 }
11117
11118 /* Compute error message size. Don't count the "%s"s, but reserve
11119 room for the terminator. */
11120 yysize = yystrlen (yyformat) - 2 * yycount + 1;
11121 {
11122 int yyi;
11123 for (yyi = 0; yyi < yycount; ++yyi)
11124 {
11125 YYPTRDIFF_T yysize1
11126 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
11127 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
11128 yysize = yysize1;
11129 else
11130 return YYENOMEM;
11131 }
11132 }
11133
11134 if (*yymsg_alloc < yysize)
11135 {
11136 *yymsg_alloc = 2 * yysize;
11137 if (! (yysize <= *yymsg_alloc
11138 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
11139 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
11140 return -1;
11141 }
11142
11143 /* Avoid sprintf, as that infringes on the user's name space.
11144 Don't have undefined behavior even if the translation
11145 produced a string with the wrong number of "%s"s. */
11146 {
11147 char *yyp = *yymsg;
11148 int yyi = 0;
11149 while ((*yyp = *yyformat) != '\0')
11150 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
11151 {
11152 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
11153 yyformat += 2;
11154 }
11155 else
11156 {
11157 ++yyp;
11158 ++yyformat;
11159 }
11160 }
11161 return 0;
11162}
11163
11164
11165/*-----------------------------------------------.
11166| Release the memory associated to this symbol. |
11167`-----------------------------------------------*/
11168
11169static void
11170yydestruct (const char *yymsg,
11171 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
11172{
11173 YY_USE (yyvaluep);
11174 YY_USE (yylocationp);
11175 YY_USE (p);
11176 if (!yymsg)
11177 yymsg = "Deleting";
11178 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp, p);
11179
11180 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
11181 switch (yykind)
11182 {
11183 case YYSYMBOL_245_16: /* @16 */
11184#line 2648 "parse.y"
11185 {
11186 if (CASE_LABELS_ENABLED_P(((*yyvaluep).labels))) st_free_table(((*yyvaluep).labels));
11187}
11188#line 11189 "parse.c"
11189 break;
11190
11191 case YYSYMBOL_246_17: /* @17 */
11192#line 2648 "parse.y"
11193 {
11194 if (CASE_LABELS_ENABLED_P(((*yyvaluep).labels))) st_free_table(((*yyvaluep).labels));
11195}
11196#line 11197 "parse.c"
11197 break;
11198
11199 default:
11200 break;
11201 }
11202 YY_IGNORE_MAYBE_UNINITIALIZED_END
11203}
11204
11205
11206
11207
11208
11209
11210/*----------.
11211| yyparse. |
11212`----------*/
11213
11214int
11215yyparse (struct parser_params *p)
11216{
11217/* Lookahead token kind. */
11218int yychar;
11219
11220
11221/* The semantic value of the lookahead symbol. */
11222/* Default value used for initialization, for pacifying older GCCs
11223 or non-GCC compilers. */
11224#ifdef __cplusplus
11225static const YYSTYPE yyval_default = {};
11226(void) yyval_default;
11227#else
11228YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)
11229#endif
11230YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
11231
11232/* Location data for the lookahead symbol. */
11233static const YYLTYPE yyloc_default
11234# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
11235 = { 1, 1, 1, 1 }
11236# endif
11237;
11238YYLTYPE yylloc = yyloc_default;
11239
11240 /* Number of syntax errors so far. */
11241 int yynerrs = 0;
11242 YY_USE (yynerrs); /* Silence compiler warning. */
11243
11244 yy_state_fast_t yystate = 0;
11245 /* Number of tokens to shift before error messages enabled. */
11246 int yyerrstatus = 0;
11247
11248 /* Refer to the stacks through separate pointers, to allow yyoverflow
11249 to reallocate them elsewhere. */
11250
11251 /* Their size. */
11252 YYPTRDIFF_T yystacksize = YYINITDEPTH;
11253
11254 /* The state stack: array, bottom, top. */
11255 yy_state_t yyssa[YYINITDEPTH];
11256 yy_state_t *yyss = yyssa;
11257 yy_state_t *yyssp = yyss;
11258
11259 /* The semantic value stack: array, bottom, top. */
11260 YYSTYPE yyvsa[YYINITDEPTH];
11261 YYSTYPE *yyvs = yyvsa;
11262 YYSTYPE *yyvsp = yyvs;
11263
11264 /* The location stack: array, bottom, top. */
11265 YYLTYPE yylsa[YYINITDEPTH];
11266 YYLTYPE *yyls = yylsa;
11267 YYLTYPE *yylsp = yyls;
11268
11269 int yyn;
11270 /* The return value of yyparse. */
11271 int yyresult;
11272 /* Lookahead symbol kind. */
11273 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
11274 /* The variables used to return semantic value and location from the
11275 action routines. */
11276 YYSTYPE yyval;
11277 YYLTYPE yyloc;
11278
11279 /* The locations where the error started and ended. */
11280 YYLTYPE yyerror_range[3];
11281
11282 /* Buffer for error messages, and its allocated size. */
11283 char yymsgbuf[128];
11284 char *yymsg = yymsgbuf;
11285 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
11286
11287#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
11288
11289 /* The number of symbols on the RHS of the reduced rule.
11290 Keep to zero when no symbol should be popped. */
11291 int yylen = 0;
11292
11293 YYDPRINTF ((stderr, "Starting parse\n"));
11294
11295 yychar = YYEMPTY; /* Cause a token to be read. */
11296
11297
11298 /* User initialization code. */
11299#line 2655 "parse.y"
11300 {
11301 RUBY_SET_YYLLOC_OF_NONE(yylloc);
11302}
11303
11304#line 11305 "parse.c"
11305
11306 yylsp[0] = yylloc;
11307 goto yysetstate;
11308
11309
11310/*------------------------------------------------------------.
11311| yynewstate -- push a new state, which is found in yystate. |
11312`------------------------------------------------------------*/
11313yynewstate:
11314 /* In all cases, when you get here, the value and location stacks
11315 have just been pushed. So pushing a state here evens the stacks. */
11316 yyssp++;
11317
11318
11319/*--------------------------------------------------------------------.
11320| yysetstate -- set current state (the top of the stack) to yystate. |
11321`--------------------------------------------------------------------*/
11322yysetstate:
11323 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
11324 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
11325 YY_IGNORE_USELESS_CAST_BEGIN
11326 *yyssp = YY_CAST (yy_state_t, yystate);
11327 YY_IGNORE_USELESS_CAST_END
11328 YY_STACK_PRINT (yyss, yyssp, p);
11329
11330 if (yyss + yystacksize - 1 <= yyssp)
11331#if !defined yyoverflow && !defined YYSTACK_RELOCATE
11332 YYNOMEM;
11333#else
11334 {
11335 /* Get the current used size of the three stacks, in elements. */
11336 YYPTRDIFF_T yysize = yyssp - yyss + 1;
11337
11338# if defined yyoverflow
11339 {
11340 /* Give user a chance to reallocate the stack. Use copies of
11341 these so that the &'s don't force the real ones into
11342 memory. */
11343 yy_state_t *yyss1 = yyss;
11344 YYSTYPE *yyvs1 = yyvs;
11345 YYLTYPE *yyls1 = yyls;
11346
11347 /* Each stack pointer address is followed by the size of the
11348 data in use in that stack, in bytes. This used to be a
11349 conditional around just the two extra args, but that might
11350 be undefined if yyoverflow is a macro. */
11351 yyoverflow (YY_("memory exhausted"),
11352 &yyss1, yysize * YYSIZEOF (*yyssp),
11353 &yyvs1, yysize * YYSIZEOF (*yyvsp),
11354 &yyls1, yysize * YYSIZEOF (*yylsp),
11355 &yystacksize);
11356 yyss = yyss1;
11357 yyvs = yyvs1;
11358 yyls = yyls1;
11359 }
11360# else /* defined YYSTACK_RELOCATE */
11361 /* Extend the stack our own way. */
11362 if (YYMAXDEPTH <= yystacksize)
11363 YYNOMEM;
11364 yystacksize *= 2;
11365 if (YYMAXDEPTH < yystacksize)
11366 yystacksize = YYMAXDEPTH;
11367
11368 {
11369 yy_state_t *yyss1 = yyss;
11370 union yyalloc *yyptr =
11371 YY_CAST (union yyalloc *,
11372 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
11373 if (! yyptr)
11374 YYNOMEM;
11375 YYSTACK_RELOCATE (yyss_alloc, yyss);
11376 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
11377 YYSTACK_RELOCATE (yyls_alloc, yyls);
11378# undef YYSTACK_RELOCATE
11379 if (yyss1 != yyssa)
11380 YYSTACK_FREE (yyss1);
11381 }
11382# endif
11383
11384 yyssp = yyss + yysize - 1;
11385 yyvsp = yyvs + yysize - 1;
11386 yylsp = yyls + yysize - 1;
11387
11388 YY_IGNORE_USELESS_CAST_BEGIN
11389 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
11390 YY_CAST (long, yystacksize)));
11391 YY_IGNORE_USELESS_CAST_END
11392
11393 if (yyss + yystacksize - 1 <= yyssp)
11394 YYABORT;
11395 }
11396#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
11397
11398
11399 if (yystate == YYFINAL)
11400 YYACCEPT;
11401
11402 goto yybackup;
11403
11404
11405/*-----------.
11406| yybackup. |
11407`-----------*/
11408yybackup:
11409 /* Do appropriate processing given the current state. Read a
11410 lookahead token if we need one and don't already have one. */
11411
11412 /* First try to decide what to do without reference to lookahead token. */
11413 yyn = yypact[yystate];
11414 if (yypact_value_is_default (yyn))
11415 goto yydefault;
11416
11417 /* Not known => get a lookahead token if don't already have one. */
11418
11419 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
11420 if (yychar == YYEMPTY)
11421 {
11422 YYDPRINTF ((stderr, "Reading a token\n"));
11423 yychar = yylex (&yylval, &yylloc, p);
11424 }
11425
11426 if (yychar <= END_OF_INPUT)
11427 {
11428 yychar = END_OF_INPUT;
11429 yytoken = YYSYMBOL_YYEOF;
11430 YYDPRINTF ((stderr, "Now at end of input.\n"));
11431 }
11432 else if (yychar == YYerror)
11433 {
11434 /* The scanner already issued an error message, process directly
11435 to error recovery. But do not keep the error token as
11436 lookahead, it is too special and may lead us to an endless
11437 loop in error recovery. */
11438 yychar = YYUNDEF;
11439 yytoken = YYSYMBOL_YYerror;
11440 yyerror_range[1] = yylloc;
11441 goto yyerrlab1;
11442 }
11443 else
11444 {
11445 yytoken = YYTRANSLATE (yychar);
11446 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc, p);
11447 }
11448
11449 /* If the proper action on seeing token YYTOKEN is to reduce or to
11450 detect an error, take that action. */
11451 yyn += yytoken;
11452 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
11453 goto yydefault;
11454 yyn = yytable[yyn];
11455 if (yyn <= 0)
11456 {
11457 if (yytable_value_is_error (yyn))
11458 goto yyerrlab;
11459 yyn = -yyn;
11460 goto yyreduce;
11461 }
11462
11463 /* Count tokens shifted since error; after three, turn off error
11464 status. */
11465 if (yyerrstatus)
11466 yyerrstatus--;
11467
11468 /* Shift the lookahead token. */
11469 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc, p);
11470 yystate = yyn;
11471 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
11472 *++yyvsp = yylval;
11473 YY_IGNORE_MAYBE_UNINITIALIZED_END
11474 *++yylsp = yylloc;
11475 /* %after-shift code. */
11476#line 2658 "parse.y"
11477 {after_shift(p);}
11478#line 11479 "parse.c"
11479
11480
11481 /* Discard the shifted token. */
11482 yychar = YYEMPTY;
11483 goto yynewstate;
11484
11485
11486/*-----------------------------------------------------------.
11487| yydefault -- do the default action for the current state. |
11488`-----------------------------------------------------------*/
11489yydefault:
11490 yyn = yydefact[yystate];
11491 if (yyn == 0)
11492 goto yyerrlab;
11493 goto yyreduce;
11494
11495
11496/*-----------------------------.
11497| yyreduce -- do a reduction. |
11498`-----------------------------*/
11499yyreduce:
11500 /* yyn is the number of a rule to reduce with. */
11501 yylen = yyr2[yyn];
11502
11503 /* If YYLEN is nonzero, implement the default value of the action:
11504 '$$ = $1'.
11505
11506 Otherwise, the following line sets YYVAL to garbage.
11507 This behavior is undocumented and Bison
11508 users should not rely upon it. Assigning to YYVAL
11509 unconditionally makes the parser a bit smaller, and it avoids a
11510 GCC warning that YYVAL may be used uninitialized. */
11511 yyval = yyvsp[1-yylen];
11512 /* %before-reduce function. */
11513#line 2659 "parse.y"
11514 {before_reduce(yylen, p);}
11515#line 11516 "parse.c"
11516
11517
11518 /* Default location. */
11519 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
11520 yyerror_range[1] = yyloc;
11521 YY_REDUCE_PRINT (yyn, p);
11522 switch (yyn)
11523 {
11524 case 2: /* $@1: %empty */
11525#line 2967 "parse.y"
11526 {
11527 SET_LEX_STATE(EXPR_BEG);
11528 local_push(p, ifndef_ripper(1)+0);
11529 /* jumps are possible in the top-level loop. */
11530 if (!ifndef_ripper(p->do_loop) + 0) init_block_exit(p);
11531 }
11532#line 11533 "parse.c"
11533 break;
11534
11535 case 3: /* program: $@1 top_compstmt */
11536#line 2974 "parse.y"
11537 {
11538 if ((yyvsp[0].node) && !compile_for_eval) {
11539 NODE *node = (yyvsp[0].node);
11540 /* last expression should not be void */
11541 if (nd_type_p(node, NODE_BLOCK)) {
11542 while (RNODE_BLOCK(node)->nd_next) {
11543 node = RNODE_BLOCK(node)->nd_next;
11544 }
11545 node = RNODE_BLOCK(node)->nd_head;
11546 }
11547 node = remove_begin(node);
11548 void_expr(p, node);
11549 }
11550 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
11551 /*% ripper[final]: program!($:2) %*/
11552 local_pop(p);
11553 }
11554#line 11555 "parse.c"
11555 break;
11556
11557 case 6: /* top_compstmt: top_stmts option_terms */
11558#line 2994 "parse.y"
11559 {
11560 void_stmts(p, (yyval.node) = (yyvsp[-1].node));
11561 }
11562#line 11563 "parse.c"
11563 break;
11564
11565 case 7: /* top_stmts: none */
11566#line 3000 "parse.y"
11567 {
11568 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11569 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
11570 }
11571#line 11572 "parse.c"
11572 break;
11573
11574 case 8: /* top_stmts: top_stmt */
11575#line 3005 "parse.y"
11576 {
11577 (yyval.node) = newline_node((yyvsp[0].node));
11578 /*% ripper: stmts_add!(stmts_new!, $:1) %*/
11579 }
11580#line 11581 "parse.c"
11581 break;
11582
11583 case 9: /* top_stmts: top_stmts terms top_stmt */
11584#line 3010 "parse.y"
11585 {
11586 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
11587 /*% ripper: stmts_add!($:1, $:3) %*/
11588 }
11589#line 11590 "parse.c"
11590 break;
11591
11592 case 10: /* top_stmt: stmt */
11593#line 3017 "parse.y"
11594 {
11595 clear_block_exit(p, true);
11596 (yyval.node) = (yyvsp[0].node);
11597 }
11598#line 11599 "parse.c"
11599 break;
11600
11601 case 11: /* top_stmt: "'BEGIN'" begin_block */
11602#line 3022 "parse.y"
11603 {
11604 (yyval.node) = (yyvsp[0].node);
11605 /*% ripper: $:2 %*/
11606 }
11607#line 11608 "parse.c"
11608 break;
11609
11610 case 12: /* block_open: '{' */
11611#line 3028 "parse.y"
11612 {(yyval.node_exits) = init_block_exit(p);}
11613#line 11614 "parse.c"
11614 break;
11615
11616 case 13: /* begin_block: block_open top_compstmt '}' */
11617#line 3031 "parse.y"
11618 {
11619 restore_block_exit(p, (yyvsp[-2].node_exits));
11620 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
11621 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
11622 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11623 /*% ripper: BEGIN!($:2) %*/
11624 }
11625#line 11626 "parse.c"
11626 break;
11627
11628 case 14: /* $@2: %empty */
11629#line 3044 "parse.y"
11630 {
11631 if (!(yyvsp[-1].node)) yyerror1(&(yylsp[0]), "else without rescue is useless");
11632 next_rescue_context(&p->ctxt, &(yyvsp[-2].ctxt), after_else);
11633 }
11634#line 11635 "parse.c"
11635 break;
11636
11637 case 15: /* $@3: %empty */
11638#line 3049 "parse.y"
11639 {
11640 next_rescue_context(&p->ctxt, &(yyvsp[-4].ctxt), after_ensure);
11641 }
11642#line 11643 "parse.c"
11643 break;
11644
11645 case 16: /* bodystmt: compstmt lex_ctxt opt_rescue k_else $@2 compstmt $@3 opt_ensure */
11646#line 3053 "parse.y"
11647 {
11648 (yyval.node) = new_bodystmt(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11649 /*% ripper: bodystmt!($:body, $:opt_rescue, $:elsebody, $:opt_ensure) %*/
11650 }
11651#line 11652 "parse.c"
11652 break;
11653
11654 case 17: /* $@4: %empty */
11655#line 3060 "parse.y"
11656 {
11657 next_rescue_context(&p->ctxt, &(yyvsp[-1].ctxt), after_ensure);
11658 }
11659#line 11660 "parse.c"
11660 break;
11661
11662 case 18: /* bodystmt: compstmt lex_ctxt opt_rescue $@4 opt_ensure */
11663#line 3064 "parse.y"
11664 {
11665 (yyval.node) = new_bodystmt(p, (yyvsp[-4].node), (yyvsp[-2].node), 0, (yyvsp[0].node), &(yyloc));
11666 /*% ripper: bodystmt!($:body, $:opt_rescue, Qnil, $:opt_ensure) %*/
11667 }
11668#line 11669 "parse.c"
11669 break;
11670
11671 case 19: /* compstmt: stmts option_terms */
11672#line 3071 "parse.y"
11673 {
11674 void_stmts(p, (yyval.node) = (yyvsp[-1].node));
11675 }
11676#line 11677 "parse.c"
11677 break;
11678
11679 case 20: /* stmts: none */
11680#line 3077 "parse.y"
11681 {
11682 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11683 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
11684 }
11685#line 11686 "parse.c"
11686 break;
11687
11688 case 21: /* stmts: stmt_or_begin */
11689#line 3082 "parse.y"
11690 {
11691 (yyval.node) = newline_node((yyvsp[0].node));
11692 /*% ripper: stmts_add!(stmts_new!, $:1) %*/
11693 }
11694#line 11695 "parse.c"
11695 break;
11696
11697 case 22: /* stmts: stmts terms stmt_or_begin */
11698#line 3087 "parse.y"
11699 {
11700 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
11701 /*% ripper: stmts_add!($:1, $:3) %*/
11702 }
11703#line 11704 "parse.c"
11704 break;
11705
11706 case 23: /* stmt_or_begin: stmt */
11707#line 3094 "parse.y"
11708 {
11709 (yyval.node) = (yyvsp[0].node);
11710 }
11711#line 11712 "parse.c"
11712 break;
11713
11714 case 24: /* $@5: %empty */
11715#line 3098 "parse.y"
11716 {
11717 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
11718 }
11719#line 11720 "parse.c"
11720 break;
11721
11722 case 25: /* stmt_or_begin: "'BEGIN'" $@5 begin_block */
11723#line 3102 "parse.y"
11724 {
11725 (yyval.node) = (yyvsp[0].node);
11726 }
11727#line 11728 "parse.c"
11728 break;
11729
11730 case 26: /* allow_exits: %empty */
11731#line 3107 "parse.y"
11732 {(yyval.node_exits) = allow_block_exit(p);}
11733#line 11734 "parse.c"
11734 break;
11735
11736 case 27: /* k_END: "'END'" lex_ctxt */
11737#line 3110 "parse.y"
11738 {
11739 (yyval.ctxt) = (yyvsp[0].ctxt);
11740 p->ctxt.in_rescue = before_rescue;
11741 /*% ripper: $:2 %*/
11742 }
11743#line 11744 "parse.c"
11744 break;
11745
11746 case 28: /* $@6: %empty */
11747#line 3116 "parse.y"
11748 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
11749#line 11750 "parse.c"
11750 break;
11751
11752 case 29: /* stmt: "'alias'" fitem $@6 fitem */
11753#line 3117 "parse.y"
11754 {
11755 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc), &(yylsp[-3]));
11756 /*% ripper: alias!($:2, $:4) %*/
11757 }
11758#line 11759 "parse.c"
11759 break;
11760
11761 case 30: /* stmt: "'alias'" "global variable" "global variable" */
11762#line 3122 "parse.y"
11763 {
11764 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc), &(yylsp[-2]));
11765 /*% ripper: var_alias!($:2, $:3) %*/
11766 }
11767#line 11768 "parse.c"
11768 break;
11769
11770 case 31: /* stmt: "'alias'" "global variable" "back reference" */
11771#line 3127 "parse.y"
11772 {
11773 char buf[2];
11774 buf[0] = '$';
11775 buf[1] = (char)RNODE_BACK_REF((yyvsp[0].node))->nd_nth;
11776 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc), &(yylsp[-2]));
11777 /*% ripper: var_alias!($:2, $:3) %*/
11778 }
11779#line 11780 "parse.c"
11780 break;
11781
11782 case 32: /* stmt: "'alias'" "global variable" "numbered reference" */
11783#line 3135 "parse.y"
11784 {
11785 static const char mesg[] = "can't make alias for the number variables";
11786 /*%%%*/
11787 yyerror1(&(yylsp[0]), mesg);
11788 /*% %*/
11789 (yyval.node) = NEW_ERROR(&(yyloc));
11790 /*% ripper[error]: alias_error!(ERR_MESG(), $:3) %*/
11791 }
11792#line 11793 "parse.c"
11793 break;
11794
11795 case 33: /* stmt: "'undef'" undef_list */
11796#line 3144 "parse.y"
11797 {
11798 nd_set_first_loc((yyvsp[0].node), (yylsp[-1]).beg_pos);
11799 RNODE_UNDEF((yyvsp[0].node))->keyword_loc = (yylsp[-1]);
11800 (yyval.node) = (yyvsp[0].node);
11801 /*% ripper: undef!($:2) %*/
11802 }
11803#line 11804 "parse.c"
11804 break;
11805
11806 case 34: /* stmt: stmt "'if' modifier" expr_value */
11807#line 3151 "parse.y"
11808 {
11809 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
11810 fixpos((yyval.node), (yyvsp[0].node));
11811 /*% ripper: if_mod!($:3, $:1) %*/
11812 }
11813#line 11814 "parse.c"
11814 break;
11815
11816 case 35: /* stmt: stmt "'unless' modifier" expr_value */
11817#line 3157 "parse.y"
11818 {
11819 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc), &(yylsp[-1]), &NULL_LOC, &NULL_LOC);
11820 fixpos((yyval.node), (yyvsp[0].node));
11821 /*% ripper: unless_mod!($:3, $:1) %*/
11822 }
11823#line 11824 "parse.c"
11824 break;
11825
11826 case 36: /* stmt: stmt "'while' modifier" expr_value */
11827#line 3163 "parse.y"
11828 {
11829 clear_block_exit(p, false);
11830 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
11831 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11832 }
11833 else {
11834 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11835 }
11836 /*% ripper: while_mod!($:3, $:1) %*/
11837 }
11838#line 11839 "parse.c"
11839 break;
11840
11841 case 37: /* stmt: stmt "'until' modifier" expr_value */
11842#line 3174 "parse.y"
11843 {
11844 clear_block_exit(p, false);
11845 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
11846 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11847 }
11848 else {
11849 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11850 }
11851 /*% ripper: until_mod!($:3, $:1) %*/
11852 }
11853#line 11854 "parse.c"
11854 break;
11855
11856 case 38: /* stmt: stmt "'rescue' modifier" after_rescue stmt */
11857#line 3185 "parse.y"
11858 {
11859 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
11860 NODE *resq;
11861 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11862 resq = NEW_RESBODY(0, 0, remove_begin((yyvsp[0].node)), 0, &loc);
11863 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-3].node)), resq, 0, &(yyloc));
11864 /*% ripper: rescue_mod!($:1, $:4) %*/
11865 }
11866#line 11867 "parse.c"
11867 break;
11868
11869 case 39: /* stmt: k_END allow_exits '{' compstmt '}' */
11870#line 3194 "parse.y"
11871 {
11872 if (p->ctxt.in_def) {
11873 rb_warn0("END in method; use at_exit");
11874 }
11875 restore_block_exit(p, (yyvsp[-3].node_exits));
11876 p->ctxt = (yyvsp[-4].ctxt);
11877 {
11878 NODE *scope = NEW_SCOPE2(0 /* tbl */, 0 /* args */, (yyvsp[-1].node) /* body */, &(yyloc));
11879 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
11880 }
11881 /*% ripper: END!($:compstmt) %*/
11882 }
11883#line 11884 "parse.c"
11884 break;
11885
11886 case 41: /* stmt: mlhs '=' lex_ctxt command_call */
11887#line 3208 "parse.y"
11888 {
11889 value_expr((yyvsp[0].node));
11890 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11891 /*% ripper: massign!($:1, $:4) %*/
11892 }
11893#line 11894 "parse.c"
11894 break;
11895
11896 case 42: /* stmt: lhs '=' lex_ctxt mrhs */
11897#line 3214 "parse.y"
11898 {
11899 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11900 /*% ripper: assign!($:1, $:4) %*/
11901 }
11902#line 11903 "parse.c"
11903 break;
11904
11905 case 43: /* stmt: mlhs '=' lex_ctxt mrhs_arg "'rescue' modifier" after_rescue stmt */
11906#line 3220 "parse.y"
11907 {
11908 p->ctxt.in_rescue = (yyvsp[-4].ctxt).in_rescue;
11909 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11910 (yyvsp[0].node) = NEW_RESBODY(0, 0, remove_begin((yyvsp[0].node)), 0, &loc);
11911 loc.beg_pos = (yylsp[-3]).beg_pos;
11912 (yyvsp[-3].node) = NEW_RESCUE((yyvsp[-3].node), (yyvsp[0].node), 0, &loc);
11913 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-6].node_masgn), (yyvsp[-3].node), (yyvsp[-4].ctxt), &(yyloc));
11914 /*% ripper: massign!($:1, rescue_mod!($:4, $:7)) %*/
11915 }
11916#line 11917 "parse.c"
11917 break;
11918
11919 case 44: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
11920#line 3230 "parse.y"
11921 {
11922 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11923 /*% ripper: massign!($:1, $:4) %*/
11924 }
11925#line 11926 "parse.c"
11926 break;
11927
11928 case 46: /* stmt: error */
11929#line 3236 "parse.y"
11930 {
11931 (void)yynerrs;
11932 (yyval.node) = NEW_ERROR(&(yyloc));
11933 }
11934#line 11935 "parse.c"
11935 break;
11936
11937 case 47: /* command_asgn: lhs '=' lex_ctxt command_rhs */
11938#line 3243 "parse.y"
11939 {
11940 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11941 /*% ripper: assign!($:1, $:4) %*/
11942 }
11943#line 11944 "parse.c"
11944 break;
11945
11946 case 48: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
11947#line 3248 "parse.y"
11948 {
11949 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11950 /*% ripper: opassign!($:1, $:2, $:4) %*/
11951 }
11952#line 11953 "parse.c"
11953 break;
11954
11955 case 49: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
11956#line 3253 "parse.y"
11957 {
11958 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc), &NULL_LOC, &(yylsp[-5]), &(yylsp[-3]), &(yylsp[-2]));
11959 /*% ripper: opassign!(aref_field!($:1, $:3), $:5, $:7) %*/
11960
11961 }
11962#line 11963 "parse.c"
11963 break;
11964
11965 case 50: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
11966#line 3259 "parse.y"
11967 {
11968 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-3]), &(yylsp[-2]));
11969 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
11970 }
11971#line 11972 "parse.c"
11972 break;
11973
11974 case 51: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
11975#line 3259 "parse.y"
11976 {
11977 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-3]), &(yylsp[-2]));
11978 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
11979 }
11980#line 11981 "parse.c"
11981 break;
11982
11983 case 52: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
11984#line 3264 "parse.y"
11985 {
11986 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
11987 (yyval.node) = new_const_op_assign(p, NEW_COLON2((yyvsp[-5].node), (yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11988 /*% ripper: opassign!(const_path_field!($:1, $:3), $:4, $:6) %*/
11989 }
11990#line 11991 "parse.c"
11991 break;
11992
11993 case 53: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
11994#line 3270 "parse.y"
11995 {
11996 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), idCOLON2, (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-3]), &(yylsp[-2]));
11997 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
11998 }
11999#line 12000 "parse.c"
12000 break;
12001
12002 case 54: /* command_asgn: defn_head f_opt_paren_args '=' endless_command */
12003#line 3275 "parse.y"
12004 {
12005 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
12006 restore_defun(p, (yyvsp[-3].node_def_temp));
12007 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12008 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12009 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
12010 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
12011 /*% ripper: def!($:head, $:args, $:$) %*/
12012 local_pop(p);
12013 }
12014#line 12015 "parse.c"
12015 break;
12016
12017 case 55: /* command_asgn: defs_head f_opt_paren_args '=' endless_command */
12018#line 3286 "parse.y"
12019 {
12020 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
12021 restore_defun(p, (yyvsp[-3].node_def_temp));
12022 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12023 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12024 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
12025 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
12026 /*% ripper: defs!(*$:head[0..2], $:args, $:$) %*/
12027 local_pop(p);
12028 }
12029#line 12030 "parse.c"
12030 break;
12031
12032 case 56: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
12033#line 3297 "parse.y"
12034 {
12035 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[-3].node));
12036 (yyval.node) = NEW_ERROR(&(yyloc));
12037 /*% ripper[error]: assign_error!(?e, opassign!(var_field!($:1), $:2, $:4)) %*/
12038 }
12039#line 12040 "parse.c"
12040 break;
12041
12042 case 58: /* endless_command: endless_command "'rescue' modifier" after_rescue arg */
12043#line 3306 "parse.y"
12044 {
12045 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12046 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
12047 /*% ripper: rescue_mod!($:1, $:4) %*/
12048 }
12049#line 12050 "parse.c"
12050 break;
12051
12052 case 61: /* endless_command: "'not'" option_'\n' endless_command */
12053#line 3312 "parse.y"
12054 {
12055 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12056 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
12057 }
12058#line 12059 "parse.c"
12059 break;
12060
12061 case 62: /* command_rhs: command_call */
12062#line 3319 "parse.y"
12063 {
12064 value_expr((yyvsp[0].node));
12065 (yyval.node) = (yyvsp[0].node);
12066 }
12067#line 12068 "parse.c"
12068 break;
12069
12070 case 63: /* command_rhs: command_call "'rescue' modifier" after_rescue stmt */
12071#line 3324 "parse.y"
12072 {
12073 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12074 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
12075 value_expr((yyvsp[-3].node));
12076 (yyval.node) = NEW_RESCUE((yyvsp[-3].node), NEW_RESBODY(0, 0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
12077 /*% ripper: rescue_mod!($:1, $:4) %*/
12078 }
12079#line 12080 "parse.c"
12080 break;
12081
12082 case 66: /* expr: expr "'and'" expr */
12083#line 3336 "parse.y"
12084 {
12085 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12086 /*% ripper: binary!($:1, ID2VAL(idAND), $:3) %*/
12087 }
12088#line 12089 "parse.c"
12089 break;
12090
12091 case 67: /* expr: expr "'or'" expr */
12092#line 3341 "parse.y"
12093 {
12094 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12095 /*% ripper: binary!($:1, ID2VAL(idOR), $:3) %*/
12096 }
12097#line 12098 "parse.c"
12098 break;
12099
12100 case 68: /* expr: "'not'" option_'\n' expr */
12101#line 3346 "parse.y"
12102 {
12103 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12104 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
12105 }
12106#line 12107 "parse.c"
12107 break;
12108
12109 case 69: /* expr: '!' command_call */
12110#line 3351 "parse.y"
12111 {
12112 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
12113 /*% ripper: unary!(ID2VAL('\'!\''), $:2) %*/
12114 }
12115#line 12116 "parse.c"
12116 break;
12117
12118 case 70: /* $@7: %empty */
12119#line 3356 "parse.y"
12120 {
12121 value_expr((yyvsp[-1].node));
12122 }
12123#line 12124 "parse.c"
12124 break;
12125
12126 case 71: /* expr: arg "=>" $@7 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
12127#line 3361 "parse.y"
12128 {
12129 pop_pktbl(p, (yyvsp[-1].tbl));
12130 pop_pvtbl(p, (yyvsp[-2].tbl));
12131 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
12132 (yyval.node) = NEW_CASE3((yyvsp[-6].node), NEW_IN((yyvsp[0].node), 0, 0, &(yylsp[0])), &(yyloc), &NULL_LOC, &NULL_LOC);
12133 /*% ripper: case!($:arg, in!($:body, Qnil, Qnil)) %*/
12134 }
12135#line 12136 "parse.c"
12136 break;
12137
12138 case 72: /* $@8: %empty */
12139#line 3369 "parse.y"
12140 {
12141 value_expr((yyvsp[-1].node));
12142 }
12143#line 12144 "parse.c"
12144 break;
12145
12146 case 73: /* expr: arg "'in'" $@8 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
12147#line 3374 "parse.y"
12148 {
12149 pop_pktbl(p, (yyvsp[-1].tbl));
12150 pop_pvtbl(p, (yyvsp[-2].tbl));
12151 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
12152 (yyval.node) = NEW_CASE3((yyvsp[-6].node), NEW_IN((yyvsp[0].node), NEW_TRUE(&(yylsp[0])), NEW_FALSE(&(yylsp[0])), &(yylsp[0])), &(yyloc), &NULL_LOC, &NULL_LOC);
12153 /*% ripper: case!($:arg, in!($:body, Qnil, Qnil)) %*/
12154 }
12155#line 12156 "parse.c"
12156 break;
12157
12158 case 75: /* def_name: fname */
12159#line 3385 "parse.y"
12160 {
12161 ID fname = (yyvsp[0].id);
12162 numparam_name(p, fname);
12163 local_push(p, 0);
12164 p->ctxt.in_def = 1;
12165 p->ctxt.in_rescue = before_rescue;
12166 p->ctxt.cant_return = 0;
12167 (yyval.id) = (yyvsp[0].id);
12168 }
12169#line 12170 "parse.c"
12170 break;
12171
12172 case 76: /* defn_head: k_def def_name */
12173#line 3397 "parse.y"
12174 {
12175 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-1].node_def_temp));
12176 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
12177 (yyval.node_def_temp)->nd_def = NEW_DEFN((yyvsp[0].id), 0, &(yyloc));
12178 /*% ripper: $:def_name %*/
12179 }
12180#line 12181 "parse.c"
12181 break;
12182
12183 case 77: /* $@9: %empty */
12184#line 3406 "parse.y"
12185 {
12186 SET_LEX_STATE(EXPR_FNAME);
12187 }
12188#line 12189 "parse.c"
12189 break;
12190
12191 case 78: /* defs_head: k_def singleton dot_or_colon $@9 def_name */
12192#line 3410 "parse.y"
12193 {
12194 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
12195 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-4].node_def_temp));
12196 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
12197 (yyval.node_def_temp)->nd_def = NEW_DEFS((yyvsp[-3].node), (yyvsp[0].id), 0, &(yyloc));
12198 /*% ripper: [$:singleton, $:dot_or_colon, $:def_name] %*/
12199 }
12200#line 12201 "parse.c"
12201 break;
12202
12203 case 79: /* expr_value: expr */
12204#line 3420 "parse.y"
12205 {
12206 value_expr((yyvsp[0].node));
12207 (yyval.node) = (yyvsp[0].node);
12208 }
12209#line 12210 "parse.c"
12210 break;
12211
12212 case 80: /* expr_value: error */
12213#line 3425 "parse.y"
12214 {
12215 (yyval.node) = NEW_ERROR(&(yyloc));
12216 }
12217#line 12218 "parse.c"
12218 break;
12219
12220 case 81: /* $@10: %empty */
12221#line 3430 "parse.y"
12222 {COND_PUSH(1);}
12223#line 12224 "parse.c"
12224 break;
12225
12226 case 82: /* $@11: %empty */
12227#line 3430 "parse.y"
12228 {COND_POP();}
12229#line 12230 "parse.c"
12230 break;
12231
12232 case 83: /* expr_value_do: $@10 expr_value do $@11 */
12233#line 3431 "parse.y"
12234 {
12235 (yyval.node) = (yyvsp[-2].node);
12236 /*% ripper: $:2 %*/
12237 }
12238#line 12239 "parse.c"
12239 break;
12240
12241 case 87: /* block_command: block_call call_op2 operation2 command_args */
12242#line 3443 "parse.y"
12243 {
12244 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12245 /*% ripper: method_add_arg!(call!($:1, $:2, $:3), $:4) %*/
12246 }
12247#line 12248 "parse.c"
12248 break;
12249
12250 case 88: /* cmd_brace_block: "{ arg" brace_body '}' */
12251#line 3450 "parse.y"
12252 {
12253 (yyval.node) = (yyvsp[-1].node);
12254 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
12255 /*% ripper: $:2 %*/
12256 }
12257#line 12258 "parse.c"
12258 break;
12259
12260 case 89: /* fcall: operation */
12261#line 3458 "parse.y"
12262 {
12263 (yyval.node_fcall) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
12264 /*% ripper: $:1 %*/
12265 }
12266#line 12267 "parse.c"
12267 break;
12268
12269 case 90: /* command: fcall command_args */
12270#line 3465 "parse.y"
12271 {
12272 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
12273 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
12274 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
12275 /*% ripper: command!($:1, $:2) %*/
12276 }
12277#line 12278 "parse.c"
12278 break;
12279
12280 case 91: /* command: fcall command_args cmd_brace_block */
12281#line 3472 "parse.y"
12282 {
12283 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
12284 (yyvsp[-2].node_fcall)->nd_args = (yyvsp[-1].node);
12285 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-2].node_fcall), (yyvsp[0].node), &(yyloc));
12286 fixpos((yyval.node), RNODE((yyvsp[-2].node_fcall)));
12287 nd_set_last_loc((yyvsp[-2].node_fcall), (yylsp[-1]).end_pos);
12288 /*% ripper: method_add_block!(command!($:1, $:2), $:3) %*/
12289 }
12290#line 12291 "parse.c"
12291 break;
12292
12293 case 92: /* command: primary_value call_op operation2 command_args */
12294#line 3481 "parse.y"
12295 {
12296 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), 0, &(yylsp[-1]), &(yyloc));
12297 /*% ripper: command_call!($:1, $:2, $:3, $:4) %*/
12298 }
12299#line 12300 "parse.c"
12300 break;
12301
12302 case 93: /* command: primary_value call_op operation2 command_args cmd_brace_block */
12303#line 3486 "parse.y"
12304 {
12305 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
12306 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, $:4), $:5) %*/
12307 }
12308#line 12309 "parse.c"
12309 break;
12310
12311 case 94: /* command: primary_value "::" operation2 command_args */
12312#line 3491 "parse.y"
12313 {
12314 (yyval.node) = new_command_qcall(p, idCOLON2, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), 0, &(yylsp[-1]), &(yyloc));
12315 /*% ripper: command_call!($:1, $:2, $:3, $:4) %*/
12316 }
12317#line 12318 "parse.c"
12318 break;
12319
12320 case 95: /* command: primary_value "::" operation2 command_args cmd_brace_block */
12321#line 3496 "parse.y"
12322 {
12323 (yyval.node) = new_command_qcall(p, idCOLON2, (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
12324 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, $:4), $:5) %*/
12325 }
12326#line 12327 "parse.c"
12327 break;
12328
12329 case 96: /* command: primary_value "::" "constant" '{' brace_body '}' */
12330#line 3501 "parse.y"
12331 {
12332 set_embraced_location((yyvsp[-1].node), &(yylsp[-2]), &(yylsp[0]));
12333 (yyval.node) = new_command_qcall(p, idCOLON2, (yyvsp[-5].node), (yyvsp[-3].id), 0, (yyvsp[-1].node), &(yylsp[-3]), &(yyloc));
12334 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, Qnil), $:5) %*/
12335 }
12336#line 12337 "parse.c"
12337 break;
12338
12339 case 97: /* command: "'super'" command_args */
12340#line 3507 "parse.y"
12341 {
12342 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
12343 fixpos((yyval.node), (yyvsp[0].node));
12344 /*% ripper: super!($:2) %*/
12345 }
12346#line 12347 "parse.c"
12347 break;
12348
12349 case 98: /* command: k_yield command_args */
12350#line 3513 "parse.y"
12351 {
12352 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
12353 fixpos((yyval.node), (yyvsp[0].node));
12354 /*% ripper: yield!($:2) %*/
12355 }
12356#line 12357 "parse.c"
12357 break;
12358
12359 case 99: /* command: k_return call_args */
12360#line 3519 "parse.y"
12361 {
12362 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc), &(yylsp[-1]));
12363 /*% ripper: return!($:2) %*/
12364 }
12365#line 12366 "parse.c"
12366 break;
12367
12368 case 100: /* command: "'break'" call_args */
12369#line 3524 "parse.y"
12370 {
12371 NODE *args = 0;
12372 args = ret_args(p, (yyvsp[0].node));
12373 (yyval.node) = add_block_exit(p, NEW_BREAK(args, &(yyloc), &(yylsp[-1])));
12374 /*% ripper: break!($:2) %*/
12375 }
12376#line 12377 "parse.c"
12377 break;
12378
12379 case 101: /* command: "'next'" call_args */
12380#line 3531 "parse.y"
12381 {
12382 NODE *args = 0;
12383 args = ret_args(p, (yyvsp[0].node));
12384 (yyval.node) = add_block_exit(p, NEW_NEXT(args, &(yyloc), &(yylsp[-1])));
12385 /*% ripper: next!($:2) %*/
12386 }
12387#line 12388 "parse.c"
12388 break;
12389
12390 case 103: /* mlhs: "(" mlhs_inner rparen */
12391#line 3541 "parse.y"
12392 {
12393 (yyval.node_masgn) = (yyvsp[-1].node_masgn);
12394 /*% ripper: mlhs_paren!($:2) %*/
12395 }
12396#line 12397 "parse.c"
12397 break;
12398
12399 case 105: /* mlhs_inner: "(" mlhs_inner rparen */
12400#line 3549 "parse.y"
12401 {
12402 (yyval.node_masgn) = NEW_MASGN(NEW_LIST((NODE *)(yyvsp[-1].node_masgn), &(yyloc)), 0, &(yyloc));
12403 /*% ripper: mlhs_paren!($:2) %*/
12404 }
12405#line 12406 "parse.c"
12406 break;
12407
12408 case 106: /* mlhs_basic: mlhs_head */
12409#line 3556 "parse.y"
12410 {
12411 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
12412 /*% ripper: $:1 %*/
12413 }
12414#line 12415 "parse.c"
12415 break;
12416
12417 case 107: /* mlhs_basic: mlhs_head mlhs_item */
12418#line 3561 "parse.y"
12419 {
12420 (yyval.node_masgn) = NEW_MASGN(list_append(p, (yyvsp[-1].node), (yyvsp[0].node)), 0, &(yyloc));
12421 /*% ripper: mlhs_add!($:1, $:2) %*/
12422 }
12423#line 12424 "parse.c"
12424 break;
12425
12426 case 108: /* mlhs_basic: mlhs_head "*" mlhs_node */
12427#line 3566 "parse.y"
12428 {
12429 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12430 /*% ripper: mlhs_add_star!($:1, $:3) %*/
12431 }
12432#line 12433 "parse.c"
12433 break;
12434
12435 case 109: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
12436#line 3571 "parse.y"
12437 {
12438 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
12439 /*% ripper: mlhs_add_post!(mlhs_add_star!($:1, $:3), $:5) %*/
12440 }
12441#line 12442 "parse.c"
12442 break;
12443
12444 case 110: /* mlhs_basic: mlhs_head "*" */
12445#line 3576 "parse.y"
12446 {
12447 (yyval.node_masgn) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
12448 /*% ripper: mlhs_add_star!($:1, Qnil) %*/
12449 }
12450#line 12451 "parse.c"
12451 break;
12452
12453 case 111: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
12454#line 3581 "parse.y"
12455 {
12456 (yyval.node_masgn) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
12457 /*% ripper: mlhs_add_post!(mlhs_add_star!($:1, Qnil), $:4) %*/
12458 }
12459#line 12460 "parse.c"
12460 break;
12461
12462 case 112: /* mlhs_basic: "*" mlhs_node */
12463#line 3586 "parse.y"
12464 {
12465 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
12466 /*% ripper: mlhs_add_star!(mlhs_new!, $:2) %*/
12467 }
12468#line 12469 "parse.c"
12469 break;
12470
12471 case 113: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
12472#line 3591 "parse.y"
12473 {
12474 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
12475 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $:2), $:4) %*/
12476 }
12477#line 12478 "parse.c"
12478 break;
12479
12480 case 114: /* mlhs_basic: "*" */
12481#line 3596 "parse.y"
12482 {
12483 (yyval.node_masgn) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
12484 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
12485 }
12486#line 12487 "parse.c"
12487 break;
12488
12489 case 115: /* mlhs_basic: "*" ',' mlhs_post */
12490#line 3601 "parse.y"
12491 {
12492 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
12493 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $:3) %*/
12494 }
12495#line 12496 "parse.c"
12496 break;
12497
12498 case 117: /* mlhs_item: "(" mlhs_inner rparen */
12499#line 3609 "parse.y"
12500 {
12501 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
12502 /*% ripper: mlhs_paren!($:2) %*/
12503 }
12504#line 12505 "parse.c"
12505 break;
12506
12507 case 118: /* mlhs_head: mlhs_item ',' */
12508#line 3616 "parse.y"
12509 {
12510 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
12511 /*% ripper: mlhs_add!(mlhs_new!, $:1) %*/
12512 }
12513#line 12514 "parse.c"
12514 break;
12515
12516 case 119: /* mlhs_head: mlhs_head mlhs_item ',' */
12517#line 3621 "parse.y"
12518 {
12519 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
12520 /*% ripper: mlhs_add!($:1, $:2) %*/
12521 }
12522#line 12523 "parse.c"
12523 break;
12524
12525 case 120: /* mlhs_post: mlhs_item */
12526#line 3628 "parse.y"
12527 {
12528 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12529 /*% ripper: mlhs_add!(mlhs_new!, $:1) %*/
12530 }
12531#line 12532 "parse.c"
12532 break;
12533
12534 case 121: /* mlhs_post: mlhs_post ',' mlhs_item */
12535#line 3633 "parse.y"
12536 {
12537 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
12538 /*% ripper: mlhs_add!($:1, $:3) %*/
12539 }
12540#line 12541 "parse.c"
12541 break;
12542
12543 case 122: /* mlhs_node: user_variable */
12544#line 3640 "parse.y"
12545 {
12546 /*% ripper: var_field!($:1) %*/
12547 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12548 }
12549#line 12550 "parse.c"
12550 break;
12551
12552 case 123: /* mlhs_node: keyword_variable */
12553#line 3640 "parse.y"
12554 {
12555 /*% ripper: var_field!($:1) %*/
12556 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12557 }
12558#line 12559 "parse.c"
12559 break;
12560
12561 case 124: /* mlhs_node: primary_value '[' opt_call_args rbracket */
12562#line 3645 "parse.y"
12563 {
12564 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12565 /*% ripper: aref_field!($:1, $:3) %*/
12566 }
12567#line 12568 "parse.c"
12568 break;
12569
12570 case 125: /* mlhs_node: primary_value call_op "local variable or method" */
12571#line 3650 "parse.y"
12572 {
12573 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
12574 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12575 /*% ripper: field!($:1, $:2, $:3) %*/
12576 }
12577#line 12578 "parse.c"
12578 break;
12579
12580 case 126: /* mlhs_node: primary_value "::" "local variable or method" */
12581#line 3656 "parse.y"
12582 {
12583 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
12584 /*% ripper: const_path_field!($:1, $:3) %*/
12585 }
12586#line 12587 "parse.c"
12587 break;
12588
12589 case 127: /* mlhs_node: primary_value call_op "constant" */
12590#line 3661 "parse.y"
12591 {
12592 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
12593 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12594 /*% ripper: field!($:1, $:2, $:3) %*/
12595 }
12596#line 12597 "parse.c"
12597 break;
12598
12599 case 128: /* mlhs_node: primary_value "::" "constant" */
12600#line 3667 "parse.y"
12601 {
12602 /*% ripper: const_path_field!($:1, $:3) %*/
12603 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
12604 }
12605#line 12606 "parse.c"
12606 break;
12607
12608 case 129: /* mlhs_node: ":: at EXPR_BEG" "constant" */
12609#line 3672 "parse.y"
12610 {
12611 /*% ripper: top_const_field!($:2) %*/
12612 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
12613 }
12614#line 12615 "parse.c"
12615 break;
12616
12617 case 130: /* mlhs_node: backref */
12618#line 3677 "parse.y"
12619 {
12620 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[0].node));
12621 (yyval.node) = NEW_ERROR(&(yyloc));
12622 /*% ripper[error]: assign_error!(?e, var_field!($:1)) %*/
12623 }
12624#line 12625 "parse.c"
12625 break;
12626
12627 case 131: /* lhs: user_variable */
12628#line 3685 "parse.y"
12629 {
12630 /*% ripper: var_field!($:1) %*/
12631 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12632 }
12633#line 12634 "parse.c"
12634 break;
12635
12636 case 132: /* lhs: keyword_variable */
12637#line 3685 "parse.y"
12638 {
12639 /*% ripper: var_field!($:1) %*/
12640 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12641 }
12642#line 12643 "parse.c"
12643 break;
12644
12645 case 133: /* lhs: primary_value '[' opt_call_args rbracket */
12646#line 3690 "parse.y"
12647 {
12648 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12649 /*% ripper: aref_field!($:1, $:3) %*/
12650 }
12651#line 12652 "parse.c"
12652 break;
12653
12654 case 134: /* lhs: primary_value call_op "local variable or method" */
12655#line 3695 "parse.y"
12656 {
12657 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12658 /*% ripper: field!($:1, $:2, $:3) %*/
12659 }
12660#line 12661 "parse.c"
12661 break;
12662
12663 case 135: /* lhs: primary_value "::" "local variable or method" */
12664#line 3700 "parse.y"
12665 {
12666 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
12667 /*% ripper: field!($:1, $:2, $:3) %*/
12668 }
12669#line 12670 "parse.c"
12670 break;
12671
12672 case 136: /* lhs: primary_value call_op "constant" */
12673#line 3705 "parse.y"
12674 {
12675 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12676 /*% ripper: field!($:1, $:2, $:3) %*/
12677 }
12678#line 12679 "parse.c"
12679 break;
12680
12681 case 137: /* lhs: primary_value "::" "constant" */
12682#line 3710 "parse.y"
12683 {
12684 /*% ripper: const_path_field!($:1, $:3) %*/
12685 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
12686 }
12687#line 12688 "parse.c"
12688 break;
12689
12690 case 138: /* lhs: ":: at EXPR_BEG" "constant" */
12691#line 3715 "parse.y"
12692 {
12693 /*% ripper: top_const_field!($:2) %*/
12694 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
12695 }
12696#line 12697 "parse.c"
12697 break;
12698
12699 case 139: /* lhs: backref */
12700#line 3720 "parse.y"
12701 {
12702 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[0].node));
12703 (yyval.node) = NEW_ERROR(&(yyloc));
12704 /*% ripper[error]: assign_error!(?e, var_field!($:1)) %*/
12705 }
12706#line 12707 "parse.c"
12707 break;
12708
12709 case 140: /* cname: "local variable or method" */
12710#line 3728 "parse.y"
12711 {
12712 static const char mesg[] = "class/module name must be CONSTANT";
12713 /*%%%*/
12714 yyerror1(&(yylsp[0]), mesg);
12715 /*% %*/
12716 /*% ripper[error]: class_name_error!(ERR_MESG(), $:1) %*/
12717 }
12718#line 12719 "parse.c"
12719 break;
12720
12721 case 142: /* cpath: ":: at EXPR_BEG" cname */
12722#line 3739 "parse.y"
12723 {
12724 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
12725 /*% ripper: top_const_ref!($:2) %*/
12726 }
12727#line 12728 "parse.c"
12728 break;
12729
12730 case 143: /* cpath: cname */
12731#line 3744 "parse.y"
12732 {
12733 (yyval.node) = NEW_COLON2(0, (yyvsp[0].id), &(yyloc));
12734 /*% ripper: const_ref!($:1) %*/
12735 }
12736#line 12737 "parse.c"
12737 break;
12738
12739 case 144: /* cpath: primary_value "::" cname */
12740#line 3749 "parse.y"
12741 {
12742 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
12743 /*% ripper: const_path_ref!($:1, $:3) %*/
12744 }
12745#line 12746 "parse.c"
12746 break;
12747
12748 case 148: /* fname: op */
12749#line 3758 "parse.y"
12750 {
12751 SET_LEX_STATE(EXPR_ENDFN);
12752 (yyval.id) = (yyvsp[0].id);
12753 }
12754#line 12755 "parse.c"
12755 break;
12756
12757 case 150: /* fitem: fname */
12758#line 3766 "parse.y"
12759 {
12760 (yyval.node) = NEW_SYM(rb_id2str((yyvsp[0].id)), &(yyloc));
12761 /*% ripper: symbol_literal!($:1) %*/
12762 }
12763#line 12764 "parse.c"
12764 break;
12765
12766 case 152: /* undef_list: fitem */
12767#line 3774 "parse.y"
12768 {
12769 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
12770 /*% ripper: rb_ary_new3(1, $:1) %*/
12771 }
12772#line 12773 "parse.c"
12773 break;
12774
12775 case 153: /* $@12: %empty */
12776#line 3778 "parse.y"
12777 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
12778#line 12779 "parse.c"
12779 break;
12780
12781 case 154: /* undef_list: undef_list ',' $@12 fitem */
12782#line 3779 "parse.y"
12783 {
12784 nd_set_last_loc((yyvsp[-3].node), (yylsp[0]).end_pos);
12785 rb_parser_ary_push_node(p, RNODE_UNDEF((yyvsp[-3].node))->nd_undefs, (yyvsp[0].node));
12786 /*% ripper: rb_ary_push($:1, $:4) %*/
12787 }
12788#line 12789 "parse.c"
12789 break;
12790
12791 case 155: /* op: '|' */
12792#line 3786 "parse.y"
12793 { (yyval.id) = '|'; }
12794#line 12795 "parse.c"
12795 break;
12796
12797 case 156: /* op: '^' */
12798#line 3787 "parse.y"
12799 { (yyval.id) = '^'; }
12800#line 12801 "parse.c"
12801 break;
12802
12803 case 157: /* op: '&' */
12804#line 3788 "parse.y"
12805 { (yyval.id) = '&'; }
12806#line 12807 "parse.c"
12807 break;
12808
12809 case 158: /* op: "<=>" */
12810#line 3789 "parse.y"
12811 { (yyval.id) = tCMP; }
12812#line 12813 "parse.c"
12813 break;
12814
12815 case 159: /* op: "==" */
12816#line 3790 "parse.y"
12817 { (yyval.id) = tEQ; }
12818#line 12819 "parse.c"
12819 break;
12820
12821 case 160: /* op: "===" */
12822#line 3791 "parse.y"
12823 { (yyval.id) = tEQQ; }
12824#line 12825 "parse.c"
12825 break;
12826
12827 case 161: /* op: "=~" */
12828#line 3792 "parse.y"
12829 { (yyval.id) = tMATCH; }
12830#line 12831 "parse.c"
12831 break;
12832
12833 case 162: /* op: "!~" */
12834#line 3793 "parse.y"
12835 { (yyval.id) = tNMATCH; }
12836#line 12837 "parse.c"
12837 break;
12838
12839 case 163: /* op: '>' */
12840#line 3794 "parse.y"
12841 { (yyval.id) = '>'; }
12842#line 12843 "parse.c"
12843 break;
12844
12845 case 164: /* op: ">=" */
12846#line 3795 "parse.y"
12847 { (yyval.id) = tGEQ; }
12848#line 12849 "parse.c"
12849 break;
12850
12851 case 165: /* op: '<' */
12852#line 3796 "parse.y"
12853 { (yyval.id) = '<'; }
12854#line 12855 "parse.c"
12855 break;
12856
12857 case 166: /* op: "<=" */
12858#line 3797 "parse.y"
12859 { (yyval.id) = tLEQ; }
12860#line 12861 "parse.c"
12861 break;
12862
12863 case 167: /* op: "!=" */
12864#line 3798 "parse.y"
12865 { (yyval.id) = tNEQ; }
12866#line 12867 "parse.c"
12867 break;
12868
12869 case 168: /* op: "<<" */
12870#line 3799 "parse.y"
12871 { (yyval.id) = tLSHFT; }
12872#line 12873 "parse.c"
12873 break;
12874
12875 case 169: /* op: ">>" */
12876#line 3800 "parse.y"
12877 { (yyval.id) = tRSHFT; }
12878#line 12879 "parse.c"
12879 break;
12880
12881 case 170: /* op: '+' */
12882#line 3801 "parse.y"
12883 { (yyval.id) = '+'; }
12884#line 12885 "parse.c"
12885 break;
12886
12887 case 171: /* op: '-' */
12888#line 3802 "parse.y"
12889 { (yyval.id) = '-'; }
12890#line 12891 "parse.c"
12891 break;
12892
12893 case 172: /* op: '*' */
12894#line 3803 "parse.y"
12895 { (yyval.id) = '*'; }
12896#line 12897 "parse.c"
12897 break;
12898
12899 case 173: /* op: "*" */
12900#line 3804 "parse.y"
12901 { (yyval.id) = '*'; }
12902#line 12903 "parse.c"
12903 break;
12904
12905 case 174: /* op: '/' */
12906#line 3805 "parse.y"
12907 { (yyval.id) = '/'; }
12908#line 12909 "parse.c"
12909 break;
12910
12911 case 175: /* op: '%' */
12912#line 3806 "parse.y"
12913 { (yyval.id) = '%'; }
12914#line 12915 "parse.c"
12915 break;
12916
12917 case 176: /* op: "**" */
12918#line 3807 "parse.y"
12919 { (yyval.id) = tPOW; }
12920#line 12921 "parse.c"
12921 break;
12922
12923 case 177: /* op: "**arg" */
12924#line 3808 "parse.y"
12925 { (yyval.id) = tDSTAR; }
12926#line 12927 "parse.c"
12927 break;
12928
12929 case 178: /* op: '!' */
12930#line 3809 "parse.y"
12931 { (yyval.id) = '!'; }
12932#line 12933 "parse.c"
12933 break;
12934
12935 case 179: /* op: '~' */
12936#line 3810 "parse.y"
12937 { (yyval.id) = '~'; }
12938#line 12939 "parse.c"
12939 break;
12940
12941 case 180: /* op: "unary+" */
12942#line 3811 "parse.y"
12943 { (yyval.id) = tUPLUS; }
12944#line 12945 "parse.c"
12945 break;
12946
12947 case 181: /* op: "unary-" */
12948#line 3812 "parse.y"
12949 { (yyval.id) = tUMINUS; }
12950#line 12951 "parse.c"
12951 break;
12952
12953 case 182: /* op: "[]" */
12954#line 3813 "parse.y"
12955 { (yyval.id) = tAREF; }
12956#line 12957 "parse.c"
12957 break;
12958
12959 case 183: /* op: "[]=" */
12960#line 3814 "parse.y"
12961 { (yyval.id) = tASET; }
12962#line 12963 "parse.c"
12963 break;
12964
12965 case 184: /* op: '`' */
12966#line 3815 "parse.y"
12967 { (yyval.id) = '`'; }
12968#line 12969 "parse.c"
12969 break;
12970
12971 case 226: /* arg: lhs '=' lex_ctxt arg_rhs */
12972#line 3833 "parse.y"
12973 {
12974 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
12975 /*% ripper: assign!($:1, $:4) %*/
12976 }
12977#line 12978 "parse.c"
12978 break;
12979
12980 case 227: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
12981#line 3838 "parse.y"
12982 {
12983 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
12984 /*% ripper: opassign!($:1, $:2, $:4) %*/
12985 }
12986#line 12987 "parse.c"
12987 break;
12988
12989 case 228: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
12990#line 3843 "parse.y"
12991 {
12992 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc), &NULL_LOC, &(yylsp[-5]), &(yylsp[-3]), &(yylsp[-2]));
12993 /*% ripper: opassign!(aref_field!($:1, $:3), $:5, $:7) %*/
12994 }
12995#line 12996 "parse.c"
12996 break;
12997
12998 case 229: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
12999#line 3848 "parse.y"
13000 {
13001 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-3]), &(yylsp[-2]));
13002 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
13003 }
13004#line 13005 "parse.c"
13005 break;
13006
13007 case 230: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
13008#line 3853 "parse.y"
13009 {
13010 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-3]), &(yylsp[-2]));
13011 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
13012 }
13013#line 13014 "parse.c"
13014 break;
13015
13016 case 231: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
13017#line 3858 "parse.y"
13018 {
13019 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), idCOLON2, (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-3]), &(yylsp[-2]));
13020 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
13021 }
13022#line 13023 "parse.c"
13023 break;
13024
13025 case 232: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
13026#line 3863 "parse.y"
13027 {
13028 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
13029 (yyval.node) = new_const_op_assign(p, NEW_COLON2((yyvsp[-5].node), (yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
13030 /*% ripper: opassign!(const_path_field!($:1, $:3), $:4, $:6) %*/
13031 }
13032#line 13033 "parse.c"
13033 break;
13034
13035 case 233: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
13036#line 3869 "parse.y"
13037 {
13038 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-3]));
13039 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
13040 /*% ripper: opassign!(top_const_field!($:2), $:3, $:5) %*/
13041 }
13042#line 13043 "parse.c"
13043 break;
13044
13045 case 234: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
13046#line 3875 "parse.y"
13047 {
13048 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[-3].node));
13049 (yyval.node) = NEW_ERROR(&(yyloc));
13050 /*% ripper[error]: assign_error!(?e, opassign!(var_field!($:1), $:2, $:4)) %*/
13051 }
13052#line 13053 "parse.c"
13053 break;
13054
13055 case 235: /* arg: arg ".." arg */
13056#line 3881 "parse.y"
13057 {
13058 value_expr((yyvsp[-2].node));
13059 value_expr((yyvsp[0].node));
13060 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13061 /*% ripper: dot2!($:1, $:3) %*/
13062 }
13063#line 13064 "parse.c"
13064 break;
13065
13066 case 236: /* arg: arg "..." arg */
13067#line 3888 "parse.y"
13068 {
13069 value_expr((yyvsp[-2].node));
13070 value_expr((yyvsp[0].node));
13071 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13072 /*% ripper: dot3!($:1, $:3) %*/
13073 }
13074#line 13075 "parse.c"
13075 break;
13076
13077 case 237: /* arg: arg ".." */
13078#line 3895 "parse.y"
13079 {
13080 value_expr((yyvsp[-1].node));
13081 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
13082 /*% ripper: dot2!($:1, Qnil) %*/
13083 }
13084#line 13085 "parse.c"
13085 break;
13086
13087 case 238: /* arg: arg "..." */
13088#line 3901 "parse.y"
13089 {
13090 value_expr((yyvsp[-1].node));
13091 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
13092 /*% ripper: dot3!($:1, Qnil) %*/
13093 }
13094#line 13095 "parse.c"
13095 break;
13096
13097 case 239: /* arg: "(.." arg */
13098#line 3907 "parse.y"
13099 {
13100 value_expr((yyvsp[0].node));
13101 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
13102 /*% ripper: dot2!(Qnil, $:2) %*/
13103 }
13104#line 13105 "parse.c"
13105 break;
13106
13107 case 240: /* arg: "(..." arg */
13108#line 3913 "parse.y"
13109 {
13110 value_expr((yyvsp[0].node));
13111 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
13112 /*% ripper: dot3!(Qnil, $:2) %*/
13113 }
13114#line 13115 "parse.c"
13115 break;
13116
13117 case 241: /* arg: arg '+' arg */
13118#line 3919 "parse.y"
13119 {
13120 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13121 /*% ripper: binary!($:1, ID2VAL('\'+\''), $:3) %*/
13122 }
13123#line 13124 "parse.c"
13124 break;
13125
13126 case 242: /* arg: arg '-' arg */
13127#line 3924 "parse.y"
13128 {
13129 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13130 /*% ripper: binary!($:1, ID2VAL('\'-\''), $:3) %*/
13131 }
13132#line 13133 "parse.c"
13133 break;
13134
13135 case 243: /* arg: arg '*' arg */
13136#line 3929 "parse.y"
13137 {
13138 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13139 /*% ripper: binary!($:1, ID2VAL('\'*\''), $:3) %*/
13140 }
13141#line 13142 "parse.c"
13142 break;
13143
13144 case 244: /* arg: arg '/' arg */
13145#line 3934 "parse.y"
13146 {
13147 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13148 /*% ripper: binary!($:1, ID2VAL('\'/\''), $:3) %*/
13149 }
13150#line 13151 "parse.c"
13151 break;
13152
13153 case 245: /* arg: arg '%' arg */
13154#line 3939 "parse.y"
13155 {
13156 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13157 /*% ripper: binary!($:1, ID2VAL('\'%\''), $:3) %*/
13158 }
13159#line 13160 "parse.c"
13160 break;
13161
13162 case 246: /* arg: arg "**" arg */
13163#line 3944 "parse.y"
13164 {
13165 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13166 /*% ripper: binary!($:1, ID2VAL(idPow), $:3) %*/
13167 }
13168#line 13169 "parse.c"
13169 break;
13170
13171 case 247: /* arg: tUMINUS_NUM simple_numeric "**" arg */
13172#line 3949 "parse.y"
13173 {
13174 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
13175 /*% ripper: unary!(ID2VAL(idUMinus), binary!($:2, ID2VAL(idPow), $:4)) %*/
13176 }
13177#line 13178 "parse.c"
13178 break;
13179
13180 case 248: /* arg: "unary+" arg */
13181#line 3954 "parse.y"
13182 {
13183 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
13184 /*% ripper: unary!(ID2VAL(idUPlus), $:2) %*/
13185 }
13186#line 13187 "parse.c"
13187 break;
13188
13189 case 249: /* arg: "unary-" arg */
13190#line 3959 "parse.y"
13191 {
13192 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
13193 /*% ripper: unary!(ID2VAL(idUMinus), $:2) %*/
13194 }
13195#line 13196 "parse.c"
13196 break;
13197
13198 case 250: /* arg: arg '|' arg */
13199#line 3964 "parse.y"
13200 {
13201 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13202 /*% ripper: binary!($:1, ID2VAL('\'|\''), $:3) %*/
13203 }
13204#line 13205 "parse.c"
13205 break;
13206
13207 case 251: /* arg: arg '^' arg */
13208#line 3969 "parse.y"
13209 {
13210 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13211 /*% ripper: binary!($:1, ID2VAL('\'^\''), $:3) %*/
13212 }
13213#line 13214 "parse.c"
13214 break;
13215
13216 case 252: /* arg: arg '&' arg */
13217#line 3974 "parse.y"
13218 {
13219 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13220 /*% ripper: binary!($:1, ID2VAL('\'&\''), $:3) %*/
13221 }
13222#line 13223 "parse.c"
13223 break;
13224
13225 case 253: /* arg: arg "<=>" arg */
13226#line 3979 "parse.y"
13227 {
13228 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13229 /*% ripper: binary!($:1, ID2VAL(idCmp), $:3) %*/
13230 }
13231#line 13232 "parse.c"
13232 break;
13233
13234 case 255: /* arg: arg "==" arg */
13235#line 3985 "parse.y"
13236 {
13237 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13238 /*% ripper: binary!($:1, ID2VAL(idEq), $:3) %*/
13239 }
13240#line 13241 "parse.c"
13241 break;
13242
13243 case 256: /* arg: arg "===" arg */
13244#line 3990 "parse.y"
13245 {
13246 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13247 /*% ripper: binary!($:1, ID2VAL(idEqq), $:3) %*/
13248 }
13249#line 13250 "parse.c"
13250 break;
13251
13252 case 257: /* arg: arg "!=" arg */
13253#line 3995 "parse.y"
13254 {
13255 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13256 /*% ripper: binary!($:1, ID2VAL(idNeq), $:3) %*/
13257 }
13258#line 13259 "parse.c"
13259 break;
13260
13261 case 258: /* arg: arg "=~" arg */
13262#line 4000 "parse.y"
13263 {
13264 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13265 /*% ripper: binary!($:1, ID2VAL(idEqTilde), $:3) %*/
13266 }
13267#line 13268 "parse.c"
13268 break;
13269
13270 case 259: /* arg: arg "!~" arg */
13271#line 4005 "parse.y"
13272 {
13273 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13274 /*% ripper: binary!($:1, ID2VAL(idNeqTilde), $:3) %*/
13275 }
13276#line 13277 "parse.c"
13277 break;
13278
13279 case 260: /* arg: '!' arg */
13280#line 4010 "parse.y"
13281 {
13282 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
13283 /*% ripper: unary!(ID2VAL('\'!\''), $:2) %*/
13284 }
13285#line 13286 "parse.c"
13286 break;
13287
13288 case 261: /* arg: '~' arg */
13289#line 4015 "parse.y"
13290 {
13291 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
13292 /*% ripper: unary!(ID2VAL('\'~\''), $:2) %*/
13293 }
13294#line 13295 "parse.c"
13295 break;
13296
13297 case 262: /* arg: arg "<<" arg */
13298#line 4020 "parse.y"
13299 {
13300 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13301 /*% ripper: binary!($:1, ID2VAL(idLTLT), $:3) %*/
13302 }
13303#line 13304 "parse.c"
13304 break;
13305
13306 case 263: /* arg: arg ">>" arg */
13307#line 4025 "parse.y"
13308 {
13309 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13310 /*% ripper: binary!($:1, ID2VAL(idGTGT), $:3) %*/
13311 }
13312#line 13313 "parse.c"
13313 break;
13314
13315 case 264: /* arg: arg "&&" arg */
13316#line 4030 "parse.y"
13317 {
13318 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13319 /*% ripper: binary!($:1, ID2VAL(idANDOP), $:3) %*/
13320 }
13321#line 13322 "parse.c"
13322 break;
13323
13324 case 265: /* arg: arg "||" arg */
13325#line 4035 "parse.y"
13326 {
13327 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13328 /*% ripper: binary!($:1, ID2VAL(idOROP), $:3) %*/
13329 }
13330#line 13331 "parse.c"
13331 break;
13332
13333 case 266: /* arg: "'defined?'" option_'\n' begin_defined arg */
13334#line 4040 "parse.y"
13335 {
13336 p->ctxt.in_defined = (yyvsp[-1].ctxt).in_defined;
13337 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
13338 /*% ripper: defined!($:4) %*/
13339 }
13340#line 13341 "parse.c"
13341 break;
13342
13343 case 267: /* arg: arg '?' arg option_'\n' ':' arg */
13344#line 4046 "parse.y"
13345 {
13346 value_expr((yyvsp[-5].node));
13347 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
13348 fixpos((yyval.node), (yyvsp[-5].node));
13349 /*% ripper: ifop!($:1, $:3, $:6) %*/
13350 }
13351#line 13352 "parse.c"
13352 break;
13353
13354 case 268: /* arg: defn_head f_opt_paren_args '=' endless_arg */
13355#line 4053 "parse.y"
13356 {
13357 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
13358 restore_defun(p, (yyvsp[-3].node_def_temp));
13359 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
13360 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
13361 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
13362 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
13363 /*% ripper: def!($:head, $:args, $:$) %*/
13364 local_pop(p);
13365 }
13366#line 13367 "parse.c"
13367 break;
13368
13369 case 269: /* arg: defs_head f_opt_paren_args '=' endless_arg */
13370#line 4064 "parse.y"
13371 {
13372 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
13373 restore_defun(p, (yyvsp[-3].node_def_temp));
13374 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
13375 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
13376 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
13377 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
13378 /*% ripper: defs!(*$:head[0..2], $:args, $:$) %*/
13379 local_pop(p);
13380 }
13381#line 13382 "parse.c"
13382 break;
13383
13384 case 270: /* arg: primary */
13385#line 4075 "parse.y"
13386 {
13387 (yyval.node) = (yyvsp[0].node);
13388 }
13389#line 13390 "parse.c"
13390 break;
13391
13392 case 272: /* endless_arg: endless_arg "'rescue' modifier" after_rescue arg */
13393#line 4082 "parse.y"
13394 {
13395 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
13396 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
13397 /*% ripper: rescue_mod!($:1, $:4) %*/
13398 }
13399#line 13400 "parse.c"
13400 break;
13401
13402 case 273: /* endless_arg: "'not'" option_'\n' endless_arg */
13403#line 4088 "parse.y"
13404 {
13405 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
13406 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
13407 }
13408#line 13409 "parse.c"
13409 break;
13410
13411 case 274: /* relop: '>' */
13412#line 4094 "parse.y"
13413 {(yyval.id) = '>';}
13414#line 13415 "parse.c"
13415 break;
13416
13417 case 275: /* relop: '<' */
13418#line 4095 "parse.y"
13419 {(yyval.id) = '<';}
13420#line 13421 "parse.c"
13421 break;
13422
13423 case 276: /* relop: ">=" */
13424#line 4096 "parse.y"
13425 {(yyval.id) = idGE;}
13426#line 13427 "parse.c"
13427 break;
13428
13429 case 277: /* relop: "<=" */
13430#line 4097 "parse.y"
13431 {(yyval.id) = idLE;}
13432#line 13433 "parse.c"
13433 break;
13434
13435 case 278: /* rel_expr: arg relop arg */
13436#line 4101 "parse.y"
13437 {
13438 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13439 /*% ripper: binary!($:1, ID2VAL($2), $:3) %*/
13440 }
13441#line 13442 "parse.c"
13442 break;
13443
13444 case 279: /* rel_expr: rel_expr relop arg */
13445#line 4106 "parse.y"
13446 {
13447 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
13448 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13449 /*% ripper: binary!($:1, ID2VAL($2), $:3) %*/
13450 }
13451#line 13452 "parse.c"
13452 break;
13453
13454 case 280: /* lex_ctxt: none */
13455#line 4114 "parse.y"
13456 {
13457 (yyval.ctxt) = p->ctxt;
13458 }
13459#line 13460 "parse.c"
13460 break;
13461
13462 case 281: /* begin_defined: lex_ctxt */
13463#line 4120 "parse.y"
13464 {
13465 p->ctxt.in_defined = 1;
13466 (yyval.ctxt) = (yyvsp[0].ctxt);
13467 }
13468#line 13469 "parse.c"
13469 break;
13470
13471 case 282: /* after_rescue: lex_ctxt */
13472#line 4127 "parse.y"
13473 {
13474 p->ctxt.in_rescue = after_rescue;
13475 (yyval.ctxt) = (yyvsp[0].ctxt);
13476 }
13477#line 13478 "parse.c"
13478 break;
13479
13480 case 283: /* arg_value: arg */
13481#line 4134 "parse.y"
13482 {
13483 value_expr((yyvsp[0].node));
13484 (yyval.node) = (yyvsp[0].node);
13485 }
13486#line 13487 "parse.c"
13487 break;
13488
13489 case 285: /* aref_args: args trailer */
13490#line 4142 "parse.y"
13491 {
13492 (yyval.node) = (yyvsp[-1].node);
13493 }
13494#line 13495 "parse.c"
13495 break;
13496
13497 case 286: /* aref_args: args ',' assocs trailer */
13498#line 4146 "parse.y"
13499 {
13500 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
13501 /*% ripper: args_add!($:1, bare_assoc_hash!($:3)) %*/
13502 }
13503#line 13504 "parse.c"
13504 break;
13505
13506 case 287: /* aref_args: assocs trailer */
13507#line 4151 "parse.y"
13508 {
13509 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
13510 /*% ripper: args_add!(args_new!, bare_assoc_hash!($:1)) %*/
13511 }
13512#line 13513 "parse.c"
13513 break;
13514
13515 case 288: /* arg_rhs: arg */
13516#line 4158 "parse.y"
13517 {
13518 value_expr((yyvsp[0].node));
13519 (yyval.node) = (yyvsp[0].node);
13520 }
13521#line 13522 "parse.c"
13522 break;
13523
13524 case 289: /* arg_rhs: arg "'rescue' modifier" after_rescue arg */
13525#line 4163 "parse.y"
13526 {
13527 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
13528 value_expr((yyvsp[-3].node));
13529 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
13530 /*% ripper: rescue_mod!($:1, $:4) %*/
13531 }
13532#line 13533 "parse.c"
13533 break;
13534
13535 case 290: /* paren_args: '(' opt_call_args rparen */
13536#line 4172 "parse.y"
13537 {
13538 (yyval.node) = (yyvsp[-1].node);
13539 /*% ripper: arg_paren!($:2) %*/
13540 }
13541#line 13542 "parse.c"
13542 break;
13543
13544 case 291: /* paren_args: '(' args ',' args_forward rparen */
13545#line 4177 "parse.y"
13546 {
13547 if (!check_forwarding_args(p)) {
13548 (yyval.node) = 0;
13549 }
13550 else {
13551 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
13552 /*% ripper: arg_paren!(args_add!($:2, $:4)) %*/
13553 }
13554 }
13555#line 13556 "parse.c"
13556 break;
13557
13558 case 292: /* paren_args: '(' args_forward rparen */
13559#line 4187 "parse.y"
13560 {
13561 if (!check_forwarding_args(p)) {
13562 (yyval.node) = 0;
13563 }
13564 else {
13565 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
13566 /*% ripper: arg_paren!($:2) %*/
13567 }
13568 }
13569#line 13570 "parse.c"
13570 break;
13571
13572 case 294: /* opt_paren_args: paren_args */
13573#line 4200 "parse.y"
13574 {
13575 (yyval.node) = (yyvsp[0].node) ? (yyvsp[0].node) : NODE_SPECIAL_EMPTY_ARGS;
13576 }
13577#line 13578 "parse.c"
13578 break;
13579
13580 case 297: /* opt_call_args: args ',' */
13581#line 4208 "parse.y"
13582 {
13583 (yyval.node) = (yyvsp[-1].node);
13584 }
13585#line 13586 "parse.c"
13586 break;
13587
13588 case 298: /* opt_call_args: args ',' assocs ',' */
13589#line 4212 "parse.y"
13590 {
13591 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
13592 /*% ripper: args_add!($:1, bare_assoc_hash!($:3)) %*/
13593 }
13594#line 13595 "parse.c"
13595 break;
13596
13597 case 299: /* opt_call_args: assocs ',' */
13598#line 4217 "parse.y"
13599 {
13600 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
13601 /*% ripper: args_add!(args_new!, bare_assoc_hash!($:1)) %*/
13602 }
13603#line 13604 "parse.c"
13604 break;
13605
13606 case 300: /* call_args: command */
13607#line 4224 "parse.y"
13608 {
13609 value_expr((yyvsp[0].node));
13610 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13611 /*% ripper: args_add!(args_new!, $:1) %*/
13612 }
13613#line 13614 "parse.c"
13614 break;
13615
13616 case 301: /* call_args: args opt_block_arg */
13617#line 4230 "parse.y"
13618 {
13619 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node_block_pass));
13620 /*% ripper: args_add_block!($:1, $:2) %*/
13621 }
13622#line 13623 "parse.c"
13623 break;
13624
13625 case 302: /* call_args: assocs opt_block_arg */
13626#line 4235 "parse.y"
13627 {
13628 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
13629 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
13630 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($:1)), $:2) %*/
13631 }
13632#line 13633 "parse.c"
13633 break;
13634
13635 case 303: /* call_args: args ',' assocs opt_block_arg */
13636#line 4241 "parse.y"
13637 {
13638 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
13639 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
13640 /*% ripper: args_add_block!(args_add!($:1, bare_assoc_hash!($:3)), $:4) %*/
13641 }
13642#line 13643 "parse.c"
13643 break;
13644
13645 case 305: /* $@13: %empty */
13646#line 4250 "parse.y"
13647 {
13648 /* If call_args starts with a open paren '(' or '[',
13649 * look-ahead reading of the letters calls CMDARG_PUSH(0),
13650 * but the push must be done after CMDARG_PUSH(1).
13651 * So this code makes them consistent by first cancelling
13652 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
13653 * and finally redoing CMDARG_PUSH(0).
13654 */
13655 int lookahead = 0;
13656 switch (yychar) {
13657 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
13658 lookahead = 1;
13659 }
13660 if (lookahead) CMDARG_POP();
13661 CMDARG_PUSH(1);
13662 if (lookahead) CMDARG_PUSH(0);
13663 }
13664#line 13665 "parse.c"
13665 break;
13666
13667 case 306: /* command_args: $@13 call_args */
13668#line 4268 "parse.y"
13669 {
13670 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
13671 * but the push must be done after CMDARG_POP() in the parser.
13672 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
13673 * CMDARG_POP() to pop 1 pushed by command_args,
13674 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
13675 */
13676 int lookahead = 0;
13677 switch (yychar) {
13678 case tLBRACE_ARG:
13679 lookahead = 1;
13680 }
13681 if (lookahead) CMDARG_POP();
13682 CMDARG_POP();
13683 if (lookahead) CMDARG_PUSH(0);
13684 (yyval.node) = (yyvsp[0].node);
13685 /*% ripper: $:2 %*/
13686 }
13687#line 13688 "parse.c"
13688 break;
13689
13690 case 307: /* block_arg: "&" arg_value */
13691#line 4289 "parse.y"
13692 {
13693 (yyval.node_block_pass) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
13694 /*% ripper: $:2 %*/
13695 }
13696#line 13697 "parse.c"
13697 break;
13698
13699 case 308: /* block_arg: "&" */
13700#line 4294 "parse.y"
13701 {
13702 forwarding_arg_check(p, idFWD_BLOCK, idFWD_ALL, "block");
13703 (yyval.node_block_pass) = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[0])), &(yyloc), &(yylsp[0]));
13704 /*% ripper: Qnil %*/
13705 }
13706#line 13707 "parse.c"
13707 break;
13708
13709 case 309: /* opt_block_arg: ',' block_arg */
13710#line 4302 "parse.y"
13711 {
13712 (yyval.node_block_pass) = (yyvsp[0].node_block_pass);
13713 /*% ripper: $:2 %*/
13714 }
13715#line 13716 "parse.c"
13716 break;
13717
13718 case 310: /* opt_block_arg: none */
13719#line 4307 "parse.y"
13720 {
13721 (yyval.node_block_pass) = 0;
13722 /*% ripper: Qfalse %*/
13723 }
13724#line 13725 "parse.c"
13725 break;
13726
13727 case 311: /* args: arg_value */
13728#line 4315 "parse.y"
13729 {
13730 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13731 /*% ripper: args_add!(args_new!, $:arg_value) %*/
13732 }
13733#line 13734 "parse.c"
13734 break;
13735
13736 case 312: /* args: arg_splat */
13737#line 4320 "parse.y"
13738 {
13739 (yyval.node) = (yyvsp[0].node);
13740 /*% ripper: args_add_star!(args_new!, $:arg_splat) %*/
13741 }
13742#line 13743 "parse.c"
13743 break;
13744
13745 case 313: /* args: args ',' arg_value */
13746#line 4325 "parse.y"
13747 {
13748 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13749 /*% ripper: args_add!($:non_last_args, $:arg_value) %*/
13750 }
13751#line 13752 "parse.c"
13752 break;
13753
13754 case 314: /* args: args ',' arg_splat */
13755#line 4330 "parse.y"
13756 {
13757 (yyval.node) = rest_arg_append(p, (yyvsp[-2].node), RNODE_SPLAT((yyvsp[0].node))->nd_head, &(yyloc));
13758 /*% ripper: args_add_star!($:non_last_args, $:arg_splat) %*/
13759 }
13760#line 13761 "parse.c"
13761 break;
13762
13763 case 315: /* arg_splat: "*" arg_value */
13764#line 4338 "parse.y"
13765 {
13766 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
13767 /*% ripper: $:arg_value %*/
13768 }
13769#line 13770 "parse.c"
13770 break;
13771
13772 case 316: /* arg_splat: "*" */
13773#line 4343 "parse.y"
13774 {
13775 forwarding_arg_check(p, idFWD_REST, idFWD_ALL, "rest");
13776 (yyval.node) = NEW_SPLAT(NEW_LVAR(idFWD_REST, &(yylsp[0])), &(yyloc), &(yylsp[0]));
13777 /*% ripper: Qnil %*/
13778 }
13779#line 13780 "parse.c"
13780 break;
13781
13782 case 319: /* mrhs: args ',' arg_value */
13783#line 4357 "parse.y"
13784 {
13785 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13786 /*% ripper: mrhs_add!(mrhs_new_from_args!($:args), $:arg_value) %*/
13787 }
13788#line 13789 "parse.c"
13789 break;
13790
13791 case 320: /* mrhs: args ',' "*" arg_value */
13792#line 4362 "parse.y"
13793 {
13794 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
13795 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($:args), $:arg_value) %*/
13796 }
13797#line 13798 "parse.c"
13798 break;
13799
13800 case 321: /* mrhs: "*" arg_value */
13801#line 4367 "parse.y"
13802 {
13803 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
13804 /*% ripper: mrhs_add_star!(mrhs_new!, $:arg_value) %*/
13805 }
13806#line 13807 "parse.c"
13807 break;
13808
13809 case 332: /* primary: "method" */
13810#line 4388 "parse.y"
13811 {
13812 (yyval.node) = (NODE *)NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
13813 /*% ripper: method_add_arg!(fcall!($:1), args_new!) %*/
13814 }
13815#line 13816 "parse.c"
13816 break;
13817
13818 case 333: /* $@14: %empty */
13819#line 4393 "parse.y"
13820 {
13821 CMDARG_PUSH(0);
13822 }
13823#line 13824 "parse.c"
13824 break;
13825
13826 case 334: /* primary: k_begin $@14 bodystmt k_end */
13827#line 4398 "parse.y"
13828 {
13829 CMDARG_POP();
13830 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
13831 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
13832 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
13833 /*% ripper: begin!($:3) %*/
13834 }
13835#line 13836 "parse.c"
13836 break;
13837
13838 case 335: /* $@15: %empty */
13839#line 4405 "parse.y"
13840 {SET_LEX_STATE(EXPR_ENDARG);}
13841#line 13842 "parse.c"
13842 break;
13843
13844 case 336: /* primary: "( arg" compstmt $@15 ')' */
13845#line 4406 "parse.y"
13846 {
13847 if (nd_type_p((yyvsp[-2].node), NODE_SELF)) RNODE_SELF((yyvsp[-2].node))->nd_state = 0;
13848 (yyval.node) = (yyvsp[-2].node);
13849 /*% ripper: paren!($:2) %*/
13850 }
13851#line 13852 "parse.c"
13852 break;
13853
13854 case 337: /* primary: "(" compstmt ')' */
13855#line 4412 "parse.y"
13856 {
13857 if (nd_type_p((yyvsp[-1].node), NODE_SELF)) RNODE_SELF((yyvsp[-1].node))->nd_state = 0;
13858 (yyval.node) = NEW_BLOCK((yyvsp[-1].node), &(yyloc));
13859 /*% ripper: paren!($:2) %*/
13860 }
13861#line 13862 "parse.c"
13862 break;
13863
13864 case 338: /* primary: primary_value "::" "constant" */
13865#line 4418 "parse.y"
13866 {
13867 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
13868 /*% ripper: const_path_ref!($:1, $:3) %*/
13869 }
13870#line 13871 "parse.c"
13871 break;
13872
13873 case 339: /* primary: ":: at EXPR_BEG" "constant" */
13874#line 4423 "parse.y"
13875 {
13876 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
13877 /*% ripper: top_const_ref!($:2) %*/
13878 }
13879#line 13880 "parse.c"
13880 break;
13881
13882 case 340: /* primary: "[" aref_args ']' */
13883#line 4428 "parse.y"
13884 {
13885 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
13886 /*% ripper: array!($:2) %*/
13887 }
13888#line 13889 "parse.c"
13889 break;
13890
13891 case 341: /* primary: "{" assoc_list '}' */
13892#line 4433 "parse.y"
13893 {
13894 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
13895 RNODE_HASH((yyval.node))->nd_brace = TRUE;
13896 /*% ripper: hash!($:2) %*/
13897 }
13898#line 13899 "parse.c"
13899 break;
13900
13901 case 342: /* primary: k_return */
13902#line 4439 "parse.y"
13903 {
13904 (yyval.node) = NEW_RETURN(0, &(yyloc), &(yylsp[0]));
13905 /*% ripper: return0! %*/
13906 }
13907#line 13908 "parse.c"
13908 break;
13909
13910 case 343: /* primary: k_yield '(' call_args rparen */
13911#line 4444 "parse.y"
13912 {
13913 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
13914 /*% ripper: yield!(paren!($:3)) %*/
13915 }
13916#line 13917 "parse.c"
13917 break;
13918
13919 case 344: /* primary: k_yield '(' rparen */
13920#line 4449 "parse.y"
13921 {
13922 (yyval.node) = NEW_YIELD(0, &(yyloc));
13923 /*% ripper: yield!(paren!(args_new!)) %*/
13924 }
13925#line 13926 "parse.c"
13926 break;
13927
13928 case 345: /* primary: k_yield */
13929#line 4454 "parse.y"
13930 {
13931 (yyval.node) = NEW_YIELD(0, &(yyloc));
13932 /*% ripper: yield0! %*/
13933 }
13934#line 13935 "parse.c"
13935 break;
13936
13937 case 346: /* primary: "'defined?'" option_'\n' '(' begin_defined expr rparen */
13938#line 4459 "parse.y"
13939 {
13940 p->ctxt.in_defined = (yyvsp[-2].ctxt).in_defined;
13941 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
13942 /*% ripper: defined!($:5) %*/
13943 }
13944#line 13945 "parse.c"
13945 break;
13946
13947 case 347: /* primary: "'not'" '(' expr rparen */
13948#line 4465 "parse.y"
13949 {
13950 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
13951 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
13952 }
13953#line 13954 "parse.c"
13954 break;
13955
13956 case 348: /* primary: "'not'" '(' rparen */
13957#line 4470 "parse.y"
13958 {
13959 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
13960 /*% ripper: unary!(ID2VAL(idNOT), Qnil) %*/
13961 }
13962#line 13963 "parse.c"
13963 break;
13964
13965 case 349: /* primary: fcall brace_block */
13966#line 4475 "parse.y"
13967 {
13968 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-1].node_fcall), (yyvsp[0].node), &(yyloc));
13969 /*% ripper: method_add_block!(method_add_arg!(fcall!($:1), args_new!), $:2) %*/
13970 }
13971#line 13972 "parse.c"
13972 break;
13973
13974 case 351: /* primary: method_call brace_block */
13975#line 4481 "parse.y"
13976 {
13977 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
13978 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13979 /*% ripper: method_add_block!($:1, $:2) %*/
13980 }
13981#line 13982 "parse.c"
13982 break;
13983
13984 case 353: /* primary: k_if expr_value then compstmt if_tail k_end */
13985#line 4491 "parse.y"
13986 {
13987 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
13988 fixpos((yyval.node), (yyvsp[-4].node));
13989 /*% ripper: if!($:2, $:4, $:5) %*/
13990 }
13991#line 13992 "parse.c"
13992 break;
13993
13994 case 354: /* primary: k_unless expr_value then compstmt opt_else k_end */
13995#line 4500 "parse.y"
13996 {
13997 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc), &(yylsp[-5]), &(yylsp[-3]), &(yylsp[0]));
13998 fixpos((yyval.node), (yyvsp[-4].node));
13999 /*% ripper: unless!($:2, $:4, $:5) %*/
14000 }
14001#line 14002 "parse.c"
14002 break;
14003
14004 case 355: /* primary: k_while expr_value_do compstmt k_end */
14005#line 4508 "parse.y"
14006 {
14007 restore_block_exit(p, (yyvsp[-3].node_exits));
14008 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc), &(yylsp[-3]), &(yylsp[0]));
14009 fixpos((yyval.node), (yyvsp[-2].node));
14010 /*% ripper: while!($:2, $:3) %*/
14011 }
14012#line 14013 "parse.c"
14013 break;
14014
14015 case 356: /* primary: k_until expr_value_do compstmt k_end */
14016#line 4517 "parse.y"
14017 {
14018 restore_block_exit(p, (yyvsp[-3].node_exits));
14019 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc), &(yylsp[-3]), &(yylsp[0]));
14020 fixpos((yyval.node), (yyvsp[-2].node));
14021 /*% ripper: until!($:2, $:3) %*/
14022 }
14023#line 14024 "parse.c"
14024 break;
14025
14026 case 357: /* @16: %empty */
14027#line 4524 "parse.y"
14028 {
14029 (yyval.labels) = p->case_labels;
14030 p->case_labels = CHECK_LITERAL_WHEN;
14031 }
14032#line 14033 "parse.c"
14033 break;
14034
14035 case 358: /* primary: k_case expr_value option_terms @16 case_body k_end */
14036#line 4530 "parse.y"
14037 {
14038 if (CASE_LABELS_ENABLED_P(p->case_labels)) st_free_table(p->case_labels);
14039 p->case_labels = (yyvsp[-2].labels);
14040 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc), &(yylsp[-5]), &(yylsp[0]));
14041 fixpos((yyval.node), (yyvsp[-4].node));
14042 /*% ripper: case!($:2, $:5) %*/
14043 }
14044#line 14045 "parse.c"
14045 break;
14046
14047 case 359: /* @17: %empty */
14048#line 4538 "parse.y"
14049 {
14050 (yyval.labels) = p->case_labels;
14051 p->case_labels = 0;
14052 }
14053#line 14054 "parse.c"
14054 break;
14055
14056 case 360: /* primary: k_case option_terms @17 case_body k_end */
14057#line 4544 "parse.y"
14058 {
14059 if (p->case_labels) st_free_table(p->case_labels);
14060 p->case_labels = (yyvsp[-2].labels);
14061 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc), &(yylsp[-4]), &(yylsp[0]));
14062 /*% ripper: case!(Qnil, $:4) %*/
14063 }
14064#line 14065 "parse.c"
14065 break;
14066
14067 case 361: /* primary: k_case expr_value option_terms p_case_body k_end */
14068#line 4553 "parse.y"
14069 {
14070 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc), &(yylsp[-4]), &(yylsp[0]));
14071 /*% ripper: case!($:2, $:4) %*/
14072 }
14073#line 14074 "parse.c"
14074 break;
14075
14076 case 362: /* primary: k_for for_var "'in'" expr_value_do compstmt k_end */
14077#line 4560 "parse.y"
14078 {
14079 restore_block_exit(p, (yyvsp[-5].node_exits));
14080 /*
14081 * for a, b, c in e
14082 * #=>
14083 * e.each{|*x| a, b, c = x}
14084 *
14085 * for a in e
14086 * #=>
14087 * e.each{|x| a, = x}
14088 */
14089 ID id = internal_id(p);
14090 rb_node_args_aux_t *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
14091 rb_node_args_t *args;
14092 NODE *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
14093 rb_ast_id_table_t *tbl = rb_ast_new_local_table(p->ast, 1);
14094 tbl->ids[0] = id; /* internal id */
14095
14096 switch (nd_type((yyvsp[-4].node))) {
14097 case NODE_LASGN:
14098 case NODE_DASGN: /* e.each {|internal_var| a = internal_var; ... } */
14099 set_nd_value(p, (yyvsp[-4].node), internal_var);
14100 id = 0;
14101 m->nd_plen = 1;
14102 m->nd_next = (yyvsp[-4].node);
14103 break;
14104 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
14105 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
14106 break;
14107 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
14108 m->nd_next = node_assign(p, (NODE *)NEW_MASGN(NEW_LIST((yyvsp[-4].node), &(yylsp[-4])), 0, &(yylsp[-4])), internal_var, NO_LEX_CTXT, &(yylsp[-4]));
14109 }
14110 /* {|*internal_id| <m> = internal_id; ... } */
14111 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
14112 scope = NEW_SCOPE2(tbl, args, (yyvsp[-1].node), &(yyloc));
14113 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
14114 fixpos((yyval.node), (yyvsp[-4].node));
14115 /*% ripper: for!($:2, $:4, $:5) %*/
14116 }
14117#line 14118 "parse.c"
14118 break;
14119
14120 case 363: /* $@18: %empty */
14121#line 4600 "parse.y"
14122 {
14123 begin_definition("class", &(yylsp[-2]), &(yylsp[-1]));
14124 }
14125#line 14126 "parse.c"
14126 break;
14127
14128 case 364: /* primary: k_class cpath superclass $@18 bodystmt k_end */
14129#line 4605 "parse.y"
14130 {
14131 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
14132 nd_set_line(RNODE_CLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14133 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
14134 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
14135 /*% ripper: class!($:cpath, $:superclass, $:bodystmt) %*/
14136 local_pop(p);
14137 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
14138 p->ctxt.cant_return = (yyvsp[-5].ctxt).cant_return;
14139 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
14140 }
14141#line 14142 "parse.c"
14142 break;
14143
14144 case 365: /* $@19: %empty */
14145#line 4617 "parse.y"
14146 {
14147 begin_definition("", &(yylsp[-2]), &(yylsp[-1]));
14148 }
14149#line 14150 "parse.c"
14150 break;
14151
14152 case 366: /* primary: k_class "<<" expr_value $@19 term bodystmt k_end */
14153#line 4623 "parse.y"
14154 {
14155 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
14156 nd_set_line(RNODE_SCLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14157 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
14158 fixpos((yyval.node), (yyvsp[-4].node));
14159 /*% ripper: sclass!($:expr_value, $:bodystmt) %*/
14160 local_pop(p);
14161 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
14162 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
14163 p->ctxt.cant_return = (yyvsp[-6].ctxt).cant_return;
14164 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
14165 }
14166#line 14167 "parse.c"
14167 break;
14168
14169 case 367: /* $@20: %empty */
14170#line 4636 "parse.y"
14171 {
14172 begin_definition("module", &(yylsp[-1]), &(yylsp[0]));
14173 }
14174#line 14175 "parse.c"
14175 break;
14176
14177 case 368: /* primary: k_module cpath $@20 bodystmt k_end */
14178#line 4641 "parse.y"
14179 {
14180 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14181 nd_set_line(RNODE_MODULE((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14182 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
14183 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
14184 /*% ripper: module!($:cpath, $:bodystmt) %*/
14185 local_pop(p);
14186 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
14187 p->ctxt.cant_return = (yyvsp[-4].ctxt).cant_return;
14188 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
14189 }
14190#line 14191 "parse.c"
14191 break;
14192
14193 case 369: /* $@21: %empty */
14194#line 4654 "parse.y"
14195 {
14196 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14197 }
14198#line 14199 "parse.c"
14199 break;
14200
14201 case 370: /* primary: defn_head f_arglist $@21 bodystmt k_end */
14202#line 4659 "parse.y"
14203 {
14204 restore_defun(p, (yyvsp[-4].node_def_temp));
14205 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
14206 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
14207 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[-1].node);
14208 /*% ripper: def!($:head, $:args, $:bodystmt) %*/
14209 local_pop(p);
14210 }
14211#line 14212 "parse.c"
14212 break;
14213
14214 case 371: /* $@22: %empty */
14215#line 4669 "parse.y"
14216 {
14217 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14218 }
14219#line 14220 "parse.c"
14220 break;
14221
14222 case 372: /* primary: defs_head f_arglist $@22 bodystmt k_end */
14223#line 4674 "parse.y"
14224 {
14225 restore_defun(p, (yyvsp[-4].node_def_temp));
14226 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
14227 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
14228 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[-1].node);
14229 /*% ripper: defs!(*$:head[0..2], $:args, $:bodystmt) %*/
14230 local_pop(p);
14231 }
14232#line 14233 "parse.c"
14233 break;
14234
14235 case 373: /* primary: "'break'" */
14236#line 4683 "parse.y"
14237 {
14238 (yyval.node) = add_block_exit(p, NEW_BREAK(0, &(yyloc), &(yylsp[0])));
14239 /*% ripper: break!(args_new!) %*/
14240 }
14241#line 14242 "parse.c"
14242 break;
14243
14244 case 374: /* primary: "'next'" */
14245#line 4688 "parse.y"
14246 {
14247 (yyval.node) = add_block_exit(p, NEW_NEXT(0, &(yyloc), &(yylsp[0])));
14248 /*% ripper: next!(args_new!) %*/
14249 }
14250#line 14251 "parse.c"
14251 break;
14252
14253 case 375: /* primary: "'redo'" */
14254#line 4693 "parse.y"
14255 {
14256 (yyval.node) = add_block_exit(p, NEW_REDO(&(yyloc), &(yylsp[0])));
14257 /*% ripper: redo! %*/
14258 }
14259#line 14260 "parse.c"
14260 break;
14261
14262 case 376: /* primary: "'retry'" */
14263#line 4698 "parse.y"
14264 {
14265 if (!p->ctxt.in_defined) {
14266 switch (p->ctxt.in_rescue) {
14267 case before_rescue: yyerror1(&(yylsp[0]), "Invalid retry without rescue"); break;
14268 case after_rescue: /* ok */ break;
14269 case after_else: yyerror1(&(yylsp[0]), "Invalid retry after else"); break;
14270 case after_ensure: yyerror1(&(yylsp[0]), "Invalid retry after ensure"); break;
14271 }
14272 }
14273 (yyval.node) = NEW_RETRY(&(yyloc));
14274 /*% ripper: retry! %*/
14275 }
14276#line 14277 "parse.c"
14277 break;
14278
14279 case 377: /* primary_value: primary */
14280#line 4713 "parse.y"
14281 {
14282 value_expr((yyvsp[0].node));
14283 (yyval.node) = (yyvsp[0].node);
14284 }
14285#line 14286 "parse.c"
14286 break;
14287
14288 case 378: /* k_begin: "'begin'" */
14289#line 4720 "parse.y"
14290 {
14291 token_info_push(p, "begin", &(yyloc));
14292 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14293 }
14294#line 14295 "parse.c"
14295 break;
14296
14297 case 379: /* k_if: "'if'" */
14298#line 4727 "parse.y"
14299 {
14300 WARN_EOL("if");
14301 token_info_push(p, "if", &(yyloc));
14302 if (p->token_info && p->token_info->nonspc &&
14303 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
14304 const char *tok = p->lex.ptok - rb_strlen_lit("if");
14305 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
14306 beg += rb_strlen_lit("else");
14307 while (beg < tok && ISSPACE(*beg)) beg++;
14308 if (beg == tok) {
14309 p->token_info->nonspc = 0;
14310 }
14311 }
14312 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14313 }
14314#line 14315 "parse.c"
14315 break;
14316
14317 case 380: /* k_unless: "'unless'" */
14318#line 4745 "parse.y"
14319 {
14320 token_info_push(p, "unless", &(yyloc));
14321 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14322 }
14323#line 14324 "parse.c"
14324 break;
14325
14326 case 381: /* k_while: "'while'" allow_exits */
14327#line 4752 "parse.y"
14328 {
14329 (yyval.node_exits) = (yyvsp[0].node_exits);
14330 token_info_push(p, "while", &(yyloc));
14331 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14332 }
14333#line 14334 "parse.c"
14334 break;
14335
14336 case 382: /* k_until: "'until'" allow_exits */
14337#line 4760 "parse.y"
14338 {
14339 (yyval.node_exits) = (yyvsp[0].node_exits);
14340 token_info_push(p, "until", &(yyloc));
14341 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14342 }
14343#line 14344 "parse.c"
14344 break;
14345
14346 case 383: /* k_case: "'case'" */
14347#line 4768 "parse.y"
14348 {
14349 token_info_push(p, "case", &(yyloc));
14350 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14351 }
14352#line 14353 "parse.c"
14353 break;
14354
14355 case 384: /* k_for: "'for'" allow_exits */
14356#line 4775 "parse.y"
14357 {
14358 (yyval.node_exits) = (yyvsp[0].node_exits);
14359 token_info_push(p, "for", &(yyloc));
14360 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14361 }
14362#line 14363 "parse.c"
14363 break;
14364
14365 case 385: /* k_class: "'class'" */
14366#line 4783 "parse.y"
14367 {
14368 token_info_push(p, "class", &(yyloc));
14369 (yyval.ctxt) = p->ctxt;
14370 p->ctxt.in_rescue = before_rescue;
14371 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14372 }
14373#line 14374 "parse.c"
14374 break;
14375
14376 case 386: /* k_module: "'module'" */
14377#line 4792 "parse.y"
14378 {
14379 token_info_push(p, "module", &(yyloc));
14380 (yyval.ctxt) = p->ctxt;
14381 p->ctxt.in_rescue = before_rescue;
14382 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14383 }
14384#line 14385 "parse.c"
14385 break;
14386
14387 case 387: /* k_def: "'def'" */
14388#line 4801 "parse.y"
14389 {
14390 token_info_push(p, "def", &(yyloc));
14391 (yyval.node_def_temp) = NEW_DEF_TEMP(&(yyloc));
14392 p->ctxt.in_argdef = 1;
14393 }
14394#line 14395 "parse.c"
14395 break;
14396
14397 case 388: /* k_do: "'do'" */
14398#line 4809 "parse.y"
14399 {
14400 token_info_push(p, "do", &(yyloc));
14401 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14402 }
14403#line 14404 "parse.c"
14404 break;
14405
14406 case 389: /* k_do_block: "'do' for block" */
14407#line 4816 "parse.y"
14408 {
14409 token_info_push(p, "do", &(yyloc));
14410 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14411 }
14412#line 14413 "parse.c"
14413 break;
14414
14415 case 390: /* k_rescue: "'rescue'" */
14416#line 4823 "parse.y"
14417 {
14418 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
14419 (yyval.ctxt) = p->ctxt;
14420 p->ctxt.in_rescue = after_rescue;
14421 }
14422#line 14423 "parse.c"
14423 break;
14424
14425 case 391: /* k_ensure: "'ensure'" */
14426#line 4831 "parse.y"
14427 {
14428 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
14429 (yyval.ctxt) = p->ctxt;
14430 }
14431#line 14432 "parse.c"
14432 break;
14433
14434 case 392: /* k_when: "'when'" */
14435#line 4838 "parse.y"
14436 {
14437 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
14438 }
14439#line 14440 "parse.c"
14440 break;
14441
14442 case 393: /* k_else: "'else'" */
14443#line 4844 "parse.y"
14444 {
14445 token_info *ptinfo_beg = p->token_info;
14446 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
14447 token_info_warn(p, "else", p->token_info, same, &(yyloc));
14448 if (same) {
14449 token_info e;
14450 e.next = ptinfo_beg->next;
14451 e.token = "else";
14452 token_info_setup(&e, p->lex.pbeg, &(yyloc));
14453 if (!e.nonspc) *ptinfo_beg = e;
14454 }
14455 }
14456#line 14457 "parse.c"
14457 break;
14458
14459 case 394: /* k_elsif: "'elsif'" */
14460#line 4859 "parse.y"
14461 {
14462 WARN_EOL("elsif");
14463 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
14464 }
14465#line 14466 "parse.c"
14466 break;
14467
14468 case 395: /* k_end: "'end'" */
14469#line 4866 "parse.y"
14470 {
14471 token_info_pop(p, "end", &(yyloc));
14472 pop_end_expect_token_locations(p);
14473 }
14474#line 14475 "parse.c"
14475 break;
14476
14477 case 396: /* k_end: "dummy end" */
14478#line 4871 "parse.y"
14479 {
14480 compile_error(p, "syntax error, unexpected end-of-input");
14481 }
14482#line 14483 "parse.c"
14483 break;
14484
14485 case 397: /* k_return: "'return'" */
14486#line 4877 "parse.y"
14487 {
14488 if (p->ctxt.cant_return && !dyna_in_block(p))
14489 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
14490 }
14491#line 14492 "parse.c"
14492 break;
14493
14494 case 398: /* k_yield: "'yield'" */
14495#line 4884 "parse.y"
14496 {
14497 if (!p->ctxt.in_defined && !p->ctxt.in_def && !compile_for_eval)
14498 yyerror1(&(yylsp[0]), "Invalid yield");
14499 }
14500#line 14501 "parse.c"
14501 break;
14502
14503 case 405: /* if_tail: k_elsif expr_value then compstmt if_tail */
14504#line 4903 "parse.y"
14505 {
14506 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14507 fixpos((yyval.node), (yyvsp[-3].node));
14508 /*% ripper: elsif!($:2, $:4, $:5) %*/
14509 }
14510#line 14511 "parse.c"
14511 break;
14512
14513 case 407: /* opt_else: k_else compstmt */
14514#line 4912 "parse.y"
14515 {
14516 (yyval.node) = (yyvsp[0].node);
14517 /*% ripper: else!($:2) %*/
14518 }
14519#line 14520 "parse.c"
14520 break;
14521
14522 case 410: /* f_marg: f_norm_arg */
14523#line 4923 "parse.y"
14524 {
14525 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14526 mark_lvar_used(p, (yyval.node));
14527 }
14528#line 14529 "parse.c"
14529 break;
14530
14531 case 411: /* f_marg: "(" f_margs rparen */
14532#line 4928 "parse.y"
14533 {
14534 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
14535 /*% ripper: mlhs_paren!($:2) %*/
14536 }
14537#line 14538 "parse.c"
14538 break;
14539
14540 case 412: /* f_marg_list: f_marg */
14541#line 4935 "parse.y"
14542 {
14543 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14544 /*% ripper: mlhs_add!(mlhs_new!, $:1) %*/
14545 }
14546#line 14547 "parse.c"
14547 break;
14548
14549 case 413: /* f_marg_list: f_marg_list ',' f_marg */
14550#line 4940 "parse.y"
14551 {
14552 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
14553 /*% ripper: mlhs_add!($:1, $:3) %*/
14554 }
14555#line 14556 "parse.c"
14556 break;
14557
14558 case 414: /* f_margs: f_marg_list */
14559#line 4947 "parse.y"
14560 {
14561 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
14562 /*% ripper: $:1 %*/
14563 }
14564#line 14565 "parse.c"
14565 break;
14566
14567 case 415: /* f_margs: f_marg_list ',' f_rest_marg */
14568#line 4952 "parse.y"
14569 {
14570 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14571 /*% ripper: mlhs_add_star!($:1, $:3) %*/
14572 }
14573#line 14574 "parse.c"
14574 break;
14575
14576 case 416: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
14577#line 4957 "parse.y"
14578 {
14579 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
14580 /*% ripper: mlhs_add_post!(mlhs_add_star!($:1, $:3), $:5) %*/
14581 }
14582#line 14583 "parse.c"
14583 break;
14584
14585 case 417: /* f_margs: f_rest_marg */
14586#line 4962 "parse.y"
14587 {
14588 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
14589 /*% ripper: mlhs_add_star!(mlhs_new!, $:1) %*/
14590 }
14591#line 14592 "parse.c"
14592 break;
14593
14594 case 418: /* f_margs: f_rest_marg ',' f_marg_list */
14595#line 4967 "parse.y"
14596 {
14597 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
14598 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $:1), $:3) %*/
14599 }
14600#line 14601 "parse.c"
14601 break;
14602
14603 case 419: /* f_rest_marg: "*" f_norm_arg */
14604#line 4974 "parse.y"
14605 {
14606 /*% ripper: $:2 %*/
14607 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14608 mark_lvar_used(p, (yyval.node));
14609 }
14610#line 14611 "parse.c"
14611 break;
14612
14613 case 420: /* f_rest_marg: "*" */
14614#line 4980 "parse.y"
14615 {
14616 (yyval.node) = NODE_SPECIAL_NO_NAME_REST;
14617 /*% ripper: Qnil %*/
14618 }
14619#line 14620 "parse.c"
14620 break;
14621
14622 case 422: /* f_any_kwrest: f_no_kwarg */
14623#line 4988 "parse.y"
14624 {
14625 (yyval.id) = idNil;
14626 /*% ripper: ID2VAL(idNil) %*/
14627 }
14628#line 14629 "parse.c"
14629 break;
14630
14631 case 423: /* $@23: %empty */
14632#line 4994 "parse.y"
14633 {p->ctxt.in_argdef = 0;}
14634#line 14635 "parse.c"
14635 break;
14636
14637 case 425: /* f_kwarg_f_block_kw: f_block_kw */
14638#line 2934 "parse.y"
14639 {
14640 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
14641 /*% ripper: rb_ary_new3(1, $:1) %*/
14642 }
14643#line 14644 "parse.c"
14644 break;
14645
14646 case 426: /* f_kwarg_f_block_kw: f_kwarg_f_block_kw ',' f_block_kw */
14647#line 2939 "parse.y"
14648 {
14649 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
14650 /*% ripper: rb_ary_push($:1, $:3) %*/
14651 }
14652#line 14653 "parse.c"
14653 break;
14654
14655 case 427: /* block_args_tail: f_kwarg_f_block_kw ',' f_kwrest opt_f_block_arg */
14656#line 4997 "parse.y"
14657 {
14658 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
14659 /*% ripper: [$:1, $:3, $:4] %*/
14660 }
14661#line 14662 "parse.c"
14662 break;
14663
14664 case 428: /* block_args_tail: f_kwarg_f_block_kw opt_f_block_arg */
14665#line 5002 "parse.y"
14666 {
14667 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), 0, (yyvsp[0].id), &(yylsp[-1]));
14668 /*% ripper: [$:1, Qnil, $:2] %*/
14669 }
14670#line 14671 "parse.c"
14671 break;
14672
14673 case 429: /* block_args_tail: f_any_kwrest opt_f_block_arg */
14674#line 5007 "parse.y"
14675 {
14676 (yyval.node_args) = new_args_tail(p, 0, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
14677 /*% ripper: [Qnil, $:1, $:2] %*/
14678 }
14679#line 14680 "parse.c"
14680 break;
14681
14682 case 430: /* block_args_tail: f_block_arg */
14683#line 5012 "parse.y"
14684 {
14685 (yyval.node_args) = new_args_tail(p, 0, 0, (yyvsp[0].id), &(yylsp[0]));
14686 /*% ripper: [Qnil, Qnil, $:1] %*/
14687 }
14688#line 14689 "parse.c"
14689 break;
14690
14691 case 431: /* excessed_comma: ',' */
14692#line 5019 "parse.y"
14693 {
14694 /* magic number for rest_id in iseq_set_arguments() */
14695 (yyval.id) = NODE_SPECIAL_EXCESSIVE_COMMA;
14696 /*% ripper: excessed_comma! %*/
14697 }
14698#line 14699 "parse.c"
14699 break;
14700
14701 case 432: /* f_opt_primary_value: f_arg_asgn f_eq primary_value */
14702#line 2912 "parse.y"
14703 {
14704 p->ctxt.in_argdef = 1;
14705 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
14706 /*% ripper: [$:$, $:3] %*/
14707 }
14708#line 14709 "parse.c"
14709 break;
14710
14711 case 433: /* f_optarg_primary_value: f_opt_primary_value */
14712#line 2921 "parse.y"
14713 {
14714 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
14715 /*% ripper: rb_ary_new3(1, $:1) %*/
14716 }
14717#line 14718 "parse.c"
14718 break;
14719
14720 case 434: /* f_optarg_primary_value: f_optarg_primary_value ',' f_opt_primary_value */
14721#line 2926 "parse.y"
14722 {
14723 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
14724 /*% ripper: rb_ary_push($:1, $:3) %*/
14725 }
14726#line 14727 "parse.c"
14727 break;
14728
14729 case 435: /* opt_args_tail_block_args_tail: ',' block_args_tail */
14730#line 2947 "parse.y"
14731 {
14732 (yyval.node_args) = (yyvsp[0].node_args);
14733 /*% ripper: $:2 %*/
14734 }
14735#line 14736 "parse.c"
14736 break;
14737
14738 case 436: /* opt_args_tail_block_args_tail: %empty */
14739#line 2952 "parse.y"
14740 {
14741 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
14742 /*% ripper: [Qnil, Qnil, Qnil] %*/
14743 }
14744#line 14745 "parse.c"
14745 break;
14746
14747 case 437: /* block_param: f_arg ',' f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail */
14748#line 5027 "parse.y"
14749 {
14750 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
14751 /*% ripper: params!($:1, $:3, $:5, Qnil, *$:6[0..2]) %*/
14752 }
14753#line 14754 "parse.c"
14754 break;
14755
14756 case 438: /* block_param: f_arg ',' f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14757#line 5032 "parse.y"
14758 {
14759 (yyval.node_args) = new_args(p, (yyvsp[-7].node_args_aux), (yyvsp[-5].node_opt_arg), (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14760 /*% ripper: params!($:1, $:3, $:5, $:7, *$:8[0..2]) %*/
14761 }
14762#line 14763 "parse.c"
14763 break;
14764
14765 case 439: /* block_param: f_arg ',' f_optarg_primary_value opt_args_tail_block_args_tail */
14766#line 5037 "parse.y"
14767 {
14768 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
14769 /*% ripper: params!($:1, $:3, Qnil, Qnil, *$:4[0..2]) %*/
14770 }
14771#line 14772 "parse.c"
14772 break;
14773
14774 case 440: /* block_param: f_arg ',' f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail */
14775#line 5042 "parse.y"
14776 {
14777 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), 0, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14778 /*% ripper: params!($:1, $:3, Qnil, $:5, *$:6[0..2]) %*/
14779 }
14780#line 14781 "parse.c"
14781 break;
14782
14783 case 441: /* block_param: f_arg ',' f_rest_arg opt_args_tail_block_args_tail */
14784#line 5047 "parse.y"
14785 {
14786 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
14787 /*% ripper: params!($:1, Qnil, $:3, Qnil, *$:4[0..2]) %*/
14788 }
14789#line 14790 "parse.c"
14790 break;
14791
14792 case 442: /* block_param: f_arg excessed_comma */
14793#line 5052 "parse.y"
14794 {
14795 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
14796 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), 0, (yyvsp[0].id), 0, (yyval.node_args), &(yyloc));
14797 /*% ripper: params!($:1, Qnil, $:2, Qnil, Qnil, Qnil, Qnil) %*/
14798 }
14799#line 14800 "parse.c"
14800 break;
14801
14802 case 443: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14803#line 5058 "parse.y"
14804 {
14805 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), 0, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14806 /*% ripper: params!($:1, Qnil, $:3, $:5, *$:6[0..2]) %*/
14807 }
14808#line 14809 "parse.c"
14809 break;
14810
14811 case 444: /* block_param: f_arg opt_args_tail_block_args_tail */
14812#line 5063 "parse.y"
14813 {
14814 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
14815 /*% ripper: params!($:1, Qnil, Qnil, Qnil, *$:2[0..2]) %*/
14816 }
14817#line 14818 "parse.c"
14818 break;
14819
14820 case 445: /* block_param: f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail */
14821#line 5068 "parse.y"
14822 {
14823 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
14824 /*% ripper: params!(Qnil, $:1, $:3, Qnil, *$:4[0..2]) %*/
14825 }
14826#line 14827 "parse.c"
14827 break;
14828
14829 case 446: /* block_param: f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14830#line 5073 "parse.y"
14831 {
14832 (yyval.node_args) = new_args(p, 0, (yyvsp[-5].node_opt_arg), (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14833 /*% ripper: params!(Qnil, $:1, $:3, $:5, *$:6[0..2]) %*/
14834 }
14835#line 14836 "parse.c"
14836 break;
14837
14838 case 447: /* block_param: f_optarg_primary_value opt_args_tail_block_args_tail */
14839#line 5078 "parse.y"
14840 {
14841 (yyval.node_args) = new_args(p, 0, (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
14842 /*% ripper: params!(Qnil, $:1, Qnil, Qnil, *$:2[0..2]) %*/
14843 }
14844#line 14845 "parse.c"
14845 break;
14846
14847 case 448: /* block_param: f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail */
14848#line 5083 "parse.y"
14849 {
14850 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), 0, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14851 /*% ripper: params!(Qnil, $:1, Qnil, $:3, *$:4[0..2]) %*/
14852 }
14853#line 14854 "parse.c"
14854 break;
14855
14856 case 449: /* block_param: f_rest_arg opt_args_tail_block_args_tail */
14857#line 5088 "parse.y"
14858 {
14859 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
14860 /*% ripper: params!(Qnil, Qnil, $:1, Qnil, *$:2[0..2]) %*/
14861 }
14862#line 14863 "parse.c"
14863 break;
14864
14865 case 450: /* block_param: f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14866#line 5093 "parse.y"
14867 {
14868 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14869 /*% ripper: params!(Qnil, Qnil, $:1, $:3, *$:4[0..2]) %*/
14870 }
14871#line 14872 "parse.c"
14872 break;
14873
14874 case 451: /* block_param: block_args_tail */
14875#line 5098 "parse.y"
14876 {
14877 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
14878 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, *$:1[0..2]) %*/
14879 }
14880#line 14881 "parse.c"
14881 break;
14882
14883 case 453: /* opt_block_param: block_param_def */
14884#line 5106 "parse.y"
14885 {
14886 p->command_start = TRUE;
14887 }
14888#line 14889 "parse.c"
14889 break;
14890
14891 case 454: /* block_param_def: '|' opt_bv_decl '|' */
14892#line 5112 "parse.y"
14893 {
14894 p->max_numparam = ORDINAL_PARAM;
14895 p->ctxt.in_argdef = 0;
14896 (yyval.node_args) = 0;
14897 /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), $:2) %*/
14898 }
14899#line 14900 "parse.c"
14900 break;
14901
14902 case 455: /* block_param_def: '|' block_param opt_bv_decl '|' */
14903#line 5119 "parse.y"
14904 {
14905 p->max_numparam = ORDINAL_PARAM;
14906 p->ctxt.in_argdef = 0;
14907 (yyval.node_args) = (yyvsp[-2].node_args);
14908 /*% ripper: block_var!($:2, $:3) %*/
14909 }
14910#line 14911 "parse.c"
14911 break;
14912
14913 case 456: /* opt_bv_decl: option_'\n' */
14914#line 5129 "parse.y"
14915 {
14916 (yyval.id) = 0;
14917 /*% ripper: Qfalse %*/
14918 }
14919#line 14920 "parse.c"
14920 break;
14921
14922 case 457: /* opt_bv_decl: option_'\n' ';' bv_decls option_'\n' */
14923#line 5134 "parse.y"
14924 {
14925 (yyval.id) = 0;
14926 /*% ripper: $:3 %*/
14927 }
14928#line 14929 "parse.c"
14929 break;
14930
14931 case 460: /* bvar: "local variable or method" */
14932#line 5147 "parse.y"
14933 {
14934 new_bv(p, (yyvsp[0].id));
14935 /*% ripper: $:1 %*/
14936 }
14937#line 14938 "parse.c"
14938 break;
14939
14940 case 461: /* bvar: f_bad_arg */
14941#line 5152 "parse.y"
14942 {
14943 (yyval.id) = 0;
14944 }
14945#line 14946 "parse.c"
14946 break;
14947
14948 case 462: /* max_numparam: %empty */
14949#line 5157 "parse.y"
14950 {
14951 (yyval.num) = p->max_numparam;
14952 p->max_numparam = 0;
14953 }
14954#line 14955 "parse.c"
14955 break;
14956
14957 case 463: /* numparam: %empty */
14958#line 5163 "parse.y"
14959 {
14960 (yyval.node) = numparam_push(p);
14961 }
14962#line 14963 "parse.c"
14963 break;
14964
14965 case 464: /* it_id: %empty */
14966#line 5168 "parse.y"
14967 {
14968 (yyval.id) = p->it_id;
14969 p->it_id = 0;
14970 }
14971#line 14972 "parse.c"
14972 break;
14973
14974 case 465: /* @24: %empty */
14975#line 5175 "parse.y"
14976 {
14977 token_info_push(p, "->", &(yylsp[0]));
14978 (yyval.vars) = dyna_push(p);
14979 }
14980#line 14981 "parse.c"
14981 break;
14982
14983 case 466: /* $@25: %empty */
14984#line 5181 "parse.y"
14985 {
14986 CMDARG_PUSH(0);
14987 }
14988#line 14989 "parse.c"
14989 break;
14990
14991 case 467: /* lambda: "->" @24 max_numparam numparam it_id allow_exits f_larglist $@25 lambda_body */
14992#line 5185 "parse.y"
14993 {
14994 int max_numparam = p->max_numparam;
14995 ID it_id = p->it_id;
14996 p->lex.lpar_beg = (yyvsp[-8].num);
14997 p->max_numparam = (yyvsp[-6].num);
14998 p->it_id = (yyvsp[-4].id);
14999 restore_block_exit(p, (yyvsp[-3].node_exits));
15000 CMDARG_POP();
15001 (yyvsp[-2].node_args) = args_with_numbered(p, (yyvsp[-2].node_args), max_numparam, it_id);
15002 {
15003 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
15004 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node_args), (yyvsp[0].node), &loc);
15005 nd_set_line(RNODE_LAMBDA((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
15006 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
15007 nd_set_first_loc((yyval.node), (yylsp[-8]).beg_pos);
15008 }
15009 /*% ripper: lambda!($:args, $:body) %*/
15010 numparam_pop(p, (yyvsp[-5].node));
15011 dyna_pop(p, (yyvsp[-7].vars));
15012 }
15013#line 15014 "parse.c"
15014 break;
15015
15016 case 468: /* f_larglist: '(' f_args opt_bv_decl ')' */
15017#line 5208 "parse.y"
15018 {
15019 p->ctxt.in_argdef = 0;
15020 (yyval.node_args) = (yyvsp[-2].node_args);
15021 p->max_numparam = ORDINAL_PARAM;
15022 /*% ripper: paren!($:2) %*/
15023 }
15024#line 15025 "parse.c"
15025 break;
15026
15027 case 469: /* f_larglist: f_args */
15028#line 5215 "parse.y"
15029 {
15030 p->ctxt.in_argdef = 0;
15031 if (!args_info_empty_p(&(yyvsp[0].node_args)->nd_ainfo))
15032 p->max_numparam = ORDINAL_PARAM;
15033 (yyval.node_args) = (yyvsp[0].node_args);
15034 }
15035#line 15036 "parse.c"
15036 break;
15037
15038 case 470: /* lambda_body: tLAMBEG compstmt '}' */
15039#line 5224 "parse.y"
15040 {
15041 token_info_pop(p, "}", &(yylsp[0]));
15042 (yyval.node) = (yyvsp[-1].node);
15043 /*% ripper: $:2 %*/
15044 }
15045#line 15046 "parse.c"
15046 break;
15047
15048 case 471: /* $@26: %empty */
15049#line 5230 "parse.y"
15050 {
15051 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
15052 }
15053#line 15054 "parse.c"
15054 break;
15055
15056 case 472: /* lambda_body: "'do' for lambda" $@26 bodystmt k_end */
15057#line 5234 "parse.y"
15058 {
15059 (yyval.node) = (yyvsp[-1].node);
15060 /*% ripper: $:3 %*/
15061 }
15062#line 15063 "parse.c"
15063 break;
15064
15065 case 473: /* do_block: k_do_block do_body k_end */
15066#line 5241 "parse.y"
15067 {
15068 (yyval.node) = (yyvsp[-1].node);
15069 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
15070 /*% ripper: $:2 %*/
15071 }
15072#line 15073 "parse.c"
15073 break;
15074
15075 case 474: /* block_call: command do_block */
15076#line 5249 "parse.y"
15077 {
15078 if (nd_type_p((yyvsp[-1].node), NODE_YIELD)) {
15079 compile_error(p, "block given to yield");
15080 }
15081 else {
15082 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
15083 }
15084 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15085 fixpos((yyval.node), (yyvsp[-1].node));
15086 /*% ripper: method_add_block!($:1, $:2) %*/
15087 }
15088#line 15089 "parse.c"
15089 break;
15090
15091 case 475: /* block_call: block_call call_op2 operation2 opt_paren_args */
15092#line 5261 "parse.y"
15093 {
15094 bool has_args = (yyvsp[0].node) != 0;
15095 if (NODE_EMPTY_ARGS_P((yyvsp[0].node))) (yyvsp[0].node) = 0;
15096 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15097 /*% ripper: call!($:1, $:2, $:3) %*/
15098 if (has_args) {
15099 /*% ripper: method_add_arg!($:$, $:4) %*/
15100 }
15101 }
15102#line 15103 "parse.c"
15103 break;
15104
15105 case 476: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
15106#line 5271 "parse.y"
15107 {
15108 if (NODE_EMPTY_ARGS_P((yyvsp[-1].node))) (yyvsp[-1].node) = 0;
15109 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
15110 /*% ripper: command_call!($:1, $:2, $:3, $:4) %*/
15111 if ((yyvsp[0].node)) {
15112 /*% ripper: method_add_block!($:$, $:5) %*/
15113 }
15114 }
15115#line 15116 "parse.c"
15116 break;
15117
15118 case 477: /* block_call: block_call call_op2 operation2 command_args do_block */
15119#line 5280 "parse.y"
15120 {
15121 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
15122 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, $:4), $:5) %*/
15123 }
15124#line 15125 "parse.c"
15125 break;
15126
15127 case 478: /* method_call: fcall paren_args */
15128#line 5287 "parse.y"
15129 {
15130 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
15131 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
15132 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
15133 /*% ripper: method_add_arg!(fcall!($:1), $:2) %*/
15134 }
15135#line 15136 "parse.c"
15136 break;
15137
15138 case 479: /* method_call: primary_value call_op operation2 opt_paren_args */
15139#line 5294 "parse.y"
15140 {
15141 bool has_args = (yyvsp[0].node) != 0;
15142 if (NODE_EMPTY_ARGS_P((yyvsp[0].node))) (yyvsp[0].node) = 0;
15143 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15144 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15145 /*% ripper: call!($:1, $:2, $:3) %*/
15146 if (has_args) {
15147 /*% ripper: method_add_arg!($:$, $:4) %*/
15148 }
15149 }
15150#line 15151 "parse.c"
15151 break;
15152
15153 case 480: /* method_call: primary_value "::" operation2 paren_args */
15154#line 5305 "parse.y"
15155 {
15156 (yyval.node) = new_qcall(p, idCOLON2, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15157 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15158 /*% ripper: method_add_arg!(call!($:1, $:2, $:3), $:4) %*/
15159 }
15160#line 15161 "parse.c"
15161 break;
15162
15163 case 481: /* method_call: primary_value "::" operation3 */
15164#line 5311 "parse.y"
15165 {
15166 (yyval.node) = new_qcall(p, idCOLON2, (yyvsp[-2].node), (yyvsp[0].id), 0, &(yylsp[0]), &(yyloc));
15167 /*% ripper: call!($:1, $:2, $:3) %*/
15168 }
15169#line 15170 "parse.c"
15170 break;
15171
15172 case 482: /* method_call: primary_value call_op paren_args */
15173#line 5316 "parse.y"
15174 {
15175 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), idCall, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15176 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15177 /*% ripper: method_add_arg!(call!($:1, $:2, ID2VAL(idCall)), $:3) %*/
15178 }
15179#line 15180 "parse.c"
15180 break;
15181
15182 case 483: /* method_call: primary_value "::" paren_args */
15183#line 5322 "parse.y"
15184 {
15185 (yyval.node) = new_qcall(p, idCOLON2, (yyvsp[-2].node), idCall, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15186 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15187 /*% ripper: method_add_arg!(call!($:1, $:2, ID2VAL(idCall)), $:3) %*/
15188 }
15189#line 15190 "parse.c"
15190 break;
15191
15192 case 484: /* method_call: "'super'" paren_args */
15193#line 5328 "parse.y"
15194 {
15195 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
15196 /*% ripper: super!($:2) %*/
15197 }
15198#line 15199 "parse.c"
15199 break;
15200
15201 case 485: /* method_call: "'super'" */
15202#line 5333 "parse.y"
15203 {
15204 (yyval.node) = NEW_ZSUPER(&(yyloc));
15205 /*% ripper: zsuper! %*/
15206 }
15207#line 15208 "parse.c"
15208 break;
15209
15210 case 486: /* method_call: primary_value '[' opt_call_args rbracket */
15211#line 5338 "parse.y"
15212 {
15213 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
15214 fixpos((yyval.node), (yyvsp[-3].node));
15215 /*% ripper: aref!($:1, $:3) %*/
15216 }
15217#line 15218 "parse.c"
15218 break;
15219
15220 case 487: /* brace_block: '{' brace_body '}' */
15221#line 5346 "parse.y"
15222 {
15223 (yyval.node) = (yyvsp[-1].node);
15224 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
15225 /*% ripper: $:2 %*/
15226 }
15227#line 15228 "parse.c"
15228 break;
15229
15230 case 488: /* brace_block: k_do do_body k_end */
15231#line 5352 "parse.y"
15232 {
15233 (yyval.node) = (yyvsp[-1].node);
15234 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
15235 /*% ripper: $:2 %*/
15236 }
15237#line 15238 "parse.c"
15238 break;
15239
15240 case 489: /* @27: %empty */
15241#line 5359 "parse.y"
15242 {(yyval.vars) = dyna_push(p);}
15243#line 15244 "parse.c"
15244 break;
15245
15246 case 490: /* brace_body: @27 max_numparam numparam it_id allow_exits opt_block_param compstmt */
15247#line 5362 "parse.y"
15248 {
15249 int max_numparam = p->max_numparam;
15250 ID it_id = p->it_id;
15251 p->max_numparam = (yyvsp[-5].num);
15252 p->it_id = (yyvsp[-3].id);
15253 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam, it_id);
15254 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
15255 /*% ripper: brace_block!($:args, $:compstmt) %*/
15256 restore_block_exit(p, (yyvsp[-2].node_exits));
15257 numparam_pop(p, (yyvsp[-4].node));
15258 dyna_pop(p, (yyvsp[-6].vars));
15259 }
15260#line 15261 "parse.c"
15261 break;
15262
15263 case 491: /* @28: %empty */
15264#line 5376 "parse.y"
15265 {
15266 (yyval.vars) = dyna_push(p);
15267 CMDARG_PUSH(0);
15268 }
15269#line 15270 "parse.c"
15270 break;
15271
15272 case 492: /* do_body: @28 max_numparam numparam it_id allow_exits opt_block_param bodystmt */
15273#line 5382 "parse.y"
15274 {
15275 int max_numparam = p->max_numparam;
15276 ID it_id = p->it_id;
15277 p->max_numparam = (yyvsp[-5].num);
15278 p->it_id = (yyvsp[-3].id);
15279 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam, it_id);
15280 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
15281 /*% ripper: do_block!($:args, $:bodystmt) %*/
15282 CMDARG_POP();
15283 restore_block_exit(p, (yyvsp[-2].node_exits));
15284 numparam_pop(p, (yyvsp[-4].node));
15285 dyna_pop(p, (yyvsp[-6].vars));
15286 }
15287#line 15288 "parse.c"
15288 break;
15289
15290 case 493: /* case_args: arg_value */
15291#line 5398 "parse.y"
15292 {
15293 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
15294 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
15295 /*% ripper: args_add!(args_new!, $:arg_value) %*/
15296 }
15297#line 15298 "parse.c"
15298 break;
15299
15300 case 494: /* case_args: "*" arg_value */
15301#line 5404 "parse.y"
15302 {
15303 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
15304 /*% ripper: args_add_star!(args_new!, $:arg_value) %*/
15305 }
15306#line 15307 "parse.c"
15307 break;
15308
15309 case 495: /* case_args: case_args ',' arg_value */
15310#line 5409 "parse.y"
15311 {
15312 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
15313 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15314 /*% ripper: args_add!($:non_last_args, $:arg_value) %*/
15315 }
15316#line 15317 "parse.c"
15317 break;
15318
15319 case 496: /* case_args: case_args ',' "*" arg_value */
15320#line 5415 "parse.y"
15321 {
15322 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
15323 /*% ripper: args_add_star!($:non_last_args, $:arg_value) %*/
15324 }
15325#line 15326 "parse.c"
15326 break;
15327
15328 case 497: /* case_body: k_when case_args then compstmt cases */
15329#line 5424 "parse.y"
15330 {
15331 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-2]));
15332 fixpos((yyval.node), (yyvsp[-3].node));
15333 /*% ripper: when!($:2, $:4, $:5) %*/
15334 }
15335#line 15336 "parse.c"
15336 break;
15337
15338 case 500: /* p_pvtbl: %empty */
15339#line 5435 "parse.y"
15340 {(yyval.tbl) = p->pvtbl; p->pvtbl = st_init_numtable();}
15341#line 15342 "parse.c"
15342 break;
15343
15344 case 501: /* p_pktbl: %empty */
15345#line 5436 "parse.y"
15346 {(yyval.tbl) = p->pktbl; p->pktbl = 0;}
15347#line 15348 "parse.c"
15348 break;
15349
15350 case 502: /* p_in_kwarg: %empty */
15351#line 5438 "parse.y"
15352 {
15353 (yyval.ctxt) = p->ctxt;
15354 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
15355 p->command_start = FALSE;
15356 p->ctxt.in_kwarg = 1;
15357 }
15358#line 15359 "parse.c"
15359 break;
15360
15361 case 503: /* $@29: %empty */
15362#line 5449 "parse.y"
15363 {
15364 pop_pktbl(p, (yyvsp[-2].tbl));
15365 pop_pvtbl(p, (yyvsp[-3].tbl));
15366 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
15367 }
15368#line 15369 "parse.c"
15369 break;
15370
15371 case 504: /* p_case_body: "'in'" p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@29 compstmt p_cases */
15372#line 5456 "parse.y"
15373 {
15374 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15375 /*% ripper: in!($:expr, $:compstmt, $:cases) %*/
15376 }
15377#line 15378 "parse.c"
15378 break;
15379
15380 case 508: /* p_top_expr: p_top_expr_body "'if' modifier" expr_value */
15381#line 5468 "parse.y"
15382 {
15383 (yyval.node) = new_if(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
15384 fixpos((yyval.node), (yyvsp[0].node));
15385 /*% ripper: if_mod!($:3, $:1) %*/
15386 }
15387#line 15388 "parse.c"
15388 break;
15389
15390 case 509: /* p_top_expr: p_top_expr_body "'unless' modifier" expr_value */
15391#line 5474 "parse.y"
15392 {
15393 (yyval.node) = new_unless(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc), &(yylsp[-1]), &NULL_LOC, &NULL_LOC);
15394 fixpos((yyval.node), (yyvsp[0].node));
15395 /*% ripper: unless_mod!($:3, $:1) %*/
15396 }
15397#line 15398 "parse.c"
15398 break;
15399
15400 case 511: /* p_top_expr_body: p_expr ',' */
15401#line 5483 "parse.y"
15402 {
15403 (yyval.node) = new_array_pattern_tail(p, 0, 1, 0, 0, &(yyloc));
15404 (yyval.node) = new_array_pattern(p, 0, (yyvsp[-1].node), (yyval.node), &(yyloc));
15405 /*% ripper: aryptn!(Qnil, [$:1], Qnil, Qnil) %*/
15406 }
15407#line 15408 "parse.c"
15408 break;
15409
15410 case 512: /* p_top_expr_body: p_expr ',' p_args */
15411#line 5489 "parse.y"
15412 {
15413 (yyval.node) = new_array_pattern(p, 0, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15414 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
15415 /*% ripper: aryptn!(Qnil, aryptn_pre_args(p, $:1, $:3[0]), *$:3[1..2]) %*/
15416 }
15417#line 15418 "parse.c"
15418 break;
15419
15420 case 513: /* p_top_expr_body: p_find */
15421#line 5495 "parse.y"
15422 {
15423 (yyval.node) = new_find_pattern(p, 0, (yyvsp[0].node), &(yyloc));
15424 /*% ripper: fndptn!(Qnil, *$:1[0..2]) %*/
15425 }
15426#line 15427 "parse.c"
15427 break;
15428
15429 case 514: /* p_top_expr_body: p_args_tail */
15430#line 5500 "parse.y"
15431 {
15432 (yyval.node) = new_array_pattern(p, 0, 0, (yyvsp[0].node), &(yyloc));
15433 /*% ripper: aryptn!(Qnil, *$:1[0..2]) %*/
15434 }
15435#line 15436 "parse.c"
15436 break;
15437
15438 case 515: /* p_top_expr_body: p_kwargs */
15439#line 5505 "parse.y"
15440 {
15441 (yyval.node) = new_hash_pattern(p, 0, (yyvsp[0].node), &(yyloc));
15442 /*% ripper: hshptn!(Qnil, *$:1[0..1]) %*/
15443 }
15444#line 15445 "parse.c"
15445 break;
15446
15447 case 517: /* p_as: p_expr "=>" p_variable */
15448#line 5515 "parse.y"
15449 {
15450 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
15451 n = list_append(p, n, (yyvsp[0].node));
15452 (yyval.node) = new_hash(p, n, &(yyloc));
15453 /*% ripper: binary!($:1, ID2VAL((id_assoc)), $:3) %*/
15454 }
15455#line 15456 "parse.c"
15456 break;
15457
15458 case 519: /* p_alt: p_alt '|' p_expr_basic */
15459#line 5525 "parse.y"
15460 {
15461 (yyval.node) = NEW_OR((yyvsp[-2].node), (yyvsp[0].node), &(yyloc), &(yylsp[-1]));
15462 /*% ripper: binary!($:1, ID2VAL(idOr), $:3) %*/
15463 }
15464#line 15465 "parse.c"
15465 break;
15466
15467 case 521: /* p_lparen: '(' p_pktbl */
15468#line 5533 "parse.y"
15469 {
15470 (yyval.tbl) = (yyvsp[0].tbl);
15471 /*% ripper: $:2 %*/
15472 }
15473#line 15474 "parse.c"
15474 break;
15475
15476 case 522: /* p_lbracket: '[' p_pktbl */
15477#line 5540 "parse.y"
15478 {
15479 (yyval.tbl) = (yyvsp[0].tbl);
15480 /*% ripper: $:2 %*/
15481 }
15482#line 15483 "parse.c"
15483 break;
15484
15485 case 525: /* p_expr_basic: p_const p_lparen p_args rparen */
15486#line 5549 "parse.y"
15487 {
15488 pop_pktbl(p, (yyvsp[-2].tbl));
15489 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), 0, (yyvsp[-1].node), &(yyloc));
15490 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15491 /*% ripper: aryptn!($:p_const, *$:p_args[0..2]) %*/
15492 }
15493#line 15494 "parse.c"
15494 break;
15495
15496 case 526: /* p_expr_basic: p_const p_lparen p_find rparen */
15497#line 5556 "parse.y"
15498 {
15499 pop_pktbl(p, (yyvsp[-2].tbl));
15500 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15501 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15502 /*% ripper: fndptn!($:p_const, *$:p_find[0..2]) %*/
15503 }
15504#line 15505 "parse.c"
15505 break;
15506
15507 case 527: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
15508#line 5563 "parse.y"
15509 {
15510 pop_pktbl(p, (yyvsp[-2].tbl));
15511 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15512 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15513 /*% ripper: hshptn!($:p_const, *$:p_kwargs[0..1]) %*/
15514 }
15515#line 15516 "parse.c"
15516 break;
15517
15518 case 528: /* p_expr_basic: p_const '(' rparen */
15519#line 5570 "parse.y"
15520 {
15521 (yyval.node) = new_array_pattern_tail(p, 0, 0, 0, 0, &(yyloc));
15522 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), 0, (yyval.node), &(yyloc));
15523 /*% ripper: aryptn!($:p_const, Qnil, Qnil, Qnil) %*/
15524 }
15525#line 15526 "parse.c"
15526 break;
15527
15528 case 529: /* p_expr_basic: p_const p_lbracket p_args rbracket */
15529#line 5576 "parse.y"
15530 {
15531 pop_pktbl(p, (yyvsp[-2].tbl));
15532 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), 0, (yyvsp[-1].node), &(yyloc));
15533 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15534 /*% ripper: aryptn!($:p_const, *$:p_args[0..2]) %*/
15535 }
15536#line 15537 "parse.c"
15537 break;
15538
15539 case 530: /* p_expr_basic: p_const p_lbracket p_find rbracket */
15540#line 5583 "parse.y"
15541 {
15542 pop_pktbl(p, (yyvsp[-2].tbl));
15543 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15544 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15545 /*% ripper: fndptn!($:p_const, *$:p_find[0..2]) %*/
15546 }
15547#line 15548 "parse.c"
15548 break;
15549
15550 case 531: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
15551#line 5590 "parse.y"
15552 {
15553 pop_pktbl(p, (yyvsp[-2].tbl));
15554 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15555 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15556 /*% ripper: hshptn!($:p_const, *$:p_kwargs[0..1]) %*/
15557 }
15558#line 15559 "parse.c"
15559 break;
15560
15561 case 532: /* p_expr_basic: p_const '[' rbracket */
15562#line 5597 "parse.y"
15563 {
15564 (yyval.node) = new_array_pattern_tail(p, 0, 0, 0, 0, &(yyloc));
15565 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), 0, (yyval.node), &(yyloc));
15566 /*% ripper: aryptn!($:1, Qnil, Qnil, Qnil) %*/
15567 }
15568#line 15569 "parse.c"
15569 break;
15570
15571 case 533: /* p_expr_basic: "[" p_args rbracket */
15572#line 5603 "parse.y"
15573 {
15574 (yyval.node) = new_array_pattern(p, 0, 0, (yyvsp[-1].node), &(yyloc));
15575 /*% ripper: aryptn!(Qnil, *$:p_args[0..2]) %*/
15576 }
15577#line 15578 "parse.c"
15578 break;
15579
15580 case 534: /* p_expr_basic: "[" p_find rbracket */
15581#line 5608 "parse.y"
15582 {
15583 (yyval.node) = new_find_pattern(p, 0, (yyvsp[-1].node), &(yyloc));
15584 /*% ripper: fndptn!(Qnil, *$:p_find[0..2]) %*/
15585 }
15586#line 15587 "parse.c"
15587 break;
15588
15589 case 535: /* p_expr_basic: "[" rbracket */
15590#line 5613 "parse.y"
15591 {
15592 (yyval.node) = new_array_pattern_tail(p, 0, 0, 0, 0, &(yyloc));
15593 (yyval.node) = new_array_pattern(p, 0, 0, (yyval.node), &(yyloc));
15594 /*% ripper: aryptn!(Qnil, Qnil, Qnil, Qnil) %*/
15595 }
15596#line 15597 "parse.c"
15597 break;
15598
15599 case 536: /* $@30: %empty */
15600#line 5619 "parse.y"
15601 {
15602 p->ctxt.in_kwarg = 0;
15603 }
15604#line 15605 "parse.c"
15605 break;
15606
15607 case 537: /* p_expr_basic: "{" p_pktbl lex_ctxt $@30 p_kwargs rbrace */
15608#line 5623 "parse.y"
15609 {
15610 pop_pktbl(p, (yyvsp[-4].tbl));
15611 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
15612 (yyval.node) = new_hash_pattern(p, 0, (yyvsp[-1].node), &(yyloc));
15613 /*% ripper: hshptn!(Qnil, *$:p_kwargs[0..1]) %*/
15614 }
15615#line 15616 "parse.c"
15616 break;
15617
15618 case 538: /* p_expr_basic: "{" rbrace */
15619#line 5630 "parse.y"
15620 {
15621 (yyval.node) = new_hash_pattern_tail(p, 0, 0, &(yyloc));
15622 (yyval.node) = new_hash_pattern(p, 0, (yyval.node), &(yyloc));
15623 /*% ripper: hshptn!(Qnil, Qnil, Qnil) %*/
15624 }
15625#line 15626 "parse.c"
15626 break;
15627
15628 case 539: /* p_expr_basic: "(" p_pktbl p_expr rparen */
15629#line 5636 "parse.y"
15630 {
15631 pop_pktbl(p, (yyvsp[-2].tbl));
15632 (yyval.node) = (yyvsp[-1].node);
15633 /*% ripper: $:p_expr %*/
15634 }
15635#line 15636 "parse.c"
15636 break;
15637
15638 case 540: /* p_args: p_expr */
15639#line 5644 "parse.y"
15640 {
15641 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
15642 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, 0, 0, &(yyloc));
15643 /*% ripper: [[$:1], Qnil, Qnil] %*/
15644 }
15645#line 15646 "parse.c"
15646 break;
15647
15648 case 541: /* p_args: p_args_head */
15649#line 5650 "parse.y"
15650 {
15651 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, 0, 0, &(yyloc));
15652 /*% ripper: [$:1, Qnil, Qnil] %*/
15653 }
15654#line 15655 "parse.c"
15655 break;
15656
15657 case 542: /* p_args: p_args_head p_arg */
15658#line 5655 "parse.y"
15659 {
15660 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, 0, 0, &(yyloc));
15661 /*% ripper: [rb_ary_concat($:1, $:2), Qnil, Qnil] %*/
15662 }
15663#line 15664 "parse.c"
15664 break;
15665
15666 case 543: /* p_args: p_args_head p_rest */
15667#line 5660 "parse.y"
15668 {
15669 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, (yyvsp[0].node), 0, &(yyloc));
15670 /*% ripper: [$:1, $:2, Qnil] %*/
15671 }
15672#line 15673 "parse.c"
15673 break;
15674
15675 case 544: /* p_args: p_args_head p_rest ',' p_args_post */
15676#line 5665 "parse.y"
15677 {
15678 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15679 /*% ripper: [$:1, $:2, $:4] %*/
15680 }
15681#line 15682 "parse.c"
15682 break;
15683
15684 case 546: /* p_args_head: p_arg ',' */
15685#line 5673 "parse.y"
15686 {
15687 (yyval.node) = (yyvsp[-1].node);
15688 }
15689#line 15690 "parse.c"
15690 break;
15691
15692 case 547: /* p_args_head: p_args_head p_arg ',' */
15693#line 5677 "parse.y"
15694 {
15695 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
15696 /*% ripper: rb_ary_concat($:1, $:2) %*/
15697 }
15698#line 15699 "parse.c"
15699 break;
15700
15701 case 548: /* p_args_tail: p_rest */
15702#line 5684 "parse.y"
15703 {
15704 (yyval.node) = new_array_pattern_tail(p, 0, 1, (yyvsp[0].node), 0, &(yyloc));
15705 /*% ripper: [Qnil, $:1, Qnil] %*/
15706 }
15707#line 15708 "parse.c"
15708 break;
15709
15710 case 549: /* p_args_tail: p_rest ',' p_args_post */
15711#line 5689 "parse.y"
15712 {
15713 (yyval.node) = new_array_pattern_tail(p, 0, 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15714 /*% ripper: [Qnil, $:1, $:3] %*/
15715 }
15716#line 15717 "parse.c"
15717 break;
15718
15719 case 550: /* p_find: p_rest ',' p_args_post ',' p_rest */
15720#line 5696 "parse.y"
15721 {
15722 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15723 /*% ripper: [$:1, $:3, $:5] %*/
15724 }
15725#line 15726 "parse.c"
15726 break;
15727
15728 case 551: /* p_rest: "*" "local variable or method" */
15729#line 5704 "parse.y"
15730 {
15731 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15732 /*% ripper: var_field!($:2) %*/
15733 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15734 }
15735#line 15736 "parse.c"
15736 break;
15737
15738 case 552: /* p_rest: "*" */
15739#line 5710 "parse.y"
15740 {
15741 (yyval.node) = 0;
15742 /*% ripper: var_field!(Qnil) %*/
15743 }
15744#line 15745 "parse.c"
15745 break;
15746
15747 case 554: /* p_args_post: p_args_post ',' p_arg */
15748#line 5718 "parse.y"
15749 {
15750 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
15751 /*% ripper: rb_ary_concat($:1, $:3) %*/
15752 }
15753#line 15754 "parse.c"
15754 break;
15755
15756 case 555: /* p_arg: p_expr */
15757#line 5725 "parse.y"
15758 {
15759 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
15760 /*% ripper: [$:1] %*/
15761 }
15762#line 15763 "parse.c"
15763 break;
15764
15765 case 556: /* p_kwargs: p_kwarg ',' p_any_kwrest */
15766#line 5732 "parse.y"
15767 {
15768 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
15769 /*% ripper: [$:1, $:3] %*/
15770 }
15771#line 15772 "parse.c"
15772 break;
15773
15774 case 557: /* p_kwargs: p_kwarg */
15775#line 5737 "parse.y"
15776 {
15777 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
15778 /*% ripper: [$:1, Qnil] %*/
15779 }
15780#line 15781 "parse.c"
15781 break;
15782
15783 case 558: /* p_kwargs: p_kwarg ',' */
15784#line 5742 "parse.y"
15785 {
15786 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
15787 /*% ripper: [$:1, Qnil] %*/
15788 }
15789#line 15790 "parse.c"
15790 break;
15791
15792 case 559: /* p_kwargs: p_any_kwrest */
15793#line 5747 "parse.y"
15794 {
15795 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, 0, &(yyloc)), (yyvsp[0].id), &(yyloc));
15796 /*% ripper: [[], $:1] %*/
15797 }
15798#line 15799 "parse.c"
15799 break;
15800
15801 case 561: /* p_kwarg: p_kwarg ',' p_kw */
15802#line 5756 "parse.y"
15803 {
15804 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
15805 /*% ripper: rb_ary_push($:1, $:3) %*/
15806 }
15807#line 15808 "parse.c"
15808 break;
15809
15810 case 562: /* p_kw: p_kw_label p_expr */
15811#line 5763 "parse.y"
15812 {
15813 error_duplicate_pattern_key(p, (yyvsp[-1].id), &(yylsp[-1]));
15814 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
15815 /*% ripper: [$:1, $:2] %*/
15816 }
15817#line 15818 "parse.c"
15818 break;
15819
15820 case 563: /* p_kw: p_kw_label */
15821#line 5769 "parse.y"
15822 {
15823 error_duplicate_pattern_key(p, (yyvsp[0].id), &(yylsp[0]));
15824 if ((yyvsp[0].id) && !is_local_id((yyvsp[0].id))) {
15825 yyerror1(&(yylsp[0]), "key must be valid as local variables");
15826 }
15827 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15828 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
15829 /*% ripper: [$:1, Qnil] %*/
15830 }
15831#line 15832 "parse.c"
15832 break;
15833
15834 case 565: /* p_kw_label: "string literal" string_contents tLABEL_END */
15835#line 5782 "parse.y"
15836 {
15837 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
15838 if (!(yyvsp[-1].node) || nd_type_p((yyvsp[-1].node), NODE_STR)) {
15839 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
15840 (yyval.id) = rb_sym2id(rb_node_sym_string_val(node));
15841 }
15842 else {
15843 yyerror1(&loc, "symbol literal with interpolation is not allowed");
15844 (yyval.id) = rb_intern_str(STR_NEW0());
15845 }
15846 /*% ripper: $:2 %*/
15847 }
15848#line 15849 "parse.c"
15849 break;
15850
15851 case 566: /* p_kwrest: kwrest_mark "local variable or method" */
15852#line 5797 "parse.y"
15853 {
15854 (yyval.id) = (yyvsp[0].id);
15855 /*% ripper: var_field!($:2) %*/
15856 }
15857#line 15858 "parse.c"
15858 break;
15859
15860 case 567: /* p_kwrest: kwrest_mark */
15861#line 5802 "parse.y"
15862 {
15863 (yyval.id) = 0;
15864 /*% ripper: Qnil %*/
15865 }
15866#line 15867 "parse.c"
15867 break;
15868
15869 case 568: /* p_kwnorest: kwrest_mark "'nil'" */
15870#line 5809 "parse.y"
15871 {
15872 (yyval.id) = 0;
15873 }
15874#line 15875 "parse.c"
15875 break;
15876
15877 case 570: /* p_any_kwrest: p_kwnorest */
15878#line 5816 "parse.y"
15879 {
15880 (yyval.id) = idNil;
15881 /*% ripper: var_field!(ID2VAL(idNil)) %*/
15882 }
15883#line 15884 "parse.c"
15884 break;
15885
15886 case 572: /* p_value: p_primitive ".." p_primitive */
15887#line 5824 "parse.y"
15888 {
15889 value_expr((yyvsp[-2].node));
15890 value_expr((yyvsp[0].node));
15891 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15892 /*% ripper: dot2!($:1, $:3) %*/
15893 }
15894#line 15895 "parse.c"
15895 break;
15896
15897 case 573: /* p_value: p_primitive "..." p_primitive */
15898#line 5831 "parse.y"
15899 {
15900 value_expr((yyvsp[-2].node));
15901 value_expr((yyvsp[0].node));
15902 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15903 /*% ripper: dot3!($:1, $:3) %*/
15904 }
15905#line 15906 "parse.c"
15906 break;
15907
15908 case 574: /* p_value: p_primitive ".." */
15909#line 5838 "parse.y"
15910 {
15911 value_expr((yyvsp[-1].node));
15912 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15913 /*% ripper: dot2!($:1, Qnil) %*/
15914 }
15915#line 15916 "parse.c"
15916 break;
15917
15918 case 575: /* p_value: p_primitive "..." */
15919#line 5844 "parse.y"
15920 {
15921 value_expr((yyvsp[-1].node));
15922 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15923 /*% ripper: dot3!($:1, Qnil) %*/
15924 }
15925#line 15926 "parse.c"
15926 break;
15927
15928 case 579: /* p_value: "(.." p_primitive */
15929#line 5853 "parse.y"
15930 {
15931 value_expr((yyvsp[0].node));
15932 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15933 /*% ripper: dot2!(Qnil, $:2) %*/
15934 }
15935#line 15936 "parse.c"
15936 break;
15937
15938 case 580: /* p_value: "(..." p_primitive */
15939#line 5859 "parse.y"
15940 {
15941 value_expr((yyvsp[0].node));
15942 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15943 /*% ripper: dot3!(Qnil, $:2) %*/
15944 }
15945#line 15946 "parse.c"
15946 break;
15947
15948 case 589: /* p_primitive: keyword_variable */
15949#line 5868 "parse.y"
15950 {
15951 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
15952 /*% ripper: var_ref!($:1) %*/
15953 }
15954#line 15955 "parse.c"
15955 break;
15956
15957 case 591: /* p_variable: "local variable or method" */
15958#line 5876 "parse.y"
15959 {
15960 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15961 /*% ripper: var_field!($:1) %*/
15962 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15963 }
15964#line 15965 "parse.c"
15965 break;
15966
15967 case 592: /* p_var_ref: '^' "local variable or method" */
15968#line 5884 "parse.y"
15969 {
15970 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
15971 if (!n) {
15972 n = NEW_ERROR(&(yyloc));
15973 }
15974 else if (!(nd_type_p(n, NODE_LVAR) || nd_type_p(n, NODE_DVAR))) {
15975 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
15976 }
15977 (yyval.node) = n;
15978 /*% ripper: var_ref!($:2) %*/
15979 }
15980#line 15981 "parse.c"
15981 break;
15982
15983 case 593: /* p_var_ref: '^' nonlocal_var */
15984#line 5896 "parse.y"
15985 {
15986 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
15987 /*% ripper: var_ref!($:2) %*/
15988 }
15989#line 15990 "parse.c"
15990 break;
15991
15992 case 594: /* p_expr_ref: '^' "(" expr_value rparen */
15993#line 5903 "parse.y"
15994 {
15995 (yyval.node) = NEW_BLOCK((yyvsp[-1].node), &(yyloc));
15996 /*% ripper: begin!($:3) %*/
15997 }
15998#line 15999 "parse.c"
15999 break;
16000
16001 case 595: /* p_const: ":: at EXPR_BEG" cname */
16002#line 5910 "parse.y"
16003 {
16004 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
16005 /*% ripper: top_const_ref!($:2) %*/
16006 }
16007#line 16008 "parse.c"
16008 break;
16009
16010 case 596: /* p_const: p_const "::" cname */
16011#line 5915 "parse.y"
16012 {
16013 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
16014 /*% ripper: const_path_ref!($:1, $:3) %*/
16015 }
16016#line 16017 "parse.c"
16017 break;
16018
16019 case 597: /* p_const: "constant" */
16020#line 5920 "parse.y"
16021 {
16022 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
16023 /*% ripper: var_ref!($:1) %*/
16024 }
16025#line 16026 "parse.c"
16026 break;
16027
16028 case 598: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
16029#line 5929 "parse.y"
16030 {
16031 NODE *err = (yyvsp[-3].node);
16032 if ((yyvsp[-3].node)) {
16033 err = NEW_ERRINFO(&(yylsp[-3]));
16034 err = node_assign(p, (yyvsp[-3].node), err, NO_LEX_CTXT, &(yylsp[-3]));
16035 }
16036 (yyval.node) = NEW_RESBODY((yyvsp[-4].node), (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16037 if ((yyvsp[-4].node)) {
16038 fixpos((yyval.node), (yyvsp[-4].node));
16039 }
16040 else if ((yyvsp[-3].node)) {
16041 fixpos((yyval.node), (yyvsp[-3].node));
16042 }
16043 else {
16044 fixpos((yyval.node), (yyvsp[-1].node));
16045 }
16046 /*% ripper: rescue!($:2, $:3, $:5, $:6) %*/
16047 }
16048#line 16049 "parse.c"
16049 break;
16050
16051 case 600: /* exc_list: arg_value */
16052#line 5951 "parse.y"
16053 {
16054 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
16055 /*% ripper: rb_ary_new3(1, $:1) %*/
16056 }
16057#line 16058 "parse.c"
16058 break;
16059
16060 case 601: /* exc_list: mrhs */
16061#line 5956 "parse.y"
16062 {
16063 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
16064 }
16065#line 16066 "parse.c"
16066 break;
16067
16068 case 603: /* exc_var: "=>" lhs */
16069#line 5963 "parse.y"
16070 {
16071 (yyval.node) = (yyvsp[0].node);
16072 /*% ripper: $:2 %*/
16073 }
16074#line 16075 "parse.c"
16075 break;
16076
16077 case 605: /* opt_ensure: k_ensure stmts option_terms */
16078#line 5971 "parse.y"
16079 {
16080 p->ctxt.in_rescue = (yyvsp[-2].ctxt).in_rescue;
16081 (yyval.node) = (yyvsp[-1].node);
16082 void_expr(p, void_stmts(p, (yyval.node)));
16083 /*% ripper: ensure!($:2) %*/
16084 }
16085#line 16086 "parse.c"
16086 break;
16087
16088 case 609: /* strings: string */
16089#line 5985 "parse.y"
16090 {
16091 NODE *node = (yyvsp[0].node);
16092 if (!node) {
16093 node = NEW_STR(STRING_NEW0(), &(yyloc));
16094 }
16095 else {
16096 node = evstr2dstr(p, node);
16097 }
16098 (yyval.node) = node;
16099 /*% ripper: $:1 %*/
16100 }
16101#line 16102 "parse.c"
16102 break;
16103
16104 case 612: /* string: string string1 */
16105#line 6001 "parse.y"
16106 {
16107 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16108 /*% ripper: string_concat!($:1, $:2) %*/
16109 }
16110#line 16111 "parse.c"
16111 break;
16112
16113 case 613: /* string1: "string literal" string_contents "terminator" */
16114#line 6008 "parse.y"
16115 {
16116 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
16117 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
16118 /*% ripper: $:2 %*/
16119 if (p->heredoc_indent > 0) {
16120 /*% ripper: heredoc_dedent!($:$, INT2NUM(%{p->heredoc_indent})) %*/
16121 p->heredoc_indent = 0;
16122 }
16123 /*% ripper: string_literal!($:$) %*/
16124 }
16125#line 16126 "parse.c"
16126 break;
16127
16128 case 614: /* xstring: "backtick literal" xstring_contents "terminator" */
16129#line 6021 "parse.y"
16130 {
16131 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
16132 /*% ripper: $:2 %*/
16133 if (p->heredoc_indent > 0) {
16134 /*% ripper: heredoc_dedent!($:$, INT2NUM(%{p->heredoc_indent})) %*/
16135 p->heredoc_indent = 0;
16136 }
16137 /*% ripper: xstring_literal!($:$) %*/
16138 }
16139#line 16140 "parse.c"
16140 break;
16141
16142 case 615: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
16143#line 6033 "parse.y"
16144 {
16145 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
16146 /*% ripper: regexp_literal!($:2, $:3) %*/
16147 }
16148#line 16149 "parse.c"
16149 break;
16150
16151 case 618: /* words_tWORDS_BEG_word_list: "word list" nonempty_list_' ' word_list "terminator" */
16152#line 2960 "parse.y"
16153 {
16154 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16155 /*% ripper: array!($:3) %*/
16156 }
16157#line 16158 "parse.c"
16158 break;
16159
16160 case 620: /* word_list: %empty */
16161#line 6043 "parse.y"
16162 {
16163 (yyval.node) = 0;
16164 /*% ripper: words_new! %*/
16165 }
16166#line 16167 "parse.c"
16167 break;
16168
16169 case 621: /* word_list: word_list word nonempty_list_' ' */
16170#line 6048 "parse.y"
16171 {
16172 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
16173 /*% ripper: words_add!($:1, $:2) %*/
16174 }
16175#line 16176 "parse.c"
16176 break;
16177
16178 case 623: /* word: word string_content */
16179#line 6057 "parse.y"
16180 {
16181 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16182 /*% ripper: word_add!($:1, $:2) %*/
16183 }
16184#line 16185 "parse.c"
16185 break;
16186
16187 case 624: /* words_tSYMBOLS_BEG_symbol_list: "symbol list" nonempty_list_' ' symbol_list "terminator" */
16188#line 2960 "parse.y"
16189 {
16190 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16191 /*% ripper: array!($:3) %*/
16192 }
16193#line 16194 "parse.c"
16194 break;
16195
16196 case 626: /* symbol_list: %empty */
16197#line 6067 "parse.y"
16198 {
16199 (yyval.node) = 0;
16200 /*% ripper: symbols_new! %*/
16201 }
16202#line 16203 "parse.c"
16203 break;
16204
16205 case 627: /* symbol_list: symbol_list word nonempty_list_' ' */
16206#line 6072 "parse.y"
16207 {
16208 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
16209 /*% ripper: symbols_add!($:1, $:2) %*/
16210 }
16211#line 16212 "parse.c"
16212 break;
16213
16214 case 628: /* words_tQWORDS_BEG_qword_list: "verbatim word list" nonempty_list_' ' qword_list "terminator" */
16215#line 2960 "parse.y"
16216 {
16217 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16218 /*% ripper: array!($:3) %*/
16219 }
16220#line 16221 "parse.c"
16221 break;
16222
16223 case 630: /* words_tQSYMBOLS_BEG_qsym_list: "verbatim symbol list" nonempty_list_' ' qsym_list "terminator" */
16224#line 2960 "parse.y"
16225 {
16226 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16227 /*% ripper: array!($:3) %*/
16228 }
16229#line 16230 "parse.c"
16230 break;
16231
16232 case 632: /* qword_list: %empty */
16233#line 6085 "parse.y"
16234 {
16235 (yyval.node) = 0;
16236 /*% ripper: qwords_new! %*/
16237 }
16238#line 16239 "parse.c"
16239 break;
16240
16241 case 633: /* qword_list: qword_list "literal content" nonempty_list_' ' */
16242#line 6090 "parse.y"
16243 {
16244 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
16245 /*% ripper: qwords_add!($:1, $:2) %*/
16246 }
16247#line 16248 "parse.c"
16248 break;
16249
16250 case 634: /* qsym_list: %empty */
16251#line 6097 "parse.y"
16252 {
16253 (yyval.node) = 0;
16254 /*% ripper: qsymbols_new! %*/
16255 }
16256#line 16257 "parse.c"
16257 break;
16258
16259 case 635: /* qsym_list: qsym_list "literal content" nonempty_list_' ' */
16260#line 6102 "parse.y"
16261 {
16262 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
16263 /*% ripper: qsymbols_add!($:1, $:2) %*/
16264 }
16265#line 16266 "parse.c"
16266 break;
16267
16268 case 636: /* string_contents: %empty */
16269#line 6109 "parse.y"
16270 {
16271 (yyval.node) = 0;
16272 /*% ripper: string_content! %*/
16273 }
16274#line 16275 "parse.c"
16275 break;
16276
16277 case 637: /* string_contents: string_contents string_content */
16278#line 6114 "parse.y"
16279 {
16280 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16281 /*% ripper: string_add!($:1, $:2) %*/
16282 }
16283#line 16284 "parse.c"
16284 break;
16285
16286 case 638: /* xstring_contents: %empty */
16287#line 6121 "parse.y"
16288 {
16289 (yyval.node) = 0;
16290 /*% ripper: xstring_new! %*/
16291 }
16292#line 16293 "parse.c"
16293 break;
16294
16295 case 639: /* xstring_contents: xstring_contents string_content */
16296#line 6126 "parse.y"
16297 {
16298 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16299 /*% ripper: xstring_add!($:1, $:2) %*/
16300 }
16301#line 16302 "parse.c"
16302 break;
16303
16304 case 640: /* regexp_contents: %empty */
16305#line 6133 "parse.y"
16306 {
16307 (yyval.node) = 0;
16308 /*% ripper: regexp_new! %*/
16309 }
16310#line 16311 "parse.c"
16311 break;
16312
16313 case 641: /* regexp_contents: regexp_contents string_content */
16314#line 6138 "parse.y"
16315 {
16316 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
16317 if (!head) {
16318 (yyval.node) = tail;
16319 }
16320 else if (!tail) {
16321 (yyval.node) = head;
16322 }
16323 else {
16324 switch (nd_type(head)) {
16325 case NODE_STR:
16326 head = str2dstr(p, head);
16327 break;
16328 case NODE_DSTR:
16329 break;
16330 default:
16331 head = list_append(p, NEW_DSTR(0, &(yyloc)), head);
16332 break;
16333 }
16334 (yyval.node) = list_append(p, head, tail);
16335 }
16336 /*% ripper: regexp_add!($:1, $:2) %*/
16337 }
16338#line 16339 "parse.c"
16339 break;
16340
16341 case 643: /* @31: %empty */
16342#line 6166 "parse.y"
16343 {
16344 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
16345 (yyval.strterm) = p->lex.strterm;
16346 p->lex.strterm = 0;
16347 SET_LEX_STATE(EXPR_BEG);
16348 }
16349#line 16350 "parse.c"
16350 break;
16351
16352 case 644: /* string_content: tSTRING_DVAR @31 string_dvar */
16353#line 6173 "parse.y"
16354 {
16355 p->lex.strterm = (yyvsp[-1].strterm);
16356 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
16357 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
16358 /*% ripper: string_dvar!($:3) %*/
16359 }
16360#line 16361 "parse.c"
16361 break;
16362
16363 case 645: /* @32: %empty */
16364#line 6180 "parse.y"
16365 {
16366 CMDARG_PUSH(0);
16367 COND_PUSH(0);
16368 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
16369 (yyval.strterm) = p->lex.strterm;
16370 p->lex.strterm = 0;
16371 SET_LEX_STATE(EXPR_BEG);
16372 }
16373#line 16374 "parse.c"
16374 break;
16375
16376 case 646: /* @33: %empty */
16377#line 6188 "parse.y"
16378 {
16379 (yyval.num) = p->lex.brace_nest;
16380 p->lex.brace_nest = 0;
16381 }
16382#line 16383 "parse.c"
16383 break;
16384
16385 case 647: /* @34: %empty */
16386#line 6192 "parse.y"
16387 {
16388 (yyval.num) = p->heredoc_indent;
16389 p->heredoc_indent = 0;
16390 }
16391#line 16392 "parse.c"
16392 break;
16393
16394 case 648: /* string_content: "'#{'" @32 @33 @34 compstmt string_dend */
16395#line 6197 "parse.y"
16396 {
16397 COND_POP();
16398 CMDARG_POP();
16399 p->lex.strterm = (yyvsp[-4].strterm);
16400 SET_LEX_STATE((yyvsp[-5].state));
16401 p->lex.brace_nest = (yyvsp[-3].num);
16402 p->heredoc_indent = (yyvsp[-2].num);
16403 p->heredoc_line_indent = -1;
16404 if ((yyvsp[-1].node)) nd_unset_fl_newline((yyvsp[-1].node));
16405 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
16406 /*% ripper: string_embexpr!($:compstmt) %*/
16407 }
16408#line 16409 "parse.c"
16409 break;
16410
16411 case 651: /* string_dvar: nonlocal_var */
16412#line 6216 "parse.y"
16413 {
16414 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
16415 /*% ripper: var_ref!($:1) %*/
16416 }
16417#line 16418 "parse.c"
16418 break;
16419
16420 case 655: /* ssym: "symbol literal" sym */
16421#line 6228 "parse.y"
16422 {
16423 SET_LEX_STATE(EXPR_END);
16424 VALUE str = rb_id2str((yyvsp[0].id));
16425 /*
16426 * TODO:
16427 * set_yylval_noname sets invalid id to yylval.
16428 * This branch can be removed once yylval is changed to
16429 * hold lexed string.
16430 */
16431 if (!str) str = STR_NEW0();
16432 (yyval.node) = NEW_SYM(str, &(yyloc));
16433 /*% ripper: symbol_literal!(symbol!($:2)) %*/
16434 }
16435#line 16436 "parse.c"
16436 break;
16437
16438 case 658: /* dsym: "symbol literal" string_contents "terminator" */
16439#line 6248 "parse.y"
16440 {
16441 SET_LEX_STATE(EXPR_END);
16442 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
16443 /*% ripper: dyna_symbol!($:2) %*/
16444 }
16445#line 16446 "parse.c"
16446 break;
16447
16448 case 660: /* numeric: tUMINUS_NUM simple_numeric */
16449#line 6257 "parse.y"
16450 {
16451 (yyval.node) = (yyvsp[0].node);
16452 negate_lit(p, (yyval.node));
16453 /*% ripper: unary!(ID2VAL(idUMinus), $:2) %*/
16454 }
16455#line 16456 "parse.c"
16456 break;
16457
16458 case 671: /* keyword_variable: "'nil'" */
16459#line 6279 "parse.y"
16460 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
16461#line 16462 "parse.c"
16462 break;
16463
16464 case 672: /* keyword_variable: "'self'" */
16465#line 6280 "parse.y"
16466 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
16467#line 16468 "parse.c"
16468 break;
16469
16470 case 673: /* keyword_variable: "'true'" */
16471#line 6281 "parse.y"
16472 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
16473#line 16474 "parse.c"
16474 break;
16475
16476 case 674: /* keyword_variable: "'false'" */
16477#line 6282 "parse.y"
16478 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
16479#line 16480 "parse.c"
16480 break;
16481
16482 case 675: /* keyword_variable: "'__FILE__'" */
16483#line 6283 "parse.y"
16484 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
16485#line 16486 "parse.c"
16486 break;
16487
16488 case 676: /* keyword_variable: "'__LINE__'" */
16489#line 6284 "parse.y"
16490 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
16491#line 16492 "parse.c"
16492 break;
16493
16494 case 677: /* keyword_variable: "'__ENCODING__'" */
16495#line 6285 "parse.y"
16496 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
16497#line 16498 "parse.c"
16498 break;
16499
16500 case 678: /* var_ref: user_variable */
16501#line 6289 "parse.y"
16502 {
16503 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
16504 if (ifdef_ripper(id_is_var(p, (yyvsp[0].id)), false)) {
16505 /*% ripper: var_ref!($:1) %*/
16506 }
16507 else {
16508 /*% ripper: vcall!($:1) %*/
16509 }
16510 }
16511#line 16512 "parse.c"
16512 break;
16513
16514 case 679: /* var_ref: keyword_variable */
16515#line 6299 "parse.y"
16516 {
16517 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
16518 /*% ripper: var_ref!($:1) %*/
16519 }
16520#line 16521 "parse.c"
16521 break;
16522
16523 case 680: /* var_lhs: user_variable */
16524#line 6306 "parse.y"
16525 {
16526 /*% ripper: var_field!($:1) %*/
16527 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
16528 }
16529#line 16530 "parse.c"
16530 break;
16531
16532 case 681: /* var_lhs: keyword_variable */
16533#line 6306 "parse.y"
16534 {
16535 /*% ripper: var_field!($:1) %*/
16536 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
16537 }
16538#line 16539 "parse.c"
16539 break;
16540
16541 case 684: /* $@35: %empty */
16542#line 6317 "parse.y"
16543 {
16544 SET_LEX_STATE(EXPR_BEG);
16545 p->command_start = TRUE;
16546 }
16547#line 16548 "parse.c"
16548 break;
16549
16550 case 685: /* superclass: '<' $@35 expr_value term */
16551#line 6322 "parse.y"
16552 {
16553 (yyval.node) = (yyvsp[-1].node);
16554 /*% ripper: $:3 %*/
16555 }
16556#line 16557 "parse.c"
16557 break;
16558
16559 case 686: /* superclass: %empty */
16560#line 6327 "parse.y"
16561 {
16562 (yyval.node) = 0;
16563 /*% ripper: Qnil %*/
16564 }
16565#line 16566 "parse.c"
16566 break;
16567
16568 case 688: /* f_opt_paren_args: none */
16569#line 6335 "parse.y"
16570 {
16571 p->ctxt.in_argdef = 0;
16572 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[-1]));
16573 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyval.node_args), &(yylsp[-1]));
16574 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, Qnil) %*/
16575 }
16576#line 16577 "parse.c"
16577 break;
16578
16579 case 689: /* f_paren_args: '(' f_args rparen */
16580#line 6344 "parse.y"
16581 {
16582 (yyval.node_args) = (yyvsp[-1].node_args);
16583 /*% ripper: paren!($:2) %*/
16584 SET_LEX_STATE(EXPR_BEG);
16585 p->command_start = TRUE;
16586 p->ctxt.in_argdef = 0;
16587 }
16588#line 16589 "parse.c"
16589 break;
16590
16591 case 691: /* @36: %empty */
16592#line 6354 "parse.y"
16593 {
16594 (yyval.ctxt) = p->ctxt;
16595 p->ctxt.in_kwarg = 1;
16596 p->ctxt.in_argdef = 1;
16597 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
16598 }
16599#line 16600 "parse.c"
16600 break;
16601
16602 case 692: /* f_arglist: @36 f_args term */
16603#line 6361 "parse.y"
16604 {
16605 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
16606 p->ctxt.in_argdef = 0;
16607 (yyval.node_args) = (yyvsp[-1].node_args);
16608 SET_LEX_STATE(EXPR_BEG);
16609 p->command_start = TRUE;
16610 /*% ripper: $:2 %*/
16611 }
16612#line 16613 "parse.c"
16613 break;
16614
16615 case 693: /* f_kwarg_f_kw: f_kw */
16616#line 2934 "parse.y"
16617 {
16618 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
16619 /*% ripper: rb_ary_new3(1, $:1) %*/
16620 }
16621#line 16622 "parse.c"
16622 break;
16623
16624 case 694: /* f_kwarg_f_kw: f_kwarg_f_kw ',' f_kw */
16625#line 2939 "parse.y"
16626 {
16627 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
16628 /*% ripper: rb_ary_push($:1, $:3) %*/
16629 }
16630#line 16631 "parse.c"
16631 break;
16632
16633 case 695: /* args_tail: f_kwarg_f_kw ',' f_kwrest opt_f_block_arg */
16634#line 6372 "parse.y"
16635 {
16636 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
16637 /*% ripper: [$:1, $:3, $:4] %*/
16638 }
16639#line 16640 "parse.c"
16640 break;
16641
16642 case 696: /* args_tail: f_kwarg_f_kw opt_f_block_arg */
16643#line 6377 "parse.y"
16644 {
16645 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), 0, (yyvsp[0].id), &(yylsp[-1]));
16646 /*% ripper: [$:1, Qnil, $:2] %*/
16647 }
16648#line 16649 "parse.c"
16649 break;
16650
16651 case 697: /* args_tail: f_any_kwrest opt_f_block_arg */
16652#line 6382 "parse.y"
16653 {
16654 (yyval.node_args) = new_args_tail(p, 0, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
16655 /*% ripper: [Qnil, $:1, $:2] %*/
16656 }
16657#line 16658 "parse.c"
16658 break;
16659
16660 case 698: /* args_tail: f_block_arg */
16661#line 6387 "parse.y"
16662 {
16663 (yyval.node_args) = new_args_tail(p, 0, 0, (yyvsp[0].id), &(yylsp[0]));
16664 /*% ripper: [Qnil, Qnil, $:1] %*/
16665 }
16666#line 16667 "parse.c"
16667 break;
16668
16669 case 699: /* args_tail: args_forward */
16670#line 6392 "parse.y"
16671 {
16672 ID fwd = (yyvsp[0].id);
16673 if (lambda_beginning_p() ||
16674 (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest)) {
16675 yyerror0("unexpected ... in lambda argument");
16676 fwd = 0;
16677 }
16678 else {
16679 add_forwarding_args(p);
16680 }
16681 (yyval.node_args) = new_args_tail(p, 0, fwd, arg_FWD_BLOCK, &(yylsp[0]));
16682 (yyval.node_args)->nd_ainfo.forwarding = 1;
16683 /*% ripper: [Qnil, $:1, Qnil] %*/
16684 }
16685#line 16686 "parse.c"
16686 break;
16687
16688 case 700: /* f_opt_arg_value: f_arg_asgn f_eq arg_value */
16689#line 2912 "parse.y"
16690 {
16691 p->ctxt.in_argdef = 1;
16692 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16693 /*% ripper: [$:$, $:3] %*/
16694 }
16695#line 16696 "parse.c"
16696 break;
16697
16698 case 701: /* f_optarg_arg_value: f_opt_arg_value */
16699#line 2921 "parse.y"
16700 {
16701 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
16702 /*% ripper: rb_ary_new3(1, $:1) %*/
16703 }
16704#line 16705 "parse.c"
16705 break;
16706
16707 case 702: /* f_optarg_arg_value: f_optarg_arg_value ',' f_opt_arg_value */
16708#line 2926 "parse.y"
16709 {
16710 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
16711 /*% ripper: rb_ary_push($:1, $:3) %*/
16712 }
16713#line 16714 "parse.c"
16714 break;
16715
16716 case 703: /* opt_args_tail_args_tail: ',' args_tail */
16717#line 2947 "parse.y"
16718 {
16719 (yyval.node_args) = (yyvsp[0].node_args);
16720 /*% ripper: $:2 %*/
16721 }
16722#line 16723 "parse.c"
16723 break;
16724
16725 case 704: /* opt_args_tail_args_tail: %empty */
16726#line 2952 "parse.y"
16727 {
16728 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
16729 /*% ripper: [Qnil, Qnil, Qnil] %*/
16730 }
16731#line 16732 "parse.c"
16732 break;
16733
16734 case 705: /* f_args: f_arg ',' f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail */
16735#line 6409 "parse.y"
16736 {
16737 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
16738 /*% ripper: params!($:1, $:3, $:5, Qnil, *$:6[0..2]) %*/
16739 }
16740#line 16741 "parse.c"
16741 break;
16742
16743 case 706: /* f_args: f_arg ',' f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail */
16744#line 6414 "parse.y"
16745 {
16746 (yyval.node_args) = new_args(p, (yyvsp[-7].node_args_aux), (yyvsp[-5].node_opt_arg), (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16747 /*% ripper: params!($:1, $:3, $:5, $:7, *$:8[0..2]) %*/
16748 }
16749#line 16750 "parse.c"
16750 break;
16751
16752 case 707: /* f_args: f_arg ',' f_optarg_arg_value opt_args_tail_args_tail */
16753#line 6419 "parse.y"
16754 {
16755 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
16756 /*% ripper: params!($:1, $:3, Qnil, Qnil, *$:4[0..2]) %*/
16757 }
16758#line 16759 "parse.c"
16759 break;
16760
16761 case 708: /* f_args: f_arg ',' f_optarg_arg_value ',' f_arg opt_args_tail_args_tail */
16762#line 6424 "parse.y"
16763 {
16764 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), 0, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16765 /*% ripper: params!($:1, $:3, Qnil, $:5, *$:6[0..2]) %*/
16766 }
16767#line 16768 "parse.c"
16768 break;
16769
16770 case 709: /* f_args: f_arg ',' f_rest_arg opt_args_tail_args_tail */
16771#line 6429 "parse.y"
16772 {
16773 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
16774 /*% ripper: params!($:1, Qnil, $:3, Qnil, *$:4[0..2]) %*/
16775 }
16776#line 16777 "parse.c"
16777 break;
16778
16779 case 710: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail_args_tail */
16780#line 6434 "parse.y"
16781 {
16782 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), 0, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16783 /*% ripper: params!($:1, Qnil, $:3, $:5, *$:6[0..2]) %*/
16784 }
16785#line 16786 "parse.c"
16786 break;
16787
16788 case 711: /* f_args: f_arg opt_args_tail_args_tail */
16789#line 6439 "parse.y"
16790 {
16791 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
16792 /*% ripper: params!($:1, Qnil, Qnil, Qnil, *$:2[0..2]) %*/
16793 }
16794#line 16795 "parse.c"
16795 break;
16796
16797 case 712: /* f_args: f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail */
16798#line 6444 "parse.y"
16799 {
16800 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
16801 /*% ripper: params!(Qnil, $:1, $:3, Qnil, *$:4[0..2]) %*/
16802 }
16803#line 16804 "parse.c"
16804 break;
16805
16806 case 713: /* f_args: f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail */
16807#line 6449 "parse.y"
16808 {
16809 (yyval.node_args) = new_args(p, 0, (yyvsp[-5].node_opt_arg), (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16810 /*% ripper: params!(Qnil, $:1, $:3, $:5, *$:6[0..2]) %*/
16811 }
16812#line 16813 "parse.c"
16813 break;
16814
16815 case 714: /* f_args: f_optarg_arg_value opt_args_tail_args_tail */
16816#line 6454 "parse.y"
16817 {
16818 (yyval.node_args) = new_args(p, 0, (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
16819 /*% ripper: params!(Qnil, $:1, Qnil, Qnil, *$:2[0..2]) %*/
16820 }
16821#line 16822 "parse.c"
16822 break;
16823
16824 case 715: /* f_args: f_optarg_arg_value ',' f_arg opt_args_tail_args_tail */
16825#line 6459 "parse.y"
16826 {
16827 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), 0, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16828 /*% ripper: params!(Qnil, $:1, Qnil, $:3, *$:4[0..2]) %*/
16829 }
16830#line 16831 "parse.c"
16831 break;
16832
16833 case 716: /* f_args: f_rest_arg opt_args_tail_args_tail */
16834#line 6464 "parse.y"
16835 {
16836 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
16837 /*% ripper: params!(Qnil, Qnil, $:1, Qnil, *$:2[0..2]) %*/
16838 }
16839#line 16840 "parse.c"
16840 break;
16841
16842 case 717: /* f_args: f_rest_arg ',' f_arg opt_args_tail_args_tail */
16843#line 6469 "parse.y"
16844 {
16845 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16846 /*% ripper: params!(Qnil, Qnil, $:1, $:3, *$:4[0..2]) %*/
16847 }
16848#line 16849 "parse.c"
16849 break;
16850
16851 case 718: /* f_args: args_tail */
16852#line 6474 "parse.y"
16853 {
16854 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
16855 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, *$:1[0..2]) %*/
16856 }
16857#line 16858 "parse.c"
16858 break;
16859
16860 case 719: /* f_args: %empty */
16861#line 6479 "parse.y"
16862 {
16863 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
16864 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyval.node_args), &(yylsp[0]));
16865 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, Qnil) %*/
16866 }
16867#line 16868 "parse.c"
16868 break;
16869
16870 case 720: /* args_forward: "(..." */
16871#line 6487 "parse.y"
16872 {
16873#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
16874 (yyval.id) = 0;
16875#else
16876 (yyval.id) = idFWD_KWREST;
16877#endif
16878 /*% ripper: args_forward! %*/
16879 }
16880#line 16881 "parse.c"
16881 break;
16882
16883 case 721: /* f_bad_arg: "constant" */
16884#line 6498 "parse.y"
16885 {
16886 static const char mesg[] = "formal argument cannot be a constant";
16887 /*%%%*/
16888 yyerror1(&(yylsp[0]), mesg);
16889 /*% %*/
16890 (yyval.id) = 0;
16891 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16892 }
16893#line 16894 "parse.c"
16894 break;
16895
16896 case 722: /* f_bad_arg: "instance variable" */
16897#line 6507 "parse.y"
16898 {
16899 static const char mesg[] = "formal argument cannot be an instance variable";
16900 /*%%%*/
16901 yyerror1(&(yylsp[0]), mesg);
16902 /*% %*/
16903 (yyval.id) = 0;
16904 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16905 }
16906#line 16907 "parse.c"
16907 break;
16908
16909 case 723: /* f_bad_arg: "global variable" */
16910#line 6516 "parse.y"
16911 {
16912 static const char mesg[] = "formal argument cannot be a global variable";
16913 /*%%%*/
16914 yyerror1(&(yylsp[0]), mesg);
16915 /*% %*/
16916 (yyval.id) = 0;
16917 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16918 }
16919#line 16920 "parse.c"
16920 break;
16921
16922 case 724: /* f_bad_arg: "class variable" */
16923#line 6525 "parse.y"
16924 {
16925 static const char mesg[] = "formal argument cannot be a class variable";
16926 /*%%%*/
16927 yyerror1(&(yylsp[0]), mesg);
16928 /*% %*/
16929 (yyval.id) = 0;
16930 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16931 }
16932#line 16933 "parse.c"
16933 break;
16934
16935 case 726: /* f_norm_arg: "local variable or method" */
16936#line 6537 "parse.y"
16937 {
16938 VALUE e = formal_argument_error(p, (yyval.id) = (yyvsp[0].id));
16939 if (e) {
16940 /*% ripper[error]: param_error!(?e, $:1) %*/
16941 }
16942 p->max_numparam = ORDINAL_PARAM;
16943 }
16944#line 16945 "parse.c"
16945 break;
16946
16947 case 727: /* f_arg_asgn: f_norm_arg */
16948#line 6547 "parse.y"
16949 {
16950 ID id = (yyvsp[0].id);
16951 arg_var(p, id);
16952 (yyval.id) = (yyvsp[0].id);
16953 }
16954#line 16955 "parse.c"
16955 break;
16956
16957 case 728: /* f_arg_item: f_arg_asgn */
16958#line 6555 "parse.y"
16959 {
16960 (yyval.node_args_aux) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
16961 /*% ripper: $:1 %*/
16962 }
16963#line 16964 "parse.c"
16964 break;
16965
16966 case 729: /* f_arg_item: "(" f_margs rparen */
16967#line 6560 "parse.y"
16968 {
16969 ID tid = internal_id(p);
16970 YYLTYPE loc;
16971 loc.beg_pos = (yylsp[-1]).beg_pos;
16972 loc.end_pos = (yylsp[-1]).beg_pos;
16973 arg_var(p, tid);
16974 if (dyna_in_block(p)) {
16975 (yyvsp[-1].node_masgn)->nd_value = NEW_DVAR(tid, &loc);
16976 }
16977 else {
16978 (yyvsp[-1].node_masgn)->nd_value = NEW_LVAR(tid, &loc);
16979 }
16980 (yyval.node_args_aux) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
16981 (yyval.node_args_aux)->nd_next = (NODE *)(yyvsp[-1].node_masgn);
16982 /*% ripper: mlhs_paren!($:2) %*/
16983 }
16984#line 16985 "parse.c"
16985 break;
16986
16987 case 731: /* f_arg: f_arg ',' f_arg_item */
16988#line 6581 "parse.y"
16989 {
16990 (yyval.node_args_aux) = (yyvsp[-2].node_args_aux);
16991 (yyval.node_args_aux)->nd_plen++;
16992 (yyval.node_args_aux)->nd_next = block_append(p, (yyval.node_args_aux)->nd_next, (yyvsp[0].node_args_aux)->nd_next);
16993 rb_discard_node(p, (NODE *)(yyvsp[0].node_args_aux));
16994 /*% ripper: rb_ary_push($:1, $:3) %*/
16995 }
16996#line 16997 "parse.c"
16997 break;
16998
16999 case 732: /* f_label: "label" */
17000#line 6592 "parse.y"
17001 {
17002 VALUE e = formal_argument_error(p, (yyval.id) = (yyvsp[0].id));
17003 if (e) {
17004 (yyval.id) = 0;
17005 /*% ripper[error]: param_error!(?e, $:1) %*/
17006 }
17007 /*
17008 * Workaround for Prism::ParseTest#test_filepath for
17009 * "unparser/corpus/literal/def.txt"
17010 *
17011 * See the discussion on https://github.com/ruby/ruby/pull/9923
17012 */
17013 arg_var(p, ifdef_ripper(0, (yyvsp[0].id)));
17014 /*% ripper: $:1 %*/
17015 p->max_numparam = ORDINAL_PARAM;
17016 p->ctxt.in_argdef = 0;
17017 }
17018#line 17019 "parse.c"
17019 break;
17020
17021 case 733: /* f_kw: f_label arg_value */
17022#line 6612 "parse.y"
17023 {
17024 p->ctxt.in_argdef = 1;
17025 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
17026 /*% ripper: [$:$, $:2] %*/
17027 }
17028#line 17029 "parse.c"
17029 break;
17030
17031 case 734: /* f_kw: f_label */
17032#line 6618 "parse.y"
17033 {
17034 p->ctxt.in_argdef = 1;
17035 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
17036 /*% ripper: [$:$, 0] %*/
17037 }
17038#line 17039 "parse.c"
17039 break;
17040
17041 case 735: /* f_block_kw: f_label primary_value */
17042#line 6626 "parse.y"
17043 {
17044 p->ctxt.in_argdef = 1;
17045 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
17046 /*% ripper: [$:$, $:2] %*/
17047 }
17048#line 17049 "parse.c"
17049 break;
17050
17051 case 736: /* f_block_kw: f_label */
17052#line 6632 "parse.y"
17053 {
17054 p->ctxt.in_argdef = 1;
17055 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
17056 /*% ripper: [$:$, 0] %*/
17057 }
17058#line 17059 "parse.c"
17059 break;
17060
17061 case 739: /* f_no_kwarg: p_kwnorest */
17062#line 6644 "parse.y"
17063 {
17064 /*% ripper: nokw_param!(Qnil) %*/
17065 }
17066#line 17067 "parse.c"
17067 break;
17068
17069 case 740: /* f_kwrest: kwrest_mark "local variable or method" */
17070#line 6650 "parse.y"
17071 {
17072 arg_var(p, shadowing_lvar(p, (yyvsp[0].id)));
17073 (yyval.id) = (yyvsp[0].id);
17074 /*% ripper: kwrest_param!($:2) %*/
17075 }
17076#line 17077 "parse.c"
17077 break;
17078
17079 case 741: /* f_kwrest: kwrest_mark */
17080#line 6656 "parse.y"
17081 {
17082 arg_var(p, idFWD_KWREST);
17083 (yyval.id) = idFWD_KWREST;
17084 /*% ripper: kwrest_param!(Qnil) %*/
17085 }
17086#line 17087 "parse.c"
17087 break;
17088
17089 case 744: /* f_rest_arg: restarg_mark "local variable or method" */
17090#line 6668 "parse.y"
17091 {
17092 arg_var(p, shadowing_lvar(p, (yyvsp[0].id)));
17093 (yyval.id) = (yyvsp[0].id);
17094 /*% ripper: rest_param!($:2) %*/
17095 }
17096#line 17097 "parse.c"
17097 break;
17098
17099 case 745: /* f_rest_arg: restarg_mark */
17100#line 6674 "parse.y"
17101 {
17102 arg_var(p, idFWD_REST);
17103 (yyval.id) = idFWD_REST;
17104 /*% ripper: rest_param!(Qnil) %*/
17105 }
17106#line 17107 "parse.c"
17107 break;
17108
17109 case 748: /* f_block_arg: blkarg_mark "local variable or method" */
17110#line 6686 "parse.y"
17111 {
17112 arg_var(p, shadowing_lvar(p, (yyvsp[0].id)));
17113 (yyval.id) = (yyvsp[0].id);
17114 /*% ripper: blockarg!($:2) %*/
17115 }
17116#line 17117 "parse.c"
17117 break;
17118
17119 case 749: /* f_block_arg: blkarg_mark */
17120#line 6692 "parse.y"
17121 {
17122 arg_var(p, idFWD_BLOCK);
17123 (yyval.id) = idFWD_BLOCK;
17124 /*% ripper: blockarg!(Qnil) %*/
17125 }
17126#line 17127 "parse.c"
17127 break;
17128
17129 case 750: /* opt_f_block_arg: ',' f_block_arg */
17130#line 6700 "parse.y"
17131 {
17132 (yyval.id) = (yyvsp[0].id);
17133 /*% ripper: $:2 %*/
17134 }
17135#line 17136 "parse.c"
17136 break;
17137
17138 case 751: /* opt_f_block_arg: none */
17139#line 6705 "parse.y"
17140 {
17141 (yyval.id) = 0;
17142 /*% ripper: Qnil %*/
17143 }
17144#line 17145 "parse.c"
17145 break;
17146
17147 case 752: /* singleton: var_ref */
17148#line 6712 "parse.y"
17149 {
17150 value_expr((yyvsp[0].node));
17151 (yyval.node) = (yyvsp[0].node);
17152 }
17153#line 17154 "parse.c"
17154 break;
17155
17156 case 753: /* $@37: %empty */
17157#line 6717 "parse.y"
17158 {
17159 SET_LEX_STATE(EXPR_BEG);
17160 p->ctxt.in_argdef = 0;
17161 }
17162#line 17163 "parse.c"
17163 break;
17164
17165 case 754: /* singleton: '(' $@37 expr rparen */
17166#line 6722 "parse.y"
17167 {
17168 p->ctxt.in_argdef = 1;
17169 NODE *expr = last_expr_node((yyvsp[-1].node));
17170 switch (nd_type(expr)) {
17171 case NODE_STR:
17172 case NODE_DSTR:
17173 case NODE_XSTR:
17174 case NODE_DXSTR:
17175 case NODE_REGX:
17176 case NODE_DREGX:
17177 case NODE_SYM:
17178 case NODE_LINE:
17179 case NODE_FILE:
17180 case NODE_ENCODING:
17181 case NODE_INTEGER:
17182 case NODE_FLOAT:
17183 case NODE_RATIONAL:
17184 case NODE_IMAGINARY:
17185 case NODE_DSYM:
17186 case NODE_LIST:
17187 case NODE_ZLIST:
17188 yyerror1(&expr->nd_loc, "can't define singleton method for literals");
17189 break;
17190 default:
17191 value_expr((yyvsp[-1].node));
17192 break;
17193 }
17194 (yyval.node) = (yyvsp[-1].node);
17195 /*% ripper: paren!($:3) %*/
17196 }
17197#line 17198 "parse.c"
17198 break;
17199
17200 case 756: /* assoc_list: assocs trailer */
17201#line 6756 "parse.y"
17202 {
17203 (yyval.node) = (yyvsp[-1].node);
17204 /*% ripper: assoclist_from_args!($:1) %*/
17205 }
17206#line 17207 "parse.c"
17207 break;
17208
17209 case 758: /* assocs: assocs ',' assoc */
17210#line 6765 "parse.y"
17211 {
17212 NODE *assocs = (yyvsp[-2].node);
17213 NODE *tail = (yyvsp[0].node);
17214 if (!assocs) {
17215 assocs = tail;
17216 }
17217 else if (tail) {
17218 if (RNODE_LIST(assocs)->nd_head) {
17219 NODE *n = RNODE_LIST(tail)->nd_next;
17220 if (!RNODE_LIST(tail)->nd_head && nd_type_p(n, NODE_LIST) &&
17221 nd_type_p((n = RNODE_LIST(n)->nd_head), NODE_HASH)) {
17222 /* DSTAR */
17223 tail = RNODE_HASH(n)->nd_head;
17224 }
17225 }
17226 if (tail) {
17227 assocs = list_concat(assocs, tail);
17228 }
17229 }
17230 (yyval.node) = assocs;
17231 /*% ripper: rb_ary_push($:1, $:3) %*/
17232 }
17233#line 17234 "parse.c"
17234 break;
17235
17236 case 759: /* assoc: arg_value "=>" arg_value */
17237#line 6790 "parse.y"
17238 {
17239 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
17240 /*% ripper: assoc_new!($:1, $:3) %*/
17241 }
17242#line 17243 "parse.c"
17243 break;
17244
17245 case 760: /* assoc: "label" arg_value */
17246#line 6795 "parse.y"
17247 {
17248 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
17249 /*% ripper: assoc_new!($:1, $:2) %*/
17250 }
17251#line 17252 "parse.c"
17252 break;
17253
17254 case 761: /* assoc: "label" */
17255#line 6800 "parse.y"
17256 {
17257 NODE *val = gettable(p, (yyvsp[0].id), &(yyloc));
17258 if (!val) val = NEW_ERROR(&(yyloc));
17259 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[0].id)), &(yylsp[0])), &(yyloc)), val);
17260 /*% ripper: assoc_new!($:1, Qnil) %*/
17261 }
17262#line 17263 "parse.c"
17263 break;
17264
17265 case 762: /* assoc: "string literal" string_contents tLABEL_END arg_value */
17266#line 6807 "parse.y"
17267 {
17268 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
17269 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
17270 /*% ripper: assoc_new!(dyna_symbol!($:2), $:4) %*/
17271 }
17272#line 17273 "parse.c"
17273 break;
17274
17275 case 763: /* assoc: "**arg" arg_value */
17276#line 6813 "parse.y"
17277 {
17278 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
17279 /*% ripper: assoc_splat!($:2) %*/
17280 }
17281#line 17282 "parse.c"
17282 break;
17283
17284 case 764: /* assoc: "**arg" */
17285#line 6818 "parse.y"
17286 {
17287 forwarding_arg_check(p, idFWD_KWREST, idFWD_ALL, "keyword rest");
17288 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)),
17289 NEW_LVAR(idFWD_KWREST, &(yyloc)));
17290 /*% ripper: assoc_splat!(Qnil) %*/
17291 }
17292#line 17293 "parse.c"
17293 break;
17294
17295 case 784: /* term: ';' */
17296#line 6864 "parse.y"
17297 {yyerrok;token_flush(p);}
17298#line 17299 "parse.c"
17299 break;
17300
17301 case 785: /* term: '\n' */
17302#line 6866 "parse.y"
17303 {
17304 (yyloc).end_pos = (yyloc).beg_pos;
17305 token_flush(p);
17306 }
17307#line 17308 "parse.c"
17308 break;
17309
17310 case 787: /* terms: terms ';' */
17311#line 6873 "parse.y"
17312 {yyerrok;}
17313#line 17314 "parse.c"
17314 break;
17315
17316 case 788: /* none: %empty */
17317#line 6877 "parse.y"
17318 {
17319 (yyval.node) = 0;
17320 }
17321#line 17322 "parse.c"
17322 break;
17323
17324
17325#line 17326 "parse.c"
17326
17327 default: break;
17328 }
17329 /* User semantic actions sometimes alter yychar, and that requires
17330 that yytoken be updated with the new translation. We take the
17331 approach of translating immediately before every use of yytoken.
17332 One alternative is translating here after every semantic action,
17333 but that translation would be missed if the semantic action invokes
17334 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
17335 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
17336 incorrect destructor might then be invoked immediately. In the
17337 case of YYERROR or YYBACKUP, subsequent parser actions might lead
17338 to an incorrect destructor call or verbose syntax error message
17339 before the lookahead is translated. */
17340 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc, p);
17341
17342 YYPOPSTACK (yylen);
17343 /* %after-reduce function. */
17344#line 2660 "parse.y"
17345 {after_reduce(yylen, p);}
17346#line 17347 "parse.c"
17347
17348 yylen = 0;
17349
17350 *++yyvsp = yyval;
17351 *++yylsp = yyloc;
17352
17353 /* Now 'shift' the result of the reduction. Determine what state
17354 that goes to, based on the state we popped back to and the rule
17355 number reduced by. */
17356 {
17357 const int yylhs = yyr1[yyn] - YYNTOKENS;
17358 const int yyi = yypgoto[yylhs] + *yyssp;
17359 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
17360 ? yytable[yyi]
17361 : yydefgoto[yylhs]);
17362 }
17363
17364 goto yynewstate;
17365
17366
17367/*--------------------------------------.
17368| yyerrlab -- here on detecting error. |
17369`--------------------------------------*/
17370yyerrlab:
17371 /* Make sure we have latest lookahead translation. See comments at
17372 user semantic actions for why this is necessary. */
17373 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
17374 /* If not already recovering from an error, report this error. */
17375 if (!yyerrstatus)
17376 {
17377 ++yynerrs;
17378 {
17379 yypcontext_t yyctx
17380 = {yyssp, yytoken, &yylloc};
17381 char const *yymsgp = YY_("syntax error");
17382 int yysyntax_error_status;
17383 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
17384 if (yysyntax_error_status == 0)
17385 yymsgp = yymsg;
17386 else if (yysyntax_error_status == -1)
17387 {
17388 if (yymsg != yymsgbuf)
17389 YYSTACK_FREE (yymsg);
17390 yymsg = YY_CAST (char *,
17391 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
17392 if (yymsg)
17393 {
17394 yysyntax_error_status
17395 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
17396 yymsgp = yymsg;
17397 }
17398 else
17399 {
17400 yymsg = yymsgbuf;
17401 yymsg_alloc = sizeof yymsgbuf;
17402 yysyntax_error_status = YYENOMEM;
17403 }
17404 }
17405 yyerror (&yylloc, p, yymsgp);
17406 if (yysyntax_error_status == YYENOMEM)
17407 YYNOMEM;
17408 }
17409 }
17410
17411 yyerror_range[1] = yylloc;
17412 if (yyerrstatus == 3)
17413 {
17414 /* If just tried and failed to reuse lookahead token after an
17415 error, discard it. */
17416
17417 if (yychar <= END_OF_INPUT)
17418 {
17419 /* Return failure if at end of input. */
17420 if (yychar == END_OF_INPUT)
17421 YYABORT;
17422 }
17423 else
17424 {
17425 yydestruct ("Error: discarding",
17426 yytoken, &yylval, &yylloc, p);
17427 yychar = YYEMPTY;
17428 }
17429 }
17430
17431 /* Else will try to reuse lookahead token after shifting the error
17432 token. */
17433 goto yyerrlab1;
17434
17435
17436/*---------------------------------------------------.
17437| yyerrorlab -- error raised explicitly by YYERROR. |
17438`---------------------------------------------------*/
17439yyerrorlab:
17440 /* Pacify compilers when the user code never invokes YYERROR and the
17441 label yyerrorlab therefore never appears in user code. */
17442 if (0)
17443 YYERROR;
17444 ++yynerrs;
17445
17446 /* Do not reclaim the symbols of the rule whose action triggered
17447 this YYERROR. */
17448 YYPOPSTACK (yylen);
17449 /* %after-pop-stack function. */
17450#line 2662 "parse.y"
17451 {after_pop_stack(yylen, p);}
17452#line 17453 "parse.c"
17453
17454 yylen = 0;
17455 YY_STACK_PRINT (yyss, yyssp, p);
17456 yystate = *yyssp;
17457 goto yyerrlab1;
17458
17459
17460/*-------------------------------------------------------------.
17461| yyerrlab1 -- common code for both syntax error and YYERROR. |
17462`-------------------------------------------------------------*/
17463yyerrlab1:
17464 yyerrstatus = 3; /* Each real token shifted decrements this. */
17465
17466 /* Pop stack until we find a state that shifts the error token. */
17467 for (;;)
17468 {
17469 yyn = yypact[yystate];
17470 if (!yypact_value_is_default (yyn))
17471 {
17472 yyn += YYSYMBOL_YYerror;
17473 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
17474 {
17475 yyn = yytable[yyn];
17476 if (0 < yyn)
17477 break;
17478 }
17479 }
17480
17481 /* Pop the current state because it cannot handle the error token. */
17482 if (yyssp == yyss)
17483 YYABORT;
17484
17485 yyerror_range[1] = *yylsp;
17486 yydestruct ("Error: popping",
17487 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
17488 YYPOPSTACK (1);
17489 /* %after-pop-stack function. */
17490#line 2662 "parse.y"
17491 {after_pop_stack(1, p);}
17492#line 17493 "parse.c"
17493
17494 yystate = *yyssp;
17495 YY_STACK_PRINT (yyss, yyssp, p);
17496 }
17497
17498 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
17499 *++yyvsp = yylval;
17500 YY_IGNORE_MAYBE_UNINITIALIZED_END
17501
17502 yyerror_range[2] = yylloc;
17503 ++yylsp;
17504 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
17505
17506 /* Shift the error token. */
17507 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp, p);
17508 /* %after-shift-error-token code. */
17509#line 2661 "parse.y"
17510 {after_shift_error_token(p);}
17511#line 17512 "parse.c"
17512
17513
17514 yystate = yyn;
17515 goto yynewstate;
17516
17517
17518/*-------------------------------------.
17519| yyacceptlab -- YYACCEPT comes here. |
17520`-------------------------------------*/
17521yyacceptlab:
17522 yyresult = 0;
17523 goto yyreturnlab;
17524
17525
17526/*-----------------------------------.
17527| yyabortlab -- YYABORT comes here. |
17528`-----------------------------------*/
17529yyabortlab:
17530 yyresult = 1;
17531 goto yyreturnlab;
17532
17533
17534/*-----------------------------------------------------------.
17535| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
17536`-----------------------------------------------------------*/
17537yyexhaustedlab:
17538 yyerror (&yylloc, p, YY_("memory exhausted"));
17539 yyresult = 2;
17540 goto yyreturnlab;
17541
17542
17543/*----------------------------------------------------------.
17544| yyreturnlab -- parsing is finished, clean up and return. |
17545`----------------------------------------------------------*/
17546yyreturnlab:
17547 if (yychar != YYEMPTY)
17548 {
17549 /* Make sure we have latest lookahead translation. See comments at
17550 user semantic actions for why this is necessary. */
17551 yytoken = YYTRANSLATE (yychar);
17552 yydestruct ("Cleanup: discarding lookahead",
17553 yytoken, &yylval, &yylloc, p);
17554 }
17555 /* Do not reclaim the symbols of the rule whose action triggered
17556 this YYABORT or YYACCEPT. */
17557 YYPOPSTACK (yylen);
17558 YY_STACK_PRINT (yyss, yyssp, p);
17559 while (yyssp != yyss)
17560 {
17561 yydestruct ("Cleanup: popping",
17562 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
17563 YYPOPSTACK (1);
17564 }
17565#ifndef yyoverflow
17566 if (yyss != yyssa)
17567 YYSTACK_FREE (yyss);
17568#endif
17569 if (yymsg != yymsgbuf)
17570 YYSTACK_FREE (yymsg);
17571 return yyresult;
17572}
17573
17574#line 6881 "parse.y"
17575
17576# undef p
17577# undef yylex
17578# undef yylval
17579# define yylval (*p->lval)
17580
17581static int regx_options(struct parser_params*);
17582static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
17583static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
17584static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
17585static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
17586
17587#define set_parser_s_value(x) (ifdef_ripper(p->s_value = (x), (void)0))
17588
17589# define set_yylval_node(x) { \
17590 YYLTYPE _cur_loc; \
17591 rb_parser_set_location(p, &_cur_loc); \
17592 yylval.node = (x); \
17593 set_parser_s_value(STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)); \
17594}
17595# define set_yylval_str(x) \
17596do { \
17597 set_yylval_node(NEW_STR(x, &_cur_loc)); \
17598 set_parser_s_value(rb_str_new_mutable_parser_string(x)); \
17599} while(0)
17600# define set_yylval_num(x) { \
17601 yylval.num = (x); \
17602 set_parser_s_value(x); \
17603}
17604# define set_yylval_id(x) (yylval.id = (x))
17605# define set_yylval_name(x) { \
17606 (yylval.id = (x)); \
17607 set_parser_s_value(ID2SYM(x)); \
17608}
17609# define yylval_id() (yylval.id)
17610
17611#define set_yylval_noname() set_yylval_id(keyword_nil)
17612#define has_delayed_token(p) (p->delayed.token != NULL)
17613
17614#ifndef RIPPER
17615#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
17616#define dispatch_scan_event(p, t) parser_dispatch_scan_event(p, t, __LINE__)
17617
17618static bool
17619parser_has_token(struct parser_params *p)
17620{
17621 const char *const pcur = p->lex.pcur;
17622 const char *const ptok = p->lex.ptok;
17623 if (p->keep_tokens && (pcur < ptok)) {
17624 rb_bug("lex.pcur < lex.ptok. (line: %d) %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF"",
17625 p->ruby_sourceline, ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur);
17626 }
17627 return pcur > ptok;
17628}
17629
17630static const char *
17631escaped_char(int c)
17632{
17633 switch (c) {
17634 case '"': return "\\\"";
17635 case '\\': return "\\\\";
17636 case '\0': return "\\0";
17637 case '\n': return "\\n";
17638 case '\r': return "\\r";
17639 case '\t': return "\\t";
17640 case '\f': return "\\f";
17641 case '\013': return "\\v";
17642 case '\010': return "\\b";
17643 case '\007': return "\\a";
17644 case '\033': return "\\e";
17645 case '\x7f': return "\\c?";
17646 }
17647 return NULL;
17648}
17649
17650static rb_parser_string_t *
17651rb_parser_str_escape(struct parser_params *p, rb_parser_string_t *str)
17652{
17653 rb_encoding *enc = p->enc;
17654 const char *ptr = str->ptr;
17655 const char *pend = ptr + str->len;
17656 const char *prev = ptr;
17657 char charbuf[5] = {'\\', 'x', 0, 0, 0};
17658 rb_parser_string_t * result = rb_parser_string_new(p, 0, 0);
17659
17660 while (ptr < pend) {
17661 unsigned int c;
17662 const char *cc;
17663 int n = rb_enc_precise_mbclen(ptr, pend, enc);
17664 if (!MBCLEN_CHARFOUND_P(n)) {
17665 if (ptr > prev) parser_str_cat(result, prev, ptr - prev);
17666 n = rb_enc_mbminlen(enc);
17667 if (pend < ptr + n)
17668 n = (int)(pend - ptr);
17669 while (n--) {
17670 c = *ptr & 0xf0 >> 4;
17671 charbuf[2] = (c < 10) ? '0' + c : 'A' + c - 10;
17672 c = *ptr & 0x0f;
17673 charbuf[3] = (c < 10) ? '0' + c : 'A' + c - 10;
17674 parser_str_cat(result, charbuf, 4);
17675 prev = ++ptr;
17676 }
17677 continue;
17678 }
17679 n = MBCLEN_CHARFOUND_LEN(n);
17680 c = rb_enc_mbc_to_codepoint(ptr, pend, enc);
17681 ptr += n;
17682 cc = escaped_char(c);
17683 if (cc) {
17684 if (ptr - n > prev) parser_str_cat(result, prev, ptr - n - prev);
17685 parser_str_cat_cstr(result, cc);
17686 prev = ptr;
17687 }
17688 else if (rb_enc_isascii(c, enc) && ISPRINT(c)) {
17689 }
17690 else {
17691 if (ptr - n > prev) {
17692 parser_str_cat(result, prev, ptr - n - prev);
17693 prev = ptr - n;
17694 }
17695 parser_str_cat(result, prev, ptr - prev);
17696 prev = ptr;
17697 }
17698 }
17699 if (ptr > prev) parser_str_cat(result, prev, ptr - prev);
17700
17701 return result;
17702}
17703
17704static void
17705parser_append_tokens(struct parser_params *p, rb_parser_string_t *str, enum yytokentype t, int line)
17706{
17707 rb_parser_ast_token_t *token = xcalloc(1, sizeof(rb_parser_ast_token_t));
17708 token->id = p->token_id;
17709 token->type_name = parser_token2char(p, t);
17710 token->str = str;
17711 token->loc.beg_pos = p->yylloc->beg_pos;
17712 token->loc.end_pos = p->yylloc->end_pos;
17713 rb_parser_ary_push_ast_token(p, p->tokens, token);
17714 p->token_id++;
17715
17716 if (p->debug) {
17717 rb_parser_string_t *str_escaped = rb_parser_str_escape(p, str);
17718 rb_parser_printf(p, "Append tokens (line: %d) [%d, :%s, \"%s\", [%d, %d, %d, %d]]\n",
17719 line, token->id, token->type_name, str_escaped->ptr,
17720 token->loc.beg_pos.lineno, token->loc.beg_pos.column,
17721 token->loc.end_pos.lineno, token->loc.end_pos.column);
17722 rb_parser_string_free(p, str_escaped);
17723 }
17724}
17725
17726static void
17727parser_dispatch_scan_event(struct parser_params *p, enum yytokentype t, int line)
17728{
17729 debug_token_line(p, "parser_dispatch_scan_event", line);
17730
17731 if (!parser_has_token(p)) return;
17732
17733 RUBY_SET_YYLLOC(*p->yylloc);
17734
17735 if (p->keep_tokens) {
17736 rb_parser_string_t *str = rb_parser_encoding_string_new(p, p->lex.ptok, p->lex.pcur - p->lex.ptok, p->enc);
17737 parser_append_tokens(p, str, t, line);
17738 }
17739
17740 token_flush(p);
17741}
17742
17743#define dispatch_delayed_token(p, t) parser_dispatch_delayed_token(p, t, __LINE__)
17744static void
17745parser_dispatch_delayed_token(struct parser_params *p, enum yytokentype t, int line)
17746{
17747 debug_token_line(p, "parser_dispatch_delayed_token", line);
17748
17749 if (!has_delayed_token(p)) return;
17750
17751 RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(*p->yylloc);
17752
17753 if (p->keep_tokens) {
17754 /* p->delayed.token is freed by rb_parser_tokens_free */
17755 parser_append_tokens(p, p->delayed.token, t, line);
17756 } else {
17757 rb_parser_string_free(p, p->delayed.token);
17758 }
17759
17760 p->delayed.token = NULL;
17761}
17762#else
17763#define literal_flush(p, ptr) ((void)(ptr))
17764
17765static int
17766ripper_has_scan_event(struct parser_params *p)
17767{
17768 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
17769 return p->lex.pcur > p->lex.ptok;
17770}
17771
17772static VALUE
17773ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
17774{
17775 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
17776 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
17777 RUBY_SET_YYLLOC(*p->yylloc);
17778 token_flush(p);
17779 return rval;
17780}
17781
17782static void
17783ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
17784{
17785 if (!ripper_has_scan_event(p)) return;
17786
17787 set_parser_s_value(ripper_scan_event_val(p, t));
17788}
17789#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
17790
17791static void
17792ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
17793{
17794 /* save and adjust the location to delayed token for callbacks */
17795 int saved_line = p->ruby_sourceline;
17796 const char *saved_tokp = p->lex.ptok;
17797 VALUE s_value, str;
17798
17799 if (!has_delayed_token(p)) return;
17800 p->ruby_sourceline = p->delayed.beg_line;
17801 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
17802 str = rb_str_new_mutable_parser_string(p->delayed.token);
17803 rb_parser_string_free(p, p->delayed.token);
17804 s_value = ripper_dispatch1(p, ripper_token2eventid(t), str);
17805 set_parser_s_value(s_value);
17806 p->delayed.token = NULL;
17807 p->ruby_sourceline = saved_line;
17808 p->lex.ptok = saved_tokp;
17809}
17810#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
17811#endif /* RIPPER */
17812
17813static inline int
17814is_identchar(struct parser_params *p, const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
17815{
17816 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
17817}
17818
17819static inline int
17820parser_is_identchar(struct parser_params *p)
17821{
17822 return !(p)->eofp && is_identchar(p, p->lex.pcur-1, p->lex.pend, p->enc);
17823}
17824
17825static inline int
17826parser_isascii(struct parser_params *p)
17827{
17828 return ISASCII(*(p->lex.pcur-1));
17829}
17830
17831static void
17832token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
17833{
17834 int column = 1, nonspc = 0, i;
17835 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
17836 if (*ptr == '\t') {
17837 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
17838 }
17839 column++;
17840 if (*ptr != ' ' && *ptr != '\t') {
17841 nonspc = 1;
17842 }
17843 }
17844
17845 ptinfo->beg = loc->beg_pos;
17846 ptinfo->indent = column;
17847 ptinfo->nonspc = nonspc;
17848}
17849
17850static void
17851token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17852{
17853 token_info *ptinfo;
17854
17855 if (!p->token_info_enabled) return;
17856 ptinfo = ALLOC(token_info);
17857 ptinfo->token = token;
17858 ptinfo->next = p->token_info;
17859 token_info_setup(ptinfo, p->lex.pbeg, loc);
17860
17861 p->token_info = ptinfo;
17862}
17863
17864static void
17865token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17866{
17867 token_info *ptinfo_beg = p->token_info;
17868
17869 if (!ptinfo_beg) return;
17870
17871 /* indentation check of matched keywords (begin..end, if..end, etc.) */
17872 token_info_warn(p, token, ptinfo_beg, 1, loc);
17873
17874 p->token_info = ptinfo_beg->next;
17875 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17876}
17877
17878static void
17879token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
17880{
17881 token_info *ptinfo_beg = p->token_info;
17882
17883 if (!ptinfo_beg) return;
17884 p->token_info = ptinfo_beg->next;
17885
17886 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
17887 ptinfo_beg->beg.column != beg_pos.column ||
17888 strcmp(ptinfo_beg->token, token)) {
17889 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
17890 beg_pos.lineno, beg_pos.column, token,
17891 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
17892 ptinfo_beg->token);
17893 }
17894
17895 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17896}
17897
17898static void
17899token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
17900{
17901 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
17902 if (!p->token_info_enabled) return;
17903 if (!ptinfo_beg) return;
17904 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
17905 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
17906 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
17907 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
17908 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
17909 rb_warn3L(ptinfo_end->beg.lineno,
17910 "mismatched indentations at '%s' with '%s' at %d",
17911 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
17912}
17913
17914static int
17915parser_precise_mbclen(struct parser_params *p, const char *ptr)
17916{
17917 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
17918 if (!MBCLEN_CHARFOUND_P(len)) {
17919 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
17920 return -1;
17921 }
17922 return len;
17923}
17924
17925#ifndef RIPPER
17926static inline void
17927parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
17928{
17929 rb_parser_string_t *str;
17930 int lineno = p->ruby_sourceline;
17931 if (!yylloc) {
17932 return;
17933 }
17934 else if (yylloc->beg_pos.lineno == lineno) {
17935 str = p->lex.lastline;
17936 }
17937 else {
17938 return;
17939 }
17940 ruby_show_error_line(p, p->error_buffer, yylloc, lineno, str);
17941}
17942
17943static int
17944parser_yyerror(struct parser_params *p, const rb_code_location_t *yylloc, const char *msg)
17945{
17946#if 0
17947 YYLTYPE current;
17948
17949 if (!yylloc) {
17950 yylloc = RUBY_SET_YYLLOC(current);
17951 }
17952 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
17953 p->ruby_sourceline != yylloc->end_pos.lineno)) {
17954 yylloc = 0;
17955 }
17956#endif
17957 parser_compile_error(p, yylloc, "%s", msg);
17958 parser_show_error_line(p, yylloc);
17959 return 0;
17960}
17961
17962static int
17963parser_yyerror0(struct parser_params *p, const char *msg)
17964{
17965 YYLTYPE current;
17966 return parser_yyerror(p, RUBY_SET_YYLLOC(current), msg);
17967}
17968
17969void
17970ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, rb_parser_string_t *str)
17971{
17972 VALUE mesg;
17973 const int max_line_margin = 30;
17974 const char *ptr, *ptr_end, *pt, *pb;
17975 const char *pre = "", *post = "", *pend;
17976 const char *code = "", *caret = "";
17977 const char *lim;
17978 const char *const pbeg = PARSER_STRING_PTR(str);
17979 char *buf;
17980 long len;
17981 int i;
17982
17983 if (!yylloc) return;
17984 pend = rb_parser_string_end(str);
17985 if (pend > pbeg && pend[-1] == '\n') {
17986 if (--pend > pbeg && pend[-1] == '\r') --pend;
17987 }
17988
17989 pt = pend;
17990 if (lineno == yylloc->end_pos.lineno &&
17991 (pend - pbeg) > yylloc->end_pos.column) {
17992 pt = pbeg + yylloc->end_pos.column;
17993 }
17994
17995 ptr = ptr_end = pt;
17996 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
17997 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
17998
17999 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
18000 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
18001
18002 len = ptr_end - ptr;
18003 if (len > 4) {
18004 if (ptr > pbeg) {
18005 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_parser_str_get_encoding(str));
18006 if (ptr > pbeg) pre = "...";
18007 }
18008 if (ptr_end < pend) {
18009 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_parser_str_get_encoding(str));
18010 if (ptr_end < pend) post = "...";
18011 }
18012 }
18013 pb = pbeg;
18014 if (lineno == yylloc->beg_pos.lineno) {
18015 pb += yylloc->beg_pos.column;
18016 if (pb > pt) pb = pt;
18017 }
18018 if (pb < ptr) pb = ptr;
18019 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
18020 return;
18021 }
18022 if (RTEST(errbuf)) {
18023 mesg = rb_attr_get(errbuf, idMesg);
18024 if (char_at_end(p, mesg, '\n') != '\n')
18025 rb_str_cat_cstr(mesg, "\n");
18026 }
18027 else {
18028 mesg = rb_enc_str_new(0, 0, rb_parser_str_get_encoding(str));
18029 }
18030 if (!errbuf && rb_stderr_tty_p()) {
18031#define CSI_BEGIN "\033["
18032#define CSI_SGR "m"
18033 rb_str_catf(mesg,
18034 CSI_BEGIN""CSI_SGR"%s" /* pre */
18035 CSI_BEGIN"1"CSI_SGR"%.*s"
18036 CSI_BEGIN"1;4"CSI_SGR"%.*s"
18037 CSI_BEGIN";1"CSI_SGR"%.*s"
18038 CSI_BEGIN""CSI_SGR"%s" /* post */
18039 "\n",
18040 pre,
18041 (int)(pb - ptr), ptr,
18042 (int)(pt - pb), pb,
18043 (int)(ptr_end - pt), pt,
18044 post);
18045 }
18046 else {
18047 char *p2;
18048
18049 len = ptr_end - ptr;
18050 lim = pt < pend ? pt : pend;
18051 i = (int)(lim - ptr);
18052 buf = ALLOCA_N(char, i+2);
18053 code = ptr;
18054 caret = p2 = buf;
18055 if (ptr <= pb) {
18056 while (ptr < pb) {
18057 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
18058 }
18059 *p2++ = '^';
18060 ptr++;
18061 }
18062 if (lim > ptr) {
18063 memset(p2, '~', (lim - ptr));
18064 p2 += (lim - ptr);
18065 }
18066 *p2 = '\0';
18067 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
18068 pre, (int)len, code, post,
18069 pre, caret);
18070 }
18071 if (!errbuf) rb_write_error_str(mesg);
18072}
18073#else
18074
18075static int
18076parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
18077{
18078 const char *pcur = 0, *ptok = 0;
18079 if (p->ruby_sourceline == yylloc->beg_pos.lineno &&
18080 p->ruby_sourceline == yylloc->end_pos.lineno) {
18081 pcur = p->lex.pcur;
18082 ptok = p->lex.ptok;
18083 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
18084 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
18085 }
18086 parser_yyerror0(p, msg);
18087 if (pcur) {
18088 p->lex.ptok = ptok;
18089 p->lex.pcur = pcur;
18090 }
18091 return 0;
18092}
18093
18094static int
18095parser_yyerror0(struct parser_params *p, const char *msg)
18096{
18097 dispatch1(parse_error, STR_NEW2(msg));
18098 ripper_error(p);
18099 return 0;
18100}
18101
18102static inline void
18103parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
18104{
18105}
18106#endif /* !RIPPER */
18107
18108static int
18109vtable_size(const struct vtable *tbl)
18110{
18111 if (!DVARS_TERMINAL_P(tbl)) {
18112 return tbl->pos;
18113 }
18114 else {
18115 return 0;
18116 }
18117}
18118
18119static struct vtable *
18120vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
18121{
18122 struct vtable *tbl = ALLOC(struct vtable);
18123 tbl->pos = 0;
18124 tbl->capa = 8;
18125 tbl->tbl = ALLOC_N(ID, tbl->capa);
18126 tbl->prev = prev;
18127#ifndef RIPPER
18128 if (p->debug) {
18129 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
18130 }
18131#endif
18132 return tbl;
18133}
18134#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
18135
18136static void
18137vtable_free_gen(struct parser_params *p, int line, const char *name,
18138 struct vtable *tbl)
18139{
18140#ifndef RIPPER
18141 if (p->debug) {
18142 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
18143 }
18144#endif
18145 if (!DVARS_TERMINAL_P(tbl)) {
18146 if (tbl->tbl) {
18147 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
18148 }
18149 ruby_sized_xfree(tbl, sizeof(*tbl));
18150 }
18151}
18152#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
18153
18154static void
18155vtable_add_gen(struct parser_params *p, int line, const char *name,
18156 struct vtable *tbl, ID id)
18157{
18158#ifndef RIPPER
18159 if (p->debug) {
18160 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
18161 line, name, (void *)tbl, rb_id2name(id));
18162 }
18163#endif
18164 if (DVARS_TERMINAL_P(tbl)) {
18165 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
18166 return;
18167 }
18168 if (tbl->pos == tbl->capa) {
18169 tbl->capa = tbl->capa * 2;
18170 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
18171 }
18172 tbl->tbl[tbl->pos++] = id;
18173}
18174#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
18175
18176static void
18177vtable_pop_gen(struct parser_params *p, int line, const char *name,
18178 struct vtable *tbl, int n)
18179{
18180 if (p->debug) {
18181 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
18182 line, name, (void *)tbl, n);
18183 }
18184 if (tbl->pos < n) {
18185 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
18186 return;
18187 }
18188 tbl->pos -= n;
18189}
18190#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
18191
18192static int
18193vtable_included(const struct vtable * tbl, ID id)
18194{
18195 int i;
18196
18197 if (!DVARS_TERMINAL_P(tbl)) {
18198 for (i = 0; i < tbl->pos; i++) {
18199 if (tbl->tbl[i] == id) {
18200 return i+1;
18201 }
18202 }
18203 }
18204 return 0;
18205}
18206
18207static void parser_prepare(struct parser_params *p);
18208
18209static int
18210e_option_supplied(struct parser_params *p)
18211{
18212 return strcmp(p->ruby_sourcefile, "-e") == 0;
18213}
18214
18215#ifndef RIPPER
18216static NODE *parser_append_options(struct parser_params *p, NODE *node);
18217
18218static VALUE
18219yycompile0(VALUE arg)
18220{
18221 int n;
18222 NODE *tree;
18223 struct parser_params *p = (struct parser_params *)arg;
18224 int cov = FALSE;
18225
18226 if (!compile_for_eval && !NIL_P(p->ruby_sourcefile_string) && !e_option_supplied(p)) {
18227 cov = TRUE;
18228 }
18229
18230 if (p->debug_lines) {
18231 p->ast->body.script_lines = p->debug_lines;
18232 }
18233
18234 parser_prepare(p);
18235#define RUBY_DTRACE_PARSE_HOOK(name) \
18236 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
18237 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
18238 }
18239 RUBY_DTRACE_PARSE_HOOK(BEGIN);
18240 n = yyparse(p);
18241 RUBY_DTRACE_PARSE_HOOK(END);
18242
18243 p->debug_lines = 0;
18244
18245 xfree(p->lex.strterm);
18246 p->lex.strterm = 0;
18247 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
18248 if (n || p->error_p) {
18249 VALUE mesg = p->error_buffer;
18250 if (!mesg) {
18251 mesg = syntax_error_new();
18252 }
18253 if (!p->error_tolerant) {
18254 rb_set_errinfo(mesg);
18255 return FALSE;
18256 }
18257 }
18258 tree = p->eval_tree;
18259 if (!tree) {
18260 tree = NEW_NIL(&NULL_LOC);
18261 }
18262 else {
18263 rb_parser_ary_t *tokens = p->tokens;
18264 NODE *prelude;
18265 NODE *body = parser_append_options(p, RNODE_SCOPE(tree)->nd_body);
18266 prelude = block_append(p, p->eval_tree_begin, body);
18267 RNODE_SCOPE(tree)->nd_body = prelude;
18268 p->ast->body.frozen_string_literal = p->frozen_string_literal;
18269 p->ast->body.coverage_enabled = cov;
18270 if (p->keep_tokens) {
18271 p->ast->node_buffer->tokens = tokens;
18272 p->tokens = NULL;
18273 }
18274 }
18275 p->ast->body.root = tree;
18276 p->ast->body.line_count = p->line_count;
18277 return TRUE;
18278}
18279
18280static rb_ast_t *
18281yycompile(struct parser_params *p, VALUE fname, int line)
18282{
18283 rb_ast_t *ast;
18284 if (NIL_P(fname)) {
18285 p->ruby_sourcefile_string = Qnil;
18286 p->ruby_sourcefile = "(none)";
18287 }
18288 else {
18289 p->ruby_sourcefile_string = rb_str_to_interned_str(fname);
18290 p->ruby_sourcefile = StringValueCStr(fname);
18291 }
18292 p->ruby_sourceline = line - 1;
18293
18294 p->lvtbl = NULL;
18295
18296 p->ast = ast = rb_ast_new();
18297 compile_callback(yycompile0, (VALUE)p);
18298 p->ast = 0;
18299
18300 while (p->lvtbl) {
18301 local_pop(p);
18302 }
18303
18304 return ast;
18305}
18306#endif /* !RIPPER */
18307
18308static rb_encoding *
18309must_be_ascii_compatible(struct parser_params *p, rb_parser_string_t *s)
18310{
18311 rb_encoding *enc = rb_parser_str_get_encoding(s);
18312 if (!rb_enc_asciicompat(enc)) {
18313 rb_raise(rb_eArgError, "invalid source encoding");
18314 }
18315 return enc;
18316}
18317
18318static rb_parser_string_t *
18319lex_getline(struct parser_params *p)
18320{
18321 rb_parser_string_t *line = (*p->lex.gets)(p, p->lex.input, p->line_count);
18322 if (!line) return 0;
18323 p->line_count++;
18324 string_buffer_append(p, line);
18325 must_be_ascii_compatible(p, line);
18326 return line;
18327}
18328
18329#ifndef RIPPER
18330rb_ast_t*
18331rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, VALUE fname, rb_parser_input_data input, int line)
18332{
18333 p->lex.gets = gets;
18334 p->lex.input = input;
18335 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
18336
18337 return yycompile(p, fname, line);
18338}
18339#endif /* !RIPPER */
18340
18341#define STR_FUNC_ESCAPE 0x01
18342#define STR_FUNC_EXPAND 0x02
18343#define STR_FUNC_REGEXP 0x04
18344#define STR_FUNC_QWORDS 0x08
18345#define STR_FUNC_SYMBOL 0x10
18346#define STR_FUNC_INDENT 0x20
18347#define STR_FUNC_LABEL 0x40
18348#define STR_FUNC_LIST 0x4000
18349#define STR_FUNC_TERM 0x8000
18350
18351enum string_type {
18352 str_label = STR_FUNC_LABEL,
18353 str_squote = (0),
18354 str_dquote = (STR_FUNC_EXPAND),
18355 str_xquote = (STR_FUNC_EXPAND),
18356 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
18357 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
18358 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
18359 str_ssym = (STR_FUNC_SYMBOL),
18360 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
18361};
18362
18363static rb_parser_string_t *
18364parser_str_new(struct parser_params *p, const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
18365{
18366 rb_parser_string_t *pstr;
18367
18368 pstr = rb_parser_encoding_string_new(p, ptr, len, enc);
18369
18370 if (!(func & STR_FUNC_REGEXP)) {
18371 if (rb_parser_is_ascii_string(p, pstr)) {
18372 }
18373 else if (rb_is_usascii_enc((void *)enc0) && enc != rb_utf8_encoding()) {
18374 /* everything is valid in ASCII-8BIT */
18375 enc = rb_ascii8bit_encoding();
18376 PARSER_ENCODING_CODERANGE_SET(pstr, enc, RB_PARSER_ENC_CODERANGE_VALID);
18377 }
18378 }
18379
18380 return pstr;
18381}
18382
18383static int
18384strterm_is_heredoc(rb_strterm_t *strterm)
18385{
18386 return strterm->heredoc;
18387}
18388
18389static rb_strterm_t *
18390new_strterm(struct parser_params *p, int func, int term, int paren)
18391{
18392 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
18393 strterm->u.literal.func = func;
18394 strterm->u.literal.term = term;
18395 strterm->u.literal.paren = paren;
18396 return strterm;
18397}
18398
18399static rb_strterm_t *
18400new_heredoc(struct parser_params *p)
18401{
18402 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
18403 strterm->heredoc = true;
18404 return strterm;
18405}
18406
18407#define peek(p,c) peek_n(p, (c), 0)
18408#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
18409#define peekc(p) peekc_n(p, 0)
18410#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
18411
18412#define add_delayed_token(p, tok, end) parser_add_delayed_token(p, tok, end, __LINE__)
18413static void
18414parser_add_delayed_token(struct parser_params *p, const char *tok, const char *end, int line)
18415{
18416 debug_token_line(p, "add_delayed_token", line);
18417
18418 if (tok < end) {
18419 if (has_delayed_token(p)) {
18420 bool next_line = parser_string_char_at_end(p, p->delayed.token, 0) == '\n';
18421 int end_line = (next_line ? 1 : 0) + p->delayed.end_line;
18422 int end_col = (next_line ? 0 : p->delayed.end_col);
18423 if (end_line != p->ruby_sourceline || end_col != tok - p->lex.pbeg) {
18424 dispatch_delayed_token(p, tSTRING_CONTENT);
18425 }
18426 }
18427 if (!has_delayed_token(p)) {
18428 p->delayed.token = rb_parser_string_new(p, 0, 0);
18429 rb_parser_enc_associate(p, p->delayed.token, p->enc);
18430 p->delayed.beg_line = p->ruby_sourceline;
18431 p->delayed.beg_col = rb_long2int(tok - p->lex.pbeg);
18432 }
18433 parser_str_cat(p->delayed.token, tok, end - tok);
18434 p->delayed.end_line = p->ruby_sourceline;
18435 p->delayed.end_col = rb_long2int(end - p->lex.pbeg);
18436 p->lex.ptok = end;
18437 }
18438}
18439
18440static void
18441set_lastline(struct parser_params *p, rb_parser_string_t *str)
18442{
18443 p->lex.pbeg = p->lex.pcur = PARSER_STRING_PTR(str);
18444 p->lex.pend = p->lex.pcur + PARSER_STRING_LEN(str);
18445 p->lex.lastline = str;
18446}
18447
18448static int
18449nextline(struct parser_params *p, int set_encoding)
18450{
18451 rb_parser_string_t *str = p->lex.nextline;
18452 p->lex.nextline = 0;
18453 if (!str) {
18454 if (p->eofp)
18455 return -1;
18456
18457 if (!lex_eol_ptr_p(p, p->lex.pbeg) && *(p->lex.pend-1) != '\n') {
18458 goto end_of_input;
18459 }
18460
18461 if (!p->lex.input || !(str = lex_getline(p))) {
18462 end_of_input:
18463 p->eofp = 1;
18464 lex_goto_eol(p);
18465 return -1;
18466 }
18467#ifndef RIPPER
18468 if (p->debug_lines) {
18469 if (set_encoding) rb_parser_enc_associate(p, str, p->enc);
18470 rb_parser_string_t *copy = rb_parser_string_deep_copy(p, str);
18471 rb_parser_ary_push_script_line(p, p->debug_lines, copy);
18472 }
18473#endif
18474 p->cr_seen = FALSE;
18475 }
18476 else if (str == AFTER_HEREDOC_WITHOUT_TERMINTOR) {
18477 /* after here-document without terminator */
18478 goto end_of_input;
18479 }
18480 add_delayed_token(p, p->lex.ptok, p->lex.pend);
18481 if (p->heredoc_end > 0) {
18482 p->ruby_sourceline = p->heredoc_end;
18483 p->heredoc_end = 0;
18484 }
18485 p->ruby_sourceline++;
18486 set_lastline(p, str);
18487 token_flush(p);
18488 return 0;
18489}
18490
18491static int
18492parser_cr(struct parser_params *p, int c)
18493{
18494 if (peek(p, '\n')) {
18495 p->lex.pcur++;
18496 c = '\n';
18497 }
18498 return c;
18499}
18500
18501static inline int
18502nextc0(struct parser_params *p, int set_encoding)
18503{
18504 int c;
18505
18506 if (UNLIKELY(lex_eol_p(p) || p->eofp || p->lex.nextline > AFTER_HEREDOC_WITHOUT_TERMINTOR)) {
18507 if (nextline(p, set_encoding)) return -1;
18508 }
18509 c = (unsigned char)*p->lex.pcur++;
18510 if (UNLIKELY(c == '\r')) {
18511 c = parser_cr(p, c);
18512 }
18513
18514 return c;
18515}
18516#define nextc(p) nextc0(p, TRUE)
18517
18518static void
18519pushback(struct parser_params *p, int c)
18520{
18521 if (c == -1) return;
18522 p->eofp = 0;
18523 p->lex.pcur--;
18524 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
18525 p->lex.pcur--;
18526 }
18527}
18528
18529#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
18530
18531#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
18532#define tok(p) (p)->tokenbuf
18533#define toklen(p) (p)->tokidx
18534
18535static int
18536looking_at_eol_p(struct parser_params *p)
18537{
18538 const char *ptr = p->lex.pcur;
18539 while (!lex_eol_ptr_p(p, ptr)) {
18540 int c = (unsigned char)*ptr++;
18541 int eol = (c == '\n' || c == '#');
18542 if (eol || !ISSPACE(c)) {
18543 return eol;
18544 }
18545 }
18546 return TRUE;
18547}
18548
18549static char*
18550newtok(struct parser_params *p)
18551{
18552 p->tokidx = 0;
18553 if (!p->tokenbuf) {
18554 p->toksiz = 60;
18555 p->tokenbuf = ALLOC_N(char, 60);
18556 }
18557 if (p->toksiz > 4096) {
18558 p->toksiz = 60;
18559 REALLOC_N(p->tokenbuf, char, 60);
18560 }
18561 return p->tokenbuf;
18562}
18563
18564static char *
18565tokspace(struct parser_params *p, int n)
18566{
18567 p->tokidx += n;
18568
18569 if (p->tokidx >= p->toksiz) {
18570 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
18571 REALLOC_N(p->tokenbuf, char, p->toksiz);
18572 }
18573 return &p->tokenbuf[p->tokidx-n];
18574}
18575
18576static void
18577tokadd(struct parser_params *p, int c)
18578{
18579 p->tokenbuf[p->tokidx++] = (char)c;
18580 if (p->tokidx >= p->toksiz) {
18581 p->toksiz *= 2;
18582 REALLOC_N(p->tokenbuf, char, p->toksiz);
18583 }
18584}
18585
18586static int
18587tok_hex(struct parser_params *p, size_t *numlen)
18588{
18589 int c;
18590
18591 c = (int)ruby_scan_hex(p->lex.pcur, 2, numlen);
18592 if (!*numlen) {
18593 flush_string_content(p, p->enc, rb_strlen_lit("\\x"));
18594 yyerror0("invalid hex escape");
18595 dispatch_scan_event(p, tSTRING_CONTENT);
18596 return 0;
18597 }
18598 p->lex.pcur += *numlen;
18599 return c;
18600}
18601
18602#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
18603
18604static int
18605escaped_control_code(int c)
18606{
18607 int c2 = 0;
18608 switch (c) {
18609 case ' ':
18610 c2 = 's';
18611 break;
18612 case '\n':
18613 c2 = 'n';
18614 break;
18615 case '\t':
18616 c2 = 't';
18617 break;
18618 case '\v':
18619 c2 = 'v';
18620 break;
18621 case '\r':
18622 c2 = 'r';
18623 break;
18624 case '\f':
18625 c2 = 'f';
18626 break;
18627 }
18628 return c2;
18629}
18630
18631#define WARN_SPACE_CHAR(c, prefix) \
18632 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c))
18633
18634static int
18635tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
18636 int regexp_literal, const char *begin)
18637{
18638 const int wide = !begin;
18639 size_t numlen;
18640 int codepoint = (int)ruby_scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
18641
18642 p->lex.pcur += numlen;
18643 if (p->lex.strterm == NULL ||
18644 strterm_is_heredoc(p->lex.strterm) ||
18645 (p->lex.strterm->u.literal.func != str_regexp)) {
18646 if (!begin) begin = p->lex.pcur;
18647 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
18648 flush_string_content(p, rb_utf8_encoding(), p->lex.pcur - begin);
18649 yyerror0("invalid Unicode escape");
18650 dispatch_scan_event(p, tSTRING_CONTENT);
18651 return wide && numlen > 0;
18652 }
18653 if (codepoint > 0x10ffff) {
18654 flush_string_content(p, rb_utf8_encoding(), p->lex.pcur - begin);
18655 yyerror0("invalid Unicode codepoint (too large)");
18656 dispatch_scan_event(p, tSTRING_CONTENT);
18657 return wide;
18658 }
18659 if ((codepoint & 0xfffff800) == 0xd800) {
18660 flush_string_content(p, rb_utf8_encoding(), p->lex.pcur - begin);
18661 yyerror0("invalid Unicode codepoint");
18662 dispatch_scan_event(p, tSTRING_CONTENT);
18663 return wide;
18664 }
18665 }
18666 if (regexp_literal) {
18667 tokcopy(p, (int)numlen);
18668 }
18669 else if (codepoint >= 0x80) {
18670 rb_encoding *utf8 = rb_utf8_encoding();
18671 if (*encp && utf8 != *encp) {
18672 YYLTYPE loc = RUBY_INIT_YYLLOC();
18673 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
18674 parser_show_error_line(p, &loc);
18675 return wide;
18676 }
18677 *encp = utf8;
18678 tokaddmbc(p, codepoint, *encp);
18679 }
18680 else {
18681 tokadd(p, codepoint);
18682 }
18683 return TRUE;
18684}
18685
18686static int tokadd_mbchar(struct parser_params *p, int c);
18687
18688static int
18689tokskip_mbchar(struct parser_params *p)
18690{
18691 int len = parser_precise_mbclen(p, p->lex.pcur-1);
18692 if (len > 0) {
18693 p->lex.pcur += len - 1;
18694 }
18695 return len;
18696}
18697
18698/* return value is for ?\u3042 */
18699static void
18700tokadd_utf8(struct parser_params *p, rb_encoding **encp,
18701 int term, int symbol_literal, int regexp_literal)
18702{
18703 /*
18704 * If `term` is not -1, then we allow multiple codepoints in \u{}
18705 * upto `term` byte, otherwise we're parsing a character literal.
18706 * And then add the codepoints to the current token.
18707 */
18708 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
18709
18710 const int open_brace = '{', close_brace = '}';
18711
18712 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
18713
18714 if (peek(p, open_brace)) { /* handle \u{...} form */
18715 if (regexp_literal && p->lex.strterm->u.literal.func == str_regexp) {
18716 /*
18717 * Skip parsing validation code and copy bytes as-is until term or
18718 * closing brace, in order to correctly handle extended regexps where
18719 * invalid unicode escapes are allowed in comments. The regexp parser
18720 * does its own validation and will catch any issues.
18721 */
18722 tokadd(p, open_brace);
18723 while (!lex_eol_ptr_p(p, ++p->lex.pcur)) {
18724 int c = peekc(p);
18725 if (c == close_brace) {
18726 tokadd(p, c);
18727 ++p->lex.pcur;
18728 break;
18729 }
18730 else if (c == term) {
18731 break;
18732 }
18733 if (c == '\\' && !lex_eol_n_p(p, 1)) {
18734 tokadd(p, c);
18735 c = *++p->lex.pcur;
18736 }
18737 tokadd_mbchar(p, c);
18738 }
18739 }
18740 else {
18741 const char *second = NULL;
18742 int c, last = nextc(p);
18743 if (lex_eol_p(p)) goto unterminated;
18744 while (ISSPACE(c = peekc(p)) && !lex_eol_ptr_p(p, ++p->lex.pcur));
18745 while (c != close_brace) {
18746 if (c == term) goto unterminated;
18747 if (second == multiple_codepoints)
18748 second = p->lex.pcur;
18749 if (regexp_literal) tokadd(p, last);
18750 if (!tokadd_codepoint(p, encp, regexp_literal, NULL)) {
18751 break;
18752 }
18753 while (ISSPACE(c = peekc(p))) {
18754 if (lex_eol_ptr_p(p, ++p->lex.pcur)) goto unterminated;
18755 last = c;
18756 }
18757 if (term == -1 && !second)
18758 second = multiple_codepoints;
18759 }
18760
18761 if (c != close_brace) {
18762 unterminated:
18763 flush_string_content(p, rb_utf8_encoding(), 0);
18764 yyerror0("unterminated Unicode escape");
18765 dispatch_scan_event(p, tSTRING_CONTENT);
18766 return;
18767 }
18768 if (second && second != multiple_codepoints) {
18769 const char *pcur = p->lex.pcur;
18770 p->lex.pcur = second;
18771 dispatch_scan_event(p, tSTRING_CONTENT);
18772 token_flush(p);
18773 p->lex.pcur = pcur;
18774 yyerror0(multiple_codepoints);
18775 token_flush(p);
18776 }
18777
18778 if (regexp_literal) tokadd(p, close_brace);
18779 nextc(p);
18780 }
18781 }
18782 else { /* handle \uxxxx form */
18783 if (!tokadd_codepoint(p, encp, regexp_literal, p->lex.pcur - rb_strlen_lit("\\u"))) {
18784 token_flush(p);
18785 return;
18786 }
18787 }
18788}
18789
18790#define ESCAPE_CONTROL 1
18791#define ESCAPE_META 2
18792
18793static int
18794read_escape(struct parser_params *p, int flags, const char *begin)
18795{
18796 int c;
18797 size_t numlen;
18798
18799 switch (c = nextc(p)) {
18800 case '\\': /* Backslash */
18801 return c;
18802
18803 case 'n': /* newline */
18804 return '\n';
18805
18806 case 't': /* horizontal tab */
18807 return '\t';
18808
18809 case 'r': /* carriage-return */
18810 return '\r';
18811
18812 case 'f': /* form-feed */
18813 return '\f';
18814
18815 case 'v': /* vertical tab */
18816 return '\13';
18817
18818 case 'a': /* alarm(bell) */
18819 return '\007';
18820
18821 case 'e': /* escape */
18822 return 033;
18823
18824 case '0': case '1': case '2': case '3': /* octal constant */
18825 case '4': case '5': case '6': case '7':
18826 pushback(p, c);
18827 c = (int)ruby_scan_oct(p->lex.pcur, 3, &numlen);
18828 p->lex.pcur += numlen;
18829 return c;
18830
18831 case 'x': /* hex constant */
18832 c = tok_hex(p, &numlen);
18833 if (numlen == 0) return 0;
18834 return c;
18835
18836 case 'b': /* backspace */
18837 return '\010';
18838
18839 case 's': /* space */
18840 return ' ';
18841
18842 case 'M':
18843 if (flags & ESCAPE_META) goto eof;
18844 if ((c = nextc(p)) != '-') {
18845 goto eof;
18846 }
18847 if ((c = nextc(p)) == '\\') {
18848 switch (peekc(p)) {
18849 case 'u': case 'U':
18850 nextc(p);
18851 goto eof;
18852 }
18853 return read_escape(p, flags|ESCAPE_META, begin) | 0x80;
18854 }
18855 else if (c == -1) goto eof;
18856 else if (!ISASCII(c)) {
18857 tokskip_mbchar(p);
18858 goto eof;
18859 }
18860 else {
18861 int c2 = escaped_control_code(c);
18862 if (c2) {
18863 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
18864 WARN_SPACE_CHAR(c2, "\\M-");
18865 }
18866 else {
18867 WARN_SPACE_CHAR(c2, "\\C-\\M-");
18868 }
18869 }
18870 else if (ISCNTRL(c)) goto eof;
18871 return ((c & 0xff) | 0x80);
18872 }
18873
18874 case 'C':
18875 if ((c = nextc(p)) != '-') {
18876 goto eof;
18877 }
18878 case 'c':
18879 if (flags & ESCAPE_CONTROL) goto eof;
18880 if ((c = nextc(p))== '\\') {
18881 switch (peekc(p)) {
18882 case 'u': case 'U':
18883 nextc(p);
18884 goto eof;
18885 }
18886 c = read_escape(p, flags|ESCAPE_CONTROL, begin);
18887 }
18888 else if (c == '?')
18889 return 0177;
18890 else if (c == -1) goto eof;
18891 else if (!ISASCII(c)) {
18892 tokskip_mbchar(p);
18893 goto eof;
18894 }
18895 else {
18896 int c2 = escaped_control_code(c);
18897 if (c2) {
18898 if (ISCNTRL(c)) {
18899 if (flags & ESCAPE_META) {
18900 WARN_SPACE_CHAR(c2, "\\M-");
18901 }
18902 else {
18903 WARN_SPACE_CHAR(c2, "");
18904 }
18905 }
18906 else {
18907 if (flags & ESCAPE_META) {
18908 WARN_SPACE_CHAR(c2, "\\M-\\C-");
18909 }
18910 else {
18911 WARN_SPACE_CHAR(c2, "\\C-");
18912 }
18913 }
18914 }
18915 else if (ISCNTRL(c)) goto eof;
18916 }
18917 return c & 0x9f;
18918
18919 eof:
18920 case -1:
18921 flush_string_content(p, p->enc, p->lex.pcur - begin);
18922 yyerror0("Invalid escape character syntax");
18923 dispatch_scan_event(p, tSTRING_CONTENT);
18924 return '\0';
18925
18926 default:
18927 return c;
18928 }
18929}
18930
18931static void
18932tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
18933{
18934 int len = rb_enc_codelen(c, enc);
18935 rb_enc_mbcput(c, tokspace(p, len), enc);
18936}
18937
18938static int
18939tokadd_escape(struct parser_params *p)
18940{
18941 int c;
18942 size_t numlen;
18943 const char *begin = p->lex.pcur;
18944
18945 switch (c = nextc(p)) {
18946 case '\n':
18947 return 0; /* just ignore */
18948
18949 case '0': case '1': case '2': case '3': /* octal constant */
18950 case '4': case '5': case '6': case '7':
18951 {
18952 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
18953 if (numlen == 0) goto eof;
18954 p->lex.pcur += numlen;
18955 tokcopy(p, (int)numlen + 1);
18956 }
18957 return 0;
18958
18959 case 'x': /* hex constant */
18960 {
18961 tok_hex(p, &numlen);
18962 if (numlen == 0) return -1;
18963 tokcopy(p, (int)numlen + 2);
18964 }
18965 return 0;
18966
18967 eof:
18968 case -1:
18969 flush_string_content(p, p->enc, p->lex.pcur - begin);
18970 yyerror0("Invalid escape character syntax");
18971 token_flush(p);
18972 return -1;
18973
18974 default:
18975 tokadd(p, '\\');
18976 tokadd(p, c);
18977 }
18978 return 0;
18979}
18980
18981static int
18982char_to_option(int c)
18983{
18984 int val;
18985
18986 switch (c) {
18987 case 'i':
18988 val = RE_ONIG_OPTION_IGNORECASE;
18989 break;
18990 case 'x':
18991 val = RE_ONIG_OPTION_EXTEND;
18992 break;
18993 case 'm':
18994 val = RE_ONIG_OPTION_MULTILINE;
18995 break;
18996 default:
18997 val = 0;
18998 break;
18999 }
19000 return val;
19001}
19002
19003#define ARG_ENCODING_FIXED 16
19004#define ARG_ENCODING_NONE 32
19005#define ENC_ASCII8BIT 1
19006#define ENC_EUC_JP 2
19007#define ENC_Windows_31J 3
19008#define ENC_UTF8 4
19009
19010static int
19011char_to_option_kcode(int c, int *option, int *kcode)
19012{
19013 *option = 0;
19014
19015 switch (c) {
19016 case 'n':
19017 *kcode = ENC_ASCII8BIT;
19018 return (*option = ARG_ENCODING_NONE);
19019 case 'e':
19020 *kcode = ENC_EUC_JP;
19021 break;
19022 case 's':
19023 *kcode = ENC_Windows_31J;
19024 break;
19025 case 'u':
19026 *kcode = ENC_UTF8;
19027 break;
19028 default:
19029 *kcode = -1;
19030 return (*option = char_to_option(c));
19031 }
19032 *option = ARG_ENCODING_FIXED;
19033 return 1;
19034}
19035
19036static int
19037regx_options(struct parser_params *p)
19038{
19039 int kcode = 0;
19040 int kopt = 0;
19041 int options = 0;
19042 int c, opt, kc;
19043
19044 newtok(p);
19045 while (c = nextc(p), ISALPHA(c)) {
19046 if (c == 'o') {
19047 options |= RE_OPTION_ONCE;
19048 }
19049 else if (char_to_option_kcode(c, &opt, &kc)) {
19050 if (kc >= 0) {
19051 if (kc != ENC_ASCII8BIT) kcode = c;
19052 kopt = opt;
19053 }
19054 else {
19055 options |= opt;
19056 }
19057 }
19058 else {
19059 tokadd(p, c);
19060 }
19061 }
19062 options |= kopt;
19063 pushback(p, c);
19064 if (toklen(p)) {
19065 YYLTYPE loc = RUBY_INIT_YYLLOC();
19066 tokfix(p);
19067 compile_error(p, "unknown regexp option%s - %*s",
19068 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
19069 parser_show_error_line(p, &loc);
19070 }
19071 return options | RE_OPTION_ENCODING(kcode);
19072}
19073
19074static int
19075tokadd_mbchar(struct parser_params *p, int c)
19076{
19077 int len = parser_precise_mbclen(p, p->lex.pcur-1);
19078 if (len < 0) return -1;
19079 tokadd(p, c);
19080 p->lex.pcur += --len;
19081 if (len > 0) tokcopy(p, len);
19082 return c;
19083}
19084
19085static inline int
19086simple_re_meta(int c)
19087{
19088 switch (c) {
19089 case '$': case '*': case '+': case '.':
19090 case '?': case '^': case '|':
19091 case ')': case ']': case '}': case '>':
19092 return TRUE;
19093 default:
19094 return FALSE;
19095 }
19096}
19097
19098static int
19099parser_update_heredoc_indent(struct parser_params *p, int c)
19100{
19101 if (p->heredoc_line_indent == -1) {
19102 if (c == '\n') p->heredoc_line_indent = 0;
19103 }
19104 else {
19105 if (c == ' ') {
19106 p->heredoc_line_indent++;
19107 return TRUE;
19108 }
19109 else if (c == '\t') {
19110 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
19111 p->heredoc_line_indent = w * TAB_WIDTH;
19112 return TRUE;
19113 }
19114 else if (c != '\n') {
19115 if (p->heredoc_indent > p->heredoc_line_indent) {
19116 p->heredoc_indent = p->heredoc_line_indent;
19117 }
19118 p->heredoc_line_indent = -1;
19119 }
19120 else {
19121 /* Whitespace only line has no indentation */
19122 p->heredoc_line_indent = 0;
19123 }
19124 }
19125 return FALSE;
19126}
19127
19128static void
19129parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
19130{
19131 YYLTYPE loc = RUBY_INIT_YYLLOC();
19132 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
19133 compile_error(p, "%s mixed within %s source", n1, n2);
19134 parser_show_error_line(p, &loc);
19135}
19136
19137static void
19138parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
19139{
19140 const char *pos = p->lex.pcur;
19141 p->lex.pcur = beg;
19142 parser_mixed_error(p, enc1, enc2);
19143 p->lex.pcur = pos;
19144}
19145
19146static inline char
19147nibble_char_upper(unsigned int c)
19148{
19149 c &= 0xf;
19150 return c + (c < 10 ? '0' : 'A' - 10);
19151}
19152
19153static int
19154tokadd_string(struct parser_params *p,
19155 int func, int term, int paren, long *nest,
19156 rb_encoding **encp, rb_encoding **enc)
19157{
19158 int c;
19159 bool erred = false;
19160#ifdef RIPPER
19161 const int heredoc_end = (p->heredoc_end ? p->heredoc_end + 1 : 0);
19162 int top_of_line = FALSE;
19163#endif
19164
19165#define mixed_error(enc1, enc2) \
19166 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
19167#define mixed_escape(beg, enc1, enc2) \
19168 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
19169
19170 while ((c = nextc(p)) != -1) {
19171 if (p->heredoc_indent > 0) {
19172 parser_update_heredoc_indent(p, c);
19173 }
19174#ifdef RIPPER
19175 if (top_of_line && heredoc_end == p->ruby_sourceline) {
19176 pushback(p, c);
19177 break;
19178 }
19179#endif
19180
19181 if (paren && c == paren) {
19182 ++*nest;
19183 }
19184 else if (c == term) {
19185 if (!nest || !*nest) {
19186 pushback(p, c);
19187 break;
19188 }
19189 --*nest;
19190 }
19191 else if ((func & STR_FUNC_EXPAND) && c == '#' && !lex_eol_p(p)) {
19192 unsigned char c2 = *p->lex.pcur;
19193 if (c2 == '$' || c2 == '@' || c2 == '{') {
19194 pushback(p, c);
19195 break;
19196 }
19197 }
19198 else if (c == '\\') {
19199 c = nextc(p);
19200 switch (c) {
19201 case '\n':
19202 if (func & STR_FUNC_QWORDS) break;
19203 if (func & STR_FUNC_EXPAND) {
19204 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
19205 continue;
19206 if (c == term) {
19207 c = '\\';
19208 goto terminate;
19209 }
19210 }
19211 tokadd(p, '\\');
19212 break;
19213
19214 case '\\':
19215 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
19216 break;
19217
19218 case 'u':
19219 if ((func & STR_FUNC_EXPAND) == 0) {
19220 tokadd(p, '\\');
19221 break;
19222 }
19223 tokadd_utf8(p, enc, term,
19224 func & STR_FUNC_SYMBOL,
19225 func & STR_FUNC_REGEXP);
19226 continue;
19227
19228 default:
19229 if (c == -1) return -1;
19230 if (!ISASCII(c)) {
19231 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
19232 goto non_ascii;
19233 }
19234 if (func & STR_FUNC_REGEXP) {
19235 switch (c) {
19236 case 'c':
19237 case 'C':
19238 case 'M': {
19239 pushback(p, c);
19240 c = read_escape(p, 0, p->lex.pcur - 1);
19241
19242 char *t = tokspace(p, rb_strlen_lit("\\x00"));
19243 *t++ = '\\';
19244 *t++ = 'x';
19245 *t++ = nibble_char_upper(c >> 4);
19246 *t++ = nibble_char_upper(c);
19247 continue;
19248 }
19249 }
19250
19251 if (c == term && !simple_re_meta(c)) {
19252 tokadd(p, c);
19253 continue;
19254 }
19255 pushback(p, c);
19256 if ((c = tokadd_escape(p)) < 0)
19257 return -1;
19258 if (*enc && *enc != *encp) {
19259 mixed_escape(p->lex.ptok+2, *enc, *encp);
19260 }
19261 continue;
19262 }
19263 else if (func & STR_FUNC_EXPAND) {
19264 pushback(p, c);
19265 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
19266 c = read_escape(p, 0, p->lex.pcur - 1);
19267 }
19268 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
19269 /* ignore backslashed spaces in %w */
19270 }
19271 else if (c != term && !(paren && c == paren)) {
19272 tokadd(p, '\\');
19273 pushback(p, c);
19274 continue;
19275 }
19276 }
19277 }
19278 else if (!parser_isascii(p)) {
19279 non_ascii:
19280 if (!*enc) {
19281 *enc = *encp;
19282 }
19283 else if (*enc != *encp) {
19284 mixed_error(*enc, *encp);
19285 continue;
19286 }
19287 if (tokadd_mbchar(p, c) == -1) return -1;
19288 continue;
19289 }
19290 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
19291 pushback(p, c);
19292 break;
19293 }
19294 if (c & 0x80) {
19295 if (!*enc) {
19296 *enc = *encp;
19297 }
19298 else if (*enc != *encp) {
19299 mixed_error(*enc, *encp);
19300 continue;
19301 }
19302 }
19303 tokadd(p, c);
19304#ifdef RIPPER
19305 top_of_line = (c == '\n');
19306#endif
19307 }
19308 terminate:
19309 if (*enc) *encp = *enc;
19310 return c;
19311}
19312
19313#define NEW_STRTERM(func, term, paren) new_strterm(p, func, term, paren)
19314
19315static void
19316flush_string_content(struct parser_params *p, rb_encoding *enc, size_t back)
19317{
19318 p->lex.pcur -= back;
19319 if (has_delayed_token(p)) {
19320 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
19321 if (len > 0) {
19322 rb_parser_enc_str_buf_cat(p, p->delayed.token, p->lex.ptok, len, enc);
19323 p->delayed.end_line = p->ruby_sourceline;
19324 p->delayed.end_col = rb_long2int(p->lex.pcur - p->lex.pbeg);
19325 }
19326 dispatch_delayed_token(p, tSTRING_CONTENT);
19327 p->lex.ptok = p->lex.pcur;
19328 }
19329 dispatch_scan_event(p, tSTRING_CONTENT);
19330 p->lex.pcur += back;
19331}
19332
19333/* this can be shared with ripper, since it's independent from struct
19334 * parser_params. */
19335#ifndef RIPPER
19336#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
19337#define SPECIAL_PUNCT(idx) ( \
19338 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
19339 BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
19340 BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
19341 BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
19342 BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
19343 BIT('0', idx))
19344const uint_least32_t ruby_global_name_punct_bits[] = {
19345 SPECIAL_PUNCT(0),
19346 SPECIAL_PUNCT(1),
19347 SPECIAL_PUNCT(2),
19348};
19349#undef BIT
19350#undef SPECIAL_PUNCT
19351#endif
19352
19353static enum yytokentype
19354parser_peek_variable_name(struct parser_params *p)
19355{
19356 int c;
19357 const char *ptr = p->lex.pcur;
19358
19359 if (lex_eol_ptr_n_p(p, ptr, 1)) return 0;
19360 c = *ptr++;
19361 switch (c) {
19362 case '$':
19363 if ((c = *ptr) == '-') {
19364 if (lex_eol_ptr_p(p, ++ptr)) return 0;
19365 c = *ptr;
19366 }
19367 else if (is_global_name_punct(c) || ISDIGIT(c)) {
19368 return tSTRING_DVAR;
19369 }
19370 break;
19371 case '@':
19372 if ((c = *ptr) == '@') {
19373 if (lex_eol_ptr_p(p, ++ptr)) return 0;
19374 c = *ptr;
19375 }
19376 break;
19377 case '{':
19378 p->lex.pcur = ptr;
19379 p->command_start = TRUE;
19380 yylval.state = p->lex.state;
19381 return tSTRING_DBEG;
19382 default:
19383 return 0;
19384 }
19385 if (!ISASCII(c) || c == '_' || ISALPHA(c))
19386 return tSTRING_DVAR;
19387 return 0;
19388}
19389
19390#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
19391#define IS_END() IS_lex_state(EXPR_END_ANY)
19392#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
19393#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
19394#define IS_LABEL_POSSIBLE() (\
19395 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
19396 IS_ARG())
19397#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
19398#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
19399
19400static inline enum yytokentype
19401parser_string_term(struct parser_params *p, int func)
19402{
19403 xfree(p->lex.strterm);
19404 p->lex.strterm = 0;
19405 if (func & STR_FUNC_REGEXP) {
19406 set_yylval_num(regx_options(p));
19407 dispatch_scan_event(p, tREGEXP_END);
19408 SET_LEX_STATE(EXPR_END);
19409 return tREGEXP_END;
19410 }
19411 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
19412 nextc(p);
19413 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
19414 return tLABEL_END;
19415 }
19416 SET_LEX_STATE(EXPR_END);
19417 return tSTRING_END;
19418}
19419
19420static enum yytokentype
19421parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
19422{
19423 int func = quote->func;
19424 int term = quote->term;
19425 int paren = quote->paren;
19426 int c, space = 0;
19427 rb_encoding *enc = p->enc;
19428 rb_encoding *base_enc = 0;
19429 rb_parser_string_t *lit;
19430
19431 if (func & STR_FUNC_TERM) {
19432 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
19433 SET_LEX_STATE(EXPR_END);
19434 xfree(p->lex.strterm);
19435 p->lex.strterm = 0;
19436 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
19437 }
19438 c = nextc(p);
19439 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
19440 while (c != '\n' && ISSPACE(c = nextc(p)));
19441 space = 1;
19442 }
19443 if (func & STR_FUNC_LIST) {
19444 quote->func &= ~STR_FUNC_LIST;
19445 space = 1;
19446 }
19447 if (c == term && !quote->nest) {
19448 if (func & STR_FUNC_QWORDS) {
19449 quote->func |= STR_FUNC_TERM;
19450 pushback(p, c); /* dispatch the term at tSTRING_END */
19451 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
19452 return ' ';
19453 }
19454 return parser_string_term(p, func);
19455 }
19456 if (space) {
19457 if (!ISSPACE(c)) pushback(p, c);
19458 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
19459 return ' ';
19460 }
19461 newtok(p);
19462 if ((func & STR_FUNC_EXPAND) && c == '#') {
19463 enum yytokentype t = parser_peek_variable_name(p);
19464 if (t) return t;
19465 tokadd(p, '#');
19466 c = nextc(p);
19467 }
19468 pushback(p, c);
19469 if (tokadd_string(p, func, term, paren, &quote->nest,
19470 &enc, &base_enc) == -1) {
19471 if (p->eofp) {
19472#ifndef RIPPER
19473# define unterminated_literal(mesg) yyerror0(mesg)
19474#else
19475# define unterminated_literal(mesg) compile_error(p, mesg)
19476#endif
19477 literal_flush(p, p->lex.pcur);
19478 if (func & STR_FUNC_QWORDS) {
19479 /* no content to add, bailing out here */
19480 unterminated_literal("unterminated list meets end of file");
19481 xfree(p->lex.strterm);
19482 p->lex.strterm = 0;
19483 return tSTRING_END;
19484 }
19485 if (func & STR_FUNC_REGEXP) {
19486 unterminated_literal("unterminated regexp meets end of file");
19487 }
19488 else {
19489 unterminated_literal("unterminated string meets end of file");
19490 }
19491 quote->func |= STR_FUNC_TERM;
19492 }
19493 }
19494
19495 tokfix(p);
19496 lit = STR_NEW3(tok(p), toklen(p), enc, func);
19497 set_yylval_str(lit);
19498 flush_string_content(p, enc, 0);
19499
19500 return tSTRING_CONTENT;
19501}
19502
19503static enum yytokentype
19504heredoc_identifier(struct parser_params *p)
19505{
19506 /*
19507 * term_len is length of `<<"END"` except `END`,
19508 * in this case term_len is 4 (<, <, " and ").
19509 */
19510 long len, offset = p->lex.pcur - p->lex.pbeg;
19511 int c = nextc(p), term, func = 0, quote = 0;
19512 enum yytokentype token = tSTRING_BEG;
19513 int indent = 0;
19514
19515 if (c == '-') {
19516 c = nextc(p);
19517 func = STR_FUNC_INDENT;
19518 offset++;
19519 }
19520 else if (c == '~') {
19521 c = nextc(p);
19522 func = STR_FUNC_INDENT;
19523 offset++;
19524 indent = INT_MAX;
19525 }
19526 switch (c) {
19527 case '\'':
19528 func |= str_squote; goto quoted;
19529 case '"':
19530 func |= str_dquote; goto quoted;
19531 case '`':
19532 token = tXSTRING_BEG;
19533 func |= str_xquote; goto quoted;
19534
19535 quoted:
19536 quote++;
19537 offset++;
19538 term = c;
19539 len = 0;
19540 while ((c = nextc(p)) != term) {
19541 if (c == -1 || c == '\r' || c == '\n') {
19542 yyerror0("unterminated here document identifier");
19543 return -1;
19544 }
19545 }
19546 break;
19547
19548 default:
19549 if (!parser_is_identchar(p)) {
19550 pushback(p, c);
19551 if (func & STR_FUNC_INDENT) {
19552 pushback(p, indent > 0 ? '~' : '-');
19553 }
19554 return 0;
19555 }
19556 func |= str_dquote;
19557 do {
19558 int n = parser_precise_mbclen(p, p->lex.pcur-1);
19559 if (n < 0) return 0;
19560 p->lex.pcur += --n;
19561 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
19562 pushback(p, c);
19563 break;
19564 }
19565
19566 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
19567 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
19568 yyerror0("too long here document identifier");
19569 dispatch_scan_event(p, tHEREDOC_BEG);
19570 lex_goto_eol(p);
19571
19572 p->lex.strterm = new_heredoc(p);
19573 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
19574 here->offset = offset;
19575 here->sourceline = p->ruby_sourceline;
19576 here->length = (unsigned)len;
19577 here->quote = quote;
19578 here->func = func;
19579 here->lastline = p->lex.lastline;
19580
19581 token_flush(p);
19582 p->heredoc_indent = indent;
19583 p->heredoc_line_indent = 0;
19584 return token;
19585}
19586
19587static void
19588heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
19589{
19590 rb_parser_string_t *line;
19591 rb_strterm_t *term = p->lex.strterm;
19592
19593 p->lex.strterm = 0;
19594 line = here->lastline;
19595 p->lex.lastline = line;
19596 p->lex.pbeg = PARSER_STRING_PTR(line);
19597 p->lex.pend = p->lex.pbeg + PARSER_STRING_LEN(line);
19598 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
19599 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
19600 p->heredoc_end = p->ruby_sourceline;
19601 p->ruby_sourceline = (int)here->sourceline;
19602 if (p->eofp) p->lex.nextline = AFTER_HEREDOC_WITHOUT_TERMINTOR;
19603 p->eofp = 0;
19604 xfree(term);
19605}
19606
19607static int
19608dedent_string_column(const char *str, long len, int width)
19609{
19610 int i, col = 0;
19611
19612 for (i = 0; i < len && col < width; i++) {
19613 if (str[i] == ' ') {
19614 col++;
19615 }
19616 else if (str[i] == '\t') {
19617 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
19618 if (n > width) break;
19619 col = n;
19620 }
19621 else {
19622 break;
19623 }
19624 }
19625
19626 return i;
19627}
19628
19629static int
19630dedent_string(struct parser_params *p, rb_parser_string_t *string, int width)
19631{
19632 char *str;
19633 long len;
19634 int i;
19635
19636 len = PARSER_STRING_LEN(string);
19637 str = PARSER_STRING_PTR(string);
19638
19639 i = dedent_string_column(str, len, width);
19640 if (!i) return 0;
19641
19642 rb_parser_str_modify(string);
19643 str = PARSER_STRING_PTR(string);
19644 if (PARSER_STRING_LEN(string) != len)
19645 rb_fatal("literal string changed: %s", PARSER_STRING_PTR(string));
19646 MEMMOVE(str, str + i, char, len - i);
19647 rb_parser_str_set_len(p, string, len - i);
19648 return i;
19649}
19650
19651static NODE *
19652heredoc_dedent(struct parser_params *p, NODE *root)
19653{
19654 NODE *node, *str_node, *prev_node;
19655 int indent = p->heredoc_indent;
19656 rb_parser_string_t *prev_lit = 0;
19657
19658 if (indent <= 0) return root;
19659 if (!root) return root;
19660
19661 prev_node = node = str_node = root;
19662 if (nd_type_p(root, NODE_LIST)) str_node = RNODE_LIST(root)->nd_head;
19663
19664 while (str_node) {
19665 rb_parser_string_t *lit = RNODE_STR(str_node)->string;
19666 if (nd_fl_newline(str_node)) {
19667 dedent_string(p, lit, indent);
19668 }
19669 if (!prev_lit) {
19670 prev_lit = lit;
19671 }
19672 else if (!literal_concat0(p, prev_lit, lit)) {
19673 return 0;
19674 }
19675 else {
19676 NODE *end = RNODE_LIST(node)->as.nd_end;
19677 node = RNODE_LIST(prev_node)->nd_next = RNODE_LIST(node)->nd_next;
19678 if (!node) {
19679 if (nd_type_p(prev_node, NODE_DSTR))
19680 nd_set_type(prev_node, NODE_STR);
19681 break;
19682 }
19683 RNODE_LIST(node)->as.nd_end = end;
19684 goto next_str;
19685 }
19686
19687 str_node = 0;
19688 while ((nd_type_p(node, NODE_LIST) || nd_type_p(node, NODE_DSTR)) && (node = RNODE_LIST(prev_node = node)->nd_next) != 0) {
19689 next_str:
19690 if (!nd_type_p(node, NODE_LIST)) break;
19691 if ((str_node = RNODE_LIST(node)->nd_head) != 0) {
19692 enum node_type type = nd_type(str_node);
19693 if (type == NODE_STR || type == NODE_DSTR) break;
19694 prev_lit = 0;
19695 str_node = 0;
19696 }
19697 }
19698 }
19699 return root;
19700}
19701
19702static int
19703whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
19704{
19705 const char *beg = p->lex.pbeg;
19706 const char *ptr = p->lex.pend;
19707
19708 if (ptr - beg < len) return FALSE;
19709 if (ptr > beg && ptr[-1] == '\n') {
19710 if (--ptr > beg && ptr[-1] == '\r') --ptr;
19711 if (ptr - beg < len) return FALSE;
19712 }
19713 if (strncmp(eos, ptr -= len, len)) return FALSE;
19714 if (indent) {
19715 while (beg < ptr && ISSPACE(*beg)) beg++;
19716 }
19717 return beg == ptr;
19718}
19719
19720static int
19721word_match_p(struct parser_params *p, const char *word, long len)
19722{
19723 if (strncmp(p->lex.pcur, word, len)) return 0;
19724 if (lex_eol_n_p(p, len)) return 1;
19725 int c = (unsigned char)p->lex.pcur[len];
19726 if (ISSPACE(c)) return 1;
19727 switch (c) {
19728 case '\0': case '\004': case '\032': return 1;
19729 }
19730 return 0;
19731}
19732
19733#define NUM_SUFFIX_R (1<<0)
19734#define NUM_SUFFIX_I (1<<1)
19735#define NUM_SUFFIX_ALL 3
19736
19737static int
19738number_literal_suffix(struct parser_params *p, int mask)
19739{
19740 int c, result = 0;
19741 const char *lastp = p->lex.pcur;
19742
19743 while ((c = nextc(p)) != -1) {
19744 if ((mask & NUM_SUFFIX_I) && c == 'i') {
19745 result |= (mask & NUM_SUFFIX_I);
19746 mask &= ~NUM_SUFFIX_I;
19747 /* r after i, rational of complex is disallowed */
19748 mask &= ~NUM_SUFFIX_R;
19749 continue;
19750 }
19751 if ((mask & NUM_SUFFIX_R) && c == 'r') {
19752 result |= (mask & NUM_SUFFIX_R);
19753 mask &= ~NUM_SUFFIX_R;
19754 continue;
19755 }
19756 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
19757 p->lex.pcur = lastp;
19758 literal_flush(p, p->lex.pcur);
19759 return 0;
19760 }
19761 pushback(p, c);
19762 break;
19763 }
19764 return result;
19765}
19766
19767static enum yytokentype
19768set_number_literal(struct parser_params *p, enum yytokentype type, int suffix, int base, int seen_point)
19769{
19770 enum rb_numeric_type numeric_type = integer_literal;
19771
19772 if (type == tFLOAT) {
19773 numeric_type = float_literal;
19774 }
19775
19776 if (suffix & NUM_SUFFIX_R) {
19777 type = tRATIONAL;
19778 numeric_type = rational_literal;
19779 }
19780 if (suffix & NUM_SUFFIX_I) {
19781 type = tIMAGINARY;
19782 }
19783
19784 switch (type) {
19785 case tINTEGER:
19786 set_yylval_node(NEW_INTEGER(strdup(tok(p)), base, &_cur_loc));
19787 break;
19788 case tFLOAT:
19789 set_yylval_node(NEW_FLOAT(strdup(tok(p)), &_cur_loc));
19790 break;
19791 case tRATIONAL:
19792 set_yylval_node(NEW_RATIONAL(strdup(tok(p)), base, seen_point, &_cur_loc));
19793 break;
19794 case tIMAGINARY:
19795 set_yylval_node(NEW_IMAGINARY(strdup(tok(p)), base, seen_point, numeric_type, &_cur_loc));
19796 (void)numeric_type; /* for ripper */
19797 break;
19798 default:
19799 rb_bug("unexpected token: %d", type);
19800 }
19801 SET_LEX_STATE(EXPR_END);
19802 return type;
19803}
19804
19805#define dispatch_heredoc_end(p) parser_dispatch_heredoc_end(p, __LINE__)
19806static void
19807parser_dispatch_heredoc_end(struct parser_params *p, int line)
19808{
19809 if (has_delayed_token(p))
19810 dispatch_delayed_token(p, tSTRING_CONTENT);
19811
19812#ifdef RIPPER
19813 VALUE str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
19814 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
19815#else
19816 if (p->keep_tokens) {
19817 rb_parser_string_t *str = rb_parser_encoding_string_new(p, p->lex.ptok, p->lex.pend - p->lex.ptok, p->enc);
19818 RUBY_SET_YYLLOC_OF_HEREDOC_END(*p->yylloc);
19819 parser_append_tokens(p, str, tHEREDOC_END, line);
19820 }
19821#endif
19822
19823 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
19824 lex_goto_eol(p);
19825 token_flush(p);
19826}
19827
19828static enum yytokentype
19829here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
19830{
19831 int c, func, indent = 0;
19832 const char *eos, *ptr, *ptr_end;
19833 long len;
19834 rb_parser_string_t *str = 0;
19835 rb_encoding *enc = p->enc;
19836 rb_encoding *base_enc = 0;
19837 int bol;
19838#ifdef RIPPER
19839 VALUE s_value;
19840#endif
19841
19842 eos = PARSER_STRING_PTR(here->lastline) + here->offset;
19843 len = here->length;
19844 indent = (func = here->func) & STR_FUNC_INDENT;
19845
19846 if ((c = nextc(p)) == -1) {
19847 error:
19848#ifdef RIPPER
19849 if (!has_delayed_token(p)) {
19850 dispatch_scan_event(p, tSTRING_CONTENT);
19851 }
19852 else {
19853 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
19854 if (!(func & STR_FUNC_REGEXP)) {
19855 int cr = ENC_CODERANGE_UNKNOWN;
19856 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
19857 if (cr != ENC_CODERANGE_7BIT &&
19858 rb_is_usascii_enc(p->enc) &&
19859 enc != rb_utf8_encoding()) {
19860 enc = rb_ascii8bit_encoding();
19861 }
19862 }
19863 rb_parser_enc_str_buf_cat(p, p->delayed.token, p->lex.ptok, len, enc);
19864 }
19865 dispatch_delayed_token(p, tSTRING_CONTENT);
19866 }
19867 lex_goto_eol(p);
19868#endif
19869 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19870 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
19871 (int)len, eos);
19872 token_flush(p);
19873 SET_LEX_STATE(EXPR_END);
19874 return tSTRING_END;
19875 }
19876 bol = was_bol(p);
19877 if (!bol) {
19878 /* not beginning of line, cannot be the terminator */
19879 }
19880 else if (p->heredoc_line_indent == -1) {
19881 /* `heredoc_line_indent == -1` means
19882 * - "after an interpolation in the same line", or
19883 * - "in a continuing line"
19884 */
19885 p->heredoc_line_indent = 0;
19886 }
19887 else if (whole_match_p(p, eos, len, indent)) {
19888 dispatch_heredoc_end(p);
19889 restore:
19890 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19891 token_flush(p);
19892 SET_LEX_STATE(EXPR_END);
19893 return tSTRING_END;
19894 }
19895
19896 if (!(func & STR_FUNC_EXPAND)) {
19897 do {
19898 ptr = PARSER_STRING_PTR(p->lex.lastline);
19899 ptr_end = p->lex.pend;
19900 if (ptr_end > ptr) {
19901 switch (ptr_end[-1]) {
19902 case '\n':
19903 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
19904 ptr_end++;
19905 break;
19906 }
19907 case '\r':
19908 --ptr_end;
19909 }
19910 }
19911
19912 if (p->heredoc_indent > 0) {
19913 long i = 0;
19914 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
19915 i++;
19916 p->heredoc_line_indent = 0;
19917 }
19918
19919 if (str)
19920 parser_str_cat(str, ptr, ptr_end - ptr);
19921 else
19922 str = rb_parser_encoding_string_new(p, ptr, ptr_end - ptr, enc);
19923 if (!lex_eol_ptr_p(p, ptr_end)) parser_str_cat_cstr(str, "\n");
19924 lex_goto_eol(p);
19925 if (p->heredoc_indent > 0) {
19926 goto flush_str;
19927 }
19928 if (nextc(p) == -1) {
19929 if (str) {
19930 rb_parser_string_free(p, str);
19931 str = 0;
19932 }
19933 goto error;
19934 }
19935 } while (!whole_match_p(p, eos, len, indent));
19936 }
19937 else {
19938 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
19939 newtok(p);
19940 if (c == '#') {
19941 enum yytokentype t = parser_peek_variable_name(p);
19942 if (p->heredoc_line_indent != -1) {
19943 if (p->heredoc_indent > p->heredoc_line_indent) {
19944 p->heredoc_indent = p->heredoc_line_indent;
19945 }
19946 p->heredoc_line_indent = -1;
19947 }
19948 if (t) return t;
19949 tokadd(p, '#');
19950 c = nextc(p);
19951 }
19952 do {
19953 pushback(p, c);
19954 enc = p->enc;
19955 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
19956 if (p->eofp) goto error;
19957 goto restore;
19958 }
19959 if (c != '\n') {
19960 if (c == '\\') p->heredoc_line_indent = -1;
19961 flush:
19962 str = STR_NEW3(tok(p), toklen(p), enc, func);
19963 flush_str:
19964 set_yylval_str(str);
19965#ifndef RIPPER
19966 if (bol) nd_set_fl_newline(yylval.node);
19967#endif
19968 flush_string_content(p, enc, 0);
19969 return tSTRING_CONTENT;
19970 }
19971 tokadd(p, nextc(p));
19972 if (p->heredoc_indent > 0) {
19973 lex_goto_eol(p);
19974 goto flush;
19975 }
19976 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
19977 if ((c = nextc(p)) == -1) goto error;
19978 } while (!whole_match_p(p, eos, len, indent));
19979 str = STR_NEW3(tok(p), toklen(p), enc, func);
19980 }
19981 dispatch_heredoc_end(p);
19982 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19983 token_flush(p);
19984 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
19985#ifdef RIPPER
19986 /* Preserve s_value for set_yylval_str */
19987 s_value = p->s_value;
19988#endif
19989 set_yylval_str(str);
19990#ifdef RIPPER
19991 set_parser_s_value(s_value);
19992#endif
19993
19994#ifndef RIPPER
19995 if (bol) nd_set_fl_newline(yylval.node);
19996#endif
19997 return tSTRING_CONTENT;
19998}
19999
20000#include "lex.c"
20001
20002static int
20003arg_ambiguous(struct parser_params *p, char c)
20004{
20005#ifndef RIPPER
20006 if (c == '/') {
20007 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after '%c' operator", WARN_I(c));
20008 }
20009 else {
20010 rb_warning1("ambiguous first argument; put parentheses or a space even after '%c' operator", WARN_I(c));
20011 }
20012#else
20013 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
20014#endif
20015 return TRUE;
20016}
20017
20018/* returns true value if formal argument error;
20019 * Qtrue, or error message if ripper */
20020static VALUE
20021formal_argument_error(struct parser_params *p, ID id)
20022{
20023 switch (id_type(id)) {
20024 case ID_LOCAL:
20025 break;
20026#ifndef RIPPER
20027# define ERR(mesg) (yyerror0(mesg), Qtrue)
20028#else
20029# define ERR(mesg) WARN_S(mesg)
20030#endif
20031 case ID_CONST:
20032 return ERR("formal argument cannot be a constant");
20033 case ID_INSTANCE:
20034 return ERR("formal argument cannot be an instance variable");
20035 case ID_GLOBAL:
20036 return ERR("formal argument cannot be a global variable");
20037 case ID_CLASS:
20038 return ERR("formal argument cannot be a class variable");
20039 default:
20040 return ERR("formal argument must be local variable");
20041#undef ERR
20042 }
20043 shadowing_lvar(p, id);
20044
20045 return Qfalse;
20046}
20047
20048static int
20049lvar_defined(struct parser_params *p, ID id)
20050{
20051 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
20052}
20053
20054/* emacsen -*- hack */
20055static long
20056parser_encode_length(struct parser_params *p, const char *name, long len)
20057{
20058 long nlen;
20059
20060 if (len > 5 && name[nlen = len - 5] == '-') {
20061 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
20062 return nlen;
20063 }
20064 if (len > 4 && name[nlen = len - 4] == '-') {
20065 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
20066 return nlen;
20067 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
20068 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
20069 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
20070 return nlen;
20071 }
20072 return len;
20073}
20074
20075static void
20076parser_set_encode(struct parser_params *p, const char *name)
20077{
20078 rb_encoding *enc;
20079 VALUE excargs[3];
20080 int idx = 0;
20081
20082 const char *wrong = 0;
20083 switch (*name) {
20084 case 'e': case 'E': wrong = "external"; break;
20085 case 'i': case 'I': wrong = "internal"; break;
20086 case 'f': case 'F': wrong = "filesystem"; break;
20087 case 'l': case 'L': wrong = "locale"; break;
20088 }
20089 if (wrong && STRCASECMP(name, wrong) == 0) goto unknown;
20090 idx = rb_enc_find_index(name);
20091 if (idx < 0) {
20092 unknown:
20093 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
20094 error:
20095 excargs[0] = rb_eArgError;
20096 excargs[2] = rb_make_backtrace();
20097 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
20098 VALUE exc = rb_make_exception(3, excargs);
20099 ruby_show_error_line(p, exc, &(YYLTYPE)RUBY_INIT_YYLLOC(), p->ruby_sourceline, p->lex.lastline);
20100
20101 rb_ast_free(p->ast);
20102 p->ast = NULL;
20103
20104 rb_exc_raise(exc);
20105 }
20106 enc = rb_enc_from_index(idx);
20107 if (!rb_enc_asciicompat(enc)) {
20108 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
20109 goto error;
20110 }
20111 p->enc = enc;
20112#ifndef RIPPER
20113 if (p->debug_lines) {
20114 long i;
20115 for (i = 0; i < p->debug_lines->len; i++) {
20116 rb_parser_enc_associate(p, p->debug_lines->data[i], enc);
20117 }
20118 }
20119#endif
20120}
20121
20122static bool
20123comment_at_top(struct parser_params *p)
20124{
20125 if (p->token_seen) return false;
20126 return (p->line_count == (p->has_shebang ? 2 : 1));
20127}
20128
20129typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
20130typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
20131
20132static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
20133
20134static void
20135magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
20136{
20137 if (!comment_at_top(p)) {
20138 return;
20139 }
20140 parser_set_encode(p, val);
20141}
20142
20143static int
20144parser_get_bool(struct parser_params *p, const char *name, const char *val)
20145{
20146 switch (*val) {
20147 case 't': case 'T':
20148 if (STRCASECMP(val, "true") == 0) {
20149 return TRUE;
20150 }
20151 break;
20152 case 'f': case 'F':
20153 if (STRCASECMP(val, "false") == 0) {
20154 return FALSE;
20155 }
20156 break;
20157 }
20158 return parser_invalid_pragma_value(p, name, val);
20159}
20160
20161static int
20162parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
20163{
20164 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
20165 return -1;
20166}
20167
20168static void
20169parser_set_token_info(struct parser_params *p, const char *name, const char *val)
20170{
20171 int b = parser_get_bool(p, name, val);
20172 if (b >= 0) p->token_info_enabled = b;
20173}
20174
20175static void
20176parser_set_frozen_string_literal(struct parser_params *p, const char *name, const char *val)
20177{
20178 int b;
20179
20180 if (p->token_seen) {
20181 rb_warning1("'%s' is ignored after any tokens", WARN_S(name));
20182 return;
20183 }
20184
20185 b = parser_get_bool(p, name, val);
20186 if (b < 0) return;
20187
20188 p->frozen_string_literal = b;
20189}
20190
20191static void
20192parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
20193{
20194 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
20195 if (*s == ' ' || *s == '\t') continue;
20196 if (*s == '#') break;
20197 rb_warning1("'%s' is ignored unless in comment-only line", WARN_S(name));
20198 return;
20199 }
20200
20201 switch (*val) {
20202 case 'n': case 'N':
20203 if (STRCASECMP(val, "none") == 0) {
20204 p->ctxt.shareable_constant_value = rb_parser_shareable_none;
20205 return;
20206 }
20207 break;
20208 case 'l': case 'L':
20209 if (STRCASECMP(val, "literal") == 0) {
20210 p->ctxt.shareable_constant_value = rb_parser_shareable_literal;
20211 return;
20212 }
20213 break;
20214 case 'e': case 'E':
20215 if (STRCASECMP(val, "experimental_copy") == 0) {
20216 p->ctxt.shareable_constant_value = rb_parser_shareable_copy;
20217 return;
20218 }
20219 if (STRCASECMP(val, "experimental_everything") == 0) {
20220 p->ctxt.shareable_constant_value = rb_parser_shareable_everything;
20221 return;
20222 }
20223 break;
20224 }
20225 parser_invalid_pragma_value(p, name, val);
20226}
20227
20228# if WARN_PAST_SCOPE
20229static void
20230parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
20231{
20232 int b = parser_get_bool(p, name, val);
20233 if (b >= 0) p->past_scope_enabled = b;
20234}
20235# endif
20236
20238 const char *name;
20239 rb_magic_comment_setter_t func;
20240 rb_magic_comment_length_t length;
20241};
20242
20243static const struct magic_comment magic_comments[] = {
20244 {"coding", magic_comment_encoding, parser_encode_length},
20245 {"encoding", magic_comment_encoding, parser_encode_length},
20246 {"frozen_string_literal", parser_set_frozen_string_literal},
20247 {"shareable_constant_value", parser_set_shareable_constant_value},
20248 {"warn_indent", parser_set_token_info},
20249# if WARN_PAST_SCOPE
20250 {"warn_past_scope", parser_set_past_scope},
20251# endif
20252};
20253
20254static const char *
20255magic_comment_marker(const char *str, long len)
20256{
20257 long i = 2;
20258
20259 while (i < len) {
20260 switch (str[i]) {
20261 case '-':
20262 if (str[i-1] == '*' && str[i-2] == '-') {
20263 return str + i + 1;
20264 }
20265 i += 2;
20266 break;
20267 case '*':
20268 if (i + 1 >= len) return 0;
20269 if (str[i+1] != '-') {
20270 i += 4;
20271 }
20272 else if (str[i-1] != '-') {
20273 i += 2;
20274 }
20275 else {
20276 return str + i + 2;
20277 }
20278 break;
20279 default:
20280 i += 3;
20281 break;
20282 }
20283 }
20284 return 0;
20285}
20286
20287static int
20288parser_magic_comment(struct parser_params *p, const char *str, long len)
20289{
20290 int indicator = 0;
20291 VALUE name = 0, val = 0;
20292 const char *beg, *end, *vbeg, *vend;
20293#define str_copy(_s, _p, _n) ((_s) \
20294 ? (void)(rb_str_resize((_s), (_n)), \
20295 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
20296 : (void)((_s) = STR_NEW((_p), (_n))))
20297
20298 if (len <= 7) return FALSE;
20299 if (!!(beg = magic_comment_marker(str, len))) {
20300 if (!(end = magic_comment_marker(beg, str + len - beg)))
20301 return FALSE;
20302 indicator = TRUE;
20303 str = beg;
20304 len = end - beg - 3;
20305 }
20306
20307 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
20308 while (len > 0) {
20309 const struct magic_comment *mc = magic_comments;
20310 char *s;
20311 int i;
20312 long n = 0;
20313
20314 for (; len > 0 && *str; str++, --len) {
20315 switch (*str) {
20316 case '\'': case '"': case ':': case ';':
20317 continue;
20318 }
20319 if (!ISSPACE(*str)) break;
20320 }
20321 for (beg = str; len > 0; str++, --len) {
20322 switch (*str) {
20323 case '\'': case '"': case ':': case ';':
20324 break;
20325 default:
20326 if (ISSPACE(*str)) break;
20327 continue;
20328 }
20329 break;
20330 }
20331 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
20332 if (!len) break;
20333 if (*str != ':') {
20334 if (!indicator) return FALSE;
20335 continue;
20336 }
20337
20338 do str++; while (--len > 0 && ISSPACE(*str));
20339 if (!len) break;
20340 const char *tok_beg = str;
20341 if (*str == '"') {
20342 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
20343 if (*str == '\\') {
20344 --len;
20345 ++str;
20346 }
20347 }
20348 vend = str;
20349 if (len) {
20350 --len;
20351 ++str;
20352 }
20353 }
20354 else {
20355 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
20356 vend = str;
20357 }
20358 const char *tok_end = str;
20359 if (indicator) {
20360 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
20361 }
20362 else {
20363 while (len > 0 && (ISSPACE(*str))) --len, str++;
20364 if (len) return FALSE;
20365 }
20366
20367 n = end - beg;
20368 str_copy(name, beg, n);
20369 s = RSTRING_PTR(name);
20370 for (i = 0; i < n; ++i) {
20371 if (s[i] == '-') s[i] = '_';
20372 }
20373 do {
20374 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
20375 n = vend - vbeg;
20376 if (mc->length) {
20377 n = (*mc->length)(p, vbeg, n);
20378 }
20379 str_copy(val, vbeg, n);
20380 p->lex.ptok = tok_beg;
20381 p->lex.pcur = tok_end;
20382 (*mc->func)(p, mc->name, RSTRING_PTR(val));
20383 break;
20384 }
20385 } while (++mc < magic_comments + numberof(magic_comments));
20386#ifdef RIPPER
20387 str_copy(val, vbeg, vend - vbeg);
20388 dispatch2(magic_comment, name, val);
20389#endif
20390 }
20391
20392 return TRUE;
20393}
20394
20395static void
20396set_file_encoding(struct parser_params *p, const char *str, const char *send)
20397{
20398 int sep = 0;
20399 const char *beg = str;
20400 VALUE s;
20401
20402 for (;;) {
20403 if (send - str <= 6) return;
20404 switch (str[6]) {
20405 case 'C': case 'c': str += 6; continue;
20406 case 'O': case 'o': str += 5; continue;
20407 case 'D': case 'd': str += 4; continue;
20408 case 'I': case 'i': str += 3; continue;
20409 case 'N': case 'n': str += 2; continue;
20410 case 'G': case 'g': str += 1; continue;
20411 case '=': case ':':
20412 sep = 1;
20413 str += 6;
20414 break;
20415 default:
20416 str += 6;
20417 if (ISSPACE(*str)) break;
20418 continue;
20419 }
20420 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
20421 sep = 0;
20422 }
20423 for (;;) {
20424 do {
20425 if (++str >= send) return;
20426 } while (ISSPACE(*str));
20427 if (sep) break;
20428 if (*str != '=' && *str != ':') return;
20429 sep = 1;
20430 str++;
20431 }
20432 beg = str;
20433 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
20434 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
20435 p->lex.ptok = beg;
20436 p->lex.pcur = str;
20437 parser_set_encode(p, RSTRING_PTR(s));
20438 rb_str_resize(s, 0);
20439}
20440
20441static void
20442parser_prepare(struct parser_params *p)
20443{
20444 int c = nextc0(p, FALSE);
20445 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
20446 switch (c) {
20447 case '#':
20448 if (peek(p, '!')) p->has_shebang = 1;
20449 break;
20450 case 0xef: /* UTF-8 BOM marker */
20451 if (!lex_eol_n_p(p, 2) &&
20452 (unsigned char)p->lex.pcur[0] == 0xbb &&
20453 (unsigned char)p->lex.pcur[1] == 0xbf) {
20454 p->enc = rb_utf8_encoding();
20455 p->lex.pcur += 2;
20456#ifndef RIPPER
20457 if (p->debug_lines) {
20458 rb_parser_string_set_encoding(p->lex.lastline, p->enc);
20459 }
20460#endif
20461 p->lex.pbeg = p->lex.pcur;
20462 token_flush(p);
20463 return;
20464 }
20465 break;
20466 case -1: /* end of script. */
20467 return;
20468 }
20469 pushback(p, c);
20470 p->enc = rb_parser_str_get_encoding(p->lex.lastline);
20471}
20472
20473#ifndef RIPPER
20474#define ambiguous_operator(tok, op, syn) ( \
20475 rb_warning0("'"op"' after local variable or literal is interpreted as binary operator"), \
20476 rb_warning0("even though it seems like "syn""))
20477#else
20478#define ambiguous_operator(tok, op, syn) \
20479 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
20480#endif
20481#define warn_balanced(tok, op, syn) ((void) \
20482 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
20483 space_seen && !ISSPACE(c) && \
20484 (ambiguous_operator(tok, op, syn), 0)), \
20485 (enum yytokentype)(tok))
20486
20487static enum yytokentype
20488no_digits(struct parser_params *p)
20489{
20490 yyerror0("numeric literal without digits");
20491 if (peek(p, '_')) nextc(p);
20492 /* dummy 0, for tUMINUS_NUM at numeric */
20493 return set_number_literal(p, tINTEGER, 0, 10, 0);
20494}
20495
20496static enum yytokentype
20497parse_numeric(struct parser_params *p, int c)
20498{
20499 int is_float, seen_point, seen_e, nondigit;
20500 int suffix;
20501
20502 is_float = seen_point = seen_e = nondigit = 0;
20503 SET_LEX_STATE(EXPR_END);
20504 newtok(p);
20505 if (c == '-' || c == '+') {
20506 tokadd(p, c);
20507 c = nextc(p);
20508 }
20509 if (c == '0') {
20510 int start = toklen(p);
20511 c = nextc(p);
20512 if (c == 'x' || c == 'X') {
20513 /* hexadecimal */
20514 c = nextc(p);
20515 if (c != -1 && ISXDIGIT(c)) {
20516 do {
20517 if (c == '_') {
20518 if (nondigit) break;
20519 nondigit = c;
20520 continue;
20521 }
20522 if (!ISXDIGIT(c)) break;
20523 nondigit = 0;
20524 tokadd(p, c);
20525 } while ((c = nextc(p)) != -1);
20526 }
20527 pushback(p, c);
20528 tokfix(p);
20529 if (toklen(p) == start) {
20530 return no_digits(p);
20531 }
20532 else if (nondigit) goto trailing_uc;
20533 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20534 return set_number_literal(p, tINTEGER, suffix, 16, 0);
20535 }
20536 if (c == 'b' || c == 'B') {
20537 /* binary */
20538 c = nextc(p);
20539 if (c == '0' || c == '1') {
20540 do {
20541 if (c == '_') {
20542 if (nondigit) break;
20543 nondigit = c;
20544 continue;
20545 }
20546 if (c != '0' && c != '1') break;
20547 nondigit = 0;
20548 tokadd(p, c);
20549 } while ((c = nextc(p)) != -1);
20550 }
20551 pushback(p, c);
20552 tokfix(p);
20553 if (toklen(p) == start) {
20554 return no_digits(p);
20555 }
20556 else if (nondigit) goto trailing_uc;
20557 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20558 return set_number_literal(p, tINTEGER, suffix, 2, 0);
20559 }
20560 if (c == 'd' || c == 'D') {
20561 /* decimal */
20562 c = nextc(p);
20563 if (c != -1 && ISDIGIT(c)) {
20564 do {
20565 if (c == '_') {
20566 if (nondigit) break;
20567 nondigit = c;
20568 continue;
20569 }
20570 if (!ISDIGIT(c)) break;
20571 nondigit = 0;
20572 tokadd(p, c);
20573 } while ((c = nextc(p)) != -1);
20574 }
20575 pushback(p, c);
20576 tokfix(p);
20577 if (toklen(p) == start) {
20578 return no_digits(p);
20579 }
20580 else if (nondigit) goto trailing_uc;
20581 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20582 return set_number_literal(p, tINTEGER, suffix, 10, 0);
20583 }
20584 if (c == '_') {
20585 /* 0_0 */
20586 goto octal_number;
20587 }
20588 if (c == 'o' || c == 'O') {
20589 /* prefixed octal */
20590 c = nextc(p);
20591 if (c == -1 || c == '_' || !ISDIGIT(c)) {
20592 tokfix(p);
20593 return no_digits(p);
20594 }
20595 }
20596 if (c >= '0' && c <= '7') {
20597 /* octal */
20598 octal_number:
20599 do {
20600 if (c == '_') {
20601 if (nondigit) break;
20602 nondigit = c;
20603 continue;
20604 }
20605 if (c < '0' || c > '9') break;
20606 if (c > '7') goto invalid_octal;
20607 nondigit = 0;
20608 tokadd(p, c);
20609 } while ((c = nextc(p)) != -1);
20610 if (toklen(p) > start) {
20611 pushback(p, c);
20612 tokfix(p);
20613 if (nondigit) goto trailing_uc;
20614 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20615 return set_number_literal(p, tINTEGER, suffix, 8, 0);
20616 }
20617 if (nondigit) {
20618 pushback(p, c);
20619 goto trailing_uc;
20620 }
20621 }
20622 if (c > '7' && c <= '9') {
20623 invalid_octal:
20624 yyerror0("Invalid octal digit");
20625 }
20626 else if (c == '.' || c == 'e' || c == 'E') {
20627 tokadd(p, '0');
20628 }
20629 else {
20630 pushback(p, c);
20631 tokfix(p);
20632 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20633 return set_number_literal(p, tINTEGER, suffix, 10, 0);
20634 }
20635 }
20636
20637 for (;;) {
20638 switch (c) {
20639 case '0': case '1': case '2': case '3': case '4':
20640 case '5': case '6': case '7': case '8': case '9':
20641 nondigit = 0;
20642 tokadd(p, c);
20643 break;
20644
20645 case '.':
20646 if (nondigit) goto trailing_uc;
20647 if (seen_point || seen_e) {
20648 goto decode_num;
20649 }
20650 else {
20651 int c0 = nextc(p);
20652 if (c0 == -1 || !ISDIGIT(c0)) {
20653 pushback(p, c0);
20654 goto decode_num;
20655 }
20656 c = c0;
20657 }
20658 seen_point = toklen(p);
20659 tokadd(p, '.');
20660 tokadd(p, c);
20661 is_float++;
20662 nondigit = 0;
20663 break;
20664
20665 case 'e':
20666 case 'E':
20667 if (nondigit) {
20668 pushback(p, c);
20669 c = nondigit;
20670 goto decode_num;
20671 }
20672 if (seen_e) {
20673 goto decode_num;
20674 }
20675 nondigit = c;
20676 c = nextc(p);
20677 if (c != '-' && c != '+' && !ISDIGIT(c)) {
20678 pushback(p, c);
20679 c = nondigit;
20680 nondigit = 0;
20681 goto decode_num;
20682 }
20683 tokadd(p, nondigit);
20684 seen_e++;
20685 is_float++;
20686 tokadd(p, c);
20687 nondigit = (c == '-' || c == '+') ? c : 0;
20688 break;
20689
20690 case '_': /* `_' in number just ignored */
20691 if (nondigit) goto decode_num;
20692 nondigit = c;
20693 break;
20694
20695 default:
20696 goto decode_num;
20697 }
20698 c = nextc(p);
20699 }
20700
20701 decode_num:
20702 pushback(p, c);
20703 if (nondigit) {
20704 trailing_uc:
20705 literal_flush(p, p->lex.pcur - 1);
20706 YYLTYPE loc = RUBY_INIT_YYLLOC();
20707 compile_error(p, "trailing '%c' in number", nondigit);
20708 parser_show_error_line(p, &loc);
20709 }
20710 tokfix(p);
20711 if (is_float) {
20712 enum yytokentype type = tFLOAT;
20713
20714 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
20715 if (suffix & NUM_SUFFIX_R) {
20716 type = tRATIONAL;
20717 }
20718 else {
20719 strtod(tok(p), 0);
20720 if (errno == ERANGE) {
20721 rb_warning1("Float %s out of range", WARN_S(tok(p)));
20722 errno = 0;
20723 }
20724 }
20725 return set_number_literal(p, type, suffix, 0, seen_point);
20726 }
20727 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20728 return set_number_literal(p, tINTEGER, suffix, 10, 0);
20729}
20730
20731static enum yytokentype
20732parse_qmark(struct parser_params *p, int space_seen)
20733{
20734 rb_encoding *enc;
20735 register int c;
20736 rb_parser_string_t *lit;
20737
20738 if (IS_END()) {
20739 SET_LEX_STATE(EXPR_VALUE);
20740 return '?';
20741 }
20742 c = nextc(p);
20743 if (c == -1) {
20744 compile_error(p, "incomplete character syntax");
20745 return 0;
20746 }
20747 if (rb_enc_isspace(c, p->enc)) {
20748 if (!IS_ARG()) {
20749 int c2 = escaped_control_code(c);
20750 if (c2) {
20751 WARN_SPACE_CHAR(c2, "?");
20752 }
20753 }
20754 ternary:
20755 pushback(p, c);
20756 SET_LEX_STATE(EXPR_VALUE);
20757 return '?';
20758 }
20759 newtok(p);
20760 enc = p->enc;
20761 if (!parser_isascii(p)) {
20762 if (tokadd_mbchar(p, c) == -1) return 0;
20763 }
20764 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
20765 !lex_eol_p(p) && is_identchar(p, p->lex.pcur, p->lex.pend, p->enc)) {
20766 if (space_seen) {
20767 const char *start = p->lex.pcur - 1, *ptr = start;
20768 do {
20769 int n = parser_precise_mbclen(p, ptr);
20770 if (n < 0) return -1;
20771 ptr += n;
20772 } while (!lex_eol_ptr_p(p, ptr) && is_identchar(p, ptr, p->lex.pend, p->enc));
20773 rb_warn2("'?' just followed by '%.*s' is interpreted as" \
20774 " a conditional operator, put a space after '?'",
20775 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
20776 }
20777 goto ternary;
20778 }
20779 else if (c == '\\') {
20780 if (peek(p, 'u')) {
20781 nextc(p);
20782 enc = rb_utf8_encoding();
20783 tokadd_utf8(p, &enc, -1, 0, 0);
20784 }
20785 else if (!ISASCII(c = peekc(p)) && c != -1) {
20786 nextc(p);
20787 if (tokadd_mbchar(p, c) == -1) return 0;
20788 }
20789 else {
20790 c = read_escape(p, 0, p->lex.pcur - rb_strlen_lit("?\\"));
20791 tokadd(p, c);
20792 }
20793 }
20794 else {
20795 tokadd(p, c);
20796 }
20797 tokfix(p);
20798 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
20799 set_yylval_str(lit);
20800 SET_LEX_STATE(EXPR_END);
20801 return tCHAR;
20802}
20803
20804static enum yytokentype
20805parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
20806{
20807 register int c;
20808 const char *ptok = p->lex.pcur;
20809
20810 if (IS_BEG()) {
20811 int term;
20812 int paren;
20813
20814 c = nextc(p);
20815 quotation:
20816 if (c == -1) goto unterminated;
20817 if (!ISALNUM(c)) {
20818 term = c;
20819 if (!ISASCII(c)) goto unknown;
20820 c = 'Q';
20821 }
20822 else {
20823 term = nextc(p);
20824 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
20825 unknown:
20826 pushback(p, term);
20827 c = parser_precise_mbclen(p, p->lex.pcur);
20828 if (c < 0) return 0;
20829 p->lex.pcur += c;
20830 yyerror0("unknown type of %string");
20831 return 0;
20832 }
20833 }
20834 if (term == -1) {
20835 unterminated:
20836 compile_error(p, "unterminated quoted string meets end of file");
20837 return 0;
20838 }
20839 paren = term;
20840 if (term == '(') term = ')';
20841 else if (term == '[') term = ']';
20842 else if (term == '{') term = '}';
20843 else if (term == '<') term = '>';
20844 else paren = 0;
20845
20846 p->lex.ptok = ptok-1;
20847 switch (c) {
20848 case 'Q':
20849 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
20850 return tSTRING_BEG;
20851
20852 case 'q':
20853 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
20854 return tSTRING_BEG;
20855
20856 case 'W':
20857 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20858 return tWORDS_BEG;
20859
20860 case 'w':
20861 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20862 return tQWORDS_BEG;
20863
20864 case 'I':
20865 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20866 return tSYMBOLS_BEG;
20867
20868 case 'i':
20869 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20870 return tQSYMBOLS_BEG;
20871
20872 case 'x':
20873 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
20874 return tXSTRING_BEG;
20875
20876 case 'r':
20877 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
20878 return tREGEXP_BEG;
20879
20880 case 's':
20881 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
20882 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
20883 return tSYMBEG;
20884
20885 default:
20886 yyerror0("unknown type of %string");
20887 return 0;
20888 }
20889 }
20890 if ((c = nextc(p)) == '=') {
20891 set_yylval_id('%');
20892 SET_LEX_STATE(EXPR_BEG);
20893 return tOP_ASGN;
20894 }
20895 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
20896 goto quotation;
20897 }
20898 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20899 pushback(p, c);
20900 return warn_balanced('%', "%%", "string literal");
20901}
20902
20903static int
20904tokadd_ident(struct parser_params *p, int c)
20905{
20906 do {
20907 if (tokadd_mbchar(p, c) == -1) return -1;
20908 c = nextc(p);
20909 } while (parser_is_identchar(p));
20910 pushback(p, c);
20911 return 0;
20912}
20913
20914static ID
20915tokenize_ident(struct parser_params *p)
20916{
20917 ID ident = TOK_INTERN();
20918
20919 set_yylval_name(ident);
20920
20921 return ident;
20922}
20923
20924static int
20925parse_numvar(struct parser_params *p)
20926{
20927 size_t len;
20928 int overflow;
20929 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
20930 const unsigned long nth_ref_max =
20932 /* NTH_REF is left-shifted to be ORed with back-ref flag and
20933 * turned into a Fixnum, in compile.c */
20934
20935 if (overflow || n > nth_ref_max) {
20936 /* compile_error()? */
20937 rb_warn1("'%s' is too big for a number variable, always nil", WARN_S(tok(p)));
20938 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
20939 }
20940 else {
20941 return (int)n;
20942 }
20943}
20944
20945static enum yytokentype
20946parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
20947{
20948 const char *ptr = p->lex.pcur;
20949 register int c;
20950
20951 SET_LEX_STATE(EXPR_END);
20952 p->lex.ptok = ptr - 1; /* from '$' */
20953 newtok(p);
20954 c = nextc(p);
20955 switch (c) {
20956 case '_': /* $_: last read line string */
20957 c = nextc(p);
20958 if (parser_is_identchar(p)) {
20959 tokadd(p, '$');
20960 tokadd(p, '_');
20961 break;
20962 }
20963 pushback(p, c);
20964 c = '_';
20965 /* fall through */
20966 case '~': /* $~: match-data */
20967 case '*': /* $*: argv */
20968 case '$': /* $$: pid */
20969 case '?': /* $?: last status */
20970 case '!': /* $!: error string */
20971 case '@': /* $@: error position */
20972 case '/': /* $/: input record separator */
20973 case '\\': /* $\: output record separator */
20974 case ';': /* $;: field separator */
20975 case ',': /* $,: output field separator */
20976 case '.': /* $.: last read line number */
20977 case '=': /* $=: ignorecase */
20978 case ':': /* $:: load path */
20979 case '<': /* $<: default input handle */
20980 case '>': /* $>: default output handle */
20981 case '\"': /* $": already loaded files */
20982 tokadd(p, '$');
20983 tokadd(p, c);
20984 goto gvar;
20985
20986 case '-':
20987 tokadd(p, '$');
20988 tokadd(p, c);
20989 c = nextc(p);
20990 if (parser_is_identchar(p)) {
20991 if (tokadd_mbchar(p, c) == -1) return 0;
20992 }
20993 else {
20994 pushback(p, c);
20995 pushback(p, '-');
20996 return '$';
20997 }
20998 gvar:
20999 tokenize_ident(p);
21000 return tGVAR;
21001
21002 case '&': /* $&: last match */
21003 case '`': /* $`: string before last match */
21004 case '\'': /* $': string after last match */
21005 case '+': /* $+: string matches last paren. */
21006 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
21007 tokadd(p, '$');
21008 tokadd(p, c);
21009 goto gvar;
21010 }
21011 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
21012 return tBACK_REF;
21013
21014 case '1': case '2': case '3':
21015 case '4': case '5': case '6':
21016 case '7': case '8': case '9':
21017 tokadd(p, '$');
21018 do {
21019 tokadd(p, c);
21020 c = nextc(p);
21021 } while (c != -1 && ISDIGIT(c));
21022 pushback(p, c);
21023 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
21024 tokfix(p);
21025 c = parse_numvar(p);
21026 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
21027 return tNTH_REF;
21028
21029 default:
21030 if (!parser_is_identchar(p)) {
21031 YYLTYPE loc = RUBY_INIT_YYLLOC();
21032 if (c == -1 || ISSPACE(c)) {
21033 compile_error(p, "'$' without identifiers is not allowed as a global variable name");
21034 }
21035 else {
21036 pushback(p, c);
21037 compile_error(p, "'$%c' is not allowed as a global variable name", c);
21038 }
21039 parser_show_error_line(p, &loc);
21040 set_yylval_noname();
21041 return tGVAR;
21042 }
21043 /* fall through */
21044 case '0':
21045 tokadd(p, '$');
21046 }
21047
21048 if (tokadd_ident(p, c)) return 0;
21049 SET_LEX_STATE(EXPR_END);
21050 if (VALID_SYMNAME_P(tok(p), toklen(p), p->enc, ID_GLOBAL)) {
21051 tokenize_ident(p);
21052 }
21053 else {
21054 compile_error(p, "'%.*s' is not allowed as a global variable name", toklen(p), tok(p));
21055 set_yylval_noname();
21056 }
21057 return tGVAR;
21058}
21059
21060static bool
21061parser_numbered_param(struct parser_params *p, int n)
21062{
21063 if (n < 0) return false;
21064
21065 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
21066 return false;
21067 }
21068 if (p->max_numparam == ORDINAL_PARAM) {
21069 compile_error(p, "ordinary parameter is defined");
21070 return false;
21071 }
21072 struct vtable *args = p->lvtbl->args;
21073 if (p->max_numparam < n) {
21074 p->max_numparam = n;
21075 }
21076 while (n > args->pos) {
21077 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
21078 }
21079 return true;
21080}
21081
21082static enum yytokentype
21083parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
21084{
21085 const char *ptr = p->lex.pcur;
21086 enum yytokentype result = tIVAR;
21087 register int c = nextc(p);
21088 YYLTYPE loc;
21089
21090 p->lex.ptok = ptr - 1; /* from '@' */
21091 newtok(p);
21092 tokadd(p, '@');
21093 if (c == '@') {
21094 result = tCVAR;
21095 tokadd(p, '@');
21096 c = nextc(p);
21097 }
21098 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
21099 if (c == -1 || !parser_is_identchar(p)) {
21100 pushback(p, c);
21101 RUBY_SET_YYLLOC(loc);
21102 if (result == tIVAR) {
21103 compile_error(p, "'@' without identifiers is not allowed as an instance variable name");
21104 }
21105 else {
21106 compile_error(p, "'@@' without identifiers is not allowed as a class variable name");
21107 }
21108 parser_show_error_line(p, &loc);
21109 set_yylval_noname();
21110 SET_LEX_STATE(EXPR_END);
21111 return result;
21112 }
21113 else if (ISDIGIT(c)) {
21114 pushback(p, c);
21115 RUBY_SET_YYLLOC(loc);
21116 if (result == tIVAR) {
21117 compile_error(p, "'@%c' is not allowed as an instance variable name", c);
21118 }
21119 else {
21120 compile_error(p, "'@@%c' is not allowed as a class variable name", c);
21121 }
21122 parser_show_error_line(p, &loc);
21123 set_yylval_noname();
21124 SET_LEX_STATE(EXPR_END);
21125 return result;
21126 }
21127
21128 if (tokadd_ident(p, c)) return 0;
21129 tokenize_ident(p);
21130 return result;
21131}
21132
21133static enum yytokentype
21134parse_ident(struct parser_params *p, int c, int cmd_state)
21135{
21136 enum yytokentype result;
21137 bool is_ascii = true;
21138 const enum lex_state_e last_state = p->lex.state;
21139 ID ident;
21140 int enforce_keyword_end = 0;
21141
21142 do {
21143 if (!ISASCII(c)) is_ascii = false;
21144 if (tokadd_mbchar(p, c) == -1) return 0;
21145 c = nextc(p);
21146 } while (parser_is_identchar(p));
21147 if ((c == '!' || c == '?') && !peek(p, '=')) {
21148 result = tFID;
21149 tokadd(p, c);
21150 }
21151 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
21152 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
21153 result = tIDENTIFIER;
21154 tokadd(p, c);
21155 }
21156 else {
21157 result = tCONSTANT; /* assume provisionally */
21158 pushback(p, c);
21159 }
21160 tokfix(p);
21161
21162 if (IS_LABEL_POSSIBLE()) {
21163 if (IS_LABEL_SUFFIX(0)) {
21164 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
21165 nextc(p);
21166 tokenize_ident(p);
21167 return tLABEL;
21168 }
21169 }
21170
21171#ifndef RIPPER
21172 if (peek_end_expect_token_locations(p)) {
21173 const rb_code_position_t *end_pos;
21174 int lineno, column;
21175 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21176
21177 end_pos = peek_end_expect_token_locations(p)->pos;
21178 lineno = end_pos->lineno;
21179 column = end_pos->column;
21180
21181 if (p->debug) {
21182 rb_parser_printf(p, "enforce_keyword_end check. current: (%d, %d), peek: (%d, %d)\n",
21183 p->ruby_sourceline, beg_pos, lineno, column);
21184 }
21185
21186 if ((p->ruby_sourceline > lineno) && (beg_pos <= column)) {
21187 const struct kwtable *kw;
21188
21189 if ((IS_lex_state(EXPR_DOT)) && (kw = rb_reserved_word(tok(p), toklen(p))) && (kw && kw->id[0] == keyword_end)) {
21190 if (p->debug) rb_parser_printf(p, "enforce_keyword_end is enabled\n");
21191 enforce_keyword_end = 1;
21192 }
21193 }
21194 }
21195#endif
21196
21197 if (is_ascii && (!IS_lex_state(EXPR_DOT) || enforce_keyword_end)) {
21198 const struct kwtable *kw;
21199
21200 /* See if it is a reserved word. */
21201 kw = rb_reserved_word(tok(p), toklen(p));
21202 if (kw) {
21203 enum lex_state_e state = p->lex.state;
21204 if (IS_lex_state_for(state, EXPR_FNAME)) {
21205 SET_LEX_STATE(EXPR_ENDFN);
21206 set_yylval_name(rb_intern2(tok(p), toklen(p)));
21207 return kw->id[0];
21208 }
21209 SET_LEX_STATE(kw->state);
21210 if (IS_lex_state(EXPR_BEG)) {
21211 p->command_start = TRUE;
21212 }
21213 if (kw->id[0] == keyword_do) {
21214 if (lambda_beginning_p()) {
21215 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
21216 return keyword_do_LAMBDA;
21217 }
21218 if (COND_P()) return keyword_do_cond;
21219 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
21220 return keyword_do_block;
21221 return keyword_do;
21222 }
21223 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED | EXPR_CLASS)))
21224 return kw->id[0];
21225 else {
21226 if (kw->id[0] != kw->id[1])
21227 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
21228 return kw->id[1];
21229 }
21230 }
21231 }
21232
21233 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
21234 if (cmd_state) {
21235 SET_LEX_STATE(EXPR_CMDARG);
21236 }
21237 else {
21238 SET_LEX_STATE(EXPR_ARG);
21239 }
21240 }
21241 else if (p->lex.state == EXPR_FNAME) {
21242 SET_LEX_STATE(EXPR_ENDFN);
21243 }
21244 else {
21245 SET_LEX_STATE(EXPR_END);
21246 }
21247
21248 ident = tokenize_ident(p);
21249 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
21250 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
21251 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
21252 (lvar_defined(p, ident) || NUMPARAM_ID_P(ident))) {
21253 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
21254 }
21255 return result;
21256}
21257
21258static void
21259warn_cr(struct parser_params *p)
21260{
21261 if (!p->cr_seen) {
21262 p->cr_seen = TRUE;
21263 /* carried over with p->lex.nextline for nextc() */
21264 rb_warn0("encountered \\r in middle of line, treated as a mere space");
21265 }
21266}
21267
21268static enum yytokentype
21269parser_yylex(struct parser_params *p)
21270{
21271 register int c;
21272 int space_seen = 0;
21273 int cmd_state;
21274 int label;
21275 enum lex_state_e last_state;
21276 int fallthru = FALSE;
21277 int token_seen = p->token_seen;
21278
21279 if (p->lex.strterm) {
21280 if (strterm_is_heredoc(p->lex.strterm)) {
21281 token_flush(p);
21282 return here_document(p, &p->lex.strterm->u.heredoc);
21283 }
21284 else {
21285 token_flush(p);
21286 return parse_string(p, &p->lex.strterm->u.literal);
21287 }
21288 }
21289 cmd_state = p->command_start;
21290 p->command_start = FALSE;
21291 p->token_seen = TRUE;
21292#ifndef RIPPER
21293 token_flush(p);
21294#endif
21295 retry:
21296 last_state = p->lex.state;
21297 switch (c = nextc(p)) {
21298 case '\0': /* NUL */
21299 case '\004': /* ^D */
21300 case '\032': /* ^Z */
21301 case -1: /* end of script. */
21302 p->eofp = 1;
21303#ifndef RIPPER
21304 if (p->end_expect_token_locations) {
21305 pop_end_expect_token_locations(p);
21306 RUBY_SET_YYLLOC_OF_DUMMY_END(*p->yylloc);
21307 return tDUMNY_END;
21308 }
21309#endif
21310 /* Set location for end-of-input because dispatch_scan_event is not called. */
21311 RUBY_SET_YYLLOC(*p->yylloc);
21312 return END_OF_INPUT;
21313
21314 /* white spaces */
21315 case '\r':
21316 warn_cr(p);
21317 /* fall through */
21318 case ' ': case '\t': case '\f':
21319 case '\13': /* '\v' */
21320 space_seen = 1;
21321 while ((c = nextc(p))) {
21322 switch (c) {
21323 case '\r':
21324 warn_cr(p);
21325 /* fall through */
21326 case ' ': case '\t': case '\f':
21327 case '\13': /* '\v' */
21328 break;
21329 default:
21330 goto outofloop;
21331 }
21332 }
21333 outofloop:
21334 pushback(p, c);
21335 dispatch_scan_event(p, tSP);
21336#ifndef RIPPER
21337 token_flush(p);
21338#endif
21339 goto retry;
21340
21341 case '#': /* it's a comment */
21342 p->token_seen = token_seen;
21343 const char *const pcur = p->lex.pcur, *const ptok = p->lex.ptok;
21344 /* no magic_comment in shebang line */
21345 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
21346 if (comment_at_top(p)) {
21347 set_file_encoding(p, p->lex.pcur, p->lex.pend);
21348 }
21349 }
21350 p->lex.pcur = pcur, p->lex.ptok = ptok;
21351 lex_goto_eol(p);
21352 dispatch_scan_event(p, tCOMMENT);
21353 fallthru = TRUE;
21354 /* fall through */
21355 case '\n':
21356 p->token_seen = token_seen;
21357 rb_parser_string_t *prevline = p->lex.lastline;
21358 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
21359 !IS_lex_state(EXPR_LABELED));
21360 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
21361 if (!fallthru) {
21362 dispatch_scan_event(p, tIGNORED_NL);
21363 }
21364 fallthru = FALSE;
21365 if (!c && p->ctxt.in_kwarg) {
21366 goto normal_newline;
21367 }
21368 goto retry;
21369 }
21370 while (1) {
21371 switch (c = nextc(p)) {
21372 case ' ': case '\t': case '\f': case '\r':
21373 case '\13': /* '\v' */
21374 space_seen = 1;
21375 break;
21376 case '#':
21377 pushback(p, c);
21378 if (space_seen) {
21379 dispatch_scan_event(p, tSP);
21380 token_flush(p);
21381 }
21382 goto retry;
21383 case '&':
21384 case '.': {
21385 dispatch_delayed_token(p, tIGNORED_NL);
21386 if (peek(p, '.') == (c == '&')) {
21387 pushback(p, c);
21388 dispatch_scan_event(p, tSP);
21389 goto retry;
21390 }
21391 }
21392 default:
21393 p->ruby_sourceline--;
21394 p->lex.nextline = p->lex.lastline;
21395 set_lastline(p, prevline);
21396 case -1: /* EOF no decrement*/
21397 if (c == -1 && space_seen) {
21398 dispatch_scan_event(p, tSP);
21399 }
21400 lex_goto_eol(p);
21401 if (c != -1) {
21402 token_flush(p);
21403 RUBY_SET_YYLLOC(*p->yylloc);
21404 }
21405 goto normal_newline;
21406 }
21407 }
21408 normal_newline:
21409 p->command_start = TRUE;
21410 SET_LEX_STATE(EXPR_BEG);
21411 return '\n';
21412
21413 case '*':
21414 if ((c = nextc(p)) == '*') {
21415 if ((c = nextc(p)) == '=') {
21416 set_yylval_id(idPow);
21417 SET_LEX_STATE(EXPR_BEG);
21418 return tOP_ASGN;
21419 }
21420 pushback(p, c);
21421 if (IS_SPCARG(c)) {
21422 rb_warning0("'**' interpreted as argument prefix");
21423 c = tDSTAR;
21424 }
21425 else if (IS_BEG()) {
21426 c = tDSTAR;
21427 }
21428 else {
21429 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
21430 }
21431 }
21432 else {
21433 if (c == '=') {
21434 set_yylval_id('*');
21435 SET_LEX_STATE(EXPR_BEG);
21436 return tOP_ASGN;
21437 }
21438 pushback(p, c);
21439 if (IS_SPCARG(c)) {
21440 rb_warning0("'*' interpreted as argument prefix");
21441 c = tSTAR;
21442 }
21443 else if (IS_BEG()) {
21444 c = tSTAR;
21445 }
21446 else {
21447 c = warn_balanced('*', "*", "argument prefix");
21448 }
21449 }
21450 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21451 return c;
21452
21453 case '!':
21454 c = nextc(p);
21455 if (IS_AFTER_OPERATOR()) {
21456 SET_LEX_STATE(EXPR_ARG);
21457 if (c == '@') {
21458 return '!';
21459 }
21460 }
21461 else {
21462 SET_LEX_STATE(EXPR_BEG);
21463 }
21464 if (c == '=') {
21465 return tNEQ;
21466 }
21467 if (c == '~') {
21468 return tNMATCH;
21469 }
21470 pushback(p, c);
21471 return '!';
21472
21473 case '=':
21474 if (was_bol(p)) {
21475 /* skip embedded rd document */
21476 if (word_match_p(p, "begin", 5)) {
21477 int first_p = TRUE;
21478
21479 lex_goto_eol(p);
21480 dispatch_scan_event(p, tEMBDOC_BEG);
21481 for (;;) {
21482 lex_goto_eol(p);
21483 if (!first_p) {
21484 dispatch_scan_event(p, tEMBDOC);
21485 }
21486 first_p = FALSE;
21487 c = nextc(p);
21488 if (c == -1) {
21489 compile_error(p, "embedded document meets end of file");
21490 return END_OF_INPUT;
21491 }
21492 if (c == '=' && word_match_p(p, "end", 3)) {
21493 break;
21494 }
21495 pushback(p, c);
21496 }
21497 lex_goto_eol(p);
21498 dispatch_scan_event(p, tEMBDOC_END);
21499 goto retry;
21500 }
21501 }
21502
21503 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21504 if ((c = nextc(p)) == '=') {
21505 if ((c = nextc(p)) == '=') {
21506 return tEQQ;
21507 }
21508 pushback(p, c);
21509 return tEQ;
21510 }
21511 if (c == '~') {
21512 return tMATCH;
21513 }
21514 else if (c == '>') {
21515 return tASSOC;
21516 }
21517 pushback(p, c);
21518 return '=';
21519
21520 case '<':
21521 c = nextc(p);
21522 if (c == '<' &&
21523 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
21524 !IS_END() &&
21525 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
21526 enum yytokentype token = heredoc_identifier(p);
21527 if (token) return token < 0 ? 0 : token;
21528 }
21529 if (IS_AFTER_OPERATOR()) {
21530 SET_LEX_STATE(EXPR_ARG);
21531 }
21532 else {
21533 if (IS_lex_state(EXPR_CLASS))
21534 p->command_start = TRUE;
21535 SET_LEX_STATE(EXPR_BEG);
21536 }
21537 if (c == '=') {
21538 if ((c = nextc(p)) == '>') {
21539 return tCMP;
21540 }
21541 pushback(p, c);
21542 return tLEQ;
21543 }
21544 if (c == '<') {
21545 if ((c = nextc(p)) == '=') {
21546 set_yylval_id(idLTLT);
21547 SET_LEX_STATE(EXPR_BEG);
21548 return tOP_ASGN;
21549 }
21550 pushback(p, c);
21551 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
21552 }
21553 pushback(p, c);
21554 return '<';
21555
21556 case '>':
21557 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21558 if ((c = nextc(p)) == '=') {
21559 return tGEQ;
21560 }
21561 if (c == '>') {
21562 if ((c = nextc(p)) == '=') {
21563 set_yylval_id(idGTGT);
21564 SET_LEX_STATE(EXPR_BEG);
21565 return tOP_ASGN;
21566 }
21567 pushback(p, c);
21568 return tRSHFT;
21569 }
21570 pushback(p, c);
21571 return '>';
21572
21573 case '"':
21574 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
21575 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
21576 p->lex.ptok = p->lex.pcur-1;
21577 return tSTRING_BEG;
21578
21579 case '`':
21580 if (IS_lex_state(EXPR_FNAME)) {
21581 SET_LEX_STATE(EXPR_ENDFN);
21582 return c;
21583 }
21584 if (IS_lex_state(EXPR_DOT)) {
21585 if (cmd_state)
21586 SET_LEX_STATE(EXPR_CMDARG);
21587 else
21588 SET_LEX_STATE(EXPR_ARG);
21589 return c;
21590 }
21591 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
21592 return tXSTRING_BEG;
21593
21594 case '\'':
21595 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
21596 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
21597 p->lex.ptok = p->lex.pcur-1;
21598 return tSTRING_BEG;
21599
21600 case '?':
21601 return parse_qmark(p, space_seen);
21602
21603 case '&':
21604 if ((c = nextc(p)) == '&') {
21605 SET_LEX_STATE(EXPR_BEG);
21606 if ((c = nextc(p)) == '=') {
21607 set_yylval_id(idANDOP);
21608 SET_LEX_STATE(EXPR_BEG);
21609 return tOP_ASGN;
21610 }
21611 pushback(p, c);
21612 return tANDOP;
21613 }
21614 else if (c == '=') {
21615 set_yylval_id('&');
21616 SET_LEX_STATE(EXPR_BEG);
21617 return tOP_ASGN;
21618 }
21619 else if (c == '.') {
21620 set_yylval_id(idANDDOT);
21621 SET_LEX_STATE(EXPR_DOT);
21622 return tANDDOT;
21623 }
21624 pushback(p, c);
21625 if (IS_SPCARG(c)) {
21626 if ((c != ':') ||
21627 (c = peekc_n(p, 1)) == -1 ||
21628 !(c == '\'' || c == '"' ||
21629 is_identchar(p, (p->lex.pcur+1), p->lex.pend, p->enc))) {
21630 rb_warning0("'&' interpreted as argument prefix");
21631 }
21632 c = tAMPER;
21633 }
21634 else if (IS_BEG()) {
21635 c = tAMPER;
21636 }
21637 else {
21638 c = warn_balanced('&', "&", "argument prefix");
21639 }
21640 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21641 return c;
21642
21643 case '|':
21644 if ((c = nextc(p)) == '|') {
21645 SET_LEX_STATE(EXPR_BEG);
21646 if ((c = nextc(p)) == '=') {
21647 set_yylval_id(idOROP);
21648 SET_LEX_STATE(EXPR_BEG);
21649 return tOP_ASGN;
21650 }
21651 pushback(p, c);
21652 if (IS_lex_state_for(last_state, EXPR_BEG)) {
21653 c = '|';
21654 pushback(p, '|');
21655 return c;
21656 }
21657 return tOROP;
21658 }
21659 if (c == '=') {
21660 set_yylval_id('|');
21661 SET_LEX_STATE(EXPR_BEG);
21662 return tOP_ASGN;
21663 }
21664 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
21665 pushback(p, c);
21666 return '|';
21667
21668 case '+':
21669 c = nextc(p);
21670 if (IS_AFTER_OPERATOR()) {
21671 SET_LEX_STATE(EXPR_ARG);
21672 if (c == '@') {
21673 return tUPLUS;
21674 }
21675 pushback(p, c);
21676 return '+';
21677 }
21678 if (c == '=') {
21679 set_yylval_id('+');
21680 SET_LEX_STATE(EXPR_BEG);
21681 return tOP_ASGN;
21682 }
21683 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
21684 SET_LEX_STATE(EXPR_BEG);
21685 pushback(p, c);
21686 if (c != -1 && ISDIGIT(c)) {
21687 return parse_numeric(p, '+');
21688 }
21689 return tUPLUS;
21690 }
21691 SET_LEX_STATE(EXPR_BEG);
21692 pushback(p, c);
21693 return warn_balanced('+', "+", "unary operator");
21694
21695 case '-':
21696 c = nextc(p);
21697 if (IS_AFTER_OPERATOR()) {
21698 SET_LEX_STATE(EXPR_ARG);
21699 if (c == '@') {
21700 return tUMINUS;
21701 }
21702 pushback(p, c);
21703 return '-';
21704 }
21705 if (c == '=') {
21706 set_yylval_id('-');
21707 SET_LEX_STATE(EXPR_BEG);
21708 return tOP_ASGN;
21709 }
21710 if (c == '>') {
21711 SET_LEX_STATE(EXPR_ENDFN);
21712 yylval.num = p->lex.lpar_beg;
21713 p->lex.lpar_beg = p->lex.paren_nest;
21714 return tLAMBDA;
21715 }
21716 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
21717 SET_LEX_STATE(EXPR_BEG);
21718 pushback(p, c);
21719 if (c != -1 && ISDIGIT(c)) {
21720 return tUMINUS_NUM;
21721 }
21722 return tUMINUS;
21723 }
21724 SET_LEX_STATE(EXPR_BEG);
21725 pushback(p, c);
21726 return warn_balanced('-', "-", "unary operator");
21727
21728 case '.': {
21729 int is_beg = IS_BEG();
21730 SET_LEX_STATE(EXPR_BEG);
21731 if ((c = nextc(p)) == '.') {
21732 if ((c = nextc(p)) == '.') {
21733 if (p->ctxt.in_argdef || IS_LABEL_POSSIBLE()) {
21734 SET_LEX_STATE(EXPR_ENDARG);
21735 return tBDOT3;
21736 }
21737 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
21738 rb_warn0("... at EOL, should be parenthesized?");
21739 }
21740 return is_beg ? tBDOT3 : tDOT3;
21741 }
21742 pushback(p, c);
21743 return is_beg ? tBDOT2 : tDOT2;
21744 }
21745 pushback(p, c);
21746 if (c != -1 && ISDIGIT(c)) {
21747 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
21748 parse_numeric(p, '.');
21749 if (ISDIGIT(prev)) {
21750 yyerror0("unexpected fraction part after numeric literal");
21751 }
21752 else {
21753 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
21754 }
21755 SET_LEX_STATE(EXPR_END);
21756 p->lex.ptok = p->lex.pcur;
21757 goto retry;
21758 }
21759 set_yylval_id('.');
21760 SET_LEX_STATE(EXPR_DOT);
21761 return '.';
21762 }
21763
21764 case '0': case '1': case '2': case '3': case '4':
21765 case '5': case '6': case '7': case '8': case '9':
21766 return parse_numeric(p, c);
21767
21768 case ')':
21769 COND_POP();
21770 CMDARG_POP();
21771 SET_LEX_STATE(EXPR_ENDFN);
21772 p->lex.paren_nest--;
21773 return c;
21774
21775 case ']':
21776 COND_POP();
21777 CMDARG_POP();
21778 SET_LEX_STATE(EXPR_END);
21779 p->lex.paren_nest--;
21780 return c;
21781
21782 case '}':
21783 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
21784 if (!p->lex.brace_nest--) return tSTRING_DEND;
21785 COND_POP();
21786 CMDARG_POP();
21787 SET_LEX_STATE(EXPR_END);
21788 p->lex.paren_nest--;
21789 return c;
21790
21791 case ':':
21792 c = nextc(p);
21793 if (c == ':') {
21794 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
21795 SET_LEX_STATE(EXPR_BEG);
21796 return tCOLON3;
21797 }
21798 set_yylval_id(idCOLON2);
21799 SET_LEX_STATE(EXPR_DOT);
21800 return tCOLON2;
21801 }
21802 if (IS_END() || ISSPACE(c) || c == '#') {
21803 pushback(p, c);
21804 c = warn_balanced(':', ":", "symbol literal");
21805 SET_LEX_STATE(EXPR_BEG);
21806 return c;
21807 }
21808 switch (c) {
21809 case '\'':
21810 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
21811 break;
21812 case '"':
21813 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
21814 break;
21815 default:
21816 pushback(p, c);
21817 break;
21818 }
21819 SET_LEX_STATE(EXPR_FNAME);
21820 return tSYMBEG;
21821
21822 case '/':
21823 if (IS_BEG()) {
21824 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21825 return tREGEXP_BEG;
21826 }
21827 if ((c = nextc(p)) == '=') {
21828 set_yylval_id('/');
21829 SET_LEX_STATE(EXPR_BEG);
21830 return tOP_ASGN;
21831 }
21832 pushback(p, c);
21833 if (IS_SPCARG(c)) {
21834 arg_ambiguous(p, '/');
21835 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21836 return tREGEXP_BEG;
21837 }
21838 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21839 return warn_balanced('/', "/", "regexp literal");
21840
21841 case '^':
21842 if ((c = nextc(p)) == '=') {
21843 set_yylval_id('^');
21844 SET_LEX_STATE(EXPR_BEG);
21845 return tOP_ASGN;
21846 }
21847 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21848 pushback(p, c);
21849 return '^';
21850
21851 case ';':
21852 SET_LEX_STATE(EXPR_BEG);
21853 p->command_start = TRUE;
21854 return ';';
21855
21856 case ',':
21857 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21858 return ',';
21859
21860 case '~':
21861 if (IS_AFTER_OPERATOR()) {
21862 if ((c = nextc(p)) != '@') {
21863 pushback(p, c);
21864 }
21865 SET_LEX_STATE(EXPR_ARG);
21866 }
21867 else {
21868 SET_LEX_STATE(EXPR_BEG);
21869 }
21870 return '~';
21871
21872 case '(':
21873 if (IS_BEG()) {
21874 c = tLPAREN;
21875 }
21876 else if (!space_seen) {
21877 /* foo( ... ) => method call, no ambiguity */
21878 }
21879 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
21880 c = tLPAREN_ARG;
21881 }
21882 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
21883 rb_warning0("parentheses after method name is interpreted as "
21884 "an argument list, not a decomposed argument");
21885 }
21886 p->lex.paren_nest++;
21887 COND_PUSH(0);
21888 CMDARG_PUSH(0);
21889 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21890 return c;
21891
21892 case '[':
21893 p->lex.paren_nest++;
21894 if (IS_AFTER_OPERATOR()) {
21895 if ((c = nextc(p)) == ']') {
21896 p->lex.paren_nest--;
21897 SET_LEX_STATE(EXPR_ARG);
21898 if ((c = nextc(p)) == '=') {
21899 return tASET;
21900 }
21901 pushback(p, c);
21902 return tAREF;
21903 }
21904 pushback(p, c);
21905 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
21906 return '[';
21907 }
21908 else if (IS_BEG()) {
21909 c = tLBRACK;
21910 }
21911 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
21912 c = tLBRACK;
21913 }
21914 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21915 COND_PUSH(0);
21916 CMDARG_PUSH(0);
21917 return c;
21918
21919 case '{':
21920 ++p->lex.brace_nest;
21921 if (lambda_beginning_p())
21922 c = tLAMBEG;
21923 else if (IS_lex_state(EXPR_LABELED))
21924 c = tLBRACE; /* hash */
21925 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
21926 c = '{'; /* block (primary) */
21927 else if (IS_lex_state(EXPR_ENDARG))
21928 c = tLBRACE_ARG; /* block (expr) */
21929 else
21930 c = tLBRACE; /* hash */
21931 if (c != tLBRACE) {
21932 p->command_start = TRUE;
21933 SET_LEX_STATE(EXPR_BEG);
21934 }
21935 else {
21936 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21937 }
21938 ++p->lex.paren_nest; /* after lambda_beginning_p() */
21939 COND_PUSH(0);
21940 CMDARG_PUSH(0);
21941 return c;
21942
21943 case '\\':
21944 c = nextc(p);
21945 if (c == '\n') {
21946 space_seen = 1;
21947 dispatch_scan_event(p, tSP);
21948 goto retry; /* skip \\n */
21949 }
21950 if (c == ' ') return tSP;
21951 if (ISSPACE(c)) return c;
21952 pushback(p, c);
21953 return '\\';
21954
21955 case '%':
21956 return parse_percent(p, space_seen, last_state);
21957
21958 case '$':
21959 return parse_gvar(p, last_state);
21960
21961 case '@':
21962 return parse_atmark(p, last_state);
21963
21964 case '_':
21965 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
21966 p->ruby__end__seen = 1;
21967 p->eofp = 1;
21968#ifdef RIPPER
21969 lex_goto_eol(p);
21970 dispatch_scan_event(p, k__END__);
21971#endif
21972 return END_OF_INPUT;
21973 }
21974 newtok(p);
21975 break;
21976
21977 default:
21978 if (!parser_is_identchar(p)) {
21979 compile_error(p, "Invalid char '\\x%02X' in expression", c);
21980 token_flush(p);
21981 goto retry;
21982 }
21983
21984 newtok(p);
21985 break;
21986 }
21987
21988 return parse_ident(p, c, cmd_state);
21989}
21990
21991static enum yytokentype
21992yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
21993{
21994 enum yytokentype t;
21995
21996 p->lval = lval;
21997 lval->node = 0;
21998 p->yylloc = yylloc;
21999
22000 t = parser_yylex(p);
22001
22002 if (has_delayed_token(p))
22003 dispatch_delayed_token(p, t);
22004 else if (t != END_OF_INPUT)
22005 dispatch_scan_event(p, t);
22006
22007 return t;
22008}
22009
22010#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
22011
22012static NODE*
22013node_new_internal(struct parser_params *p, enum node_type type, size_t size, size_t alignment)
22014{
22015 NODE *n = rb_ast_newnode(p->ast, type, size, alignment);
22016
22017 rb_node_init(n, type);
22018 return n;
22019}
22020
22021static NODE *
22022nd_set_loc(NODE *nd, const YYLTYPE *loc)
22023{
22024 nd->nd_loc = *loc;
22025 nd_set_line(nd, loc->beg_pos.lineno);
22026 return nd;
22027}
22028
22029static NODE*
22030node_newnode(struct parser_params *p, enum node_type type, size_t size, size_t alignment, const rb_code_location_t *loc)
22031{
22032 NODE *n = node_new_internal(p, type, size, alignment);
22033
22034 nd_set_loc(n, loc);
22035 nd_set_node_id(n, parser_get_node_id(p));
22036 return n;
22037}
22038
22039#define NODE_NEWNODE(node_type, type, loc) (type *)(node_newnode(p, node_type, sizeof(type), RUBY_ALIGNOF(type), loc))
22040
22041static rb_node_scope_t *
22042rb_node_scope_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
22043{
22044 rb_ast_id_table_t *nd_tbl;
22045 nd_tbl = local_tbl(p);
22046 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
22047 n->nd_tbl = nd_tbl;
22048 n->nd_body = nd_body;
22049 n->nd_args = nd_args;
22050
22051 return n;
22052}
22053
22054static rb_node_scope_t *
22055rb_node_scope_new2(struct parser_params *p, rb_ast_id_table_t *nd_tbl, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
22056{
22057 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
22058 n->nd_tbl = nd_tbl;
22059 n->nd_body = nd_body;
22060 n->nd_args = nd_args;
22061
22062 return n;
22063}
22064
22065static rb_node_defn_t *
22066rb_node_defn_new(struct parser_params *p, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
22067{
22068 rb_node_defn_t *n = NODE_NEWNODE(NODE_DEFN, rb_node_defn_t, loc);
22069 n->nd_mid = nd_mid;
22070 n->nd_defn = nd_defn;
22071
22072 return n;
22073}
22074
22075static rb_node_defs_t *
22076rb_node_defs_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
22077{
22078 rb_node_defs_t *n = NODE_NEWNODE(NODE_DEFS, rb_node_defs_t, loc);
22079 n->nd_recv = nd_recv;
22080 n->nd_mid = nd_mid;
22081 n->nd_defn = nd_defn;
22082
22083 return n;
22084}
22085
22086static rb_node_block_t *
22087rb_node_block_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22088{
22089 rb_node_block_t *n = NODE_NEWNODE(NODE_BLOCK, rb_node_block_t, loc);
22090 n->nd_head = nd_head;
22091 n->nd_end = (NODE *)n;
22092 n->nd_next = 0;
22093
22094 return n;
22095}
22096
22097static rb_node_for_t *
22098rb_node_for_new(struct parser_params *p, NODE *nd_iter, NODE *nd_body, const YYLTYPE *loc)
22099{
22100 rb_node_for_t *n = NODE_NEWNODE(NODE_FOR, rb_node_for_t, loc);
22101 n->nd_body = nd_body;
22102 n->nd_iter = nd_iter;
22103
22104 return n;
22105}
22106
22107static rb_node_for_masgn_t *
22108rb_node_for_masgn_new(struct parser_params *p, NODE *nd_var, const YYLTYPE *loc)
22109{
22110 rb_node_for_masgn_t *n = NODE_NEWNODE(NODE_FOR_MASGN, rb_node_for_masgn_t, loc);
22111 n->nd_var = nd_var;
22112
22113 return n;
22114}
22115
22116static rb_node_retry_t *
22117rb_node_retry_new(struct parser_params *p, const YYLTYPE *loc)
22118{
22119 rb_node_retry_t *n = NODE_NEWNODE(NODE_RETRY, rb_node_retry_t, loc);
22120
22121 return n;
22122}
22123
22124static rb_node_begin_t *
22125rb_node_begin_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22126{
22127 rb_node_begin_t *n = NODE_NEWNODE(NODE_BEGIN, rb_node_begin_t, loc);
22128 n->nd_body = nd_body;
22129
22130 return n;
22131}
22132
22133static rb_node_rescue_t *
22134rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *nd_else, const YYLTYPE *loc)
22135{
22136 rb_node_rescue_t *n = NODE_NEWNODE(NODE_RESCUE, rb_node_rescue_t, loc);
22137 n->nd_head = nd_head;
22138 n->nd_resq = nd_resq;
22139 n->nd_else = nd_else;
22140
22141 return n;
22142}
22143
22144static rb_node_resbody_t *
22145rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_exc_var, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
22146{
22147 rb_node_resbody_t *n = NODE_NEWNODE(NODE_RESBODY, rb_node_resbody_t, loc);
22148 n->nd_args = nd_args;
22149 n->nd_exc_var = nd_exc_var;
22150 n->nd_body = nd_body;
22151 n->nd_next = nd_next;
22152
22153 return n;
22154}
22155
22156static rb_node_ensure_t *
22157rb_node_ensure_new(struct parser_params *p, NODE *nd_head, NODE *nd_ensr, const YYLTYPE *loc)
22158{
22159 rb_node_ensure_t *n = NODE_NEWNODE(NODE_ENSURE, rb_node_ensure_t, loc);
22160 n->nd_head = nd_head;
22161 n->nd_ensr = nd_ensr;
22162
22163 return n;
22164}
22165
22166static rb_node_and_t *
22167rb_node_and_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22168{
22169 rb_node_and_t *n = NODE_NEWNODE(NODE_AND, rb_node_and_t, loc);
22170 n->nd_1st = nd_1st;
22171 n->nd_2nd = nd_2nd;
22172 n->operator_loc = *operator_loc;
22173
22174 return n;
22175}
22176
22177static rb_node_or_t *
22178rb_node_or_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22179{
22180 rb_node_or_t *n = NODE_NEWNODE(NODE_OR, rb_node_or_t, loc);
22181 n->nd_1st = nd_1st;
22182 n->nd_2nd = nd_2nd;
22183 n->operator_loc = *operator_loc;
22184
22185 return n;
22186}
22187
22188static rb_node_return_t *
22189rb_node_return_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
22190{
22191 rb_node_return_t *n = NODE_NEWNODE(NODE_RETURN, rb_node_return_t, loc);
22192 n->nd_stts = nd_stts;
22193 n->keyword_loc = *keyword_loc;
22194 return n;
22195}
22196
22197static rb_node_yield_t *
22198rb_node_yield_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22199{
22200 rb_node_yield_t *n = NODE_NEWNODE(NODE_YIELD, rb_node_yield_t, loc);
22201 n->nd_head = nd_head;
22202
22203 return n;
22204}
22205
22206static rb_node_if_t *
22207rb_node_if_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc)
22208{
22209 rb_node_if_t *n = NODE_NEWNODE(NODE_IF, rb_node_if_t, loc);
22210 n->nd_cond = nd_cond;
22211 n->nd_body = nd_body;
22212 n->nd_else = nd_else;
22213
22214 return n;
22215}
22216
22217static rb_node_unless_t *
22218rb_node_unless_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *then_keyword_loc, const YYLTYPE *end_keyword_loc)
22219{
22220 rb_node_unless_t *n = NODE_NEWNODE(NODE_UNLESS, rb_node_unless_t, loc);
22221 n->nd_cond = nd_cond;
22222 n->nd_body = nd_body;
22223 n->nd_else = nd_else;
22224 n->keyword_loc = *keyword_loc;
22225 n->then_keyword_loc = *then_keyword_loc;
22226 n->end_keyword_loc = *end_keyword_loc;
22227
22228 return n;
22229}
22230
22231static rb_node_class_t *
22232rb_node_class_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, NODE *nd_super, const YYLTYPE *loc)
22233{
22234 /* Keep the order of node creation */
22235 NODE *scope = NEW_SCOPE(0, nd_body, loc);
22236 rb_node_class_t *n = NODE_NEWNODE(NODE_CLASS, rb_node_class_t, loc);
22237 n->nd_cpath = nd_cpath;
22238 n->nd_body = scope;
22239 n->nd_super = nd_super;
22240
22241 return n;
22242}
22243
22244static rb_node_sclass_t *
22245rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const YYLTYPE *loc)
22246{
22247 /* Keep the order of node creation */
22248 NODE *scope = NEW_SCOPE(0, nd_body, loc);
22249 rb_node_sclass_t *n = NODE_NEWNODE(NODE_SCLASS, rb_node_sclass_t, loc);
22250 n->nd_recv = nd_recv;
22251 n->nd_body = scope;
22252
22253 return n;
22254}
22255
22256static rb_node_module_t *
22257rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc)
22258{
22259 /* Keep the order of node creation */
22260 NODE *scope = NEW_SCOPE(0, nd_body, loc);
22261 rb_node_module_t *n = NODE_NEWNODE(NODE_MODULE, rb_node_module_t, loc);
22262 n->nd_cpath = nd_cpath;
22263 n->nd_body = scope;
22264
22265 return n;
22266}
22267
22268static rb_node_iter_t *
22269rb_node_iter_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
22270{
22271 /* Keep the order of node creation */
22272 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
22273 rb_node_iter_t *n = NODE_NEWNODE(NODE_ITER, rb_node_iter_t, loc);
22274 n->nd_body = scope;
22275 n->nd_iter = 0;
22276
22277 return n;
22278}
22279
22280static rb_node_lambda_t *
22281rb_node_lambda_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
22282{
22283 /* Keep the order of node creation */
22284 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
22285 rb_node_lambda_t *n = NODE_NEWNODE(NODE_LAMBDA, rb_node_lambda_t, loc);
22286 n->nd_body = scope;
22287
22288 return n;
22289}
22290
22291static rb_node_case_t *
22292rb_node_case_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc)
22293{
22294 rb_node_case_t *n = NODE_NEWNODE(NODE_CASE, rb_node_case_t, loc);
22295 n->nd_head = nd_head;
22296 n->nd_body = nd_body;
22297 n->case_keyword_loc = *case_keyword_loc;
22298 n->end_keyword_loc = *end_keyword_loc;
22299
22300 return n;
22301}
22302
22303static rb_node_case2_t *
22304rb_node_case2_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc)
22305{
22306 rb_node_case2_t *n = NODE_NEWNODE(NODE_CASE2, rb_node_case2_t, loc);
22307 n->nd_head = 0;
22308 n->nd_body = nd_body;
22309 n->case_keyword_loc = *case_keyword_loc;
22310 n->end_keyword_loc = *end_keyword_loc;
22311
22312 return n;
22313}
22314
22315static rb_node_case3_t *
22316rb_node_case3_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc)
22317{
22318 rb_node_case3_t *n = NODE_NEWNODE(NODE_CASE3, rb_node_case3_t, loc);
22319 n->nd_head = nd_head;
22320 n->nd_body = nd_body;
22321 n->case_keyword_loc = *case_keyword_loc;
22322 n->end_keyword_loc = *end_keyword_loc;
22323
22324 return n;
22325}
22326
22327static rb_node_when_t *
22328rb_node_when_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *then_keyword_loc)
22329{
22330 rb_node_when_t *n = NODE_NEWNODE(NODE_WHEN, rb_node_when_t, loc);
22331 n->nd_head = nd_head;
22332 n->nd_body = nd_body;
22333 n->nd_next = nd_next;
22334 n->keyword_loc = *keyword_loc;
22335 n->then_keyword_loc = *then_keyword_loc;
22336
22337 return n;
22338}
22339
22340static rb_node_in_t *
22341rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
22342{
22343 rb_node_in_t *n = NODE_NEWNODE(NODE_IN, rb_node_in_t, loc);
22344 n->nd_head = nd_head;
22345 n->nd_body = nd_body;
22346 n->nd_next = nd_next;
22347
22348 return n;
22349}
22350
22351static rb_node_while_t *
22352rb_node_while_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *closing_loc)
22353{
22354 rb_node_while_t *n = NODE_NEWNODE(NODE_WHILE, rb_node_while_t, loc);
22355 n->nd_cond = nd_cond;
22356 n->nd_body = nd_body;
22357 n->nd_state = nd_state;
22358 n->keyword_loc = *keyword_loc;
22359 n->closing_loc = *closing_loc;
22360
22361 return n;
22362}
22363
22364static rb_node_until_t *
22365rb_node_until_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *closing_loc)
22366{
22367 rb_node_until_t *n = NODE_NEWNODE(NODE_UNTIL, rb_node_until_t, loc);
22368 n->nd_cond = nd_cond;
22369 n->nd_body = nd_body;
22370 n->nd_state = nd_state;
22371 n->keyword_loc = *keyword_loc;
22372 n->closing_loc = *closing_loc;
22373
22374 return n;
22375}
22376
22377static rb_node_colon2_t *
22378rb_node_colon2_new(struct parser_params *p, NODE *nd_head, ID nd_mid, const YYLTYPE *loc)
22379{
22380 rb_node_colon2_t *n = NODE_NEWNODE(NODE_COLON2, rb_node_colon2_t, loc);
22381 n->nd_head = nd_head;
22382 n->nd_mid = nd_mid;
22383
22384 return n;
22385}
22386
22387static rb_node_colon3_t *
22388rb_node_colon3_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
22389{
22390 rb_node_colon3_t *n = NODE_NEWNODE(NODE_COLON3, rb_node_colon3_t, loc);
22391 n->nd_mid = nd_mid;
22392
22393 return n;
22394}
22395
22396static rb_node_dot2_t *
22397rb_node_dot2_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
22398{
22399 rb_node_dot2_t *n = NODE_NEWNODE(NODE_DOT2, rb_node_dot2_t, loc);
22400 n->nd_beg = nd_beg;
22401 n->nd_end = nd_end;
22402
22403 return n;
22404}
22405
22406static rb_node_dot3_t *
22407rb_node_dot3_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
22408{
22409 rb_node_dot3_t *n = NODE_NEWNODE(NODE_DOT3, rb_node_dot3_t, loc);
22410 n->nd_beg = nd_beg;
22411 n->nd_end = nd_end;
22412
22413 return n;
22414}
22415
22416static rb_node_self_t *
22417rb_node_self_new(struct parser_params *p, const YYLTYPE *loc)
22418{
22419 rb_node_self_t *n = NODE_NEWNODE(NODE_SELF, rb_node_self_t, loc);
22420 n->nd_state = 1;
22421
22422 return n;
22423}
22424
22425static rb_node_nil_t *
22426rb_node_nil_new(struct parser_params *p, const YYLTYPE *loc)
22427{
22428 rb_node_nil_t *n = NODE_NEWNODE(NODE_NIL, rb_node_nil_t, loc);
22429
22430 return n;
22431}
22432
22433static rb_node_true_t *
22434rb_node_true_new(struct parser_params *p, const YYLTYPE *loc)
22435{
22436 rb_node_true_t *n = NODE_NEWNODE(NODE_TRUE, rb_node_true_t, loc);
22437
22438 return n;
22439}
22440
22441static rb_node_false_t *
22442rb_node_false_new(struct parser_params *p, const YYLTYPE *loc)
22443{
22444 rb_node_false_t *n = NODE_NEWNODE(NODE_FALSE, rb_node_false_t, loc);
22445
22446 return n;
22447}
22448
22449static rb_node_super_t *
22450rb_node_super_new(struct parser_params *p, NODE *nd_args, const YYLTYPE *loc)
22451{
22452 rb_node_super_t *n = NODE_NEWNODE(NODE_SUPER, rb_node_super_t, loc);
22453 n->nd_args = nd_args;
22454
22455 return n;
22456}
22457
22458static rb_node_zsuper_t *
22459rb_node_zsuper_new(struct parser_params *p, const YYLTYPE *loc)
22460{
22461 rb_node_zsuper_t *n = NODE_NEWNODE(NODE_ZSUPER, rb_node_zsuper_t, loc);
22462
22463 return n;
22464}
22465
22466static rb_node_match2_t *
22467rb_node_match2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
22468{
22469 rb_node_match2_t *n = NODE_NEWNODE(NODE_MATCH2, rb_node_match2_t, loc);
22470 n->nd_recv = nd_recv;
22471 n->nd_value = nd_value;
22472 n->nd_args = 0;
22473
22474 return n;
22475}
22476
22477static rb_node_match3_t *
22478rb_node_match3_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
22479{
22480 rb_node_match3_t *n = NODE_NEWNODE(NODE_MATCH3, rb_node_match3_t, loc);
22481 n->nd_recv = nd_recv;
22482 n->nd_value = nd_value;
22483
22484 return n;
22485}
22486
22487/* TODO: Use union for NODE_LIST2 */
22488static rb_node_list_t *
22489rb_node_list_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22490{
22491 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
22492 n->nd_head = nd_head;
22493 n->as.nd_alen = 1;
22494 n->nd_next = 0;
22495
22496 return n;
22497}
22498
22499static rb_node_list_t *
22500rb_node_list_new2(struct parser_params *p, NODE *nd_head, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22501{
22502 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
22503 n->nd_head = nd_head;
22504 n->as.nd_alen = nd_alen;
22505 n->nd_next = nd_next;
22506
22507 return n;
22508}
22509
22510static rb_node_zlist_t *
22511rb_node_zlist_new(struct parser_params *p, const YYLTYPE *loc)
22512{
22513 rb_node_zlist_t *n = NODE_NEWNODE(NODE_ZLIST, rb_node_zlist_t, loc);
22514
22515 return n;
22516}
22517
22518static rb_node_hash_t *
22519rb_node_hash_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22520{
22521 rb_node_hash_t *n = NODE_NEWNODE(NODE_HASH, rb_node_hash_t, loc);
22522 n->nd_head = nd_head;
22523 n->nd_brace = 0;
22524
22525 return n;
22526}
22527
22528static rb_node_masgn_t *
22529rb_node_masgn_new(struct parser_params *p, NODE *nd_head, NODE *nd_args, const YYLTYPE *loc)
22530{
22531 rb_node_masgn_t *n = NODE_NEWNODE(NODE_MASGN, rb_node_masgn_t, loc);
22532 n->nd_head = nd_head;
22533 n->nd_value = 0;
22534 n->nd_args = nd_args;
22535
22536 return n;
22537}
22538
22539static rb_node_gasgn_t *
22540rb_node_gasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22541{
22542 rb_node_gasgn_t *n = NODE_NEWNODE(NODE_GASGN, rb_node_gasgn_t, loc);
22543 n->nd_vid = nd_vid;
22544 n->nd_value = nd_value;
22545
22546 return n;
22547}
22548
22549static rb_node_lasgn_t *
22550rb_node_lasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22551{
22552 rb_node_lasgn_t *n = NODE_NEWNODE(NODE_LASGN, rb_node_lasgn_t, loc);
22553 n->nd_vid = nd_vid;
22554 n->nd_value = nd_value;
22555
22556 return n;
22557}
22558
22559static rb_node_dasgn_t *
22560rb_node_dasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22561{
22562 rb_node_dasgn_t *n = NODE_NEWNODE(NODE_DASGN, rb_node_dasgn_t, loc);
22563 n->nd_vid = nd_vid;
22564 n->nd_value = nd_value;
22565
22566 return n;
22567}
22568
22569static rb_node_iasgn_t *
22570rb_node_iasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22571{
22572 rb_node_iasgn_t *n = NODE_NEWNODE(NODE_IASGN, rb_node_iasgn_t, loc);
22573 n->nd_vid = nd_vid;
22574 n->nd_value = nd_value;
22575
22576 return n;
22577}
22578
22579static rb_node_cvasgn_t *
22580rb_node_cvasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22581{
22582 rb_node_cvasgn_t *n = NODE_NEWNODE(NODE_CVASGN, rb_node_cvasgn_t, loc);
22583 n->nd_vid = nd_vid;
22584 n->nd_value = nd_value;
22585
22586 return n;
22587}
22588
22589static rb_node_op_asgn1_t *
22590rb_node_op_asgn1_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *index, NODE *rvalue, const YYLTYPE *loc, const YYLTYPE *call_operator_loc, const YYLTYPE *opening_loc, const YYLTYPE *closing_loc, const YYLTYPE *binary_operator_loc)
22591{
22592 rb_node_op_asgn1_t *n = NODE_NEWNODE(NODE_OP_ASGN1, rb_node_op_asgn1_t, loc);
22593 n->nd_recv = nd_recv;
22594 n->nd_mid = nd_mid;
22595 n->nd_index = index;
22596 n->nd_rvalue = rvalue;
22597 n->call_operator_loc = *call_operator_loc;
22598 n->opening_loc = *opening_loc;
22599 n->closing_loc = *closing_loc;
22600 n->binary_operator_loc = *binary_operator_loc;
22601
22602 return n;
22603}
22604
22605static rb_node_op_asgn2_t *
22606rb_node_op_asgn2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, ID nd_vid, ID nd_mid, bool nd_aid, const YYLTYPE *loc, const YYLTYPE *call_operator_loc, const YYLTYPE *message_loc, const YYLTYPE *binary_operator_loc)
22607{
22608 rb_node_op_asgn2_t *n = NODE_NEWNODE(NODE_OP_ASGN2, rb_node_op_asgn2_t, loc);
22609 n->nd_recv = nd_recv;
22610 n->nd_value = nd_value;
22611 n->nd_vid = nd_vid;
22612 n->nd_mid = nd_mid;
22613 n->nd_aid = nd_aid;
22614 n->call_operator_loc = *call_operator_loc;
22615 n->message_loc = *message_loc;
22616 n->binary_operator_loc = *binary_operator_loc;
22617
22618 return n;
22619}
22620
22621static rb_node_op_asgn_or_t *
22622rb_node_op_asgn_or_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
22623{
22624 rb_node_op_asgn_or_t *n = NODE_NEWNODE(NODE_OP_ASGN_OR, rb_node_op_asgn_or_t, loc);
22625 n->nd_head = nd_head;
22626 n->nd_value = nd_value;
22627
22628 return n;
22629}
22630
22631static rb_node_op_asgn_and_t *
22632rb_node_op_asgn_and_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
22633{
22634 rb_node_op_asgn_and_t *n = NODE_NEWNODE(NODE_OP_ASGN_AND, rb_node_op_asgn_and_t, loc);
22635 n->nd_head = nd_head;
22636 n->nd_value = nd_value;
22637
22638 return n;
22639}
22640
22641static rb_node_gvar_t *
22642rb_node_gvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22643{
22644 rb_node_gvar_t *n = NODE_NEWNODE(NODE_GVAR, rb_node_gvar_t, loc);
22645 n->nd_vid = nd_vid;
22646
22647 return n;
22648}
22649
22650static rb_node_lvar_t *
22651rb_node_lvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22652{
22653 rb_node_lvar_t *n = NODE_NEWNODE(NODE_LVAR, rb_node_lvar_t, loc);
22654 n->nd_vid = nd_vid;
22655
22656 return n;
22657}
22658
22659static rb_node_dvar_t *
22660rb_node_dvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22661{
22662 rb_node_dvar_t *n = NODE_NEWNODE(NODE_DVAR, rb_node_dvar_t, loc);
22663 n->nd_vid = nd_vid;
22664
22665 return n;
22666}
22667
22668static rb_node_ivar_t *
22669rb_node_ivar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22670{
22671 rb_node_ivar_t *n = NODE_NEWNODE(NODE_IVAR, rb_node_ivar_t, loc);
22672 n->nd_vid = nd_vid;
22673
22674 return n;
22675}
22676
22677static rb_node_const_t *
22678rb_node_const_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22679{
22680 rb_node_const_t *n = NODE_NEWNODE(NODE_CONST, rb_node_const_t, loc);
22681 n->nd_vid = nd_vid;
22682
22683 return n;
22684}
22685
22686static rb_node_cvar_t *
22687rb_node_cvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22688{
22689 rb_node_cvar_t *n = NODE_NEWNODE(NODE_CVAR, rb_node_cvar_t, loc);
22690 n->nd_vid = nd_vid;
22691
22692 return n;
22693}
22694
22695static rb_node_nth_ref_t *
22696rb_node_nth_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
22697{
22698 rb_node_nth_ref_t *n = NODE_NEWNODE(NODE_NTH_REF, rb_node_nth_ref_t, loc);
22699 n->nd_nth = nd_nth;
22700
22701 return n;
22702}
22703
22704static rb_node_back_ref_t *
22705rb_node_back_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
22706{
22707 rb_node_back_ref_t *n = NODE_NEWNODE(NODE_BACK_REF, rb_node_back_ref_t, loc);
22708 n->nd_nth = nd_nth;
22709
22710 return n;
22711}
22712
22713static rb_node_integer_t *
22714rb_node_integer_new(struct parser_params *p, char* val, int base, const YYLTYPE *loc)
22715{
22716 rb_node_integer_t *n = NODE_NEWNODE(NODE_INTEGER, rb_node_integer_t, loc);
22717 n->val = val;
22718 n->minus = FALSE;
22719 n->base = base;
22720
22721 return n;
22722}
22723
22724static rb_node_float_t *
22725rb_node_float_new(struct parser_params *p, char* val, const YYLTYPE *loc)
22726{
22727 rb_node_float_t *n = NODE_NEWNODE(NODE_FLOAT, rb_node_float_t, loc);
22728 n->val = val;
22729 n->minus = FALSE;
22730
22731 return n;
22732}
22733
22734static rb_node_rational_t *
22735rb_node_rational_new(struct parser_params *p, char* val, int base, int seen_point, const YYLTYPE *loc)
22736{
22737 rb_node_rational_t *n = NODE_NEWNODE(NODE_RATIONAL, rb_node_rational_t, loc);
22738 n->val = val;
22739 n->minus = FALSE;
22740 n->base = base;
22741 n->seen_point = seen_point;
22742
22743 return n;
22744}
22745
22746static rb_node_imaginary_t *
22747rb_node_imaginary_new(struct parser_params *p, char* val, int base, int seen_point, enum rb_numeric_type numeric_type, const YYLTYPE *loc)
22748{
22749 rb_node_imaginary_t *n = NODE_NEWNODE(NODE_IMAGINARY, rb_node_imaginary_t, loc);
22750 n->val = val;
22751 n->minus = FALSE;
22752 n->base = base;
22753 n->seen_point = seen_point;
22754 n->type = numeric_type;
22755
22756 return n;
22757}
22758
22759static rb_node_str_t *
22760rb_node_str_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc)
22761{
22762 rb_node_str_t *n = NODE_NEWNODE(NODE_STR, rb_node_str_t, loc);
22763 n->string = string;
22764
22765 return n;
22766}
22767
22768/* TODO; Use union for NODE_DSTR2 */
22769static rb_node_dstr_t *
22770rb_node_dstr_new0(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22771{
22772 rb_node_dstr_t *n = NODE_NEWNODE(NODE_DSTR, rb_node_dstr_t, loc);
22773 n->string = string;
22774 n->as.nd_alen = nd_alen;
22775 n->nd_next = (rb_node_list_t *)nd_next;
22776
22777 return n;
22778}
22779
22780static rb_node_dstr_t *
22781rb_node_dstr_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc)
22782{
22783 return rb_node_dstr_new0(p, string, 1, 0, loc);
22784}
22785
22786static rb_node_xstr_t *
22787rb_node_xstr_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc)
22788{
22789 rb_node_xstr_t *n = NODE_NEWNODE(NODE_XSTR, rb_node_xstr_t, loc);
22790 n->string = string;
22791
22792 return n;
22793}
22794
22795static rb_node_dxstr_t *
22796rb_node_dxstr_new(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22797{
22798 rb_node_dxstr_t *n = NODE_NEWNODE(NODE_DXSTR, rb_node_dxstr_t, loc);
22799 n->string = string;
22800 n->as.nd_alen = nd_alen;
22801 n->nd_next = (rb_node_list_t *)nd_next;
22802
22803 return n;
22804}
22805
22806static rb_node_sym_t *
22807rb_node_sym_new(struct parser_params *p, VALUE str, const YYLTYPE *loc)
22808{
22809 rb_node_sym_t *n = NODE_NEWNODE(NODE_SYM, rb_node_sym_t, loc);
22810 n->string = rb_str_to_parser_string(p, str);
22811
22812 return n;
22813}
22814
22815static rb_node_dsym_t *
22816rb_node_dsym_new(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22817{
22818 rb_node_dsym_t *n = NODE_NEWNODE(NODE_DSYM, rb_node_dsym_t, loc);
22819 n->string = string;
22820 n->as.nd_alen = nd_alen;
22821 n->nd_next = (rb_node_list_t *)nd_next;
22822
22823 return n;
22824}
22825
22826static rb_node_evstr_t *
22827rb_node_evstr_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22828{
22829 rb_node_evstr_t *n = NODE_NEWNODE(NODE_EVSTR, rb_node_evstr_t, loc);
22830 n->nd_body = nd_body;
22831
22832 return n;
22833}
22834
22835static rb_node_regx_t *
22836rb_node_regx_new(struct parser_params *p, rb_parser_string_t *string, int options, const YYLTYPE *loc)
22837{
22838 rb_node_regx_t *n = NODE_NEWNODE(NODE_REGX, rb_node_regx_t, loc);
22839 n->string = string;
22840 n->options = options & RE_OPTION_MASK;
22841
22842 return n;
22843}
22844
22845static rb_node_call_t *
22846rb_node_call_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22847{
22848 rb_node_call_t *n = NODE_NEWNODE(NODE_CALL, rb_node_call_t, loc);
22849 n->nd_recv = nd_recv;
22850 n->nd_mid = nd_mid;
22851 n->nd_args = nd_args;
22852
22853 return n;
22854}
22855
22856static rb_node_opcall_t *
22857rb_node_opcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22858{
22859 rb_node_opcall_t *n = NODE_NEWNODE(NODE_OPCALL, rb_node_opcall_t, loc);
22860 n->nd_recv = nd_recv;
22861 n->nd_mid = nd_mid;
22862 n->nd_args = nd_args;
22863
22864 return n;
22865}
22866
22867static rb_node_fcall_t *
22868rb_node_fcall_new(struct parser_params *p, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22869{
22870 rb_node_fcall_t *n = NODE_NEWNODE(NODE_FCALL, rb_node_fcall_t, loc);
22871 n->nd_mid = nd_mid;
22872 n->nd_args = nd_args;
22873
22874 return n;
22875}
22876
22877static rb_node_qcall_t *
22878rb_node_qcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22879{
22880 rb_node_qcall_t *n = NODE_NEWNODE(NODE_QCALL, rb_node_qcall_t, loc);
22881 n->nd_recv = nd_recv;
22882 n->nd_mid = nd_mid;
22883 n->nd_args = nd_args;
22884
22885 return n;
22886}
22887
22888static rb_node_vcall_t *
22889rb_node_vcall_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
22890{
22891 rb_node_vcall_t *n = NODE_NEWNODE(NODE_VCALL, rb_node_vcall_t, loc);
22892 n->nd_mid = nd_mid;
22893
22894 return n;
22895}
22896
22897static rb_node_once_t *
22898rb_node_once_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22899{
22900 rb_node_once_t *n = NODE_NEWNODE(NODE_ONCE, rb_node_once_t, loc);
22901 n->nd_body = nd_body;
22902
22903 return n;
22904}
22905
22906static rb_node_args_t *
22907rb_node_args_new(struct parser_params *p, const YYLTYPE *loc)
22908{
22909 rb_node_args_t *n = NODE_NEWNODE(NODE_ARGS, rb_node_args_t, loc);
22910 MEMZERO(&n->nd_ainfo, struct rb_args_info, 1);
22911
22912 return n;
22913}
22914
22915static rb_node_args_aux_t *
22916rb_node_args_aux_new(struct parser_params *p, ID nd_pid, int nd_plen, const YYLTYPE *loc)
22917{
22918 rb_node_args_aux_t *n = NODE_NEWNODE(NODE_ARGS_AUX, rb_node_args_aux_t, loc);
22919 n->nd_pid = nd_pid;
22920 n->nd_plen = nd_plen;
22921 n->nd_next = 0;
22922
22923 return n;
22924}
22925
22926static rb_node_opt_arg_t *
22927rb_node_opt_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22928{
22929 rb_node_opt_arg_t *n = NODE_NEWNODE(NODE_OPT_ARG, rb_node_opt_arg_t, loc);
22930 n->nd_body = nd_body;
22931 n->nd_next = 0;
22932
22933 return n;
22934}
22935
22936static rb_node_kw_arg_t *
22937rb_node_kw_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22938{
22939 rb_node_kw_arg_t *n = NODE_NEWNODE(NODE_KW_ARG, rb_node_kw_arg_t, loc);
22940 n->nd_body = nd_body;
22941 n->nd_next = 0;
22942
22943 return n;
22944}
22945
22946static rb_node_postarg_t *
22947rb_node_postarg_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
22948{
22949 rb_node_postarg_t *n = NODE_NEWNODE(NODE_POSTARG, rb_node_postarg_t, loc);
22950 n->nd_1st = nd_1st;
22951 n->nd_2nd = nd_2nd;
22952
22953 return n;
22954}
22955
22956static rb_node_argscat_t *
22957rb_node_argscat_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22958{
22959 rb_node_argscat_t *n = NODE_NEWNODE(NODE_ARGSCAT, rb_node_argscat_t, loc);
22960 n->nd_head = nd_head;
22961 n->nd_body = nd_body;
22962
22963 return n;
22964}
22965
22966static rb_node_argspush_t *
22967rb_node_argspush_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22968{
22969 rb_node_argspush_t *n = NODE_NEWNODE(NODE_ARGSPUSH, rb_node_argspush_t, loc);
22970 n->nd_head = nd_head;
22971 n->nd_body = nd_body;
22972
22973 return n;
22974}
22975
22976static rb_node_splat_t *
22977rb_node_splat_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22978{
22979 rb_node_splat_t *n = NODE_NEWNODE(NODE_SPLAT, rb_node_splat_t, loc);
22980 n->nd_head = nd_head;
22981 n->operator_loc = *operator_loc;
22982
22983 return n;
22984}
22985
22986static rb_node_block_pass_t *
22987rb_node_block_pass_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22988{
22989 rb_node_block_pass_t *n = NODE_NEWNODE(NODE_BLOCK_PASS, rb_node_block_pass_t, loc);
22990 n->forwarding = 0;
22991 n->nd_head = 0;
22992 n->nd_body = nd_body;
22993 n->operator_loc = *operator_loc;
22994
22995 return n;
22996}
22997
22998static rb_node_alias_t *
22999rb_node_alias_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23000{
23001 rb_node_alias_t *n = NODE_NEWNODE(NODE_ALIAS, rb_node_alias_t, loc);
23002 n->nd_1st = nd_1st;
23003 n->nd_2nd = nd_2nd;
23004 n->keyword_loc = *keyword_loc;
23005
23006 return n;
23007}
23008
23009static rb_node_valias_t *
23010rb_node_valias_new(struct parser_params *p, ID nd_alias, ID nd_orig, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23011{
23012 rb_node_valias_t *n = NODE_NEWNODE(NODE_VALIAS, rb_node_valias_t, loc);
23013 n->nd_alias = nd_alias;
23014 n->nd_orig = nd_orig;
23015 n->keyword_loc = *keyword_loc;
23016
23017 return n;
23018}
23019
23020static rb_node_undef_t *
23021rb_node_undef_new(struct parser_params *p, NODE *nd_undef, const YYLTYPE *loc)
23022{
23023 rb_node_undef_t *n = NODE_NEWNODE(NODE_UNDEF, rb_node_undef_t, loc);
23024 n->nd_undefs = rb_parser_ary_new_capa_for_node(p, 1);
23025 n->keyword_loc = NULL_LOC;
23026 rb_parser_ary_push_node(p, n->nd_undefs, nd_undef);
23027
23028 return n;
23029}
23030
23031static rb_node_errinfo_t *
23032rb_node_errinfo_new(struct parser_params *p, const YYLTYPE *loc)
23033{
23034 rb_node_errinfo_t *n = NODE_NEWNODE(NODE_ERRINFO, rb_node_errinfo_t, loc);
23035
23036 return n;
23037}
23038
23039static rb_node_defined_t *
23040rb_node_defined_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
23041{
23042 rb_node_defined_t *n = NODE_NEWNODE(NODE_DEFINED, rb_node_defined_t, loc);
23043 n->nd_head = nd_head;
23044
23045 return n;
23046}
23047
23048static rb_node_postexe_t *
23049rb_node_postexe_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
23050{
23051 rb_node_postexe_t *n = NODE_NEWNODE(NODE_POSTEXE, rb_node_postexe_t, loc);
23052 n->nd_body = nd_body;
23053
23054 return n;
23055}
23056
23057static rb_node_attrasgn_t *
23058rb_node_attrasgn_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
23059{
23060 rb_node_attrasgn_t *n = NODE_NEWNODE(NODE_ATTRASGN, rb_node_attrasgn_t, loc);
23061 n->nd_recv = nd_recv;
23062 n->nd_mid = nd_mid;
23063 n->nd_args = nd_args;
23064
23065 return n;
23066}
23067
23068static rb_node_aryptn_t *
23069rb_node_aryptn_new(struct parser_params *p, NODE *pre_args, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
23070{
23071 rb_node_aryptn_t *n = NODE_NEWNODE(NODE_ARYPTN, rb_node_aryptn_t, loc);
23072 n->nd_pconst = 0;
23073 n->pre_args = pre_args;
23074 n->rest_arg = rest_arg;
23075 n->post_args = post_args;
23076
23077 return n;
23078}
23079
23080static rb_node_hshptn_t *
23081rb_node_hshptn_new(struct parser_params *p, NODE *nd_pconst, NODE *nd_pkwargs, NODE *nd_pkwrestarg, const YYLTYPE *loc)
23082{
23083 rb_node_hshptn_t *n = NODE_NEWNODE(NODE_HSHPTN, rb_node_hshptn_t, loc);
23084 n->nd_pconst = nd_pconst;
23085 n->nd_pkwargs = nd_pkwargs;
23086 n->nd_pkwrestarg = nd_pkwrestarg;
23087
23088 return n;
23089}
23090
23091static rb_node_fndptn_t *
23092rb_node_fndptn_new(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
23093{
23094 rb_node_fndptn_t *n = NODE_NEWNODE(NODE_FNDPTN, rb_node_fndptn_t, loc);
23095 n->nd_pconst = 0;
23096 n->pre_rest_arg = pre_rest_arg;
23097 n->args = args;
23098 n->post_rest_arg = post_rest_arg;
23099
23100 return n;
23101}
23102
23103static rb_node_line_t *
23104rb_node_line_new(struct parser_params *p, const YYLTYPE *loc)
23105{
23106 rb_node_line_t *n = NODE_NEWNODE(NODE_LINE, rb_node_line_t, loc);
23107
23108 return n;
23109}
23110
23111static rb_node_file_t *
23112rb_node_file_new(struct parser_params *p, VALUE str, const YYLTYPE *loc)
23113{
23114 rb_node_file_t *n = NODE_NEWNODE(NODE_FILE, rb_node_file_t, loc);
23115 n->path = rb_str_to_parser_string(p, str);
23116
23117 return n;
23118}
23119
23120static rb_node_encoding_t *
23121rb_node_encoding_new(struct parser_params *p, const YYLTYPE *loc)
23122{
23123 rb_node_encoding_t *n = NODE_NEWNODE(NODE_ENCODING, rb_node_encoding_t, loc);
23124 n->enc = p->enc;
23125
23126 return n;
23127}
23128
23129static rb_node_cdecl_t *
23130rb_node_cdecl_new(struct parser_params *p, ID nd_vid, NODE *nd_value, NODE *nd_else, enum rb_parser_shareability shareability, const YYLTYPE *loc)
23131{
23132 rb_node_cdecl_t *n = NODE_NEWNODE(NODE_CDECL, rb_node_cdecl_t, loc);
23133 n->nd_vid = nd_vid;
23134 n->nd_value = nd_value;
23135 n->nd_else = nd_else;
23136 n->shareability = shareability;
23137
23138 return n;
23139}
23140
23141static rb_node_op_cdecl_t *
23142rb_node_op_cdecl_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, ID nd_aid, enum rb_parser_shareability shareability, const YYLTYPE *loc)
23143{
23144 rb_node_op_cdecl_t *n = NODE_NEWNODE(NODE_OP_CDECL, rb_node_op_cdecl_t, loc);
23145 n->nd_head = nd_head;
23146 n->nd_value = nd_value;
23147 n->nd_aid = nd_aid;
23148 n->shareability = shareability;
23149
23150 return n;
23151}
23152
23153static rb_node_error_t *
23154rb_node_error_new(struct parser_params *p, const YYLTYPE *loc)
23155{
23156 rb_node_error_t *n = NODE_NEWNODE(NODE_ERROR, rb_node_error_t, loc);
23157
23158 return n;
23159}
23160
23161static rb_node_break_t *
23162rb_node_break_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23163{
23164 rb_node_break_t *n = NODE_NEWNODE(NODE_BREAK, rb_node_break_t, loc);
23165 n->nd_stts = nd_stts;
23166 n->nd_chain = 0;
23167 n->keyword_loc = *keyword_loc;
23168
23169 return n;
23170}
23171
23172static rb_node_next_t *
23173rb_node_next_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23174{
23175 rb_node_next_t *n = NODE_NEWNODE(NODE_NEXT, rb_node_next_t, loc);
23176 n->nd_stts = nd_stts;
23177 n->nd_chain = 0;
23178 n->keyword_loc = *keyword_loc;
23179
23180 return n;
23181}
23182
23183static rb_node_redo_t *
23184rb_node_redo_new(struct parser_params *p, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23185{
23186 rb_node_redo_t *n = NODE_NEWNODE(NODE_REDO, rb_node_redo_t, loc);
23187 n->nd_chain = 0;
23188 n->keyword_loc = *keyword_loc;
23189
23190 return n;
23191}
23192
23193static rb_node_def_temp_t *
23194rb_node_def_temp_new(struct parser_params *p, const YYLTYPE *loc)
23195{
23196 rb_node_def_temp_t *n = NODE_NEWNODE((enum node_type)NODE_DEF_TEMP, rb_node_def_temp_t, loc);
23197 n->save.numparam_save = 0;
23198 n->save.max_numparam = 0;
23199 n->save.ctxt = p->ctxt;
23200 n->nd_def = 0;
23201 n->nd_mid = 0;
23202
23203 return n;
23204}
23205
23206static rb_node_def_temp_t *
23207def_head_save(struct parser_params *p, rb_node_def_temp_t *n)
23208{
23209 n->save.numparam_save = numparam_push(p);
23210 n->save.max_numparam = p->max_numparam;
23211 return n;
23212}
23213
23214#ifndef RIPPER
23215static enum node_type
23216nodetype(NODE *node) /* for debug */
23217{
23218 return (enum node_type)nd_type(node);
23219}
23220
23221static int
23222nodeline(NODE *node)
23223{
23224 return nd_line(node);
23225}
23226#endif
23227
23228static NODE*
23229newline_node(NODE *node)
23230{
23231 if (node) {
23232 node = remove_begin(node);
23233 nd_set_fl_newline(node);
23234 }
23235 return node;
23236}
23237
23238static void
23239fixpos(NODE *node, NODE *orig)
23240{
23241 if (!node) return;
23242 if (!orig) return;
23243 nd_set_line(node, nd_line(orig));
23244}
23245
23246static NODE*
23247block_append(struct parser_params *p, NODE *head, NODE *tail)
23248{
23249 NODE *end, *h = head, *nd;
23250
23251 if (tail == 0) return head;
23252
23253 if (h == 0) return tail;
23254 switch (nd_type(h)) {
23255 default:
23256 h = end = NEW_BLOCK(head, &head->nd_loc);
23257 head = end;
23258 break;
23259 case NODE_BLOCK:
23260 end = RNODE_BLOCK(h)->nd_end;
23261 break;
23262 }
23263
23264 nd = RNODE_BLOCK(end)->nd_head;
23265 switch (nd_type(nd)) {
23266 case NODE_RETURN:
23267 case NODE_BREAK:
23268 case NODE_NEXT:
23269 case NODE_REDO:
23270 case NODE_RETRY:
23271 rb_warning0L(nd_line(tail), "statement not reached");
23272 break;
23273
23274 default:
23275 break;
23276 }
23277
23278 if (!nd_type_p(tail, NODE_BLOCK)) {
23279 tail = NEW_BLOCK(tail, &tail->nd_loc);
23280 }
23281 RNODE_BLOCK(end)->nd_next = tail;
23282 RNODE_BLOCK(h)->nd_end = RNODE_BLOCK(tail)->nd_end;
23283 nd_set_last_loc(head, nd_last_loc(tail));
23284 return head;
23285}
23286
23287/* append item to the list */
23288static NODE*
23289list_append(struct parser_params *p, NODE *list, NODE *item)
23290{
23291 NODE *last;
23292
23293 if (list == 0) return NEW_LIST(item, &item->nd_loc);
23294 if (RNODE_LIST(list)->nd_next) {
23295 last = RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end;
23296 }
23297 else {
23298 last = list;
23299 }
23300
23301 RNODE_LIST(list)->as.nd_alen += 1;
23302 RNODE_LIST(last)->nd_next = NEW_LIST(item, &item->nd_loc);
23303 RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end = RNODE_LIST(last)->nd_next;
23304
23305 nd_set_last_loc(list, nd_last_loc(item));
23306
23307 return list;
23308}
23309
23310/* concat two lists */
23311static NODE*
23312list_concat(NODE *head, NODE *tail)
23313{
23314 NODE *last;
23315
23316 if (RNODE_LIST(head)->nd_next) {
23317 last = RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end;
23318 }
23319 else {
23320 last = head;
23321 }
23322
23323 RNODE_LIST(head)->as.nd_alen += RNODE_LIST(tail)->as.nd_alen;
23324 RNODE_LIST(last)->nd_next = tail;
23325 if (RNODE_LIST(tail)->nd_next) {
23326 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = RNODE_LIST(RNODE_LIST(tail)->nd_next)->as.nd_end;
23327 }
23328 else {
23329 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = tail;
23330 }
23331
23332 nd_set_last_loc(head, nd_last_loc(tail));
23333
23334 return head;
23335}
23336
23337static int
23338literal_concat0(struct parser_params *p, rb_parser_string_t *head, rb_parser_string_t *tail)
23339{
23340 if (!tail) return 1;
23341 if (!rb_parser_enc_compatible(p, head, tail)) {
23342 compile_error(p, "string literal encodings differ (%s / %s)",
23343 rb_enc_name(rb_parser_str_get_encoding(head)),
23344 rb_enc_name(rb_parser_str_get_encoding(tail)));
23345 rb_parser_str_resize(p, head, 0);
23346 rb_parser_str_resize(p, tail, 0);
23347 return 0;
23348 }
23349 rb_parser_str_buf_append(p, head, tail);
23350 return 1;
23351}
23352
23353static rb_parser_string_t *
23354string_literal_head(struct parser_params *p, enum node_type htype, NODE *head)
23355{
23356 if (htype != NODE_DSTR) return NULL;
23357 if (RNODE_DSTR(head)->nd_next) {
23358 head = RNODE_LIST(RNODE_LIST(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_head;
23359 if (!head || !nd_type_p(head, NODE_STR)) return NULL;
23360 }
23361 rb_parser_string_t *lit = RNODE_DSTR(head)->string;
23362 ASSUME(lit);
23363 return lit;
23364}
23365
23366#ifndef RIPPER
23367static rb_parser_string_t *
23368rb_parser_string_deep_copy(struct parser_params *p, const rb_parser_string_t *orig)
23369{
23370 rb_parser_string_t *copy;
23371 if (!orig) return NULL;
23372 copy = rb_parser_string_new(p, PARSER_STRING_PTR(orig), PARSER_STRING_LEN(orig));
23373 copy->coderange = orig->coderange;
23374 copy->enc = orig->enc;
23375 return copy;
23376}
23377#endif
23378
23379/* concat two string literals */
23380static NODE *
23381literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
23382{
23383 enum node_type htype;
23384 rb_parser_string_t *lit;
23385
23386 if (!head) return tail;
23387 if (!tail) return head;
23388
23389 htype = nd_type(head);
23390 if (htype == NODE_EVSTR) {
23391 head = new_dstr(p, head, loc);
23392 htype = NODE_DSTR;
23393 }
23394 if (p->heredoc_indent > 0) {
23395 switch (htype) {
23396 case NODE_STR:
23397 head = str2dstr(p, head);
23398 case NODE_DSTR:
23399 return list_append(p, head, tail);
23400 default:
23401 break;
23402 }
23403 }
23404 switch (nd_type(tail)) {
23405 case NODE_STR:
23406 if ((lit = string_literal_head(p, htype, head)) != false) {
23407 htype = NODE_STR;
23408 }
23409 else {
23410 lit = RNODE_DSTR(head)->string;
23411 }
23412 if (htype == NODE_STR) {
23413 if (!literal_concat0(p, lit, RNODE_STR(tail)->string)) {
23414 error:
23415 rb_discard_node(p, head);
23416 rb_discard_node(p, tail);
23417 return 0;
23418 }
23419 rb_discard_node(p, tail);
23420 }
23421 else {
23422 list_append(p, head, tail);
23423 }
23424 break;
23425
23426 case NODE_DSTR:
23427 if (htype == NODE_STR) {
23428 if (!literal_concat0(p, RNODE_STR(head)->string, RNODE_DSTR(tail)->string))
23429 goto error;
23430 rb_parser_string_free(p, RNODE_DSTR(tail)->string);
23431 RNODE_DSTR(tail)->string = RNODE_STR(head)->string;
23432 RNODE_STR(head)->string = NULL;
23433 rb_discard_node(p, head);
23434 head = tail;
23435 }
23436 else if (!RNODE_DSTR(tail)->string) {
23437 append:
23438 RNODE_DSTR(head)->as.nd_alen += RNODE_DSTR(tail)->as.nd_alen - 1;
23439 if (!RNODE_DSTR(head)->nd_next) {
23440 RNODE_DSTR(head)->nd_next = RNODE_DSTR(tail)->nd_next;
23441 }
23442 else if (RNODE_DSTR(tail)->nd_next) {
23443 RNODE_DSTR(RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_next = RNODE_DSTR(tail)->nd_next;
23444 RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end = RNODE_DSTR(RNODE_DSTR(tail)->nd_next)->as.nd_end;
23445 }
23446 rb_discard_node(p, tail);
23447 }
23448 else if ((lit = string_literal_head(p, htype, head)) != false) {
23449 if (!literal_concat0(p, lit, RNODE_DSTR(tail)->string))
23450 goto error;
23451 rb_parser_string_free(p, RNODE_DSTR(tail)->string);
23452 RNODE_DSTR(tail)->string = 0;
23453 goto append;
23454 }
23455 else {
23456 list_concat(head, NEW_LIST2(NEW_STR(RNODE_DSTR(tail)->string, loc), RNODE_DSTR(tail)->as.nd_alen, (NODE *)RNODE_DSTR(tail)->nd_next, loc));
23457 RNODE_DSTR(tail)->string = 0;
23458 }
23459 break;
23460
23461 case NODE_EVSTR:
23462 if (htype == NODE_STR) {
23463 head = str2dstr(p, head);
23464 RNODE_DSTR(head)->as.nd_alen = 1;
23465 }
23466 list_append(p, head, tail);
23467 break;
23468 }
23469 return head;
23470}
23471
23472static void
23473nd_copy_flag(NODE *new_node, NODE *old_node)
23474{
23475 if (nd_fl_newline(old_node)) nd_set_fl_newline(new_node);
23476 nd_set_line(new_node, nd_line(old_node));
23477 new_node->nd_loc = old_node->nd_loc;
23478 new_node->node_id = old_node->node_id;
23479}
23480
23481static NODE *
23482str2dstr(struct parser_params *p, NODE *node)
23483{
23484 NODE *new_node = (NODE *)NODE_NEW_INTERNAL(NODE_DSTR, rb_node_dstr_t);
23485 nd_copy_flag(new_node, node);
23486 RNODE_DSTR(new_node)->string = RNODE_STR(node)->string;
23487 RNODE_DSTR(new_node)->as.nd_alen = 0;
23488 RNODE_DSTR(new_node)->nd_next = 0;
23489 RNODE_STR(node)->string = 0;
23490
23491 return new_node;
23492}
23493
23494static NODE *
23495str2regx(struct parser_params *p, NODE *node, int options)
23496{
23497 NODE *new_node = (NODE *)NODE_NEW_INTERNAL(NODE_REGX, rb_node_regx_t);
23498 nd_copy_flag(new_node, node);
23499 RNODE_REGX(new_node)->string = RNODE_STR(node)->string;
23500 RNODE_REGX(new_node)->options = options;
23501 RNODE_STR(node)->string = 0;
23502
23503 return new_node;
23504}
23505
23506static NODE *
23507evstr2dstr(struct parser_params *p, NODE *node)
23508{
23509 if (nd_type_p(node, NODE_EVSTR)) {
23510 node = new_dstr(p, node, &node->nd_loc);
23511 }
23512 return node;
23513}
23514
23515static NODE *
23516new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23517{
23518 NODE *head = node;
23519
23520 if (node) {
23521 switch (nd_type(node)) {
23522 case NODE_STR:
23523 return str2dstr(p, node);
23524 case NODE_DSTR:
23525 break;
23526 case NODE_EVSTR:
23527 return node;
23528 }
23529 }
23530 return NEW_EVSTR(head, loc);
23531}
23532
23533static NODE *
23534new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23535{
23536 NODE *dstr = NEW_DSTR(STRING_NEW0(), loc);
23537 return list_append(p, dstr, node);
23538}
23539
23540static NODE *
23541call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
23542 const YYLTYPE *op_loc, const YYLTYPE *loc)
23543{
23544 NODE *expr;
23545 value_expr(recv);
23546 value_expr(arg1);
23547 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
23548 nd_set_line(expr, op_loc->beg_pos.lineno);
23549 return expr;
23550}
23551
23552static NODE *
23553call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
23554{
23555 NODE *opcall;
23556 value_expr(recv);
23557 opcall = NEW_OPCALL(recv, id, 0, loc);
23558 nd_set_line(opcall, op_loc->beg_pos.lineno);
23559 return opcall;
23560}
23561
23562static NODE *
23563new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
23564{
23565 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
23566 nd_set_line(qcall, op_loc->beg_pos.lineno);
23567 return qcall;
23568}
23569
23570static NODE*
23571new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
23572{
23573 NODE *ret;
23574 if (block) block_dup_check(p, args, block);
23575 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
23576 if (block) ret = method_add_block(p, ret, block, loc);
23577 fixpos(ret, recv);
23578 return ret;
23579}
23580
23581#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? RNODE_ONCE(node)->nd_body : node)
23582
23583static NODE*
23584last_expr_once_body(NODE *node)
23585{
23586 if (!node) return 0;
23587 return nd_once_body(node);
23588}
23589
23590static NODE*
23591match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
23592{
23593 NODE *n;
23594 int line = op_loc->beg_pos.lineno;
23595
23596 value_expr(node1);
23597 value_expr(node2);
23598
23599 if ((n = last_expr_once_body(node1)) != 0) {
23600 switch (nd_type(n)) {
23601 case NODE_DREGX:
23602 {
23603 NODE *match = NEW_MATCH2(node1, node2, loc);
23604 nd_set_line(match, line);
23605 return match;
23606 }
23607
23608 case NODE_REGX:
23609 {
23610 const VALUE lit = rb_node_regx_string_val(n);
23611 if (!NIL_P(lit)) {
23612 NODE *match = NEW_MATCH2(node1, node2, loc);
23613 RNODE_MATCH2(match)->nd_args = reg_named_capture_assign(p, lit, loc, assignable);
23614 nd_set_line(match, line);
23615 return match;
23616 }
23617 }
23618 }
23619 }
23620
23621 if ((n = last_expr_once_body(node2)) != 0) {
23622 NODE *match3;
23623
23624 switch (nd_type(n)) {
23625 case NODE_DREGX:
23626 match3 = NEW_MATCH3(node2, node1, loc);
23627 return match3;
23628 }
23629 }
23630
23631 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
23632 nd_set_line(n, line);
23633 return n;
23634}
23635
23636# if WARN_PAST_SCOPE
23637static int
23638past_dvar_p(struct parser_params *p, ID id)
23639{
23640 struct vtable *past = p->lvtbl->past;
23641 while (past) {
23642 if (vtable_included(past, id)) return 1;
23643 past = past->prev;
23644 }
23645 return 0;
23646}
23647# endif
23648
23649static int
23650numparam_nested_p(struct parser_params *p)
23651{
23652 struct local_vars *local = p->lvtbl;
23653 NODE *outer = local->numparam.outer;
23654 NODE *inner = local->numparam.inner;
23655 if (outer || inner) {
23656 NODE *used = outer ? outer : inner;
23657 compile_error(p, "numbered parameter is already used in\n"
23658 "%s:%d: %s block here",
23659 p->ruby_sourcefile, nd_line(used),
23660 outer ? "outer" : "inner");
23661 parser_show_error_line(p, &used->nd_loc);
23662 return 1;
23663 }
23664 return 0;
23665}
23666
23667static int
23668numparam_used_p(struct parser_params *p)
23669{
23670 NODE *numparam = p->lvtbl->numparam.current;
23671 if (numparam) {
23672 compile_error(p, "numbered parameter is already used in\n"
23673 "%s:%d: current block here",
23674 p->ruby_sourcefile, nd_line(numparam));
23675 parser_show_error_line(p, &numparam->nd_loc);
23676 return 1;
23677 }
23678 return 0;
23679}
23680
23681static int
23682it_used_p(struct parser_params *p)
23683{
23684 NODE *it = p->lvtbl->it;
23685 if (it) {
23686 compile_error(p, "'it' is already used in\n"
23687 "%s:%d: current block here",
23688 p->ruby_sourcefile, nd_line(it));
23689 parser_show_error_line(p, &it->nd_loc);
23690 return 1;
23691 }
23692 return 0;
23693}
23694
23695static NODE*
23696gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
23697{
23698 ID *vidp = NULL;
23699 NODE *node;
23700 switch (id) {
23701 case keyword_self:
23702 return NEW_SELF(loc);
23703 case keyword_nil:
23704 return NEW_NIL(loc);
23705 case keyword_true:
23706 return NEW_TRUE(loc);
23707 case keyword_false:
23708 return NEW_FALSE(loc);
23709 case keyword__FILE__:
23710 {
23711 VALUE file = p->ruby_sourcefile_string;
23712 if (NIL_P(file))
23713 file = rb_str_new(0, 0);
23714 node = NEW_FILE(file, loc);
23715 }
23716 return node;
23717 case keyword__LINE__:
23718 return NEW_LINE(loc);
23719 case keyword__ENCODING__:
23720 return NEW_ENCODING(loc);
23721
23722 }
23723 switch (id_type(id)) {
23724 case ID_LOCAL:
23725 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
23726 if (NUMPARAM_ID_P(id) && (numparam_nested_p(p) || it_used_p(p))) return 0;
23727 if (vidp) *vidp |= LVAR_USED;
23728 node = NEW_DVAR(id, loc);
23729 return node;
23730 }
23731 if (local_id_ref(p, id, &vidp)) {
23732 if (vidp) *vidp |= LVAR_USED;
23733 node = NEW_LVAR(id, loc);
23734 return node;
23735 }
23736 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
23737 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
23738 if (numparam_nested_p(p) || it_used_p(p)) return 0;
23739 node = NEW_DVAR(id, loc);
23740 struct local_vars *local = p->lvtbl;
23741 if (!local->numparam.current) local->numparam.current = node;
23742 return node;
23743 }
23744# if WARN_PAST_SCOPE
23745 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
23746 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
23747 }
23748# endif
23749 /* method call without arguments */
23750 if (dyna_in_block(p) && id == rb_intern("it") && !(DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev))) {
23751 if (numparam_used_p(p)) return 0;
23752 if (p->max_numparam == ORDINAL_PARAM) {
23753 compile_error(p, "ordinary parameter is defined");
23754 return 0;
23755 }
23756 if (!p->it_id) {
23757 p->it_id = internal_id(p);
23758 vtable_add(p->lvtbl->args, p->it_id);
23759 }
23760 NODE *node = NEW_DVAR(p->it_id, loc);
23761 if (!p->lvtbl->it) p->lvtbl->it = node;
23762 return node;
23763 }
23764 return NEW_VCALL(id, loc);
23765 case ID_GLOBAL:
23766 return NEW_GVAR(id, loc);
23767 case ID_INSTANCE:
23768 return NEW_IVAR(id, loc);
23769 case ID_CONST:
23770 return NEW_CONST(id, loc);
23771 case ID_CLASS:
23772 return NEW_CVAR(id, loc);
23773 }
23774 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
23775 return 0;
23776}
23777
23778static rb_node_opt_arg_t *
23779opt_arg_append(rb_node_opt_arg_t *opt_list, rb_node_opt_arg_t *opt)
23780{
23781 rb_node_opt_arg_t *opts = opt_list;
23782 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
23783
23784 while (opts->nd_next) {
23785 opts = opts->nd_next;
23786 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
23787 }
23788 opts->nd_next = opt;
23789
23790 return opt_list;
23791}
23792
23793static rb_node_kw_arg_t *
23794kwd_append(rb_node_kw_arg_t *kwlist, rb_node_kw_arg_t *kw)
23795{
23796 if (kwlist) {
23797 /* Assume rb_node_kw_arg_t and rb_node_opt_arg_t has same structure */
23798 opt_arg_append(RNODE_OPT_ARG(kwlist), RNODE_OPT_ARG(kw));
23799 }
23800 return kwlist;
23801}
23802
23803static NODE *
23804new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
23805{
23806 NODE *n = expr;
23807 while (n) {
23808 if (nd_type_p(n, NODE_BEGIN)) {
23809 n = RNODE_BEGIN(n)->nd_body;
23810 }
23811 else if (nd_type_p(n, NODE_BLOCK) && RNODE_BLOCK(n)->nd_end == n) {
23812 n = RNODE_BLOCK(n)->nd_head;
23813 }
23814 else {
23815 break;
23816 }
23817 }
23818 return NEW_DEFINED(n, loc);
23819}
23820
23821static NODE*
23822str_to_sym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23823{
23824 VALUE lit;
23825 rb_parser_string_t *str = RNODE_STR(node)->string;
23826 if (rb_parser_enc_str_coderange(p, str) == RB_PARSER_ENC_CODERANGE_BROKEN) {
23827 yyerror1(loc, "invalid symbol");
23828 lit = STR_NEW0();
23829 }
23830 else {
23831 lit = rb_str_new_parser_string(str);
23832 }
23833 return NEW_SYM(lit, loc);
23834}
23835
23836static NODE*
23837symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
23838{
23839 enum node_type type = nd_type(symbol);
23840 switch (type) {
23841 case NODE_DSTR:
23842 nd_set_type(symbol, NODE_DSYM);
23843 break;
23844 case NODE_STR:
23845 symbol = str_to_sym_node(p, symbol, &RNODE(symbol)->nd_loc);
23846 break;
23847 default:
23848 compile_error(p, "unexpected node as symbol: %s", parser_node_name(type));
23849 }
23850 return list_append(p, symbols, symbol);
23851}
23852
23853static NODE *
23854new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
23855{
23856 struct RNode_LIST *list;
23857 NODE *prev;
23858
23859 if (!node) {
23860 /* Check string is valid regex */
23861 rb_parser_string_t *str = STRING_NEW0();
23862 reg_compile(p, str, options);
23863 node = NEW_REGX(str, options, loc);
23864 return node;
23865 }
23866 switch (nd_type(node)) {
23867 case NODE_STR:
23868 {
23869 /* Check string is valid regex */
23870 reg_compile(p, RNODE_STR(node)->string, options);
23871 node = str2regx(p, node, options);
23872 }
23873 break;
23874 default:
23875 node = NEW_DSTR0(STRING_NEW0(), 1, NEW_LIST(node, loc), loc);
23876 /* fall through */
23877 case NODE_DSTR:
23878 nd_set_type(node, NODE_DREGX);
23879 nd_set_loc(node, loc);
23880 rb_node_dregx_t *const dreg = RNODE_DREGX(node);
23881 dreg->as.nd_cflag = options & RE_OPTION_MASK;
23882 if (dreg->string) reg_fragment_check(p, dreg->string, options);
23883 prev = node;
23884 for (list = dreg->nd_next; list; list = RNODE_LIST(list->nd_next)) {
23885 NODE *frag = list->nd_head;
23886 enum node_type type = nd_type(frag);
23887 if (type == NODE_STR || (type == NODE_DSTR && !RNODE_DSTR(frag)->nd_next)) {
23888 rb_parser_string_t *tail = RNODE_STR(frag)->string;
23889 if (reg_fragment_check(p, tail, options) && prev && RNODE_DREGX(prev)->string) {
23890 rb_parser_string_t *lit = prev == node ? dreg->string : RNODE_STR(RNODE_LIST(prev)->nd_head)->string;
23891 if (!literal_concat0(p, lit, tail)) {
23892 return NEW_NIL(loc); /* dummy node on error */
23893 }
23894 rb_parser_str_resize(p, tail, 0);
23895 RNODE_LIST(prev)->nd_next = list->nd_next;
23896 rb_discard_node(p, list->nd_head);
23897 rb_discard_node(p, (NODE *)list);
23898 list = RNODE_LIST(prev);
23899 }
23900 else {
23901 prev = (NODE *)list;
23902 }
23903 }
23904 else {
23905 prev = 0;
23906 }
23907 }
23908 if (!dreg->nd_next) {
23909 /* Check string is valid regex */
23910 reg_compile(p, dreg->string, options);
23911 }
23912 if (options & RE_OPTION_ONCE) {
23913 node = NEW_ONCE(node, loc);
23914 }
23915 break;
23916 }
23917 return node;
23918}
23919
23920static rb_node_kw_arg_t *
23921new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
23922{
23923 if (!k) return 0;
23924 return NEW_KW_ARG((k), loc);
23925}
23926
23927static NODE *
23928new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23929{
23930 if (!node) {
23931 NODE *xstr = NEW_XSTR(STRING_NEW0(), loc);
23932 return xstr;
23933 }
23934 switch (nd_type(node)) {
23935 case NODE_STR:
23936 nd_set_type(node, NODE_XSTR);
23937 nd_set_loc(node, loc);
23938 break;
23939 case NODE_DSTR:
23940 nd_set_type(node, NODE_DXSTR);
23941 nd_set_loc(node, loc);
23942 break;
23943 default:
23944 node = NEW_DXSTR(0, 1, NEW_LIST(node, loc), loc);
23945 break;
23946 }
23947 return node;
23948}
23949
23950static const
23951struct st_hash_type literal_type = {
23952 literal_cmp,
23953 literal_hash,
23954};
23955
23956static int nd_type_st_key_enable_p(NODE *node);
23957
23958static void
23959check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
23960{
23961 /* See https://bugs.ruby-lang.org/issues/20331 for discussion about what is warned. */
23962 if (!arg || !p->case_labels) return;
23963 if (!nd_type_st_key_enable_p(arg)) return;
23964
23965 if (p->case_labels == CHECK_LITERAL_WHEN) {
23966 p->case_labels = st_init_table(&literal_type);
23967 }
23968 else {
23969 st_data_t line;
23970 if (st_lookup(p->case_labels, (st_data_t)arg, &line)) {
23971 rb_warning2("'when' clause on line %d duplicates 'when' clause on line %d and is ignored",
23972 WARN_I((int)nd_line(arg)), WARN_I((int)line));
23973 return;
23974 }
23975 }
23976 st_insert(p->case_labels, (st_data_t)arg, (st_data_t)p->ruby_sourceline);
23977}
23978
23979#ifdef RIPPER
23980static int
23981id_is_var(struct parser_params *p, ID id)
23982{
23983 if (is_notop_id(id)) {
23984 switch (id & ID_SCOPE_MASK) {
23985 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
23986 return 1;
23987 case ID_LOCAL:
23988 if (dyna_in_block(p)) {
23989 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
23990 }
23991 if (local_id(p, id)) return 1;
23992 /* method call without arguments */
23993 return 0;
23994 }
23995 }
23996 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
23997 return 0;
23998}
23999#endif
24000
24001static inline enum lex_state_e
24002parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
24003{
24004 if (p->debug) {
24005 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
24006 }
24007 return p->lex.state = ls;
24008}
24009
24010#ifndef RIPPER
24011static void
24012flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
24013{
24014 VALUE mesg = p->debug_buffer;
24015
24016 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
24017 p->debug_buffer = Qnil;
24018 rb_io_puts(1, &mesg, out);
24019 }
24020 if (!NIL_P(str) && RSTRING_LEN(str)) {
24021 rb_io_write(p->debug_output, str);
24022 }
24023}
24024
24025static const char rb_parser_lex_state_names[][8] = {
24026 "BEG", "END", "ENDARG", "ENDFN", "ARG",
24027 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
24028 "LABEL", "LABELED","FITEM",
24029};
24030
24031static VALUE
24032append_lex_state_name(struct parser_params *p, enum lex_state_e state, VALUE buf)
24033{
24034 int i, sep = 0;
24035 unsigned int mask = 1;
24036 static const char none[] = "NONE";
24037
24038 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
24039 if ((unsigned)state & mask) {
24040 if (sep) {
24041 rb_str_cat(buf, "|", 1);
24042 }
24043 sep = 1;
24044 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
24045 }
24046 }
24047 if (!sep) {
24048 rb_str_cat(buf, none, sizeof(none)-1);
24049 }
24050 return buf;
24051}
24052
24053enum lex_state_e
24054rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
24055 enum lex_state_e to, int line)
24056{
24057 VALUE mesg;
24058 mesg = rb_str_new_cstr("lex_state: ");
24059 append_lex_state_name(p, from, mesg);
24060 rb_str_cat_cstr(mesg, " -> ");
24061 append_lex_state_name(p, to, mesg);
24062 rb_str_catf(mesg, " at line %d\n", line);
24063 flush_debug_buffer(p, p->debug_output, mesg);
24064 return to;
24065}
24066
24067VALUE
24068rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state)
24069{
24070 return rb_str_to_interned_str(append_lex_state_name(p, state, rb_str_new(0, 0)));
24071}
24072
24073static void
24074append_bitstack_value(struct parser_params *p, stack_type stack, VALUE mesg)
24075{
24076 if (stack == 0) {
24077 rb_str_cat_cstr(mesg, "0");
24078 }
24079 else {
24080 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
24081 for (; mask && !(stack & mask); mask >>= 1) continue;
24082 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
24083 }
24084}
24085
24086void
24087rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
24088 const char *name, int line)
24089{
24090 VALUE mesg = rb_sprintf("%s: ", name);
24091 append_bitstack_value(p, stack, mesg);
24092 rb_str_catf(mesg, " at line %d\n", line);
24093 flush_debug_buffer(p, p->debug_output, mesg);
24094}
24095
24096void
24097rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
24098{
24099 va_list ap;
24100 VALUE mesg = rb_str_new_cstr("internal parser error: ");
24101
24102 va_start(ap, fmt);
24103 rb_str_vcatf(mesg, fmt, ap);
24104 va_end(ap);
24105 yyerror0(RSTRING_PTR(mesg));
24106 RB_GC_GUARD(mesg);
24107
24108 mesg = rb_str_new(0, 0);
24109 append_lex_state_name(p, p->lex.state, mesg);
24110 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
24111 rb_str_resize(mesg, 0);
24112 append_bitstack_value(p, p->cond_stack, mesg);
24113 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
24114 rb_str_resize(mesg, 0);
24115 append_bitstack_value(p, p->cmdarg_stack, mesg);
24116 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
24117 if (p->debug_output == rb_ractor_stdout())
24118 p->debug_output = rb_ractor_stderr();
24119 p->debug = TRUE;
24120}
24121
24122static YYLTYPE *
24123rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
24124{
24125 yylloc->beg_pos.lineno = sourceline;
24126 yylloc->beg_pos.column = beg_pos;
24127 yylloc->end_pos.lineno = sourceline;
24128 yylloc->end_pos.column = end_pos;
24129 return yylloc;
24130}
24131
24132YYLTYPE *
24133rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
24134{
24135 int sourceline = here->sourceline;
24136 int beg_pos = (int)here->offset - here->quote
24137 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
24138 int end_pos = (int)here->offset + here->length + here->quote;
24139
24140 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24141}
24142
24143YYLTYPE *
24144rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc)
24145{
24146 yylloc->beg_pos.lineno = p->delayed.beg_line;
24147 yylloc->beg_pos.column = p->delayed.beg_col;
24148 yylloc->end_pos.lineno = p->delayed.end_line;
24149 yylloc->end_pos.column = p->delayed.end_col;
24150
24151 return yylloc;
24152}
24153
24154YYLTYPE *
24155rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc)
24156{
24157 int sourceline = p->ruby_sourceline;
24158 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
24159 int end_pos = (int)(p->lex.pend - p->lex.pbeg);
24160 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24161}
24162
24163YYLTYPE *
24164rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc)
24165{
24166 yylloc->end_pos = yylloc->beg_pos;
24167
24168 return yylloc;
24169}
24170
24171YYLTYPE *
24172rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
24173{
24174 int sourceline = p->ruby_sourceline;
24175 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
24176 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
24177 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24178}
24179
24180YYLTYPE *
24181rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
24182{
24183 int sourceline = p->ruby_sourceline;
24184 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
24185 int end_pos = (int)(p->lex.pcur - p->lex.pbeg);
24186 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24187}
24188#endif /* !RIPPER */
24189
24190static int
24191assignable0(struct parser_params *p, ID id, const char **err)
24192{
24193 if (!id) return -1;
24194 switch (id) {
24195 case keyword_self:
24196 *err = "Can't change the value of self";
24197 return -1;
24198 case keyword_nil:
24199 *err = "Can't assign to nil";
24200 return -1;
24201 case keyword_true:
24202 *err = "Can't assign to true";
24203 return -1;
24204 case keyword_false:
24205 *err = "Can't assign to false";
24206 return -1;
24207 case keyword__FILE__:
24208 *err = "Can't assign to __FILE__";
24209 return -1;
24210 case keyword__LINE__:
24211 *err = "Can't assign to __LINE__";
24212 return -1;
24213 case keyword__ENCODING__:
24214 *err = "Can't assign to __ENCODING__";
24215 return -1;
24216 }
24217 switch (id_type(id)) {
24218 case ID_LOCAL:
24219 if (dyna_in_block(p)) {
24220 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
24221 compile_error(p, "Can't assign to numbered parameter _%d",
24222 NUMPARAM_ID_TO_IDX(id));
24223 return -1;
24224 }
24225 if (dvar_curr(p, id)) return NODE_DASGN;
24226 if (dvar_defined(p, id)) return NODE_DASGN;
24227 if (local_id(p, id)) return NODE_LASGN;
24228 dyna_var(p, id);
24229 return NODE_DASGN;
24230 }
24231 else {
24232 if (!local_id(p, id)) local_var(p, id);
24233 return NODE_LASGN;
24234 }
24235 break;
24236 case ID_GLOBAL: return NODE_GASGN;
24237 case ID_INSTANCE: return NODE_IASGN;
24238 case ID_CONST:
24239 if (!p->ctxt.in_def) return NODE_CDECL;
24240 *err = "dynamic constant assignment";
24241 return -1;
24242 case ID_CLASS: return NODE_CVASGN;
24243 default:
24244 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
24245 }
24246 return -1;
24247}
24248
24249static NODE*
24250assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
24251{
24252 const char *err = 0;
24253 int node_type = assignable0(p, id, &err);
24254 switch (node_type) {
24255 case NODE_DASGN: return NEW_DASGN(id, val, loc);
24256 case NODE_LASGN: return NEW_LASGN(id, val, loc);
24257 case NODE_GASGN: return NEW_GASGN(id, val, loc);
24258 case NODE_IASGN: return NEW_IASGN(id, val, loc);
24259 case NODE_CDECL: return NEW_CDECL(id, val, 0, p->ctxt.shareable_constant_value, loc);
24260 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
24261 }
24262/* TODO: FIXME */
24263#ifndef RIPPER
24264 if (err) yyerror1(loc, err);
24265#else
24266 if (err) set_value(assign_error(p, err, p->s_lvalue));
24267#endif
24268 return NEW_ERROR(loc);
24269}
24270
24271static int
24272is_private_local_id(struct parser_params *p, ID name)
24273{
24274 VALUE s;
24275 if (name == idUScore) return 1;
24276 if (!is_local_id(name)) return 0;
24277 s = rb_id2str(name);
24278 if (!s) return 0;
24279 return RSTRING_PTR(s)[0] == '_';
24280}
24281
24282static int
24283shadowing_lvar_0(struct parser_params *p, ID name)
24284{
24285 if (dyna_in_block(p)) {
24286 if (dvar_curr(p, name)) {
24287 if (is_private_local_id(p, name)) return 1;
24288 yyerror0("duplicated argument name");
24289 }
24290 else if (dvar_defined(p, name) || local_id(p, name)) {
24291 vtable_add(p->lvtbl->vars, name);
24292 if (p->lvtbl->used) {
24293 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
24294 }
24295 return 0;
24296 }
24297 }
24298 else {
24299 if (local_id(p, name)) {
24300 if (is_private_local_id(p, name)) return 1;
24301 yyerror0("duplicated argument name");
24302 }
24303 }
24304 return 1;
24305}
24306
24307static ID
24308shadowing_lvar(struct parser_params *p, ID name)
24309{
24310 shadowing_lvar_0(p, name);
24311 return name;
24312}
24313
24314static void
24315new_bv(struct parser_params *p, ID name)
24316{
24317 if (!name) return;
24318 if (!is_local_id(name)) {
24319 compile_error(p, "invalid local variable - %"PRIsVALUE,
24320 rb_id2str(name));
24321 return;
24322 }
24323 if (!shadowing_lvar_0(p, name)) return;
24324 dyna_var(p, name);
24325 ID *vidp = 0;
24326 if (dvar_defined_ref(p, name, &vidp)) {
24327 if (vidp) *vidp |= LVAR_USED;
24328 }
24329}
24330
24331static void
24332aryset_check(struct parser_params *p, NODE *args)
24333{
24334 NODE *block = 0, *kwds = 0;
24335 if (args && nd_type_p(args, NODE_BLOCK_PASS)) {
24336 block = RNODE_BLOCK_PASS(args)->nd_body;
24337 args = RNODE_BLOCK_PASS(args)->nd_head;
24338 }
24339 if (args && nd_type_p(args, NODE_ARGSCAT)) {
24340 args = RNODE_ARGSCAT(args)->nd_body;
24341 }
24342 if (args && nd_type_p(args, NODE_ARGSPUSH)) {
24343 kwds = RNODE_ARGSPUSH(args)->nd_body;
24344 }
24345 else {
24346 for (NODE *next = args; next && nd_type_p(next, NODE_LIST);
24347 next = RNODE_LIST(next)->nd_next) {
24348 kwds = RNODE_LIST(next)->nd_head;
24349 }
24350 }
24351 if (kwds && nd_type_p(kwds, NODE_HASH) && !RNODE_HASH(kwds)->nd_brace) {
24352 yyerror1(&kwds->nd_loc, "keyword arg given in index assignment");
24353 }
24354 if (block) {
24355 yyerror1(&block->nd_loc, "block arg given in index assignment");
24356 }
24357}
24358
24359static NODE *
24360aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
24361{
24362 aryset_check(p, idx);
24363 return NEW_ATTRASGN(recv, tASET, idx, loc);
24364}
24365
24366static void
24367block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
24368{
24369 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
24370 compile_error(p, "both block arg and actual block given");
24371 }
24372}
24373
24374static NODE *
24375attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
24376{
24377 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
24378 return NEW_ATTRASGN(recv, id, 0, loc);
24379}
24380
24381static VALUE
24382rb_backref_error(struct parser_params *p, NODE *node)
24383{
24384#ifndef RIPPER
24385# define ERR(...) (compile_error(p, __VA_ARGS__), Qtrue)
24386#else
24387# define ERR(...) rb_sprintf(__VA_ARGS__)
24388#endif
24389 switch (nd_type(node)) {
24390 case NODE_NTH_REF:
24391 return ERR("Can't set variable $%ld", RNODE_NTH_REF(node)->nd_nth);
24392 case NODE_BACK_REF:
24393 return ERR("Can't set variable $%c", (int)RNODE_BACK_REF(node)->nd_nth);
24394 }
24395#undef ERR
24396 UNREACHABLE_RETURN(Qfalse); /* only called on syntax error */
24397}
24398
24399static NODE *
24400arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
24401{
24402 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
24403 switch (nd_type(node1)) {
24404 case NODE_LIST:
24405 return list_append(p, node1, node2);
24406 case NODE_BLOCK_PASS:
24407 RNODE_BLOCK_PASS(node1)->nd_head = arg_append(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
24408 node1->nd_loc.end_pos = RNODE_BLOCK_PASS(node1)->nd_head->nd_loc.end_pos;
24409 return node1;
24410 case NODE_ARGSPUSH:
24411 RNODE_ARGSPUSH(node1)->nd_body = list_append(p, NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, &RNODE_ARGSPUSH(node1)->nd_body->nd_loc), node2);
24412 node1->nd_loc.end_pos = RNODE_ARGSPUSH(node1)->nd_body->nd_loc.end_pos;
24413 nd_set_type(node1, NODE_ARGSCAT);
24414 return node1;
24415 case NODE_ARGSCAT:
24416 if (!nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
24417 RNODE_ARGSCAT(node1)->nd_body = list_append(p, RNODE_ARGSCAT(node1)->nd_body, node2);
24418 node1->nd_loc.end_pos = RNODE_ARGSCAT(node1)->nd_body->nd_loc.end_pos;
24419 return node1;
24420 }
24421 return NEW_ARGSPUSH(node1, node2, loc);
24422}
24423
24424static NODE *
24425arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
24426{
24427 if (!node2) return node1;
24428 switch (nd_type(node1)) {
24429 case NODE_BLOCK_PASS:
24430 if (RNODE_BLOCK_PASS(node1)->nd_head)
24431 RNODE_BLOCK_PASS(node1)->nd_head = arg_concat(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
24432 else
24433 RNODE_LIST(node1)->nd_head = NEW_LIST(node2, loc);
24434 return node1;
24435 case NODE_ARGSPUSH:
24436 if (!nd_type_p(node2, NODE_LIST)) break;
24437 RNODE_ARGSPUSH(node1)->nd_body = list_concat(NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, loc), node2);
24438 nd_set_type(node1, NODE_ARGSCAT);
24439 return node1;
24440 case NODE_ARGSCAT:
24441 if (!nd_type_p(node2, NODE_LIST) ||
24442 !nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
24443 RNODE_ARGSCAT(node1)->nd_body = list_concat(RNODE_ARGSCAT(node1)->nd_body, node2);
24444 return node1;
24445 }
24446 return NEW_ARGSCAT(node1, node2, loc);
24447}
24448
24449static NODE *
24450last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
24451{
24452 NODE *n1;
24453 if ((n1 = splat_array(args)) != 0) {
24454 return list_append(p, n1, last_arg);
24455 }
24456 return arg_append(p, args, last_arg, loc);
24457}
24458
24459static NODE *
24460rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
24461{
24462 NODE *n1;
24463 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
24464 return list_concat(n1, rest_arg);
24465 }
24466 return arg_concat(p, args, rest_arg, loc);
24467}
24468
24469static NODE *
24470splat_array(NODE* node)
24471{
24472 if (nd_type_p(node, NODE_SPLAT)) node = RNODE_SPLAT(node)->nd_head;
24473 if (nd_type_p(node, NODE_LIST)) return node;
24474 return 0;
24475}
24476
24477static void
24478mark_lvar_used(struct parser_params *p, NODE *rhs)
24479{
24480 ID *vidp = NULL;
24481 if (!rhs) return;
24482 switch (nd_type(rhs)) {
24483 case NODE_LASGN:
24484 if (local_id_ref(p, RNODE_LASGN(rhs)->nd_vid, &vidp)) {
24485 if (vidp) *vidp |= LVAR_USED;
24486 }
24487 break;
24488 case NODE_DASGN:
24489 if (dvar_defined_ref(p, RNODE_DASGN(rhs)->nd_vid, &vidp)) {
24490 if (vidp) *vidp |= LVAR_USED;
24491 }
24492 break;
24493#if 0
24494 case NODE_MASGN:
24495 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
24496 mark_lvar_used(p, rhs->nd_head);
24497 }
24498 break;
24499#endif
24500 }
24501}
24502
24503static int is_static_content(NODE *node);
24504
24505static NODE *
24506node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
24507{
24508 if (!lhs) return 0;
24509
24510 switch (nd_type(lhs)) {
24511 case NODE_CDECL:
24512 case NODE_GASGN:
24513 case NODE_IASGN:
24514 case NODE_LASGN:
24515 case NODE_DASGN:
24516 case NODE_MASGN:
24517 case NODE_CVASGN:
24518 set_nd_value(p, lhs, rhs);
24519 nd_set_loc(lhs, loc);
24520 break;
24521
24522 case NODE_ATTRASGN:
24523 RNODE_ATTRASGN(lhs)->nd_args = arg_append(p, RNODE_ATTRASGN(lhs)->nd_args, rhs, loc);
24524 nd_set_loc(lhs, loc);
24525 break;
24526
24527 default:
24528 /* should not happen */
24529 break;
24530 }
24531
24532 return lhs;
24533}
24534
24535static NODE *
24536value_expr_check(struct parser_params *p, NODE *node)
24537{
24538 NODE *void_node = 0, *vn;
24539
24540 if (!node) {
24541 rb_warning0("empty expression");
24542 }
24543 while (node) {
24544 switch (nd_type(node)) {
24545 case NODE_ENSURE:
24546 vn = RNODE_ENSURE(node)->nd_head;
24547 node = RNODE_ENSURE(node)->nd_ensr;
24548 /* nd_ensr should not be NULL, check it out next */
24549 if (vn && (vn = value_expr_check(p, vn))) {
24550 goto found;
24551 }
24552 break;
24553
24554 case NODE_RESCUE:
24555 /* void only if all children are void */
24556 vn = RNODE_RESCUE(node)->nd_head;
24557 if (!vn || !(vn = value_expr_check(p, vn))) return NULL;
24558 if (!void_node) void_node = vn;
24559 for (NODE *r = RNODE_RESCUE(node)->nd_resq; r; r = RNODE_RESBODY(r)->nd_next) {
24560 if (!nd_type_p(r, NODE_RESBODY)) {
24561 compile_error(p, "unexpected node");
24562 return NULL;
24563 }
24564 if (!(vn = value_expr_check(p, RNODE_RESBODY(r)->nd_body))) {
24565 void_node = 0;
24566 break;
24567 }
24568 if (!void_node) void_node = vn;
24569 }
24570 node = RNODE_RESCUE(node)->nd_else;
24571 if (!node) return void_node;
24572 break;
24573
24574 case NODE_RETURN:
24575 case NODE_BREAK:
24576 case NODE_NEXT:
24577 case NODE_REDO:
24578 case NODE_RETRY:
24579 goto found;
24580
24581 case NODE_CASE3:
24582 if (!RNODE_CASE3(node)->nd_body || !nd_type_p(RNODE_CASE3(node)->nd_body, NODE_IN)) {
24583 compile_error(p, "unexpected node");
24584 return NULL;
24585 }
24586 if (RNODE_IN(RNODE_CASE3(node)->nd_body)->nd_body) {
24587 return NULL;
24588 }
24589 /* single line pattern matching with "=>" operator */
24590 goto found;
24591
24592 case NODE_BLOCK:
24593 while (RNODE_BLOCK(node)->nd_next) {
24594 node = RNODE_BLOCK(node)->nd_next;
24595 }
24596 node = RNODE_BLOCK(node)->nd_head;
24597 break;
24598
24599 case NODE_BEGIN:
24600 node = RNODE_BEGIN(node)->nd_body;
24601 break;
24602
24603 case NODE_IF:
24604 case NODE_UNLESS:
24605 if (!RNODE_IF(node)->nd_body) {
24606 return NULL;
24607 }
24608 else if (!RNODE_IF(node)->nd_else) {
24609 return NULL;
24610 }
24611 vn = value_expr_check(p, RNODE_IF(node)->nd_body);
24612 if (!vn) return NULL;
24613 if (!void_node) void_node = vn;
24614 node = RNODE_IF(node)->nd_else;
24615 break;
24616
24617 case NODE_AND:
24618 case NODE_OR:
24619 node = RNODE_AND(node)->nd_1st;
24620 break;
24621
24622 case NODE_LASGN:
24623 case NODE_DASGN:
24624 case NODE_MASGN:
24625 mark_lvar_used(p, node);
24626 return NULL;
24627
24628 default:
24629 return NULL;
24630 }
24631 }
24632
24633 return NULL;
24634
24635 found:
24636 /* return the first found node */
24637 return void_node ? void_node : node;
24638}
24639
24640static int
24641value_expr_gen(struct parser_params *p, NODE *node)
24642{
24643 NODE *void_node = value_expr_check(p, node);
24644 if (void_node) {
24645 yyerror1(&void_node->nd_loc, "void value expression");
24646 /* or "control never reach"? */
24647 return FALSE;
24648 }
24649 return TRUE;
24650}
24651
24652static void
24653void_expr(struct parser_params *p, NODE *node)
24654{
24655 const char *useless = 0;
24656
24657 if (!RTEST(ruby_verbose)) return;
24658
24659 if (!node || !(node = nd_once_body(node))) return;
24660 switch (nd_type(node)) {
24661 case NODE_OPCALL:
24662 switch (RNODE_OPCALL(node)->nd_mid) {
24663 case '+':
24664 case '-':
24665 case '*':
24666 case '/':
24667 case '%':
24668 case tPOW:
24669 case tUPLUS:
24670 case tUMINUS:
24671 case '|':
24672 case '^':
24673 case '&':
24674 case tCMP:
24675 case '>':
24676 case tGEQ:
24677 case '<':
24678 case tLEQ:
24679 case tEQ:
24680 case tNEQ:
24681 useless = rb_id2name(RNODE_OPCALL(node)->nd_mid);
24682 break;
24683 }
24684 break;
24685
24686 case NODE_LVAR:
24687 case NODE_DVAR:
24688 case NODE_GVAR:
24689 case NODE_IVAR:
24690 case NODE_CVAR:
24691 case NODE_NTH_REF:
24692 case NODE_BACK_REF:
24693 useless = "a variable";
24694 break;
24695 case NODE_CONST:
24696 useless = "a constant";
24697 break;
24698 case NODE_SYM:
24699 case NODE_LINE:
24700 case NODE_FILE:
24701 case NODE_ENCODING:
24702 case NODE_INTEGER:
24703 case NODE_FLOAT:
24704 case NODE_RATIONAL:
24705 case NODE_IMAGINARY:
24706 case NODE_STR:
24707 case NODE_DSTR:
24708 case NODE_REGX:
24709 case NODE_DREGX:
24710 useless = "a literal";
24711 break;
24712 case NODE_COLON2:
24713 case NODE_COLON3:
24714 useless = "::";
24715 break;
24716 case NODE_DOT2:
24717 useless = "..";
24718 break;
24719 case NODE_DOT3:
24720 useless = "...";
24721 break;
24722 case NODE_SELF:
24723 useless = "self";
24724 break;
24725 case NODE_NIL:
24726 useless = "nil";
24727 break;
24728 case NODE_TRUE:
24729 useless = "true";
24730 break;
24731 case NODE_FALSE:
24732 useless = "false";
24733 break;
24734 case NODE_DEFINED:
24735 useless = "defined?";
24736 break;
24737 }
24738
24739 if (useless) {
24740 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
24741 }
24742}
24743
24744/* warns useless use of block and returns the last statement node */
24745static NODE *
24746void_stmts(struct parser_params *p, NODE *node)
24747{
24748 NODE *const n = node;
24749 if (!RTEST(ruby_verbose)) return n;
24750 if (!node) return n;
24751 if (!nd_type_p(node, NODE_BLOCK)) return n;
24752
24753 while (RNODE_BLOCK(node)->nd_next) {
24754 void_expr(p, RNODE_BLOCK(node)->nd_head);
24755 node = RNODE_BLOCK(node)->nd_next;
24756 }
24757 return RNODE_BLOCK(node)->nd_head;
24758}
24759
24760static NODE *
24761remove_begin(NODE *node)
24762{
24763 NODE **n = &node, *n1 = node;
24764 while (n1 && nd_type_p(n1, NODE_BEGIN) && RNODE_BEGIN(n1)->nd_body) {
24765 *n = n1 = RNODE_BEGIN(n1)->nd_body;
24766 }
24767 return node;
24768}
24769
24770static void
24771reduce_nodes(struct parser_params *p, NODE **body)
24772{
24773 NODE *node = *body;
24774
24775 if (!node) {
24776 *body = NEW_NIL(&NULL_LOC);
24777 return;
24778 }
24779#define subnodes(type, n1, n2) \
24780 ((!type(node)->n1) ? (type(node)->n2 ? (body = &type(node)->n2, 1) : 0) : \
24781 (!type(node)->n2) ? (body = &type(node)->n1, 1) : \
24782 (reduce_nodes(p, &type(node)->n1), body = &type(node)->n2, 1))
24783
24784 while (node) {
24785 int newline = (int)nd_fl_newline(node);
24786 switch (nd_type(node)) {
24787 end:
24788 case NODE_NIL:
24789 *body = 0;
24790 return;
24791 case NODE_BEGIN:
24792 *body = node = RNODE_BEGIN(node)->nd_body;
24793 if (newline && node) nd_set_fl_newline(node);
24794 continue;
24795 case NODE_BLOCK:
24796 body = &RNODE_BLOCK(RNODE_BLOCK(node)->nd_end)->nd_head;
24797 break;
24798 case NODE_IF:
24799 case NODE_UNLESS:
24800 if (subnodes(RNODE_IF, nd_body, nd_else)) break;
24801 return;
24802 case NODE_CASE:
24803 body = &RNODE_CASE(node)->nd_body;
24804 break;
24805 case NODE_WHEN:
24806 if (!subnodes(RNODE_WHEN, nd_body, nd_next)) goto end;
24807 break;
24808 case NODE_ENSURE:
24809 body = &RNODE_ENSURE(node)->nd_head;
24810 break;
24811 case NODE_RESCUE:
24812 newline = 0; // RESBODY should not be a NEWLINE
24813 if (RNODE_RESCUE(node)->nd_else) {
24814 body = &RNODE_RESCUE(node)->nd_resq;
24815 break;
24816 }
24817 if (!subnodes(RNODE_RESCUE, nd_head, nd_resq)) goto end;
24818 break;
24819 default:
24820 return;
24821 }
24822 node = *body;
24823 if (newline && node) nd_set_fl_newline(node);
24824 }
24825
24826#undef subnodes
24827}
24828
24829static int
24830is_static_content(NODE *node)
24831{
24832 if (!node) return 1;
24833 switch (nd_type(node)) {
24834 case NODE_HASH:
24835 if (!(node = RNODE_HASH(node)->nd_head)) break;
24836 case NODE_LIST:
24837 do {
24838 if (!is_static_content(RNODE_LIST(node)->nd_head)) return 0;
24839 } while ((node = RNODE_LIST(node)->nd_next) != 0);
24840 case NODE_SYM:
24841 case NODE_REGX:
24842 case NODE_LINE:
24843 case NODE_FILE:
24844 case NODE_ENCODING:
24845 case NODE_INTEGER:
24846 case NODE_FLOAT:
24847 case NODE_RATIONAL:
24848 case NODE_IMAGINARY:
24849 case NODE_STR:
24850 case NODE_NIL:
24851 case NODE_TRUE:
24852 case NODE_FALSE:
24853 case NODE_ZLIST:
24854 break;
24855 default:
24856 return 0;
24857 }
24858 return 1;
24859}
24860
24861static int
24862assign_in_cond(struct parser_params *p, NODE *node)
24863{
24864 switch (nd_type(node)) {
24865 case NODE_MASGN:
24866 case NODE_LASGN:
24867 case NODE_DASGN:
24868 case NODE_GASGN:
24869 case NODE_IASGN:
24870 case NODE_CVASGN:
24871 case NODE_CDECL:
24872 break;
24873
24874 default:
24875 return 0;
24876 }
24877
24878 if (!get_nd_value(p, node)) return 1;
24879 if (is_static_content(get_nd_value(p, node))) {
24880 /* reports always */
24881 rb_warn0L(nd_line(get_nd_value(p, node)), "found '= literal' in conditional, should be ==");
24882 }
24883 return 1;
24884}
24885
24886enum cond_type {
24887 COND_IN_OP,
24888 COND_IN_COND,
24889 COND_IN_FF
24890};
24891
24892#define SWITCH_BY_COND_TYPE(t, w, arg) do { \
24893 switch (t) { \
24894 case COND_IN_OP: break; \
24895 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
24896 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
24897 } \
24898} while (0)
24899
24900static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*,bool);
24901
24902static NODE*
24903range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24904{
24905 enum node_type type;
24906
24907 if (node == 0) return 0;
24908
24909 type = nd_type(node);
24910 value_expr(node);
24911 if (type == NODE_INTEGER) {
24912 if (!e_option_supplied(p)) rb_warn0L(nd_line(node), "integer literal in flip-flop");
24913 ID lineno = rb_intern("$.");
24914 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
24915 }
24916 return cond0(p, node, COND_IN_FF, loc, true);
24917}
24918
24919static NODE*
24920cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc, bool top)
24921{
24922 if (node == 0) return 0;
24923 if (!(node = nd_once_body(node))) return 0;
24924 assign_in_cond(p, node);
24925
24926 switch (nd_type(node)) {
24927 case NODE_BEGIN:
24928 RNODE_BEGIN(node)->nd_body = cond0(p, RNODE_BEGIN(node)->nd_body, type, loc, top);
24929 break;
24930
24931 case NODE_DSTR:
24932 case NODE_EVSTR:
24933 case NODE_STR:
24934 case NODE_FILE:
24935 SWITCH_BY_COND_TYPE(type, warn, "string ");
24936 break;
24937
24938 case NODE_REGX:
24939 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ");
24940 nd_set_type(node, NODE_MATCH);
24941 break;
24942
24943 case NODE_DREGX:
24944 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ");
24945
24946 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
24947
24948 case NODE_BLOCK:
24949 {
24950 NODE *end = RNODE_BLOCK(node)->nd_end;
24951 NODE **expr = &RNODE_BLOCK(end)->nd_head;
24952 if (top) top = node == end;
24953 *expr = cond0(p, *expr, type, loc, top);
24954 }
24955 break;
24956
24957 case NODE_AND:
24958 case NODE_OR:
24959 RNODE_AND(node)->nd_1st = cond0(p, RNODE_AND(node)->nd_1st, COND_IN_COND, loc, true);
24960 RNODE_AND(node)->nd_2nd = cond0(p, RNODE_AND(node)->nd_2nd, COND_IN_COND, loc, true);
24961 break;
24962
24963 case NODE_DOT2:
24964 case NODE_DOT3:
24965 if (!top) break;
24966 RNODE_DOT2(node)->nd_beg = range_op(p, RNODE_DOT2(node)->nd_beg, loc);
24967 RNODE_DOT2(node)->nd_end = range_op(p, RNODE_DOT2(node)->nd_end, loc);
24968 switch (nd_type(node)) {
24969 case NODE_DOT2:
24970 nd_set_type(node,NODE_FLIP2);
24971 rb_node_flip2_t *flip2 = RNODE_FLIP2(node); /* for debug info */
24972 (void)flip2;
24973 break;
24974 case NODE_DOT3:
24975 nd_set_type(node, NODE_FLIP3);
24976 rb_node_flip3_t *flip3 = RNODE_FLIP3(node); /* for debug info */
24977 (void)flip3;
24978 break;
24979 }
24980 break;
24981
24982 case NODE_SYM:
24983 case NODE_DSYM:
24984 SWITCH_BY_COND_TYPE(type, warning, "symbol ");
24985 break;
24986
24987 case NODE_LINE:
24988 SWITCH_BY_COND_TYPE(type, warning, "");
24989 break;
24990
24991 case NODE_ENCODING:
24992 SWITCH_BY_COND_TYPE(type, warning, "");
24993 break;
24994
24995 case NODE_INTEGER:
24996 case NODE_FLOAT:
24997 case NODE_RATIONAL:
24998 case NODE_IMAGINARY:
24999 SWITCH_BY_COND_TYPE(type, warning, "");
25000 break;
25001
25002 default:
25003 break;
25004 }
25005 return node;
25006}
25007
25008static NODE*
25009cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25010{
25011 if (node == 0) return 0;
25012 return cond0(p, node, COND_IN_COND, loc, true);
25013}
25014
25015static NODE*
25016method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25017{
25018 if (node == 0) return 0;
25019 return cond0(p, node, COND_IN_OP, loc, true);
25020}
25021
25022static NODE*
25023new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
25024{
25025 YYLTYPE loc = {*pos, *pos};
25026 return NEW_NIL(&loc);
25027}
25028
25029static NODE*
25030new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
25031{
25032 if (!cc) return right;
25033 cc = cond0(p, cc, COND_IN_COND, loc, true);
25034 return newline_node(NEW_IF(cc, left, right, loc));
25035}
25036
25037static NODE*
25038new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *then_keyword_loc, const YYLTYPE *end_keyword_loc)
25039{
25040 if (!cc) return right;
25041 cc = cond0(p, cc, COND_IN_COND, loc, true);
25042 return newline_node(NEW_UNLESS(cc, left, right, loc, keyword_loc, then_keyword_loc, end_keyword_loc));
25043}
25044
25045#define NEW_AND_OR(type, f, s, loc, op_loc) (type == NODE_AND ? NEW_AND(f,s,loc,op_loc) : NEW_OR(f,s,loc,op_loc))
25046
25047static NODE*
25048logop(struct parser_params *p, ID id, NODE *left, NODE *right,
25049 const YYLTYPE *op_loc, const YYLTYPE *loc)
25050{
25051 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
25052 NODE *op;
25053 value_expr(left);
25054 if (left && nd_type_p(left, type)) {
25055 NODE *node = left, *second;
25056 while ((second = RNODE_AND(node)->nd_2nd) != 0 && nd_type_p(second, type)) {
25057 node = second;
25058 }
25059 RNODE_AND(node)->nd_2nd = NEW_AND_OR(type, second, right, loc, op_loc);
25060 nd_set_line(RNODE_AND(node)->nd_2nd, op_loc->beg_pos.lineno);
25061 left->nd_loc.end_pos = loc->end_pos;
25062 return left;
25063 }
25064 op = NEW_AND_OR(type, left, right, loc, op_loc);
25065 nd_set_line(op, op_loc->beg_pos.lineno);
25066 return op;
25067}
25068
25069#undef NEW_AND_OR
25070
25071static void
25072no_blockarg(struct parser_params *p, NODE *node)
25073{
25074 if (nd_type_p(node, NODE_BLOCK_PASS)) {
25075 compile_error(p, "block argument should not be given");
25076 }
25077}
25078
25079static NODE *
25080ret_args(struct parser_params *p, NODE *node)
25081{
25082 if (node) {
25083 no_blockarg(p, node);
25084 if (nd_type_p(node, NODE_LIST) && !RNODE_LIST(node)->nd_next) {
25085 node = RNODE_LIST(node)->nd_head;
25086 }
25087 }
25088 return node;
25089}
25090
25091static NODE *
25092new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25093{
25094 if (node) no_blockarg(p, node);
25095
25096 return NEW_YIELD(node, loc);
25097}
25098
25099static NODE*
25100negate_lit(struct parser_params *p, NODE* node)
25101{
25102 switch (nd_type(node)) {
25103 case NODE_INTEGER:
25104 RNODE_INTEGER(node)->minus = TRUE;
25105 break;
25106 case NODE_FLOAT:
25107 RNODE_FLOAT(node)->minus = TRUE;
25108 break;
25109 case NODE_RATIONAL:
25110 RNODE_RATIONAL(node)->minus = TRUE;
25111 break;
25112 case NODE_IMAGINARY:
25113 RNODE_IMAGINARY(node)->minus = TRUE;
25114 break;
25115 }
25116 return node;
25117}
25118
25119static NODE *
25120arg_blk_pass(NODE *node1, rb_node_block_pass_t *node2)
25121{
25122 if (node2) {
25123 if (!node1) return (NODE *)node2;
25124 node2->nd_head = node1;
25125 nd_set_first_lineno(node2, nd_first_lineno(node1));
25126 nd_set_first_column(node2, nd_first_column(node1));
25127 return (NODE *)node2;
25128 }
25129 return node1;
25130}
25131
25132static bool
25133args_info_empty_p(struct rb_args_info *args)
25134{
25135 if (args->pre_args_num) return false;
25136 if (args->post_args_num) return false;
25137 if (args->rest_arg) return false;
25138 if (args->opt_args) return false;
25139 if (args->block_arg) return false;
25140 if (args->kw_args) return false;
25141 if (args->kw_rest_arg) return false;
25142 return true;
25143}
25144
25145static rb_node_args_t *
25146new_args(struct parser_params *p, rb_node_args_aux_t *pre_args, rb_node_opt_arg_t *opt_args, ID rest_arg, rb_node_args_aux_t *post_args, rb_node_args_t *tail, const YYLTYPE *loc)
25147{
25148 struct rb_args_info *args = &tail->nd_ainfo;
25149
25150 if (args->forwarding) {
25151 if (rest_arg) {
25152 yyerror1(&RNODE(tail)->nd_loc, "... after rest argument");
25153 return tail;
25154 }
25155 rest_arg = idFWD_REST;
25156 }
25157
25158 args->pre_args_num = pre_args ? pre_args->nd_plen : 0;
25159 args->pre_init = pre_args ? pre_args->nd_next : 0;
25160
25161 args->post_args_num = post_args ? post_args->nd_plen : 0;
25162 args->post_init = post_args ? post_args->nd_next : 0;
25163 args->first_post_arg = post_args ? post_args->nd_pid : 0;
25164
25165 args->rest_arg = rest_arg;
25166
25167 args->opt_args = opt_args;
25168
25169#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25170 args->ruby2_keywords = args->forwarding;
25171#else
25172 args->ruby2_keywords = 0;
25173#endif
25174
25175 nd_set_loc(RNODE(tail), loc);
25176
25177 return tail;
25178}
25179
25180static rb_node_args_t *
25181new_args_tail(struct parser_params *p, rb_node_kw_arg_t *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
25182{
25183 rb_node_args_t *node = NEW_ARGS(&NULL_LOC);
25184 struct rb_args_info *args = &node->nd_ainfo;
25185 if (p->error_p) return node;
25186
25187 args->block_arg = block;
25188 args->kw_args = kw_args;
25189
25190 if (kw_args) {
25191 /*
25192 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
25193 * variable order: k1, kr1, k2, &b, internal_id, krest
25194 * #=> <reorder>
25195 * variable order: kr1, k1, k2, internal_id, krest, &b
25196 */
25197 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
25198 struct vtable *vtargs = p->lvtbl->args;
25199 rb_node_kw_arg_t *kwn = kw_args;
25200
25201 if (block) block = vtargs->tbl[vtargs->pos-1];
25202 vtable_pop(vtargs, !!block + !!kw_rest_arg);
25203 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
25204 while (kwn) {
25205 if (!NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body)))
25206 --kw_vars;
25207 --required_kw_vars;
25208 kwn = kwn->nd_next;
25209 }
25210
25211 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
25212 ID vid = get_nd_vid(p, kwn->nd_body);
25213 if (NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body))) {
25214 *required_kw_vars++ = vid;
25215 }
25216 else {
25217 *kw_vars++ = vid;
25218 }
25219 }
25220
25221 arg_var(p, kw_bits);
25222 if (kw_rest_arg) arg_var(p, kw_rest_arg);
25223 if (block) arg_var(p, block);
25224
25225 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
25226 }
25227 else if (kw_rest_arg == idNil) {
25228 args->no_kwarg = 1;
25229 }
25230 else if (kw_rest_arg) {
25231 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
25232 }
25233
25234 return node;
25235}
25236
25237static rb_node_args_t *
25238args_with_numbered(struct parser_params *p, rb_node_args_t *args, int max_numparam, ID it_id)
25239{
25240 if (max_numparam > NO_PARAM || it_id) {
25241 if (!args) {
25242 YYLTYPE loc = RUBY_INIT_YYLLOC();
25243 args = new_args_tail(p, 0, 0, 0, 0);
25244 nd_set_loc(RNODE(args), &loc);
25245 }
25246 args->nd_ainfo.pre_args_num = it_id ? 1 : max_numparam;
25247 }
25248 return args;
25249}
25250
25251static NODE*
25252new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
25253{
25254 RNODE_ARYPTN(aryptn)->nd_pconst = constant;
25255
25256 if (pre_arg) {
25257 NODE *pre_args = NEW_LIST(pre_arg, loc);
25258 if (RNODE_ARYPTN(aryptn)->pre_args) {
25259 RNODE_ARYPTN(aryptn)->pre_args = list_concat(pre_args, RNODE_ARYPTN(aryptn)->pre_args);
25260 }
25261 else {
25262 RNODE_ARYPTN(aryptn)->pre_args = pre_args;
25263 }
25264 }
25265 return aryptn;
25266}
25267
25268static NODE*
25269new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
25270{
25271 if (has_rest) {
25272 rest_arg = rest_arg ? rest_arg : NODE_SPECIAL_NO_NAME_REST;
25273 }
25274 else {
25275 rest_arg = NULL;
25276 }
25277 NODE *node = NEW_ARYPTN(pre_args, rest_arg, post_args, loc);
25278
25279 return node;
25280}
25281
25282static NODE*
25283new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
25284{
25285 RNODE_FNDPTN(fndptn)->nd_pconst = constant;
25286
25287 return fndptn;
25288}
25289
25290static NODE*
25291new_find_pattern_tail(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
25292{
25293 pre_rest_arg = pre_rest_arg ? pre_rest_arg : NODE_SPECIAL_NO_NAME_REST;
25294 post_rest_arg = post_rest_arg ? post_rest_arg : NODE_SPECIAL_NO_NAME_REST;
25295 NODE *node = NEW_FNDPTN(pre_rest_arg, args, post_rest_arg, loc);
25296
25297 return node;
25298}
25299
25300static NODE*
25301new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
25302{
25303 RNODE_HSHPTN(hshptn)->nd_pconst = constant;
25304 return hshptn;
25305}
25306
25307static NODE*
25308new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
25309{
25310 NODE *node, *kw_rest_arg_node;
25311
25312 if (kw_rest_arg == idNil) {
25313 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
25314 }
25315 else if (kw_rest_arg) {
25316 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
25317 }
25318 else {
25319 kw_rest_arg_node = NULL;
25320 }
25321
25322 node = NEW_HSHPTN(0, kw_args, kw_rest_arg_node, loc);
25323
25324 return node;
25325}
25326
25327static NODE*
25328dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25329{
25330 if (!node) {
25331 return NEW_SYM(STR_NEW0(), loc);
25332 }
25333
25334 switch (nd_type(node)) {
25335 case NODE_DSTR:
25336 nd_set_type(node, NODE_DSYM);
25337 nd_set_loc(node, loc);
25338 break;
25339 case NODE_STR:
25340 node = str_to_sym_node(p, node, loc);
25341 break;
25342 default:
25343 node = NEW_DSYM(0, 1, NEW_LIST(node, loc), loc);
25344 break;
25345 }
25346 return node;
25347}
25348
25349static int
25350nd_type_st_key_enable_p(NODE *node)
25351{
25352 switch (nd_type(node)) {
25353 case NODE_INTEGER:
25354 case NODE_FLOAT:
25355 case NODE_RATIONAL:
25356 case NODE_IMAGINARY:
25357 case NODE_STR:
25358 case NODE_SYM:
25359 case NODE_REGX:
25360 case NODE_LINE:
25361 case NODE_FILE:
25362 case NODE_ENCODING:
25363 return true;
25364 default:
25365 return false;
25366 }
25367}
25368
25369static VALUE
25370nd_value(struct parser_params *p, NODE *node)
25371{
25372 switch (nd_type(node)) {
25373 case NODE_STR:
25374 return rb_node_str_string_val(node);
25375 case NODE_INTEGER:
25376 return rb_node_integer_literal_val(node);
25377 case NODE_FLOAT:
25378 return rb_node_float_literal_val(node);
25379 case NODE_RATIONAL:
25380 return rb_node_rational_literal_val(node);
25381 case NODE_IMAGINARY:
25382 return rb_node_imaginary_literal_val(node);
25383 case NODE_SYM:
25384 return rb_node_sym_string_val(node);
25385 case NODE_REGX:
25386 return rb_node_regx_string_val(node);
25387 case NODE_LINE:
25388 return rb_node_line_lineno_val(node);
25389 case NODE_ENCODING:
25390 return rb_node_encoding_val(node);
25391 case NODE_FILE:
25392 return rb_node_file_path_val(node);
25393 default:
25394 rb_bug("unexpected node: %s", ruby_node_name(nd_type(node)));
25396 }
25397}
25398
25399static void
25400warn_duplicate_keys(struct parser_params *p, NODE *hash)
25401{
25402 /* See https://bugs.ruby-lang.org/issues/20331 for discussion about what is warned. */
25403 p->warn_duplicate_keys_table = st_init_table_with_size(&literal_type, RNODE_LIST(hash)->as.nd_alen / 2);
25404 while (hash && RNODE_LIST(hash)->nd_next) {
25405 NODE *head = RNODE_LIST(hash)->nd_head;
25406 NODE *value = RNODE_LIST(hash)->nd_next;
25407 NODE *next = RNODE_LIST(value)->nd_next;
25408 st_data_t key;
25409 st_data_t data;
25410
25411 /* keyword splat, e.g. {k: 1, **z, k: 2} */
25412 if (!head) {
25413 head = value;
25414 }
25415
25416 if (nd_type_st_key_enable_p(head)) {
25417 key = (st_data_t)head;
25418
25419 if (st_delete(p->warn_duplicate_keys_table, &key, &data)) {
25420 rb_warn2L(nd_line((NODE *)data),
25421 "key %+"PRIsWARN" is duplicated and overwritten on line %d",
25422 nd_value(p, head), WARN_I(nd_line(head)));
25423 }
25424 st_insert(p->warn_duplicate_keys_table, (st_data_t)key, (st_data_t)hash);
25425 }
25426 hash = next;
25427 }
25428 st_free_table(p->warn_duplicate_keys_table);
25429 p->warn_duplicate_keys_table = NULL;
25430}
25431
25432static NODE *
25433new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
25434{
25435 if (hash) warn_duplicate_keys(p, hash);
25436 return NEW_HASH(hash, loc);
25437}
25438
25439static void
25440error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
25441{
25442 if (is_private_local_id(p, id)) {
25443 return;
25444 }
25445 if (st_is_member(p->pvtbl, id)) {
25446 yyerror1(loc, "duplicated variable name");
25447 }
25448 else {
25449 st_insert(p->pvtbl, (st_data_t)id, 0);
25450 }
25451}
25452
25453static void
25454error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
25455{
25456 if (!p->pktbl) {
25457 p->pktbl = st_init_numtable();
25458 }
25459 else if (st_is_member(p->pktbl, key)) {
25460 yyerror1(loc, "duplicated key name");
25461 return;
25462 }
25463 st_insert(p->pktbl, (st_data_t)key, 0);
25464}
25465
25466static NODE *
25467new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
25468{
25469 return NEW_HASH(hash, loc);
25470}
25471
25472static NODE *
25473new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
25474{
25475 NODE *asgn;
25476
25477 if (lhs) {
25478 ID vid = get_nd_vid(p, lhs);
25479 YYLTYPE lhs_loc = lhs->nd_loc;
25480 if (op == tOROP) {
25481 set_nd_value(p, lhs, rhs);
25482 nd_set_loc(lhs, loc);
25483 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
25484 }
25485 else if (op == tANDOP) {
25486 set_nd_value(p, lhs, rhs);
25487 nd_set_loc(lhs, loc);
25488 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
25489 }
25490 else {
25491 asgn = lhs;
25492 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
25493 set_nd_value(p, asgn, rhs);
25494 nd_set_loc(asgn, loc);
25495 }
25496 }
25497 else {
25498 asgn = NEW_ERROR(loc);
25499 }
25500 return asgn;
25501}
25502
25503static NODE *
25504new_ary_op_assign(struct parser_params *p, NODE *ary,
25505 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc,
25506 const YYLTYPE *call_operator_loc, const YYLTYPE *opening_loc, const YYLTYPE *closing_loc, const YYLTYPE *binary_operator_loc)
25507{
25508 NODE *asgn;
25509
25510 aryset_check(p, args);
25511 args = make_list(args, args_loc);
25512 asgn = NEW_OP_ASGN1(ary, op, args, rhs, loc, call_operator_loc, opening_loc, closing_loc, binary_operator_loc);
25513 fixpos(asgn, ary);
25514 return asgn;
25515}
25516
25517static NODE *
25518new_attr_op_assign(struct parser_params *p, NODE *lhs,
25519 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc,
25520 const YYLTYPE *call_operator_loc, const YYLTYPE *message_loc, const YYLTYPE *binary_operator_loc)
25521{
25522 NODE *asgn;
25523
25524 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc, call_operator_loc, message_loc, binary_operator_loc);
25525 fixpos(asgn, lhs);
25526 return asgn;
25527}
25528
25529static NODE *
25530new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
25531{
25532 NODE *asgn;
25533
25534 if (lhs) {
25535 asgn = NEW_OP_CDECL(lhs, op, rhs, ctxt.shareable_constant_value, loc);
25536 }
25537 else {
25538 asgn = NEW_ERROR(loc);
25539 }
25540 fixpos(asgn, lhs);
25541 return asgn;
25542}
25543
25544static NODE *
25545const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
25546{
25547 if (p->ctxt.in_def) {
25548#ifndef RIPPER
25549 yyerror1(loc, "dynamic constant assignment");
25550#else
25551 set_value(assign_error(p, "dynamic constant assignment", p->s_lvalue));
25552#endif
25553 }
25554 return NEW_CDECL(0, 0, (path), p->ctxt.shareable_constant_value, loc);
25555}
25556
25557#ifdef RIPPER
25558static VALUE
25559assign_error(struct parser_params *p, const char *mesg, VALUE a)
25560{
25561 a = dispatch2(assign_error, ERR_MESG(), a);
25562 ripper_error(p);
25563 return a;
25564}
25565#endif
25566
25567static NODE *
25568new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
25569{
25570 NODE *result = head;
25571 if (rescue) {
25572 NODE *tmp = rescue_else ? rescue_else : rescue;
25573 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
25574
25575 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
25576 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
25577 }
25578 if (ensure) {
25579 result = NEW_ENSURE(result, ensure, loc);
25580 }
25581 fixpos(result, head);
25582 return result;
25583}
25584
25585static void
25586warn_unused_var(struct parser_params *p, struct local_vars *local)
25587{
25588 int cnt;
25589
25590 if (!local->used) return;
25591 cnt = local->used->pos;
25592 if (cnt != local->vars->pos) {
25593 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
25594 }
25595#ifndef RIPPER
25596 ID *v = local->vars->tbl;
25597 ID *u = local->used->tbl;
25598 for (int i = 0; i < cnt; ++i) {
25599 if (!v[i] || (u[i] & LVAR_USED)) continue;
25600 if (is_private_local_id(p, v[i])) continue;
25601 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
25602 }
25603#endif
25604}
25605
25606static void
25607local_push(struct parser_params *p, int toplevel_scope)
25608{
25609 struct local_vars *local;
25610 int inherits_dvars = toplevel_scope && compile_for_eval;
25611 int warn_unused_vars = RTEST(ruby_verbose);
25612
25613 local = ALLOC(struct local_vars);
25614 local->prev = p->lvtbl;
25615 local->args = vtable_alloc(0);
25616 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
25617#ifndef RIPPER
25618 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
25619 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
25620#endif
25621 local->numparam.outer = 0;
25622 local->numparam.inner = 0;
25623 local->numparam.current = 0;
25624 local->it = 0;
25625 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
25626
25627# if WARN_PAST_SCOPE
25628 local->past = 0;
25629# endif
25630 CMDARG_PUSH(0);
25631 COND_PUSH(0);
25632 p->lvtbl = local;
25633}
25634
25635static void
25636vtable_chain_free(struct parser_params *p, struct vtable *table)
25637{
25638 while (!DVARS_TERMINAL_P(table)) {
25639 struct vtable *cur_table = table;
25640 table = cur_table->prev;
25641 vtable_free(cur_table);
25642 }
25643}
25644
25645static void
25646local_free(struct parser_params *p, struct local_vars *local)
25647{
25648 vtable_chain_free(p, local->used);
25649
25650# if WARN_PAST_SCOPE
25651 vtable_chain_free(p, local->past);
25652# endif
25653
25654 vtable_chain_free(p, local->args);
25655 vtable_chain_free(p, local->vars);
25656
25657 ruby_sized_xfree(local, sizeof(struct local_vars));
25658}
25659
25660static void
25661local_pop(struct parser_params *p)
25662{
25663 struct local_vars *local = p->lvtbl->prev;
25664 if (p->lvtbl->used) {
25665 warn_unused_var(p, p->lvtbl);
25666 }
25667
25668 local_free(p, p->lvtbl);
25669 p->lvtbl = local;
25670
25671 CMDARG_POP();
25672 COND_POP();
25673}
25674
25675static rb_ast_id_table_t *
25676local_tbl(struct parser_params *p)
25677{
25678 int cnt_args = vtable_size(p->lvtbl->args);
25679 int cnt_vars = vtable_size(p->lvtbl->vars);
25680 int cnt = cnt_args + cnt_vars;
25681 int i, j;
25682 rb_ast_id_table_t *tbl;
25683
25684 if (cnt <= 0) return 0;
25685 tbl = rb_ast_new_local_table(p->ast, cnt);
25686 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
25687 /* remove IDs duplicated to warn shadowing */
25688 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
25689 ID id = p->lvtbl->vars->tbl[i];
25690 if (!vtable_included(p->lvtbl->args, id)) {
25691 tbl->ids[j++] = id;
25692 }
25693 }
25694 if (j < cnt) {
25695 tbl = rb_ast_resize_latest_local_table(p->ast, j);
25696 }
25697
25698 return tbl;
25699}
25700
25701static void
25702numparam_name(struct parser_params *p, ID id)
25703{
25704 if (!NUMPARAM_ID_P(id)) return;
25705 compile_error(p, "_%d is reserved for numbered parameter",
25706 NUMPARAM_ID_TO_IDX(id));
25707}
25708
25709static void
25710arg_var(struct parser_params *p, ID id)
25711{
25712 numparam_name(p, id);
25713 vtable_add(p->lvtbl->args, id);
25714}
25715
25716static void
25717local_var(struct parser_params *p, ID id)
25718{
25719 numparam_name(p, id);
25720 vtable_add(p->lvtbl->vars, id);
25721 if (p->lvtbl->used) {
25722 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
25723 }
25724}
25725
25726#ifndef RIPPER
25727int
25728rb_parser_local_defined(struct parser_params *p, ID id, const struct rb_iseq_struct *iseq)
25729{
25730 return rb_local_defined(id, iseq);
25731}
25732#endif
25733
25734static int
25735local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
25736{
25737 struct vtable *vars, *args, *used;
25738
25739 vars = p->lvtbl->vars;
25740 args = p->lvtbl->args;
25741 used = p->lvtbl->used;
25742
25743 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25744 vars = vars->prev;
25745 args = args->prev;
25746 if (used) used = used->prev;
25747 }
25748
25749 if (vars && vars->prev == DVARS_INHERIT) {
25750 return rb_parser_local_defined(p, id, p->parent_iseq);
25751 }
25752 else if (vtable_included(args, id)) {
25753 return 1;
25754 }
25755 else {
25756 int i = vtable_included(vars, id);
25757 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
25758 return i != 0;
25759 }
25760}
25761
25762static int
25763local_id(struct parser_params *p, ID id)
25764{
25765 return local_id_ref(p, id, NULL);
25766}
25767
25768static int
25769check_forwarding_args(struct parser_params *p)
25770{
25771 if (local_id(p, idFWD_ALL)) return TRUE;
25772 compile_error(p, "unexpected ...");
25773 return FALSE;
25774}
25775
25776static void
25777add_forwarding_args(struct parser_params *p)
25778{
25779 arg_var(p, idFWD_REST);
25780#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25781 arg_var(p, idFWD_KWREST);
25782#endif
25783 arg_var(p, idFWD_BLOCK);
25784 arg_var(p, idFWD_ALL);
25785}
25786
25787static void
25788forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var)
25789{
25790 bool conflict = false;
25791
25792 struct vtable *vars, *args;
25793
25794 vars = p->lvtbl->vars;
25795 args = p->lvtbl->args;
25796
25797 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25798 conflict |= (vtable_included(args, arg) && !(all && vtable_included(args, all)));
25799 vars = vars->prev;
25800 args = args->prev;
25801 }
25802
25803 bool found = false;
25804 if (vars && vars->prev == DVARS_INHERIT && !found) {
25805 found = (rb_parser_local_defined(p, arg, p->parent_iseq) &&
25806 !(all && rb_parser_local_defined(p, all, p->parent_iseq)));
25807 }
25808 else {
25809 found = (vtable_included(args, arg) &&
25810 !(all && vtable_included(args, all)));
25811 }
25812
25813 if (!found) {
25814 compile_error(p, "no anonymous %s parameter", var);
25815 }
25816 else if (conflict) {
25817 compile_error(p, "anonymous %s parameter is also used within block", var);
25818 }
25819}
25820
25821static NODE *
25822new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
25823{
25824 NODE *rest = NEW_LVAR(idFWD_REST, loc);
25825#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25826 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
25827#endif
25828 rb_node_block_pass_t *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), argsloc, &NULL_LOC);
25829 NODE *args = leading ? rest_arg_append(p, leading, rest, argsloc) : NEW_SPLAT(rest, loc, &NULL_LOC);
25830 block->forwarding = TRUE;
25831#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25832 args = arg_append(p, args, new_hash(p, kwrest, loc), argsloc);
25833#endif
25834 return arg_blk_pass(args, block);
25835}
25836
25837static NODE *
25838numparam_push(struct parser_params *p)
25839{
25840 struct local_vars *local = p->lvtbl;
25841 NODE *inner = local->numparam.inner;
25842 if (!local->numparam.outer) {
25843 local->numparam.outer = local->numparam.current;
25844 }
25845 local->numparam.inner = 0;
25846 local->numparam.current = 0;
25847 local->it = 0;
25848 return inner;
25849}
25850
25851static void
25852numparam_pop(struct parser_params *p, NODE *prev_inner)
25853{
25854 struct local_vars *local = p->lvtbl;
25855 if (prev_inner) {
25856 /* prefer first one */
25857 local->numparam.inner = prev_inner;
25858 }
25859 else if (local->numparam.current) {
25860 /* current and inner are exclusive */
25861 local->numparam.inner = local->numparam.current;
25862 }
25863 if (p->max_numparam > NO_PARAM) {
25864 /* current and outer are exclusive */
25865 local->numparam.current = local->numparam.outer;
25866 local->numparam.outer = 0;
25867 }
25868 else {
25869 /* no numbered parameter */
25870 local->numparam.current = 0;
25871 }
25872 local->it = 0;
25873}
25874
25875static const struct vtable *
25876dyna_push(struct parser_params *p)
25877{
25878 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
25879 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
25880 if (p->lvtbl->used) {
25881 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
25882 }
25883 return p->lvtbl->args;
25884}
25885
25886static void
25887dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
25888{
25889 struct vtable *tmp = *vtblp;
25890 *vtblp = tmp->prev;
25891# if WARN_PAST_SCOPE
25892 if (p->past_scope_enabled) {
25893 tmp->prev = p->lvtbl->past;
25894 p->lvtbl->past = tmp;
25895 return;
25896 }
25897# endif
25898 vtable_free(tmp);
25899}
25900
25901static void
25902dyna_pop_1(struct parser_params *p)
25903{
25904 struct vtable *tmp;
25905
25906 if ((tmp = p->lvtbl->used) != 0) {
25907 warn_unused_var(p, p->lvtbl);
25908 p->lvtbl->used = p->lvtbl->used->prev;
25909 vtable_free(tmp);
25910 }
25911 dyna_pop_vtable(p, &p->lvtbl->args);
25912 dyna_pop_vtable(p, &p->lvtbl->vars);
25913}
25914
25915static void
25916dyna_pop(struct parser_params *p, const struct vtable *lvargs)
25917{
25918 while (p->lvtbl->args != lvargs) {
25919 dyna_pop_1(p);
25920 if (!p->lvtbl->args) {
25921 struct local_vars *local = p->lvtbl->prev;
25922 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
25923 p->lvtbl = local;
25924 }
25925 }
25926 dyna_pop_1(p);
25927}
25928
25929static int
25930dyna_in_block(struct parser_params *p)
25931{
25932 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
25933}
25934
25935#ifndef RIPPER
25936int
25937dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
25938{
25939 struct vtable *vars, *args, *used;
25940 int i;
25941
25942 args = p->lvtbl->args;
25943 vars = p->lvtbl->vars;
25944 used = p->lvtbl->used;
25945
25946 while (!DVARS_TERMINAL_P(vars)) {
25947 if (vtable_included(args, id)) {
25948 return 1;
25949 }
25950 if ((i = vtable_included(vars, id)) != 0) {
25951 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
25952 return 1;
25953 }
25954 args = args->prev;
25955 vars = vars->prev;
25956 if (!vidrefp) used = 0;
25957 if (used) used = used->prev;
25958 }
25959
25960 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
25961 return rb_dvar_defined(id, p->parent_iseq);
25962 }
25963
25964 return 0;
25965}
25966#endif
25967
25968static int
25969dvar_defined(struct parser_params *p, ID id)
25970{
25971 return dvar_defined_ref(p, id, NULL);
25972}
25973
25974static int
25975dvar_curr(struct parser_params *p, ID id)
25976{
25977 return (vtable_included(p->lvtbl->args, id) ||
25978 vtable_included(p->lvtbl->vars, id));
25979}
25980
25981static void
25982reg_fragment_enc_error(struct parser_params* p, rb_parser_string_t *str, int c)
25983{
25984 compile_error(p,
25985 "regexp encoding option '%c' differs from source encoding '%s'",
25986 c, rb_enc_name(rb_parser_str_get_encoding(str)));
25987}
25988
25989#ifndef RIPPER
25990static rb_encoding *
25991find_enc(struct parser_params* p, const char *name)
25992{
25993 int idx = rb_enc_find_index(name);
25994 if (idx < 0) {
25995 rb_bug("unknown encoding name: %s", name);
25996 }
25997
25998 return rb_enc_from_index(idx);
25999}
26000
26001static rb_encoding *
26002kcode_to_enc(struct parser_params* p, int kcode)
26003{
26004 rb_encoding *enc;
26005
26006 switch (kcode) {
26007 case ENC_ASCII8BIT:
26008 enc = rb_ascii8bit_encoding();
26009 break;
26010 case ENC_EUC_JP:
26011 enc = find_enc(p, "EUC-JP");
26012 break;
26013 case ENC_Windows_31J:
26014 enc = find_enc(p, "Windows-31J");
26015 break;
26016 case ENC_UTF8:
26017 enc = rb_utf8_encoding();
26018 break;
26019 default:
26020 enc = NULL;
26021 break;
26022 }
26023
26024 return enc;
26025}
26026
26027int
26028rb_reg_fragment_setenc(struct parser_params* p, rb_parser_string_t *str, int options)
26029{
26030 int c = RE_OPTION_ENCODING_IDX(options);
26031
26032 if (c) {
26033 int opt, idx;
26034 rb_encoding *enc;
26035
26036 char_to_option_kcode(c, &opt, &idx);
26037 enc = kcode_to_enc(p, idx);
26038 if (enc != rb_parser_str_get_encoding(str) &&
26039 !rb_parser_is_ascii_string(p, str)) {
26040 goto error;
26041 }
26042 rb_parser_string_set_encoding(str, enc);
26043 }
26044 else if (RE_OPTION_ENCODING_NONE(options)) {
26045 if (!PARSER_ENCODING_IS_ASCII8BIT(p, str) &&
26046 !rb_parser_is_ascii_string(p, str)) {
26047 c = 'n';
26048 goto error;
26049 }
26050 rb_parser_enc_associate(p, str, rb_ascii8bit_encoding());
26051 }
26052 else if (rb_is_usascii_enc(p->enc)) {
26053 if (!rb_parser_is_ascii_string(p, str)) {
26054 /* raise in re.c */
26055 rb_parser_enc_associate(p, str, rb_usascii_encoding());
26056 }
26057 else {
26058 rb_parser_enc_associate(p, str, rb_ascii8bit_encoding());
26059 }
26060 }
26061 return 0;
26062
26063 error:
26064 return c;
26065}
26066#endif
26067
26068static void
26069reg_fragment_setenc(struct parser_params* p, rb_parser_string_t *str, int options)
26070{
26071 int c = rb_reg_fragment_setenc(p, str, options);
26072 if (c) reg_fragment_enc_error(p, str, c);
26073}
26074
26075#ifndef RIPPER
26076int
26077reg_fragment_check(struct parser_params* p, rb_parser_string_t *str, int options)
26078{
26079 VALUE err, str2;
26080 reg_fragment_setenc(p, str, options);
26081 /* TODO */
26082 str2 = rb_str_new_parser_string(str);
26083 err = rb_reg_check_preprocess(str2);
26084 if (err != Qnil) {
26085 err = rb_obj_as_string(err);
26086 compile_error(p, "%"PRIsVALUE, err);
26087 return 0;
26088 }
26089 return 1;
26090}
26091#endif
26092
26093#ifndef UNIVERSAL_PARSER
26094typedef struct {
26095 struct parser_params* parser;
26096 rb_encoding *enc;
26097 NODE *succ_block;
26098 const YYLTYPE *loc;
26099 rb_parser_assignable_func assignable;
26101
26102static int
26103reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
26104 int back_num, int *back_refs, OnigRegex regex, void *arg0)
26105{
26107 struct parser_params* p = arg->parser;
26108 rb_encoding *enc = arg->enc;
26109 long len = name_end - name;
26110 const char *s = (const char *)name;
26111
26112 return rb_reg_named_capture_assign_iter_impl(p, s, len, enc, &arg->succ_block, arg->loc, arg->assignable);
26113}
26114
26115static NODE *
26116reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc, rb_parser_assignable_func assignable)
26117{
26119
26120 arg.parser = p;
26121 arg.enc = rb_enc_get(regexp);
26122 arg.succ_block = 0;
26123 arg.loc = loc;
26124 arg.assignable = assignable;
26125 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
26126
26127 if (!arg.succ_block) return 0;
26128 return RNODE_BLOCK(arg.succ_block)->nd_next;
26129}
26130#endif
26131
26132#ifndef RIPPER
26133NODE *
26134rb_parser_assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
26135{
26136 return assignable(p, id, val, loc);
26137}
26138
26139int
26140rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len,
26141 rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc, rb_parser_assignable_func assignable)
26142{
26143 ID var;
26144 NODE *node, *succ;
26145
26146 if (!len) return ST_CONTINUE;
26147 if (!VALID_SYMNAME_P(s, len, enc, ID_LOCAL))
26148 return ST_CONTINUE;
26149
26150 var = intern_cstr(s, len, enc);
26151 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
26152 if (!lvar_defined(p, var)) return ST_CONTINUE;
26153 }
26154 node = node_assign(p, assignable(p, var, 0, loc), NEW_SYM(rb_id2str(var), loc), NO_LEX_CTXT, loc);
26155 succ = *succ_block;
26156 if (!succ) succ = NEW_ERROR(loc);
26157 succ = block_append(p, succ, node);
26158 *succ_block = succ;
26159 return ST_CONTINUE;
26160}
26161#endif
26162
26163static VALUE
26164parser_reg_compile(struct parser_params* p, rb_parser_string_t *str, int options)
26165{
26166 VALUE str2;
26167 reg_fragment_setenc(p, str, options);
26168 str2 = rb_str_new_parser_string(str);
26169 return rb_parser_reg_compile(p, str2, options);
26170}
26171
26172#ifndef RIPPER
26173VALUE
26174rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
26175{
26176 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
26177}
26178#endif
26179
26180static VALUE
26181reg_compile(struct parser_params* p, rb_parser_string_t *str, int options)
26182{
26183 VALUE re;
26184 VALUE err;
26185
26186 err = rb_errinfo();
26187 re = parser_reg_compile(p, str, options);
26188 if (NIL_P(re)) {
26189 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
26190 rb_set_errinfo(err);
26191 compile_error(p, "%"PRIsVALUE, m);
26192 return Qnil;
26193 }
26194 return re;
26195}
26196
26197#ifndef RIPPER
26198void
26199rb_ruby_parser_set_options(struct parser_params *p, int print, int loop, int chomp, int split)
26200{
26201 p->do_print = print;
26202 p->do_loop = loop;
26203 p->do_chomp = chomp;
26204 p->do_split = split;
26205}
26206
26207static NODE *
26208parser_append_options(struct parser_params *p, NODE *node)
26209{
26210 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
26211 const YYLTYPE *const LOC = &default_location;
26212
26213 if (p->do_print) {
26214 NODE *print = (NODE *)NEW_FCALL(rb_intern("print"),
26215 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
26216 LOC);
26217 node = block_append(p, node, print);
26218 }
26219
26220 if (p->do_loop) {
26221 NODE *irs = NEW_LIST(NEW_GVAR(rb_intern("$/"), LOC), LOC);
26222
26223 if (p->do_split) {
26224 ID ifs = rb_intern("$;");
26225 ID fields = rb_intern("$F");
26226 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
26227 NODE *split = NEW_GASGN(fields,
26228 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
26229 rb_intern("split"), args, LOC),
26230 LOC);
26231 node = block_append(p, split, node);
26232 }
26233 if (p->do_chomp) {
26234 NODE *chomp = NEW_SYM(rb_str_new_cstr("chomp"), LOC);
26235 chomp = list_append(p, NEW_LIST(chomp, LOC), NEW_TRUE(LOC));
26236 irs = list_append(p, irs, NEW_HASH(chomp, LOC));
26237 }
26238
26239 node = NEW_WHILE((NODE *)NEW_FCALL(idGets, irs, LOC), node, 1, LOC, &NULL_LOC, &NULL_LOC);
26240 }
26241
26242 return node;
26243}
26244
26245void
26246rb_init_parse(void)
26247{
26248 /* just to suppress unused-function warnings */
26249 (void)nodetype;
26250 (void)nodeline;
26251}
26252
26253ID
26254internal_id(struct parser_params *p)
26255{
26256 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
26257}
26258#endif /* !RIPPER */
26259
26260static void
26261parser_initialize(struct parser_params *p)
26262{
26263 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
26264 p->command_start = TRUE;
26265 p->ruby_sourcefile_string = Qnil;
26266 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
26267 string_buffer_init(p);
26268 p->node_id = 0;
26269 p->delayed.token = NULL;
26270 p->frozen_string_literal = -1; /* not specified */
26271#ifndef RIPPER
26272 p->error_buffer = Qfalse;
26273 p->end_expect_token_locations = NULL;
26274 p->token_id = 0;
26275 p->tokens = NULL;
26276#else
26277 p->result = Qnil;
26278 p->parsing_thread = Qnil;
26279 p->s_value = Qnil;
26280 p->s_lvalue = Qnil;
26281 p->s_value_stack = rb_ary_new();
26282#endif
26283 p->debug_buffer = Qnil;
26284 p->debug_output = rb_ractor_stdout();
26285 p->enc = rb_utf8_encoding();
26286 p->exits = 0;
26287}
26288
26289#ifdef RIPPER
26290#define rb_ruby_parser_mark ripper_parser_mark
26291#define rb_ruby_parser_free ripper_parser_free
26292#define rb_ruby_parser_memsize ripper_parser_memsize
26293#endif
26294
26295void
26296rb_ruby_parser_mark(void *ptr)
26297{
26298 struct parser_params *p = (struct parser_params*)ptr;
26299
26300 rb_gc_mark(p->ruby_sourcefile_string);
26301#ifndef RIPPER
26302 rb_gc_mark(p->error_buffer);
26303#else
26304 rb_gc_mark(p->value);
26305 rb_gc_mark(p->result);
26306 rb_gc_mark(p->parsing_thread);
26307 rb_gc_mark(p->s_value);
26308 rb_gc_mark(p->s_lvalue);
26309 rb_gc_mark(p->s_value_stack);
26310#endif
26311 rb_gc_mark(p->debug_buffer);
26312 rb_gc_mark(p->debug_output);
26313}
26314
26315void
26316rb_ruby_parser_free(void *ptr)
26317{
26318 struct parser_params *p = (struct parser_params*)ptr;
26319 struct local_vars *local, *prev;
26320
26321 if (p->ast) {
26322 rb_ast_free(p->ast);
26323 }
26324
26325 if (p->warn_duplicate_keys_table) {
26326 st_free_table(p->warn_duplicate_keys_table);
26327 }
26328
26329#ifndef RIPPER
26330 if (p->tokens) {
26331 rb_parser_ary_free(p, p->tokens);
26332 }
26333#endif
26334
26335 if (p->tokenbuf) {
26336 ruby_sized_xfree(p->tokenbuf, p->toksiz);
26337 }
26338
26339 for (local = p->lvtbl; local; local = prev) {
26340 prev = local->prev;
26341 local_free(p, local);
26342 }
26343
26344 {
26345 token_info *ptinfo;
26346 while ((ptinfo = p->token_info) != 0) {
26347 p->token_info = ptinfo->next;
26348 xfree(ptinfo);
26349 }
26350 }
26351 string_buffer_free(p);
26352
26353 if (p->pvtbl) {
26354 st_free_table(p->pvtbl);
26355 }
26356
26357 if (CASE_LABELS_ENABLED_P(p->case_labels)) {
26358 st_free_table(p->case_labels);
26359 }
26360
26361 xfree(p->lex.strterm);
26362 p->lex.strterm = 0;
26363
26364 xfree(ptr);
26365}
26366
26367size_t
26368rb_ruby_parser_memsize(const void *ptr)
26369{
26370 struct parser_params *p = (struct parser_params*)ptr;
26371 struct local_vars *local;
26372 size_t size = sizeof(*p);
26373
26374 size += p->toksiz;
26375 for (local = p->lvtbl; local; local = local->prev) {
26376 size += sizeof(*local);
26377 if (local->vars) size += local->vars->capa * sizeof(ID);
26378 }
26379 return size;
26380}
26381
26382#ifndef RIPPER
26383#undef rb_reserved_word
26384
26385const struct kwtable *
26386rb_reserved_word(const char *str, unsigned int len)
26387{
26388 return reserved_word(str, len);
26389}
26390
26391#ifdef UNIVERSAL_PARSER
26392rb_parser_t *
26393rb_ruby_parser_allocate(const rb_parser_config_t *config)
26394{
26395 /* parser_initialize expects fields to be set to 0 */
26396 rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t));
26397 p->config = config;
26398 return p;
26399}
26400
26401rb_parser_t *
26402rb_ruby_parser_new(const rb_parser_config_t *config)
26403{
26404 /* parser_initialize expects fields to be set to 0 */
26405 rb_parser_t *p = rb_ruby_parser_allocate(config);
26406 parser_initialize(p);
26407 return p;
26408}
26409#else
26410rb_parser_t *
26411rb_ruby_parser_allocate(void)
26412{
26413 /* parser_initialize expects fields to be set to 0 */
26414 rb_parser_t *p = (rb_parser_t *)ruby_xcalloc(1, sizeof(rb_parser_t));
26415 return p;
26416}
26417
26418rb_parser_t *
26419rb_ruby_parser_new(void)
26420{
26421 /* parser_initialize expects fields to be set to 0 */
26422 rb_parser_t *p = rb_ruby_parser_allocate();
26423 parser_initialize(p);
26424 return p;
26425}
26426#endif
26427
26428rb_parser_t *
26429rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main)
26430{
26431 p->error_buffer = main ? Qfalse : Qnil;
26432 p->parent_iseq = base;
26433 return p;
26434}
26435
26436void
26437rb_ruby_parser_set_script_lines(rb_parser_t *p)
26438{
26439 p->debug_lines = rb_parser_ary_new_capa_for_script_line(p, 10);
26440}
26441
26442void
26443rb_ruby_parser_error_tolerant(rb_parser_t *p)
26444{
26445 p->error_tolerant = 1;
26446}
26447
26448void
26449rb_ruby_parser_keep_tokens(rb_parser_t *p)
26450{
26451 p->keep_tokens = 1;
26452 p->tokens = rb_parser_ary_new_capa_for_ast_token(p, 10);
26453}
26454
26455rb_encoding *
26456rb_ruby_parser_encoding(rb_parser_t *p)
26457{
26458 return p->enc;
26459}
26460
26461int
26462rb_ruby_parser_end_seen_p(rb_parser_t *p)
26463{
26464 return p->ruby__end__seen;
26465}
26466
26467int
26468rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag)
26469{
26470 p->debug = flag;
26471 return flag;
26472}
26473#endif /* !RIPPER */
26474
26475#ifdef RIPPER
26476int
26477rb_ruby_parser_get_yydebug(rb_parser_t *p)
26478{
26479 return p->debug;
26480}
26481
26482void
26483rb_ruby_parser_set_value(rb_parser_t *p, VALUE value)
26484{
26485 p->value = value;
26486}
26487
26488int
26489rb_ruby_parser_error_p(rb_parser_t *p)
26490{
26491 return p->error_p;
26492}
26493
26494VALUE
26495rb_ruby_parser_debug_output(rb_parser_t *p)
26496{
26497 return p->debug_output;
26498}
26499
26500void
26501rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output)
26502{
26503 p->debug_output = output;
26504}
26505
26506VALUE
26507rb_ruby_parser_parsing_thread(rb_parser_t *p)
26508{
26509 return p->parsing_thread;
26510}
26511
26512void
26513rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread)
26514{
26515 p->parsing_thread = parsing_thread;
26516}
26517
26518void
26519rb_ruby_parser_ripper_initialize(rb_parser_t *p, rb_parser_lex_gets_func *gets, rb_parser_input_data input, VALUE sourcefile_string, const char *sourcefile, int sourceline)
26520{
26521 p->lex.gets = gets;
26522 p->lex.input = input;
26523 p->eofp = 0;
26524 p->ruby_sourcefile_string = sourcefile_string;
26525 p->ruby_sourcefile = sourcefile;
26526 p->ruby_sourceline = sourceline;
26527}
26528
26529VALUE
26530rb_ruby_parser_result(rb_parser_t *p)
26531{
26532 return p->result;
26533}
26534
26535rb_encoding *
26536rb_ruby_parser_enc(rb_parser_t *p)
26537{
26538 return p->enc;
26539}
26540
26541VALUE
26542rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p)
26543{
26544 return p->ruby_sourcefile_string;
26545}
26546
26547int
26548rb_ruby_parser_ruby_sourceline(rb_parser_t *p)
26549{
26550 return p->ruby_sourceline;
26551}
26552
26553int
26554rb_ruby_parser_lex_state(rb_parser_t *p)
26555{
26556 return p->lex.state;
26557}
26558
26559void
26560rb_ruby_ripper_parse0(rb_parser_t *p)
26561{
26562 parser_prepare(p);
26563 p->ast = rb_ast_new();
26564 ripper_yyparse((void*)p);
26565 rb_ast_free(p->ast);
26566 p->ast = 0;
26567 p->eval_tree = 0;
26568 p->eval_tree_begin = 0;
26569}
26570
26571int
26572rb_ruby_ripper_dedent_string(rb_parser_t *p, rb_parser_string_t *string, int width)
26573{
26574 return dedent_string(p, string, width);
26575}
26576
26577int
26578rb_ruby_ripper_initialized_p(rb_parser_t *p)
26579{
26580 return p->lex.input != 0;
26581}
26582
26583void
26584rb_ruby_ripper_parser_initialize(rb_parser_t *p)
26585{
26586 parser_initialize(p);
26587}
26588
26589long
26590rb_ruby_ripper_column(rb_parser_t *p)
26591{
26592 return p->lex.ptok - p->lex.pbeg;
26593}
26594
26595long
26596rb_ruby_ripper_token_len(rb_parser_t *p)
26597{
26598 return p->lex.pcur - p->lex.ptok;
26599}
26600
26601rb_parser_string_t *
26602rb_ruby_ripper_lex_lastline(rb_parser_t *p)
26603{
26604 return p->lex.lastline;
26605}
26606
26607VALUE
26608rb_ruby_ripper_lex_state_name(struct parser_params *p, int state)
26609{
26610 return rb_parser_lex_state_name(p, (enum lex_state_e)state);
26611}
26612
26613#ifdef UNIVERSAL_PARSER
26614rb_parser_t *
26615rb_ripper_parser_params_allocate(const rb_parser_config_t *config)
26616{
26617 rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t));
26618 p->config = config;
26619 return p;
26620}
26621#endif
26622
26623struct parser_params*
26624rb_ruby_ripper_parser_allocate(void)
26625{
26626 return (struct parser_params *)ruby_xcalloc(1, sizeof(struct parser_params));
26627}
26628#endif /* RIPPER */
26629
26630#ifndef RIPPER
26631void
26632rb_parser_printf(struct parser_params *p, const char *fmt, ...)
26633{
26634 va_list ap;
26635 VALUE mesg = p->debug_buffer;
26636
26637 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
26638 va_start(ap, fmt);
26639 rb_str_vcatf(mesg, fmt, ap);
26640 va_end(ap);
26641 if (char_at_end(p, mesg, 0) == '\n') {
26642 rb_io_write(p->debug_output, mesg);
26643 p->debug_buffer = Qnil;
26644 }
26645}
26646
26647static void
26648parser_compile_error(struct parser_params *p, const rb_code_location_t *loc, const char *fmt, ...)
26649{
26650 va_list ap;
26651 int lineno, column;
26652
26653 if (loc) {
26654 lineno = loc->end_pos.lineno;
26655 column = loc->end_pos.column;
26656 }
26657 else {
26658 lineno = p->ruby_sourceline;
26659 column = rb_long2int(p->lex.pcur - p->lex.pbeg);
26660 }
26661
26662 rb_io_flush(p->debug_output);
26663 p->error_p = 1;
26664 va_start(ap, fmt);
26665 p->error_buffer =
26666 rb_syntax_error_append(p->error_buffer,
26667 p->ruby_sourcefile_string,
26668 lineno, column,
26669 p->enc, fmt, ap);
26670 va_end(ap);
26671}
26672
26673static size_t
26674count_char(const char *str, int c)
26675{
26676 int n = 0;
26677 while (str[n] == c) ++n;
26678 return n;
26679}
26680
26681/*
26682 * strip enclosing double-quotes, same as the default yytnamerr except
26683 * for that single-quotes matching back-quotes do not stop stripping.
26684 *
26685 * "\"`class' keyword\"" => "`class' keyword"
26686 */
26687size_t
26688rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
26689{
26690 if (*yystr == '"') {
26691 size_t yyn = 0, bquote = 0;
26692 const char *yyp = yystr;
26693
26694 while (*++yyp) {
26695 switch (*yyp) {
26696 case '\'':
26697 if (!bquote) {
26698 bquote = count_char(yyp+1, '\'') + 1;
26699 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
26700 yyn += bquote;
26701 yyp += bquote - 1;
26702 break;
26703 }
26704 else {
26705 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
26706 if (yyres) memcpy(yyres + yyn, yyp, bquote);
26707 yyn += bquote;
26708 yyp += bquote - 1;
26709 bquote = 0;
26710 break;
26711 }
26712 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
26713 if (yyres) memcpy(yyres + yyn, yyp, 3);
26714 yyn += 3;
26715 yyp += 2;
26716 break;
26717 }
26718 goto do_not_strip_quotes;
26719 }
26720
26721 case ',':
26722 goto do_not_strip_quotes;
26723
26724 case '\\':
26725 if (*++yyp != '\\')
26726 goto do_not_strip_quotes;
26727 /* Fall through. */
26728 default:
26729 if (yyres)
26730 yyres[yyn] = *yyp;
26731 yyn++;
26732 break;
26733
26734 case '"':
26735 case '\0':
26736 if (yyres)
26737 yyres[yyn] = '\0';
26738 return yyn;
26739 }
26740 }
26741 do_not_strip_quotes: ;
26742 }
26743
26744 if (!yyres) return strlen(yystr);
26745
26746 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
26747}
26748#endif
26749
26750#ifdef RIPPER
26751#define validate(x) (void)(x)
26752
26753static VALUE
26754ripper_dispatch0(struct parser_params *p, ID mid)
26755{
26756 return rb_funcall(p->value, mid, 0);
26757}
26758
26759static VALUE
26760ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
26761{
26762 validate(a);
26763 return rb_funcall(p->value, mid, 1, a);
26764}
26765
26766static VALUE
26767ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
26768{
26769 validate(a);
26770 validate(b);
26771 return rb_funcall(p->value, mid, 2, a, b);
26772}
26773
26774static VALUE
26775ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
26776{
26777 validate(a);
26778 validate(b);
26779 validate(c);
26780 return rb_funcall(p->value, mid, 3, a, b, c);
26781}
26782
26783static VALUE
26784ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
26785{
26786 validate(a);
26787 validate(b);
26788 validate(c);
26789 validate(d);
26790 return rb_funcall(p->value, mid, 4, a, b, c, d);
26791}
26792
26793static VALUE
26794ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
26795{
26796 validate(a);
26797 validate(b);
26798 validate(c);
26799 validate(d);
26800 validate(e);
26801 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
26802}
26803
26804static VALUE
26805ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
26806{
26807 validate(a);
26808 validate(b);
26809 validate(c);
26810 validate(d);
26811 validate(e);
26812 validate(f);
26813 validate(g);
26814 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
26815}
26816
26817void
26818ripper_error(struct parser_params *p)
26819{
26820 p->error_p = TRUE;
26821}
26822
26823VALUE
26824ripper_value(struct parser_params *p)
26825{
26826 (void)yystpcpy; /* may not used in newer bison */
26827
26828 return p->value;
26829}
26830
26831#endif /* RIPPER */
26832/*
26833 * Local variables:
26834 * mode: c
26835 * c-file-style: "ruby"
26836 * End:
26837 */
#define ENC_CODERANGE_7BIT
Old name of RUBY_ENC_CODERANGE_7BIT.
Definition coderange.h:180
#define REALLOC_N
Old name of RB_REALLOC_N.
Definition memory.h:403
#define ISSPACE
Old name of rb_isspace.
Definition ctype.h:88
#define ALLOC
Old name of RB_ALLOC.
Definition memory.h:400
#define xfree
Old name of ruby_xfree.
Definition xmalloc.h:58
#define xrealloc
Old name of ruby_xrealloc.
Definition xmalloc.h:56
#define UNREACHABLE_RETURN
Old name of RBIMPL_UNREACHABLE_RETURN.
Definition assume.h:29
#define ZALLOC
Old name of RB_ZALLOC.
Definition memory.h:402
#define ENC_CODERANGE_UNKNOWN
Old name of RUBY_ENC_CODERANGE_UNKNOWN.
Definition coderange.h:179
#define xmalloc
Old name of ruby_xmalloc.
Definition xmalloc.h:53
#define ISDIGIT
Old name of rb_isdigit.
Definition ctype.h:93
#define ASSUME
Old name of RBIMPL_ASSUME.
Definition assume.h:27
#define ALLOC_N
Old name of RB_ALLOC_N.
Definition memory.h:399
#define MBCLEN_CHARFOUND_LEN(ret)
Old name of ONIGENC_MBCLEN_CHARFOUND_LEN.
Definition encoding.h:517
#define STRCASECMP
Old name of st_locale_insensitive_strcasecmp.
Definition ctype.h:102
#define ISALPHA
Old name of rb_isalpha.
Definition ctype.h:92
#define STRNCASECMP
Old name of st_locale_insensitive_strncasecmp.
Definition ctype.h:103
#define ISASCII
Old name of rb_isascii.
Definition ctype.h:85
#define FIXNUM_MAX
Old name of RUBY_FIXNUM_MAX.
Definition fixnum.h:26
#define Qnil
Old name of RUBY_Qnil.
#define Qfalse
Old name of RUBY_Qfalse.
#define NIL_P
Old name of RB_NIL_P.
#define MBCLEN_CHARFOUND_P(ret)
Old name of ONIGENC_MBCLEN_CHARFOUND_P.
Definition encoding.h:516
#define ISPRINT
Old name of rb_isprint.
Definition ctype.h:86
#define xcalloc
Old name of ruby_xcalloc.
Definition xmalloc.h:55
#define ISXDIGIT
Old name of rb_isxdigit.
Definition ctype.h:94
#define ISCNTRL
Old name of rb_iscntrl.
Definition ctype.h:96
#define ISALNUM
Old name of rb_isalnum.
Definition ctype.h:91
#define ruby_verbose
This variable controls whether the interpreter is in debug mode.
Definition error.h:475
VALUE rb_eRuntimeError
RuntimeError exception.
Definition error.c:1428
VALUE rb_eSyntaxError
SyntaxError exception.
Definition error.c:1447
VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
Allocates, then initialises an instance of the given class.
Definition object.c:2138
Encoding relates APIs.
long rb_str_coderange_scan_restartable(const char *str, const char *end, rb_encoding *enc, int *cr)
Scans the passed string until it finds something odd.
Definition string.c:784
VALUE rb_funcall(VALUE recv, ID mid, int n,...)
Calls a method.
Definition vm_eval.c:1099
#define rb_str_new(str, len)
Allocates an instance of rb_cString.
Definition string.h:1498
#define rb_usascii_str_new(str, len)
Identical to rb_str_new, except it generates a string of "US ASCII" encoding.
Definition string.h:1532
VALUE rb_str_cat(VALUE dst, const char *src, long srclen)
Destructively appends the passed contents to the string.
Definition string.c:3444
#define rb_strlen_lit(str)
Length of a string literal.
Definition string.h:1692
#define rb_str_cat_cstr(buf, str)
Identical to rb_str_cat(), except it assumes the passed pointer is a pointer to a C string.
Definition string.h:1656
#define rb_str_new_cstr(str)
Identical to rb_str_new, except it assumes the passed pointer is a pointer to a C string.
Definition string.h:1514
ID rb_sym2id(VALUE obj)
Converts an instance of rb_cSymbol into an ID.
Definition symbol.c:917
int capa
Designed capacity of the buffer.
Definition io.h:11
int off
Offset inside of ptr.
Definition io.h:5
int len
Length of the buffer.
Definition io.h:8
#define strtod(s, e)
Just another name of ruby_strtod.
Definition util.h:223
#define strdup(s)
Just another name of ruby_strdup.
Definition util.h:187
#define rb_long2int
Just another name of rb_long2int_inline.
Definition long.h:62
#define MEMCPY(p1, p2, type, n)
Handy macro to call memcpy.
Definition memory.h:372
#define ALLOCA_N(type, n)
Definition memory.h:292
#define MEMZERO(p, type, n)
Handy macro to erase a region of memory.
Definition memory.h:360
#define RB_GC_GUARD(v)
Prevents premature destruction of local objects.
Definition memory.h:167
#define MEMMOVE(p1, p2, type, n)
Handy macro to call memmove.
Definition memory.h:384
VALUE type(ANYARGS)
ANYARGS-ed function type.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
#define RREGEXP_PTR(obj)
Convenient accessor macro.
Definition rregexp.h:45
#define StringValueCStr(v)
Identical to StringValuePtr, except it additionally checks for the contents for viability as a C stri...
Definition rstring.h:89
#define errno
Ractor-aware version of errno.
Definition ruby.h:388
#define RTEST
This is an old name of RB_TEST.
Definition lex.c:33
Definition st.h:79
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40
#define RBIMPL_WARNING_IGNORED(flag)
Suppresses a warning.
#define RBIMPL_WARNING_PUSH()
Pushes compiler warning state.
#define RBIMPL_WARNING_POP()
Pops compiler warning state.