Ruby 3.4.2p28 (2025-02-15 revision d2930f8e7a5db8a7337fa43370940381b420cc3e)
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);
1540int rb_parser_reg_fragment_check(struct parser_params*, rb_parser_string_t*, int, rb_parser_reg_fragment_error_func);
1541static void reg_fragment_error(struct parser_params *, VALUE);
1542#define reg_fragment_check(p, str, option) rb_parser_reg_fragment_check(p, str, option, reg_fragment_error)
1543
1544static int literal_concat0(struct parser_params *p, rb_parser_string_t *head, rb_parser_string_t *tail);
1545static NODE *heredoc_dedent(struct parser_params*,NODE*);
1546
1547static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
1548
1549#ifdef RIPPER
1550#define get_value(idx) (rb_ary_entry(p->s_value_stack, idx))
1551#define set_value(val) (p->s_lvalue = val)
1552static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
1553static int id_is_var(struct parser_params *p, ID id);
1554#endif
1555
1556RUBY_SYMBOL_EXPORT_BEGIN
1557VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
1558int rb_reg_fragment_setenc(struct parser_params*, rb_parser_string_t *, int);
1559enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
1560VALUE rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state);
1561void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
1562PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
1563YYLTYPE *rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
1564YYLTYPE *rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc);
1565YYLTYPE *rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc);
1566YYLTYPE *rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc);
1567YYLTYPE *rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc);
1568YYLTYPE *rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc);
1569void ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, rb_parser_string_t *str);
1570RUBY_SYMBOL_EXPORT_END
1571
1572static void flush_string_content(struct parser_params *p, rb_encoding *enc, size_t back);
1573static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
1574static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
1575static VALUE formal_argument_error(struct parser_params*, ID);
1576static ID shadowing_lvar(struct parser_params*,ID);
1577static void new_bv(struct parser_params*,ID);
1578
1579static void local_push(struct parser_params*,int);
1580static void local_pop(struct parser_params*);
1581static void local_var(struct parser_params*, ID);
1582static void arg_var(struct parser_params*, ID);
1583static int local_id(struct parser_params *p, ID id);
1584static int local_id_ref(struct parser_params*, ID, ID **);
1585#define internal_id rb_parser_internal_id
1586ID internal_id(struct parser_params*);
1587static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
1588static int check_forwarding_args(struct parser_params*);
1589static void add_forwarding_args(struct parser_params *p);
1590static void forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var);
1591
1592static const struct vtable *dyna_push(struct parser_params *);
1593static void dyna_pop(struct parser_params*, const struct vtable *);
1594static int dyna_in_block(struct parser_params*);
1595#define dyna_var(p, id) local_var(p, id)
1596static int dvar_defined(struct parser_params*, ID);
1597#define dvar_defined_ref rb_parser_dvar_defined_ref
1598int dvar_defined_ref(struct parser_params*, ID, ID**);
1599static int dvar_curr(struct parser_params*,ID);
1600
1601static int lvar_defined(struct parser_params*, ID);
1602
1603static NODE *numparam_push(struct parser_params *p);
1604static void numparam_pop(struct parser_params *p, NODE *prev_inner);
1605
1606#define METHOD_NOT '!'
1607
1608#define idFWD_REST '*'
1609#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
1610#define idFWD_BLOCK '&'
1611#define idFWD_ALL idDot3
1612#define arg_FWD_BLOCK idFWD_BLOCK
1613
1614#define RE_ONIG_OPTION_IGNORECASE 1
1615#define RE_ONIG_OPTION_EXTEND (RE_ONIG_OPTION_IGNORECASE<<1)
1616#define RE_ONIG_OPTION_MULTILINE (RE_ONIG_OPTION_EXTEND<<1)
1617#define RE_OPTION_ONCE (1<<16)
1618#define RE_OPTION_ENCODING_SHIFT 8
1619#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
1620#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
1621#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
1622#define RE_OPTION_MASK 0xff
1623#define RE_OPTION_ARG_ENCODING_NONE 32
1624
1625#define CHECK_LITERAL_WHEN (st_table *)1
1626#define CASE_LABELS_ENABLED_P(case_labels) (case_labels && case_labels != CHECK_LITERAL_WHEN)
1627
1628#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
1629RUBY_FUNC_EXPORTED size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
1630
1631#define TOKEN2ID(tok) ( \
1632 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
1633 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
1634 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
1635 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
1636 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
1637 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
1638 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
1639
1640/****** Ripper *******/
1641
1642#ifdef RIPPER
1643
1644#include "eventids1.h"
1645#include "eventids2.h"
1646
1647extern const struct ripper_parser_ids ripper_parser_ids;
1648
1649static VALUE ripper_dispatch0(struct parser_params*,ID);
1650static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
1651static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
1652static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
1653static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
1654static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
1655static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
1656void ripper_error(struct parser_params *p);
1657
1658#define dispatch0(n) ripper_dispatch0(p, RIPPER_ID(n))
1659#define dispatch1(n,a) ripper_dispatch1(p, RIPPER_ID(n), (a))
1660#define dispatch2(n,a,b) ripper_dispatch2(p, RIPPER_ID(n), (a), (b))
1661#define dispatch3(n,a,b,c) ripper_dispatch3(p, RIPPER_ID(n), (a), (b), (c))
1662#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, RIPPER_ID(n), (a), (b), (c), (d))
1663#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, RIPPER_ID(n), (a), (b), (c), (d), (e))
1664#define dispatch7(n,a,b,c,d,e,f,g) ripper_dispatch7(p, RIPPER_ID(n), (a), (b), (c), (d), (e), (f), (g))
1665
1666#define yyparse ripper_yyparse
1667
1668static VALUE
1669aryptn_pre_args(struct parser_params *p, VALUE pre_arg, VALUE pre_args)
1670{
1671 if (!NIL_P(pre_arg)) {
1672 if (!NIL_P(pre_args)) {
1673 rb_ary_unshift(pre_args, pre_arg);
1674 }
1675 else {
1676 pre_args = rb_ary_new_from_args(1, pre_arg);
1677 }
1678 }
1679 return pre_args;
1680}
1681
1682#define ID2VAL(id) STATIC_ID2SYM(id)
1683#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
1684#endif /* RIPPER */
1685
1686#define KWD2EID(t, v) keyword_##t
1687
1688static NODE *
1689new_scope_body(struct parser_params *p, rb_node_args_t *args, NODE *body, const YYLTYPE *loc)
1690{
1691 body = remove_begin(body);
1692 reduce_nodes(p, &body);
1693 NODE *n = NEW_SCOPE(args, body, loc);
1694 nd_set_line(n, loc->end_pos.lineno);
1695 set_line_body(body, loc->beg_pos.lineno);
1696 return n;
1697}
1698
1699static NODE *
1700rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1701 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1702{
1703 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1704 rescue = NEW_RESBODY(0, 0, remove_begin(rescue), 0, &loc);
1705 loc.beg_pos = arg_loc->beg_pos;
1706 return NEW_RESCUE(arg, rescue, 0, &loc);
1707}
1708
1709static NODE *add_block_exit(struct parser_params *p, NODE *node);
1710static rb_node_exits_t *init_block_exit(struct parser_params *p);
1711static rb_node_exits_t *allow_block_exit(struct parser_params *p);
1712static void restore_block_exit(struct parser_params *p, rb_node_exits_t *exits);
1713static void clear_block_exit(struct parser_params *p, bool error);
1714
1715static void
1716next_rescue_context(struct lex_context *next, const struct lex_context *outer, enum rescue_context def)
1717{
1718 next->in_rescue = outer->in_rescue == after_rescue ? after_rescue : def;
1719}
1720
1721static void
1722restore_defun(struct parser_params *p, rb_node_def_temp_t *temp)
1723{
1724 /* See: def_name action */
1725 struct lex_context ctxt = temp->save.ctxt;
1726 p->ctxt.in_def = ctxt.in_def;
1727 p->ctxt.shareable_constant_value = ctxt.shareable_constant_value;
1728 p->ctxt.in_rescue = ctxt.in_rescue;
1729 p->max_numparam = temp->save.max_numparam;
1730 numparam_pop(p, temp->save.numparam_save);
1731 clear_block_exit(p, true);
1732}
1733
1734static void
1735endless_method_name(struct parser_params *p, ID mid, const YYLTYPE *loc)
1736{
1737 if (is_attrset_id(mid)) {
1738 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1739 }
1740 token_info_drop(p, "def", loc->beg_pos);
1741}
1742
1743#define debug_token_line(p, name, line) do { \
1744 if (p->debug) { \
1745 const char *const pcur = p->lex.pcur; \
1746 const char *const ptok = p->lex.ptok; \
1747 rb_parser_printf(p, name ":%d (%d: %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF")\n", \
1748 line, p->ruby_sourceline, \
1749 ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur); \
1750 } \
1751 } while (0)
1752
1753#define begin_definition(k, loc_beg, loc_end) \
1754 do { \
1755 if (!(p->ctxt.in_class = (k)[0] != 0)) { \
1756 /* singleton class */ \
1757 p->ctxt.cant_return = !p->ctxt.in_def; \
1758 p->ctxt.in_def = 0; \
1759 } \
1760 else if (p->ctxt.in_def) { \
1761 YYLTYPE loc = code_loc_gen(loc_beg, loc_end); \
1762 yyerror1(&loc, k " definition in method body"); \
1763 } \
1764 else { \
1765 p->ctxt.cant_return = 1; \
1766 } \
1767 local_push(p, 0); \
1768 } while (0)
1769
1770#ifndef RIPPER
1771# define ifndef_ripper(x) (x)
1772# define ifdef_ripper(r,x) (x)
1773#else
1774# define ifndef_ripper(x)
1775# define ifdef_ripper(r,x) (r)
1776#endif
1777
1778# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1779# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1780# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1781# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1782# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1783# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1784# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1785# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1786# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1787# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1788# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1789# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1790# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1791# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1792# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1793# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1794# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1795# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1796# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1797# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1798#ifdef RIPPER
1799extern const ID id_warn, id_warning, id_gets, id_assoc;
1800# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1801# define WARN_S_L(s,l) STR_NEW(s,l)
1802# define WARN_S(s) STR_NEW2(s)
1803# define WARN_I(i) INT2NUM(i)
1804# define WARN_ID(i) rb_id2str(i)
1805# define PRIsWARN PRIsVALUE
1806# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1807# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1808# ifdef HAVE_VA_ARGS_MACRO
1809# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1810# else
1811# define WARN_CALL rb_funcall
1812# endif
1813# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1814# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1815# ifdef HAVE_VA_ARGS_MACRO
1816# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1817# else
1818# define WARNING_CALL rb_funcall
1819# endif
1820# define compile_error ripper_compile_error
1821#else
1822# define WARN_S_L(s,l) s
1823# define WARN_S(s) s
1824# define WARN_I(i) i
1825# define WARN_ID(i) rb_id2name(i)
1826# define PRIsWARN PRIsVALUE
1827# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1828# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1829# define WARN_CALL rb_compile_warn
1830# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1831# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1832# define WARNING_CALL rb_compile_warning
1833PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const rb_code_location_t *loc, const char *fmt, ...), 3, 4);
1834# define compile_error(p, ...) parser_compile_error(p, NULL, __VA_ARGS__)
1835#endif
1836
1837#define RNODE_EXITS(node) ((rb_node_exits_t*)(node))
1838
1839static NODE *
1840add_block_exit(struct parser_params *p, NODE *node)
1841{
1842 if (!node) {
1843 compile_error(p, "unexpected null node");
1844 return 0;
1845 }
1846 switch (nd_type(node)) {
1847 case NODE_BREAK: case NODE_NEXT: case NODE_REDO: break;
1848 default:
1849 compile_error(p, "add_block_exit: unexpected node: %s", parser_node_name(nd_type(node)));
1850 return node;
1851 }
1852 if (!p->ctxt.in_defined) {
1853 rb_node_exits_t *exits = p->exits;
1854 if (exits) {
1855 RNODE_EXITS(exits->nd_stts)->nd_chain = node;
1856 exits->nd_stts = node;
1857 }
1858 }
1859 return node;
1860}
1861
1862static rb_node_exits_t *
1863init_block_exit(struct parser_params *p)
1864{
1865 rb_node_exits_t *old = p->exits;
1866 rb_node_exits_t *exits = NODE_NEW_INTERNAL(NODE_EXITS, rb_node_exits_t);
1867 exits->nd_chain = 0;
1868 exits->nd_stts = RNODE(exits);
1869 p->exits = exits;
1870 return old;
1871}
1872
1873static rb_node_exits_t *
1874allow_block_exit(struct parser_params *p)
1875{
1876 rb_node_exits_t *exits = p->exits;
1877 p->exits = 0;
1878 return exits;
1879}
1880
1881static void
1882restore_block_exit(struct parser_params *p, rb_node_exits_t *exits)
1883{
1884 p->exits = exits;
1885}
1886
1887static void
1888clear_block_exit(struct parser_params *p, bool error)
1889{
1890 rb_node_exits_t *exits = p->exits;
1891 if (!exits) return;
1892 if (error) {
1893 for (NODE *e = RNODE(exits); (e = RNODE_EXITS(e)->nd_chain) != 0; ) {
1894 switch (nd_type(e)) {
1895 case NODE_BREAK:
1896 yyerror1(&e->nd_loc, "Invalid break");
1897 break;
1898 case NODE_NEXT:
1899 yyerror1(&e->nd_loc, "Invalid next");
1900 break;
1901 case NODE_REDO:
1902 yyerror1(&e->nd_loc, "Invalid redo");
1903 break;
1904 default:
1905 yyerror1(&e->nd_loc, "unexpected node");
1906 goto end_checks; /* no nd_chain */
1907 }
1908 }
1909 end_checks:;
1910 }
1911 exits->nd_stts = RNODE(exits);
1912 exits->nd_chain = 0;
1913}
1914
1915#define WARN_EOL(tok) \
1916 (looking_at_eol_p(p) ? \
1917 (void)rb_warning0("'" tok "' at the end of line without an expression") : \
1918 (void)0)
1919static int looking_at_eol_p(struct parser_params *p);
1920
1921static NODE *
1922get_nd_value(struct parser_params *p, NODE *node)
1923{
1924 switch (nd_type(node)) {
1925 case NODE_GASGN:
1926 return RNODE_GASGN(node)->nd_value;
1927 case NODE_IASGN:
1928 return RNODE_IASGN(node)->nd_value;
1929 case NODE_LASGN:
1930 return RNODE_LASGN(node)->nd_value;
1931 case NODE_DASGN:
1932 return RNODE_DASGN(node)->nd_value;
1933 case NODE_MASGN:
1934 return RNODE_MASGN(node)->nd_value;
1935 case NODE_CVASGN:
1936 return RNODE_CVASGN(node)->nd_value;
1937 case NODE_CDECL:
1938 return RNODE_CDECL(node)->nd_value;
1939 default:
1940 compile_error(p, "get_nd_value: unexpected node: %s", parser_node_name(nd_type(node)));
1941 return 0;
1942 }
1943}
1944
1945static void
1946set_nd_value(struct parser_params *p, NODE *node, NODE *rhs)
1947{
1948 switch (nd_type(node)) {
1949 case NODE_CDECL:
1950 RNODE_CDECL(node)->nd_value = rhs;
1951 break;
1952 case NODE_GASGN:
1953 RNODE_GASGN(node)->nd_value = rhs;
1954 break;
1955 case NODE_IASGN:
1956 RNODE_IASGN(node)->nd_value = rhs;
1957 break;
1958 case NODE_LASGN:
1959 RNODE_LASGN(node)->nd_value = rhs;
1960 break;
1961 case NODE_DASGN:
1962 RNODE_DASGN(node)->nd_value = rhs;
1963 break;
1964 case NODE_MASGN:
1965 RNODE_MASGN(node)->nd_value = rhs;
1966 break;
1967 case NODE_CVASGN:
1968 RNODE_CVASGN(node)->nd_value = rhs;
1969 break;
1970 default:
1971 compile_error(p, "set_nd_value: unexpected node: %s", parser_node_name(nd_type(node)));
1972 break;
1973 }
1974}
1975
1976static ID
1977get_nd_vid(struct parser_params *p, NODE *node)
1978{
1979 switch (nd_type(node)) {
1980 case NODE_CDECL:
1981 return RNODE_CDECL(node)->nd_vid;
1982 case NODE_GASGN:
1983 return RNODE_GASGN(node)->nd_vid;
1984 case NODE_IASGN:
1985 return RNODE_IASGN(node)->nd_vid;
1986 case NODE_LASGN:
1987 return RNODE_LASGN(node)->nd_vid;
1988 case NODE_DASGN:
1989 return RNODE_DASGN(node)->nd_vid;
1990 case NODE_CVASGN:
1991 return RNODE_CVASGN(node)->nd_vid;
1992 default:
1993 compile_error(p, "get_nd_vid: unexpected node: %s", parser_node_name(nd_type(node)));
1994 return 0;
1995 }
1996}
1997
1998static NODE *
1999get_nd_args(struct parser_params *p, NODE *node)
2000{
2001 switch (nd_type(node)) {
2002 case NODE_CALL:
2003 return RNODE_CALL(node)->nd_args;
2004 case NODE_OPCALL:
2005 return RNODE_OPCALL(node)->nd_args;
2006 case NODE_FCALL:
2007 return RNODE_FCALL(node)->nd_args;
2008 case NODE_QCALL:
2009 return RNODE_QCALL(node)->nd_args;
2010 case NODE_SUPER:
2011 return RNODE_SUPER(node)->nd_args;
2012 case NODE_VCALL:
2013 case NODE_ZSUPER:
2014 case NODE_YIELD:
2015 case NODE_RETURN:
2016 case NODE_BREAK:
2017 case NODE_NEXT:
2018 return 0;
2019 default:
2020 compile_error(p, "get_nd_args: unexpected node: %s", parser_node_name(nd_type(node)));
2021 return 0;
2022 }
2023}
2024
2025static st_index_t
2026djb2(const uint8_t *str, size_t len)
2027{
2028 st_index_t hash = 5381;
2029
2030 for (size_t i = 0; i < len; i++) {
2031 hash = ((hash << 5) + hash) + str[i];
2032 }
2033
2034 return hash;
2035}
2036
2037static st_index_t
2038parser_memhash(const void *ptr, long len)
2039{
2040 return djb2(ptr, len);
2041}
2042
2043#define PARSER_STRING_PTR(str) (str->ptr)
2044#define PARSER_STRING_LEN(str) (str->len)
2045#define PARSER_STRING_END(str) (&str->ptr[str->len])
2046#define STRING_SIZE(str) ((size_t)str->len + 1)
2047#define STRING_TERM_LEN(str) (1)
2048#define STRING_TERM_FILL(str) (str->ptr[str->len] = '\0')
2049#define PARSER_STRING_RESIZE_CAPA_TERM(p,str,capacity,termlen) do {\
2050 SIZED_REALLOC_N(str->ptr, char, (size_t)total + termlen, STRING_SIZE(str)); \
2051 str->len = total; \
2052} while (0)
2053#define STRING_SET_LEN(str, n) do { \
2054 (str)->len = (n); \
2055} while (0)
2056#define PARSER_STRING_GETMEM(str, ptrvar, lenvar) \
2057 ((ptrvar) = str->ptr, \
2058 (lenvar) = str->len)
2059
2060static inline int
2061parser_string_char_at_end(struct parser_params *p, rb_parser_string_t *str, int when_empty)
2062{
2063 return PARSER_STRING_LEN(str) > 0 ? (unsigned char)PARSER_STRING_END(str)[-1] : when_empty;
2064}
2065
2066static rb_parser_string_t *
2067rb_parser_string_new(rb_parser_t *p, const char *ptr, long len)
2068{
2069 rb_parser_string_t *str;
2070
2071 if (len < 0) {
2072 rb_bug("negative string size (or size too big): %ld", len);
2073 }
2074
2075 str = xcalloc(1, sizeof(rb_parser_string_t));
2076 str->ptr = xcalloc(len + 1, sizeof(char));
2077
2078 if (ptr) {
2079 memcpy(PARSER_STRING_PTR(str), ptr, len);
2080 }
2081 STRING_SET_LEN(str, len);
2082 STRING_TERM_FILL(str);
2083 return str;
2084}
2085
2086static rb_parser_string_t *
2087rb_parser_encoding_string_new(rb_parser_t *p, const char *ptr, long len, rb_encoding *enc)
2088{
2089 rb_parser_string_t *str = rb_parser_string_new(p, ptr, len);
2090 str->coderange = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2091 str->enc = enc;
2092 return str;
2093}
2094
2095#ifndef RIPPER
2096rb_parser_string_t *
2097rb_str_to_parser_string(rb_parser_t *p, VALUE str)
2098{
2099 /* Type check */
2100 rb_parser_string_t *ret = rb_parser_encoding_string_new(p, RSTRING_PTR(str), RSTRING_LEN(str), rb_enc_get(str));
2101 RB_GC_GUARD(str);
2102 return ret;
2103}
2104
2105void
2106rb_parser_string_free(rb_parser_t *p, rb_parser_string_t *str)
2107{
2108 if (!str) return;
2109 xfree(PARSER_STRING_PTR(str));
2110 xfree(str);
2111}
2112#endif
2113
2114static st_index_t
2115rb_parser_str_hash(rb_parser_string_t *str)
2116{
2117 return parser_memhash((const void *)PARSER_STRING_PTR(str), PARSER_STRING_LEN(str));
2118}
2119
2120static st_index_t
2121rb_char_p_hash(const char *c)
2122{
2123 return parser_memhash((const void *)c, strlen(c));
2124}
2125
2126static size_t
2127rb_parser_str_capacity(rb_parser_string_t *str, const int termlen)
2128{
2129 return PARSER_STRING_LEN(str);
2130}
2131
2132#ifndef RIPPER
2133static char *
2134rb_parser_string_end(rb_parser_string_t *str)
2135{
2136 return &str->ptr[str->len];
2137}
2138#endif
2139
2140static void
2141rb_parser_string_set_encoding(rb_parser_string_t *str, rb_encoding *enc)
2142{
2143 str->enc = enc;
2144}
2145
2146static rb_encoding *
2147rb_parser_str_get_encoding(rb_parser_string_t *str)
2148{
2149 return str->enc;
2150}
2151
2152#ifndef RIPPER
2153static bool
2154PARSER_ENCODING_IS_ASCII8BIT(struct parser_params *p, rb_parser_string_t *str)
2155{
2156 return rb_parser_str_get_encoding(str) == rb_ascii8bit_encoding();
2157}
2158#endif
2159
2160static int
2161PARSER_ENC_CODERANGE(rb_parser_string_t *str)
2162{
2163 return str->coderange;
2164}
2165
2166static void
2167PARSER_ENC_CODERANGE_SET(rb_parser_string_t *str, int coderange)
2168{
2169 str->coderange = coderange;
2170}
2171
2172static void
2173PARSER_ENCODING_CODERANGE_SET(rb_parser_string_t *str, rb_encoding *enc, enum rb_parser_string_coderange_type cr)
2174{
2175 rb_parser_string_set_encoding(str, enc);
2176 PARSER_ENC_CODERANGE_SET(str, cr);
2177}
2178
2179static void
2180PARSER_ENC_CODERANGE_CLEAR(rb_parser_string_t *str)
2181{
2182 str->coderange = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2183}
2184
2185static bool
2186PARSER_ENC_CODERANGE_ASCIIONLY(rb_parser_string_t *str)
2187{
2188 return PARSER_ENC_CODERANGE(str) == RB_PARSER_ENC_CODERANGE_7BIT;
2189}
2190
2191static bool
2192PARSER_ENC_CODERANGE_CLEAN_P(int cr)
2193{
2194 return cr == RB_PARSER_ENC_CODERANGE_7BIT || cr == RB_PARSER_ENC_CODERANGE_VALID;
2195}
2196
2197static const char *
2198rb_parser_search_nonascii(const char *p, const char *e)
2199{
2200 const char *s = p;
2201
2202 for (; s < e; s++) {
2203 if (*s & 0x80) return s;
2204 }
2205
2206 return NULL;
2207}
2208
2209static int
2210rb_parser_coderange_scan(struct parser_params *p, const char *ptr, long len, rb_encoding *enc)
2211{
2212 const char *e = ptr + len;
2213
2214 if (enc == rb_ascii8bit_encoding()) {
2215 /* enc is ASCII-8BIT. ASCII-8BIT string never be broken. */
2216 ptr = rb_parser_search_nonascii(ptr, e);
2217 return ptr ? RB_PARSER_ENC_CODERANGE_VALID : RB_PARSER_ENC_CODERANGE_7BIT;
2218 }
2219
2220 /* parser string encoding is always asciicompat */
2221 ptr = rb_parser_search_nonascii(ptr, e);
2222 if (!ptr) return RB_PARSER_ENC_CODERANGE_7BIT;
2223 for (;;) {
2224 int ret = rb_enc_precise_mbclen(ptr, e, enc);
2225 if (!MBCLEN_CHARFOUND_P(ret)) return RB_PARSER_ENC_CODERANGE_BROKEN;
2226 ptr += MBCLEN_CHARFOUND_LEN(ret);
2227 if (ptr == e) break;
2228 ptr = rb_parser_search_nonascii(ptr, e);
2229 if (!ptr) break;
2230 }
2231
2232 return RB_PARSER_ENC_CODERANGE_VALID;
2233}
2234
2235static int
2236rb_parser_enc_coderange_scan(struct parser_params *p, rb_parser_string_t *str, rb_encoding *enc)
2237{
2238 return rb_parser_coderange_scan(p, PARSER_STRING_PTR(str), PARSER_STRING_LEN(str), enc);
2239}
2240
2241static int
2242rb_parser_enc_str_coderange(struct parser_params *p, rb_parser_string_t *str)
2243{
2244 int cr = PARSER_ENC_CODERANGE(str);
2245
2246 if (cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2247 cr = rb_parser_enc_coderange_scan(p, str, rb_parser_str_get_encoding(str));
2248 PARSER_ENC_CODERANGE_SET(str, cr);
2249 }
2250
2251 return cr;
2252}
2253
2254static rb_parser_string_t *
2255rb_parser_enc_associate(struct parser_params *p, rb_parser_string_t *str, rb_encoding *enc)
2256{
2257 if (rb_parser_str_get_encoding(str) == enc)
2258 return str;
2259 if (!PARSER_ENC_CODERANGE_ASCIIONLY(str)) {
2260 PARSER_ENC_CODERANGE_CLEAR(str);
2261 }
2262 rb_parser_string_set_encoding(str, enc);
2263 return str;
2264}
2265
2266static bool
2267rb_parser_is_ascii_string(struct parser_params *p, rb_parser_string_t *str)
2268{
2269 return rb_parser_enc_str_coderange(p, str) == RB_PARSER_ENC_CODERANGE_7BIT;
2270}
2271
2272static rb_encoding *
2273rb_parser_enc_compatible(struct parser_params *p, rb_parser_string_t *str1, rb_parser_string_t *str2)
2274{
2275 rb_encoding *enc1 = rb_parser_str_get_encoding(str1);
2276 rb_encoding *enc2 = rb_parser_str_get_encoding(str2);
2277
2278 if (enc1 == NULL || enc2 == NULL)
2279 return 0;
2280
2281 if (enc1 == enc2) {
2282 return enc1;
2283 }
2284
2285 if (PARSER_STRING_LEN(str2) == 0)
2286 return enc1;
2287 if (PARSER_STRING_LEN(str1) == 0)
2288 return rb_parser_is_ascii_string(p, str2) ? enc1 : enc2;
2289
2290 int cr1, cr2;
2291
2292 cr1 = rb_parser_enc_str_coderange(p, str1);
2293 cr2 = rb_parser_enc_str_coderange(p, str2);
2294
2295 if (cr1 != cr2) {
2296 if (cr1 == RB_PARSER_ENC_CODERANGE_7BIT) return enc2;
2297 if (cr2 == RB_PARSER_ENC_CODERANGE_7BIT) return enc1;
2298 }
2299
2300 if (cr2 == RB_PARSER_ENC_CODERANGE_7BIT) {
2301 return enc1;
2302 }
2303
2304 if (cr1 == RB_PARSER_ENC_CODERANGE_7BIT) {
2305 return enc2;
2306 }
2307
2308 return 0;
2309}
2310
2311static void
2312rb_parser_str_modify(rb_parser_string_t *str)
2313{
2314 PARSER_ENC_CODERANGE_CLEAR(str);
2315}
2316
2317static void
2318rb_parser_str_set_len(struct parser_params *p, rb_parser_string_t *str, long len)
2319{
2320 long capa;
2321 const int termlen = STRING_TERM_LEN(str);
2322
2323 if (len > (capa = (long)(rb_parser_str_capacity(str, termlen))) || len < 0) {
2324 rb_bug("probable buffer overflow: %ld for %ld", len, capa);
2325 }
2326
2327 int cr = PARSER_ENC_CODERANGE(str);
2328 if (cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2329 /* Leave unknown. */
2330 }
2331 else if (len > PARSER_STRING_LEN(str)) {
2332 PARSER_ENC_CODERANGE_SET(str, RB_PARSER_ENC_CODERANGE_UNKNOWN);
2333 }
2334 else if (len < PARSER_STRING_LEN(str)) {
2335 if (cr != RB_PARSER_ENC_CODERANGE_7BIT) {
2336 /* ASCII-only string is keeping after truncated. Valid
2337 * and broken may be invalid or valid, leave unknown. */
2338 PARSER_ENC_CODERANGE_SET(str, RB_PARSER_ENC_CODERANGE_UNKNOWN);
2339 }
2340 }
2341
2342 STRING_SET_LEN(str, len);
2343 STRING_TERM_FILL(str);
2344}
2345
2346static rb_parser_string_t *
2347rb_parser_str_buf_cat(struct parser_params *p, rb_parser_string_t *str, const char *ptr, long len)
2348{
2349 rb_parser_str_modify(str);
2350 if (len == 0) return 0;
2351
2352 long total, olen, off = -1;
2353 char *sptr;
2354 const int termlen = STRING_TERM_LEN(str);
2355
2356 PARSER_STRING_GETMEM(str, sptr, olen);
2357 if (ptr >= sptr && ptr <= sptr + olen) {
2358 off = ptr - sptr;
2359 }
2360
2361 if (olen > LONG_MAX - len) {
2362 compile_error(p, "string sizes too big");
2363 return 0;
2364 }
2365 total = olen + len;
2366 PARSER_STRING_RESIZE_CAPA_TERM(p, str, total, termlen);
2367 sptr = PARSER_STRING_PTR(str);
2368 if (off != -1) {
2369 ptr = sptr + off;
2370 }
2371 memcpy(sptr + olen, ptr, len);
2372 STRING_SET_LEN(str, total);
2373 STRING_TERM_FILL(str);
2374
2375 return str;
2376}
2377
2378#define parser_str_cat(str, ptr, len) rb_parser_str_buf_cat(p, str, ptr, len)
2379#define parser_str_cat_cstr(str, lit) rb_parser_str_buf_cat(p, str, lit, strlen(lit))
2380
2381static rb_parser_string_t *
2382rb_parser_enc_cr_str_buf_cat(struct parser_params *p, rb_parser_string_t *str, const char *ptr, long len,
2383 rb_encoding *ptr_enc, int ptr_cr, int *ptr_cr_ret)
2384{
2385 int str_cr, res_cr;
2386 rb_encoding *str_enc, *res_enc;
2387
2388 str_enc = rb_parser_str_get_encoding(str);
2389 str_cr = PARSER_STRING_LEN(str) ? PARSER_ENC_CODERANGE(str) : RB_PARSER_ENC_CODERANGE_7BIT;
2390
2391 if (str_enc == ptr_enc) {
2392 if (str_cr != RB_PARSER_ENC_CODERANGE_UNKNOWN && ptr_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2393 ptr_cr = rb_parser_coderange_scan(p, ptr, len, ptr_enc);
2394 }
2395 }
2396 else {
2397 /* parser string encoding is always asciicompat */
2398 if (ptr_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2399 ptr_cr = rb_parser_coderange_scan(p, ptr, len, ptr_enc);
2400 }
2401 if (str_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2402 if (str_enc == rb_ascii8bit_encoding() || ptr_cr != RB_PARSER_ENC_CODERANGE_7BIT) {
2403 str_cr = rb_parser_enc_str_coderange(p, str);
2404 }
2405 }
2406 }
2407 if (ptr_cr_ret)
2408 *ptr_cr_ret = ptr_cr;
2409
2410 if (str_enc != ptr_enc &&
2411 str_cr != RB_PARSER_ENC_CODERANGE_7BIT &&
2412 ptr_cr != RB_PARSER_ENC_CODERANGE_7BIT) {
2413 goto incompatible;
2414 }
2415
2416 if (str_cr == RB_PARSER_ENC_CODERANGE_UNKNOWN) {
2417 res_enc = str_enc;
2418 res_cr = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2419 }
2420 else if (str_cr == RB_PARSER_ENC_CODERANGE_7BIT) {
2421 if (ptr_cr == RB_PARSER_ENC_CODERANGE_7BIT) {
2422 res_enc = str_enc;
2423 res_cr = RB_PARSER_ENC_CODERANGE_7BIT;
2424 }
2425 else {
2426 res_enc = ptr_enc;
2427 res_cr = ptr_cr;
2428 }
2429 }
2430 else if (str_cr == RB_PARSER_ENC_CODERANGE_VALID) {
2431 res_enc = str_enc;
2432 if (PARSER_ENC_CODERANGE_CLEAN_P(ptr_cr))
2433 res_cr = str_cr;
2434 else
2435 res_cr = ptr_cr;
2436 }
2437 else { /* str_cr == RB_PARSER_ENC_CODERANGE_BROKEN */
2438 res_enc = str_enc;
2439 res_cr = str_cr;
2440 if (0 < len) res_cr = RB_PARSER_ENC_CODERANGE_UNKNOWN;
2441 }
2442
2443 if (len < 0) {
2444 compile_error(p, "negative string size (or size too big)");
2445 }
2446 parser_str_cat(str, ptr, len);
2447 PARSER_ENCODING_CODERANGE_SET(str, res_enc, res_cr);
2448 return str;
2449
2450 incompatible:
2451 compile_error(p, "incompatible character encodings: %s and %s",
2452 rb_enc_name(str_enc), rb_enc_name(ptr_enc));
2454
2455}
2456
2457static rb_parser_string_t *
2458rb_parser_enc_str_buf_cat(struct parser_params *p, rb_parser_string_t *str, const char *ptr, long len,
2459 rb_encoding *ptr_enc)
2460{
2461 return rb_parser_enc_cr_str_buf_cat(p, str, ptr, len, ptr_enc, RB_PARSER_ENC_CODERANGE_UNKNOWN, NULL);
2462}
2463
2464static rb_parser_string_t *
2465rb_parser_str_buf_append(struct parser_params *p, rb_parser_string_t *str, rb_parser_string_t *str2)
2466{
2467 int str2_cr = rb_parser_enc_str_coderange(p, str2);
2468
2469 rb_parser_enc_cr_str_buf_cat(p, str, PARSER_STRING_PTR(str2), PARSER_STRING_LEN(str2),
2470 rb_parser_str_get_encoding(str2), str2_cr, &str2_cr);
2471
2472 PARSER_ENC_CODERANGE_SET(str2, str2_cr);
2473
2474 return str;
2475}
2476
2477static rb_parser_string_t *
2478rb_parser_str_resize(struct parser_params *p, rb_parser_string_t *str, long len)
2479{
2480 if (len < 0) {
2481 rb_bug("negative string size (or size too big)");
2482 }
2483
2484 long slen = PARSER_STRING_LEN(str);
2485
2486 if (slen > len && PARSER_ENC_CODERANGE(str) != RB_PARSER_ENC_CODERANGE_7BIT) {
2487 PARSER_ENC_CODERANGE_CLEAR(str);
2488 }
2489
2490 {
2491 long capa;
2492 const int termlen = STRING_TERM_LEN(str);
2493
2494 if ((capa = slen) < len) {
2495 SIZED_REALLOC_N(str->ptr, char, (size_t)len + termlen, STRING_SIZE(str));
2496 }
2497 else if (len == slen) return str;
2498 STRING_SET_LEN(str, len);
2499 STRING_TERM_FILL(str);
2500 }
2501 return str;
2502}
2503
2504# define PARSER_ENC_STRING_GETMEM(str, ptrvar, lenvar, encvar) \
2505 ((ptrvar) = str->ptr, \
2506 (lenvar) = str->len, \
2507 (encvar) = str->enc)
2508
2509static int
2510rb_parser_string_hash_cmp(rb_parser_string_t *str1, rb_parser_string_t *str2)
2511{
2512 long len1, len2;
2513 const char *ptr1, *ptr2;
2514 rb_encoding *enc1, *enc2;
2515
2516 PARSER_ENC_STRING_GETMEM(str1, ptr1, len1, enc1);
2517 PARSER_ENC_STRING_GETMEM(str2, ptr2, len2, enc2);
2518
2519 return (len1 != len2 ||
2520 enc1 != enc2 ||
2521 memcmp(ptr1, ptr2, len1) != 0);
2522}
2523
2524static void
2525rb_parser_ary_extend(rb_parser_t *p, rb_parser_ary_t *ary, long len)
2526{
2527 long i;
2528 if (ary->capa < len) {
2529 ary->capa = len;
2530 ary->data = (rb_parser_ary_data *)xrealloc(ary->data, sizeof(rb_parser_ary_data) * len);
2531 for (i = ary->len; i < len; i++) {
2532 ary->data[i] = 0;
2533 }
2534 }
2535}
2536
2537/*
2538 * Do not call this directly.
2539 * Use rb_parser_ary_new_capa_for_XXX() instead.
2540 */
2541static rb_parser_ary_t *
2542parser_ary_new_capa(rb_parser_t *p, long len)
2543{
2544 if (len < 0) {
2545 rb_bug("negative array size (or size too big): %ld", len);
2546 }
2547 rb_parser_ary_t *ary = xcalloc(1, sizeof(rb_parser_ary_t));
2548 ary->data_type = 0;
2549 ary->len = 0;
2550 ary->capa = len;
2551 if (0 < len) {
2552 ary->data = (rb_parser_ary_data *)xcalloc(len, sizeof(rb_parser_ary_data));
2553 }
2554 else {
2555 ary->data = NULL;
2556 }
2557 return ary;
2558}
2559
2560#ifndef RIPPER
2561static rb_parser_ary_t *
2562rb_parser_ary_new_capa_for_script_line(rb_parser_t *p, long len)
2563{
2564 rb_parser_ary_t *ary = parser_ary_new_capa(p, len);
2565 ary->data_type = PARSER_ARY_DATA_SCRIPT_LINE;
2566 return ary;
2567}
2568
2569static rb_parser_ary_t *
2570rb_parser_ary_new_capa_for_ast_token(rb_parser_t *p, long len)
2571{
2572 rb_parser_ary_t *ary = parser_ary_new_capa(p, len);
2573 ary->data_type = PARSER_ARY_DATA_AST_TOKEN;
2574 return ary;
2575}
2576#endif
2577
2578static rb_parser_ary_t *
2579rb_parser_ary_new_capa_for_node(rb_parser_t *p, long len)
2580{
2581 rb_parser_ary_t *ary = parser_ary_new_capa(p, len);
2582 ary->data_type = PARSER_ARY_DATA_NODE;
2583 return ary;
2584}
2585
2586/*
2587 * Do not call this directly.
2588 * Use rb_parser_ary_push_XXX() instead.
2589 */
2590static rb_parser_ary_t *
2591parser_ary_push(rb_parser_t *p, rb_parser_ary_t *ary, rb_parser_ary_data val)
2592{
2593 if (ary->len == ary->capa) {
2594 rb_parser_ary_extend(p, ary, ary->len == 0 ? 1 : ary->len * 2);
2595 }
2596 ary->data[ary->len++] = val;
2597 return ary;
2598}
2599
2600#ifndef RIPPER
2601static rb_parser_ary_t *
2602rb_parser_ary_push_ast_token(rb_parser_t *p, rb_parser_ary_t *ary, rb_parser_ast_token_t *val)
2603{
2604 if (ary->data_type != PARSER_ARY_DATA_AST_TOKEN) {
2605 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2606 }
2607 return parser_ary_push(p, ary, val);
2608}
2609
2610static rb_parser_ary_t *
2611rb_parser_ary_push_script_line(rb_parser_t *p, rb_parser_ary_t *ary, rb_parser_string_t *val)
2612{
2613 if (ary->data_type != PARSER_ARY_DATA_SCRIPT_LINE) {
2614 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2615 }
2616 return parser_ary_push(p, ary, val);
2617}
2618#endif
2619
2620static rb_parser_ary_t *
2621rb_parser_ary_push_node(rb_parser_t *p, rb_parser_ary_t *ary, NODE *val)
2622{
2623 if (ary->data_type != PARSER_ARY_DATA_NODE) {
2624 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2625 }
2626 return parser_ary_push(p, ary, val);
2627}
2628
2629#ifndef RIPPER
2630static void
2631rb_parser_ast_token_free(rb_parser_t *p, rb_parser_ast_token_t *token)
2632{
2633 if (!token) return;
2634 rb_parser_string_free(p, token->str);
2635 xfree(token);
2636}
2637
2638static void
2639rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary)
2640{
2641# define foreach_ary(ptr) \
2642 for (rb_parser_ary_data *ptr = ary->data, *const end_ary_data = ptr + ary->len; \
2643 ptr < end_ary_data; ptr++)
2644 switch (ary->data_type) {
2645 case PARSER_ARY_DATA_AST_TOKEN:
2646 foreach_ary(data) {rb_parser_ast_token_free(p, *data);}
2647 break;
2648 case PARSER_ARY_DATA_SCRIPT_LINE:
2649 foreach_ary(data) {rb_parser_string_free(p, *data);}
2650 break;
2651 case PARSER_ARY_DATA_NODE:
2652 /* Do nothing because nodes are freed when rb_ast_t is freed */
2653 break;
2654 default:
2655 rb_bug("unexpected rb_parser_ary_data_type: %d", ary->data_type);
2656 break;
2657 }
2658# undef foreach_ary
2659 xfree(ary->data);
2660 xfree(ary);
2661}
2662
2663#endif /* !RIPPER */
2664
2665#line 2666 "parse.c"
2666
2667# ifndef YY_CAST
2668# ifdef __cplusplus
2669# define YY_CAST(Type, Val) static_cast<Type> (Val)
2670# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
2671# else
2672# define YY_CAST(Type, Val) ((Type) (Val))
2673# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
2674# endif
2675# endif
2676# ifndef YY_NULLPTR
2677# if defined __cplusplus
2678# if 201103L <= __cplusplus
2679# define YY_NULLPTR nullptr
2680# else
2681# define YY_NULLPTR 0
2682# endif
2683# else
2684# define YY_NULLPTR ((void*)0)
2685# endif
2686# endif
2687
2688#include "parse.h"
2689/* Symbol kind. */
2690enum yysymbol_kind_t
2691{
2692 YYSYMBOL_YYEMPTY = -2,
2693 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
2694 YYSYMBOL_YYerror = 1, /* error */
2695 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
2696 YYSYMBOL_keyword_class = 3, /* "'class'" */
2697 YYSYMBOL_keyword_module = 4, /* "'module'" */
2698 YYSYMBOL_keyword_def = 5, /* "'def'" */
2699 YYSYMBOL_keyword_undef = 6, /* "'undef'" */
2700 YYSYMBOL_keyword_begin = 7, /* "'begin'" */
2701 YYSYMBOL_keyword_rescue = 8, /* "'rescue'" */
2702 YYSYMBOL_keyword_ensure = 9, /* "'ensure'" */
2703 YYSYMBOL_keyword_end = 10, /* "'end'" */
2704 YYSYMBOL_keyword_if = 11, /* "'if'" */
2705 YYSYMBOL_keyword_unless = 12, /* "'unless'" */
2706 YYSYMBOL_keyword_then = 13, /* "'then'" */
2707 YYSYMBOL_keyword_elsif = 14, /* "'elsif'" */
2708 YYSYMBOL_keyword_else = 15, /* "'else'" */
2709 YYSYMBOL_keyword_case = 16, /* "'case'" */
2710 YYSYMBOL_keyword_when = 17, /* "'when'" */
2711 YYSYMBOL_keyword_while = 18, /* "'while'" */
2712 YYSYMBOL_keyword_until = 19, /* "'until'" */
2713 YYSYMBOL_keyword_for = 20, /* "'for'" */
2714 YYSYMBOL_keyword_break = 21, /* "'break'" */
2715 YYSYMBOL_keyword_next = 22, /* "'next'" */
2716 YYSYMBOL_keyword_redo = 23, /* "'redo'" */
2717 YYSYMBOL_keyword_retry = 24, /* "'retry'" */
2718 YYSYMBOL_keyword_in = 25, /* "'in'" */
2719 YYSYMBOL_keyword_do = 26, /* "'do'" */
2720 YYSYMBOL_keyword_do_cond = 27, /* "'do' for condition" */
2721 YYSYMBOL_keyword_do_block = 28, /* "'do' for block" */
2722 YYSYMBOL_keyword_do_LAMBDA = 29, /* "'do' for lambda" */
2723 YYSYMBOL_keyword_return = 30, /* "'return'" */
2724 YYSYMBOL_keyword_yield = 31, /* "'yield'" */
2725 YYSYMBOL_keyword_super = 32, /* "'super'" */
2726 YYSYMBOL_keyword_self = 33, /* "'self'" */
2727 YYSYMBOL_keyword_nil = 34, /* "'nil'" */
2728 YYSYMBOL_keyword_true = 35, /* "'true'" */
2729 YYSYMBOL_keyword_false = 36, /* "'false'" */
2730 YYSYMBOL_keyword_and = 37, /* "'and'" */
2731 YYSYMBOL_keyword_or = 38, /* "'or'" */
2732 YYSYMBOL_keyword_not = 39, /* "'not'" */
2733 YYSYMBOL_modifier_if = 40, /* "'if' modifier" */
2734 YYSYMBOL_modifier_unless = 41, /* "'unless' modifier" */
2735 YYSYMBOL_modifier_while = 42, /* "'while' modifier" */
2736 YYSYMBOL_modifier_until = 43, /* "'until' modifier" */
2737 YYSYMBOL_modifier_rescue = 44, /* "'rescue' modifier" */
2738 YYSYMBOL_keyword_alias = 45, /* "'alias'" */
2739 YYSYMBOL_keyword_defined = 46, /* "'defined?'" */
2740 YYSYMBOL_keyword_BEGIN = 47, /* "'BEGIN'" */
2741 YYSYMBOL_keyword_END = 48, /* "'END'" */
2742 YYSYMBOL_keyword__LINE__ = 49, /* "'__LINE__'" */
2743 YYSYMBOL_keyword__FILE__ = 50, /* "'__FILE__'" */
2744 YYSYMBOL_keyword__ENCODING__ = 51, /* "'__ENCODING__'" */
2745 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
2746 YYSYMBOL_tFID = 53, /* "method" */
2747 YYSYMBOL_tGVAR = 54, /* "global variable" */
2748 YYSYMBOL_tIVAR = 55, /* "instance variable" */
2749 YYSYMBOL_tCONSTANT = 56, /* "constant" */
2750 YYSYMBOL_tCVAR = 57, /* "class variable" */
2751 YYSYMBOL_tLABEL = 58, /* "label" */
2752 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
2753 YYSYMBOL_tFLOAT = 60, /* "float literal" */
2754 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
2755 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
2756 YYSYMBOL_tCHAR = 63, /* "char literal" */
2757 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
2758 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
2759 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
2760 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
2761 YYSYMBOL_tDUMNY_END = 68, /* "dummy end" */
2762 YYSYMBOL_69_ = 69, /* '.' */
2763 YYSYMBOL_70_backslash_ = 70, /* "backslash" */
2764 YYSYMBOL_tSP = 71, /* "escaped space" */
2765 YYSYMBOL_72_escaped_horizontal_tab_ = 72, /* "escaped horizontal tab" */
2766 YYSYMBOL_73_escaped_form_feed_ = 73, /* "escaped form feed" */
2767 YYSYMBOL_74_escaped_carriage_return_ = 74, /* "escaped carriage return" */
2768 YYSYMBOL_75_escaped_vertical_tab_ = 75, /* "escaped vertical tab" */
2769 YYSYMBOL_tUPLUS = 76, /* "unary+" */
2770 YYSYMBOL_tUMINUS = 77, /* "unary-" */
2771 YYSYMBOL_tPOW = 78, /* "**" */
2772 YYSYMBOL_tCMP = 79, /* "<=>" */
2773 YYSYMBOL_tEQ = 80, /* "==" */
2774 YYSYMBOL_tEQQ = 81, /* "===" */
2775 YYSYMBOL_tNEQ = 82, /* "!=" */
2776 YYSYMBOL_tGEQ = 83, /* ">=" */
2777 YYSYMBOL_tLEQ = 84, /* "<=" */
2778 YYSYMBOL_tANDOP = 85, /* "&&" */
2779 YYSYMBOL_tOROP = 86, /* "||" */
2780 YYSYMBOL_tMATCH = 87, /* "=~" */
2781 YYSYMBOL_tNMATCH = 88, /* "!~" */
2782 YYSYMBOL_tDOT2 = 89, /* ".." */
2783 YYSYMBOL_tDOT3 = 90, /* "..." */
2784 YYSYMBOL_tBDOT2 = 91, /* "(.." */
2785 YYSYMBOL_tBDOT3 = 92, /* "(..." */
2786 YYSYMBOL_tAREF = 93, /* "[]" */
2787 YYSYMBOL_tASET = 94, /* "[]=" */
2788 YYSYMBOL_tLSHFT = 95, /* "<<" */
2789 YYSYMBOL_tRSHFT = 96, /* ">>" */
2790 YYSYMBOL_tANDDOT = 97, /* "&." */
2791 YYSYMBOL_tCOLON2 = 98, /* "::" */
2792 YYSYMBOL_tCOLON3 = 99, /* ":: at EXPR_BEG" */
2793 YYSYMBOL_tOP_ASGN = 100, /* "operator-assignment" */
2794 YYSYMBOL_tASSOC = 101, /* "=>" */
2795 YYSYMBOL_tLPAREN = 102, /* "(" */
2796 YYSYMBOL_tLPAREN_ARG = 103, /* "( arg" */
2797 YYSYMBOL_tRPAREN = 104, /* ")" */
2798 YYSYMBOL_tLBRACK = 105, /* "[" */
2799 YYSYMBOL_tLBRACE = 106, /* "{" */
2800 YYSYMBOL_tLBRACE_ARG = 107, /* "{ arg" */
2801 YYSYMBOL_tSTAR = 108, /* "*" */
2802 YYSYMBOL_tDSTAR = 109, /* "**arg" */
2803 YYSYMBOL_tAMPER = 110, /* "&" */
2804 YYSYMBOL_tLAMBDA = 111, /* "->" */
2805 YYSYMBOL_tSYMBEG = 112, /* "symbol literal" */
2806 YYSYMBOL_tSTRING_BEG = 113, /* "string literal" */
2807 YYSYMBOL_tXSTRING_BEG = 114, /* "backtick literal" */
2808 YYSYMBOL_tREGEXP_BEG = 115, /* "regexp literal" */
2809 YYSYMBOL_tWORDS_BEG = 116, /* "word list" */
2810 YYSYMBOL_tQWORDS_BEG = 117, /* "verbatim word list" */
2811 YYSYMBOL_tSYMBOLS_BEG = 118, /* "symbol list" */
2812 YYSYMBOL_tQSYMBOLS_BEG = 119, /* "verbatim symbol list" */
2813 YYSYMBOL_tSTRING_END = 120, /* "terminator" */
2814 YYSYMBOL_tSTRING_DEND = 121, /* "'}'" */
2815 YYSYMBOL_tSTRING_DBEG = 122, /* "'#{'" */
2816 YYSYMBOL_tSTRING_DVAR = 123, /* tSTRING_DVAR */
2817 YYSYMBOL_tLAMBEG = 124, /* tLAMBEG */
2818 YYSYMBOL_tLABEL_END = 125, /* tLABEL_END */
2819 YYSYMBOL_tIGNORED_NL = 126, /* tIGNORED_NL */
2820 YYSYMBOL_tCOMMENT = 127, /* tCOMMENT */
2821 YYSYMBOL_tEMBDOC_BEG = 128, /* tEMBDOC_BEG */
2822 YYSYMBOL_tEMBDOC = 129, /* tEMBDOC */
2823 YYSYMBOL_tEMBDOC_END = 130, /* tEMBDOC_END */
2824 YYSYMBOL_tHEREDOC_BEG = 131, /* tHEREDOC_BEG */
2825 YYSYMBOL_tHEREDOC_END = 132, /* tHEREDOC_END */
2826 YYSYMBOL_k__END__ = 133, /* k__END__ */
2827 YYSYMBOL_tLOWEST = 134, /* tLOWEST */
2828 YYSYMBOL_135_ = 135, /* '=' */
2829 YYSYMBOL_136_ = 136, /* '?' */
2830 YYSYMBOL_137_ = 137, /* ':' */
2831 YYSYMBOL_138_ = 138, /* '>' */
2832 YYSYMBOL_139_ = 139, /* '<' */
2833 YYSYMBOL_140_ = 140, /* '|' */
2834 YYSYMBOL_141_ = 141, /* '^' */
2835 YYSYMBOL_142_ = 142, /* '&' */
2836 YYSYMBOL_143_ = 143, /* '+' */
2837 YYSYMBOL_144_ = 144, /* '-' */
2838 YYSYMBOL_145_ = 145, /* '*' */
2839 YYSYMBOL_146_ = 146, /* '/' */
2840 YYSYMBOL_147_ = 147, /* '%' */
2841 YYSYMBOL_tUMINUS_NUM = 148, /* tUMINUS_NUM */
2842 YYSYMBOL_149_ = 149, /* '!' */
2843 YYSYMBOL_150_ = 150, /* '~' */
2844 YYSYMBOL_tLAST_TOKEN = 151, /* tLAST_TOKEN */
2845 YYSYMBOL_152_ = 152, /* '{' */
2846 YYSYMBOL_153_ = 153, /* '}' */
2847 YYSYMBOL_154_ = 154, /* '[' */
2848 YYSYMBOL_155_n_ = 155, /* '\n' */
2849 YYSYMBOL_156_ = 156, /* ',' */
2850 YYSYMBOL_157_ = 157, /* '`' */
2851 YYSYMBOL_158_ = 158, /* '(' */
2852 YYSYMBOL_159_ = 159, /* ')' */
2853 YYSYMBOL_160_ = 160, /* ']' */
2854 YYSYMBOL_161_ = 161, /* ';' */
2855 YYSYMBOL_162_ = 162, /* ' ' */
2856 YYSYMBOL_YYACCEPT = 163, /* $accept */
2857 YYSYMBOL_164_1 = 164, /* $@1 */
2858 YYSYMBOL_program = 165, /* program */
2859 YYSYMBOL_option_terms = 166, /* option_terms */
2860 YYSYMBOL_top_compstmt = 167, /* top_compstmt */
2861 YYSYMBOL_top_stmts = 168, /* top_stmts */
2862 YYSYMBOL_top_stmt = 169, /* top_stmt */
2863 YYSYMBOL_block_open = 170, /* block_open */
2864 YYSYMBOL_begin_block = 171, /* begin_block */
2865 YYSYMBOL_172_2 = 172, /* $@2 */
2866 YYSYMBOL_173_3 = 173, /* $@3 */
2867 YYSYMBOL_bodystmt = 174, /* bodystmt */
2868 YYSYMBOL_175_4 = 175, /* $@4 */
2869 YYSYMBOL_compstmt = 176, /* compstmt */
2870 YYSYMBOL_stmts = 177, /* stmts */
2871 YYSYMBOL_stmt_or_begin = 178, /* stmt_or_begin */
2872 YYSYMBOL_179_5 = 179, /* $@5 */
2873 YYSYMBOL_allow_exits = 180, /* allow_exits */
2874 YYSYMBOL_k_END = 181, /* k_END */
2875 YYSYMBOL_182_6 = 182, /* $@6 */
2876 YYSYMBOL_stmt = 183, /* stmt */
2877 YYSYMBOL_command_asgn = 184, /* command_asgn */
2878 YYSYMBOL_endless_command = 185, /* endless_command */
2879 YYSYMBOL_option__n_ = 186, /* option_'\n' */
2880 YYSYMBOL_command_rhs = 187, /* command_rhs */
2881 YYSYMBOL_expr = 188, /* expr */
2882 YYSYMBOL_189_7 = 189, /* $@7 */
2883 YYSYMBOL_190_8 = 190, /* $@8 */
2884 YYSYMBOL_def_name = 191, /* def_name */
2885 YYSYMBOL_defn_head = 192, /* defn_head */
2886 YYSYMBOL_193_9 = 193, /* $@9 */
2887 YYSYMBOL_defs_head = 194, /* defs_head */
2888 YYSYMBOL_expr_value = 195, /* expr_value */
2889 YYSYMBOL_196_10 = 196, /* $@10 */
2890 YYSYMBOL_197_11 = 197, /* $@11 */
2891 YYSYMBOL_expr_value_do = 198, /* expr_value_do */
2892 YYSYMBOL_command_call = 199, /* command_call */
2893 YYSYMBOL_block_command = 200, /* block_command */
2894 YYSYMBOL_cmd_brace_block = 201, /* cmd_brace_block */
2895 YYSYMBOL_fcall = 202, /* fcall */
2896 YYSYMBOL_command = 203, /* command */
2897 YYSYMBOL_mlhs = 204, /* mlhs */
2898 YYSYMBOL_mlhs_inner = 205, /* mlhs_inner */
2899 YYSYMBOL_mlhs_basic = 206, /* mlhs_basic */
2900 YYSYMBOL_mlhs_item = 207, /* mlhs_item */
2901 YYSYMBOL_mlhs_head = 208, /* mlhs_head */
2902 YYSYMBOL_mlhs_post = 209, /* mlhs_post */
2903 YYSYMBOL_mlhs_node = 210, /* mlhs_node */
2904 YYSYMBOL_lhs = 211, /* lhs */
2905 YYSYMBOL_cname = 212, /* cname */
2906 YYSYMBOL_cpath = 213, /* cpath */
2907 YYSYMBOL_fname = 214, /* fname */
2908 YYSYMBOL_fitem = 215, /* fitem */
2909 YYSYMBOL_undef_list = 216, /* undef_list */
2910 YYSYMBOL_217_12 = 217, /* $@12 */
2911 YYSYMBOL_op = 218, /* op */
2912 YYSYMBOL_reswords = 219, /* reswords */
2913 YYSYMBOL_arg = 220, /* arg */
2914 YYSYMBOL_endless_arg = 221, /* endless_arg */
2915 YYSYMBOL_relop = 222, /* relop */
2916 YYSYMBOL_rel_expr = 223, /* rel_expr */
2917 YYSYMBOL_lex_ctxt = 224, /* lex_ctxt */
2918 YYSYMBOL_begin_defined = 225, /* begin_defined */
2919 YYSYMBOL_after_rescue = 226, /* after_rescue */
2920 YYSYMBOL_arg_value = 227, /* arg_value */
2921 YYSYMBOL_aref_args = 228, /* aref_args */
2922 YYSYMBOL_arg_rhs = 229, /* arg_rhs */
2923 YYSYMBOL_paren_args = 230, /* paren_args */
2924 YYSYMBOL_opt_paren_args = 231, /* opt_paren_args */
2925 YYSYMBOL_opt_call_args = 232, /* opt_call_args */
2926 YYSYMBOL_call_args = 233, /* call_args */
2927 YYSYMBOL_234_13 = 234, /* $@13 */
2928 YYSYMBOL_command_args = 235, /* command_args */
2929 YYSYMBOL_block_arg = 236, /* block_arg */
2930 YYSYMBOL_opt_block_arg = 237, /* opt_block_arg */
2931 YYSYMBOL_args = 238, /* args */
2932 YYSYMBOL_arg_splat = 239, /* arg_splat */
2933 YYSYMBOL_mrhs_arg = 240, /* mrhs_arg */
2934 YYSYMBOL_mrhs = 241, /* mrhs */
2935 YYSYMBOL_primary = 242, /* primary */
2936 YYSYMBOL_243_14 = 243, /* $@14 */
2937 YYSYMBOL_244_15 = 244, /* $@15 */
2938 YYSYMBOL_245_16 = 245, /* @16 */
2939 YYSYMBOL_246_17 = 246, /* @17 */
2940 YYSYMBOL_247_18 = 247, /* $@18 */
2941 YYSYMBOL_248_19 = 248, /* $@19 */
2942 YYSYMBOL_249_20 = 249, /* $@20 */
2943 YYSYMBOL_250_21 = 250, /* $@21 */
2944 YYSYMBOL_251_22 = 251, /* $@22 */
2945 YYSYMBOL_primary_value = 252, /* primary_value */
2946 YYSYMBOL_k_begin = 253, /* k_begin */
2947 YYSYMBOL_k_if = 254, /* k_if */
2948 YYSYMBOL_k_unless = 255, /* k_unless */
2949 YYSYMBOL_k_while = 256, /* k_while */
2950 YYSYMBOL_k_until = 257, /* k_until */
2951 YYSYMBOL_k_case = 258, /* k_case */
2952 YYSYMBOL_k_for = 259, /* k_for */
2953 YYSYMBOL_k_class = 260, /* k_class */
2954 YYSYMBOL_k_module = 261, /* k_module */
2955 YYSYMBOL_k_def = 262, /* k_def */
2956 YYSYMBOL_k_do = 263, /* k_do */
2957 YYSYMBOL_k_do_block = 264, /* k_do_block */
2958 YYSYMBOL_k_rescue = 265, /* k_rescue */
2959 YYSYMBOL_k_ensure = 266, /* k_ensure */
2960 YYSYMBOL_k_when = 267, /* k_when */
2961 YYSYMBOL_k_else = 268, /* k_else */
2962 YYSYMBOL_k_elsif = 269, /* k_elsif */
2963 YYSYMBOL_k_end = 270, /* k_end */
2964 YYSYMBOL_k_return = 271, /* k_return */
2965 YYSYMBOL_k_yield = 272, /* k_yield */
2966 YYSYMBOL_then = 273, /* then */
2967 YYSYMBOL_do = 274, /* do */
2968 YYSYMBOL_if_tail = 275, /* if_tail */
2969 YYSYMBOL_opt_else = 276, /* opt_else */
2970 YYSYMBOL_for_var = 277, /* for_var */
2971 YYSYMBOL_f_marg = 278, /* f_marg */
2972 YYSYMBOL_f_marg_list = 279, /* f_marg_list */
2973 YYSYMBOL_f_margs = 280, /* f_margs */
2974 YYSYMBOL_f_rest_marg = 281, /* f_rest_marg */
2975 YYSYMBOL_f_any_kwrest = 282, /* f_any_kwrest */
2976 YYSYMBOL_283_23 = 283, /* $@23 */
2977 YYSYMBOL_f_eq = 284, /* f_eq */
2978 YYSYMBOL_f_kwarg_f_block_kw = 285, /* f_kwarg_f_block_kw */
2979 YYSYMBOL_block_args_tail = 286, /* block_args_tail */
2980 YYSYMBOL_excessed_comma = 287, /* excessed_comma */
2981 YYSYMBOL_f_opt_primary_value = 288, /* f_opt_primary_value */
2982 YYSYMBOL_f_optarg_primary_value = 289, /* f_optarg_primary_value */
2983 YYSYMBOL_opt_args_tail_block_args_tail = 290, /* opt_args_tail_block_args_tail */
2984 YYSYMBOL_block_param = 291, /* block_param */
2985 YYSYMBOL_opt_block_param = 292, /* opt_block_param */
2986 YYSYMBOL_block_param_def = 293, /* block_param_def */
2987 YYSYMBOL_opt_bv_decl = 294, /* opt_bv_decl */
2988 YYSYMBOL_bv_decls = 295, /* bv_decls */
2989 YYSYMBOL_bvar = 296, /* bvar */
2990 YYSYMBOL_max_numparam = 297, /* max_numparam */
2991 YYSYMBOL_numparam = 298, /* numparam */
2992 YYSYMBOL_it_id = 299, /* it_id */
2993 YYSYMBOL_300_24 = 300, /* @24 */
2994 YYSYMBOL_301_25 = 301, /* $@25 */
2995 YYSYMBOL_lambda = 302, /* lambda */
2996 YYSYMBOL_f_larglist = 303, /* f_larglist */
2997 YYSYMBOL_lambda_body = 304, /* lambda_body */
2998 YYSYMBOL_305_26 = 305, /* $@26 */
2999 YYSYMBOL_do_block = 306, /* do_block */
3000 YYSYMBOL_block_call = 307, /* block_call */
3001 YYSYMBOL_method_call = 308, /* method_call */
3002 YYSYMBOL_brace_block = 309, /* brace_block */
3003 YYSYMBOL_310_27 = 310, /* @27 */
3004 YYSYMBOL_brace_body = 311, /* brace_body */
3005 YYSYMBOL_312_28 = 312, /* @28 */
3006 YYSYMBOL_do_body = 313, /* do_body */
3007 YYSYMBOL_case_args = 314, /* case_args */
3008 YYSYMBOL_case_body = 315, /* case_body */
3009 YYSYMBOL_cases = 316, /* cases */
3010 YYSYMBOL_p_pvtbl = 317, /* p_pvtbl */
3011 YYSYMBOL_p_pktbl = 318, /* p_pktbl */
3012 YYSYMBOL_p_in_kwarg = 319, /* p_in_kwarg */
3013 YYSYMBOL_320_29 = 320, /* $@29 */
3014 YYSYMBOL_p_case_body = 321, /* p_case_body */
3015 YYSYMBOL_p_cases = 322, /* p_cases */
3016 YYSYMBOL_p_top_expr = 323, /* p_top_expr */
3017 YYSYMBOL_p_top_expr_body = 324, /* p_top_expr_body */
3018 YYSYMBOL_p_expr = 325, /* p_expr */
3019 YYSYMBOL_p_as = 326, /* p_as */
3020 YYSYMBOL_p_alt = 327, /* p_alt */
3021 YYSYMBOL_p_lparen = 328, /* p_lparen */
3022 YYSYMBOL_p_lbracket = 329, /* p_lbracket */
3023 YYSYMBOL_p_expr_basic = 330, /* p_expr_basic */
3024 YYSYMBOL_331_30 = 331, /* $@30 */
3025 YYSYMBOL_p_args = 332, /* p_args */
3026 YYSYMBOL_p_args_head = 333, /* p_args_head */
3027 YYSYMBOL_p_args_tail = 334, /* p_args_tail */
3028 YYSYMBOL_p_find = 335, /* p_find */
3029 YYSYMBOL_p_rest = 336, /* p_rest */
3030 YYSYMBOL_p_args_post = 337, /* p_args_post */
3031 YYSYMBOL_p_arg = 338, /* p_arg */
3032 YYSYMBOL_p_kwargs = 339, /* p_kwargs */
3033 YYSYMBOL_p_kwarg = 340, /* p_kwarg */
3034 YYSYMBOL_p_kw = 341, /* p_kw */
3035 YYSYMBOL_p_kw_label = 342, /* p_kw_label */
3036 YYSYMBOL_p_kwrest = 343, /* p_kwrest */
3037 YYSYMBOL_p_kwnorest = 344, /* p_kwnorest */
3038 YYSYMBOL_p_any_kwrest = 345, /* p_any_kwrest */
3039 YYSYMBOL_p_value = 346, /* p_value */
3040 YYSYMBOL_p_primitive = 347, /* p_primitive */
3041 YYSYMBOL_p_variable = 348, /* p_variable */
3042 YYSYMBOL_p_var_ref = 349, /* p_var_ref */
3043 YYSYMBOL_p_expr_ref = 350, /* p_expr_ref */
3044 YYSYMBOL_p_const = 351, /* p_const */
3045 YYSYMBOL_opt_rescue = 352, /* opt_rescue */
3046 YYSYMBOL_exc_list = 353, /* exc_list */
3047 YYSYMBOL_exc_var = 354, /* exc_var */
3048 YYSYMBOL_opt_ensure = 355, /* opt_ensure */
3049 YYSYMBOL_literal = 356, /* literal */
3050 YYSYMBOL_strings = 357, /* strings */
3051 YYSYMBOL_string = 358, /* string */
3052 YYSYMBOL_string1 = 359, /* string1 */
3053 YYSYMBOL_xstring = 360, /* xstring */
3054 YYSYMBOL_regexp = 361, /* regexp */
3055 YYSYMBOL_nonempty_list__ = 362, /* nonempty_list_' ' */
3056 YYSYMBOL_words_tWORDS_BEG_word_list = 363, /* words_tWORDS_BEG_word_list */
3057 YYSYMBOL_words = 364, /* words */
3058 YYSYMBOL_word_list = 365, /* word_list */
3059 YYSYMBOL_word = 366, /* word */
3060 YYSYMBOL_words_tSYMBOLS_BEG_symbol_list = 367, /* words_tSYMBOLS_BEG_symbol_list */
3061 YYSYMBOL_symbols = 368, /* symbols */
3062 YYSYMBOL_symbol_list = 369, /* symbol_list */
3063 YYSYMBOL_words_tQWORDS_BEG_qword_list = 370, /* words_tQWORDS_BEG_qword_list */
3064 YYSYMBOL_qwords = 371, /* qwords */
3065 YYSYMBOL_words_tQSYMBOLS_BEG_qsym_list = 372, /* words_tQSYMBOLS_BEG_qsym_list */
3066 YYSYMBOL_qsymbols = 373, /* qsymbols */
3067 YYSYMBOL_qword_list = 374, /* qword_list */
3068 YYSYMBOL_qsym_list = 375, /* qsym_list */
3069 YYSYMBOL_string_contents = 376, /* string_contents */
3070 YYSYMBOL_xstring_contents = 377, /* xstring_contents */
3071 YYSYMBOL_regexp_contents = 378, /* regexp_contents */
3072 YYSYMBOL_string_content = 379, /* string_content */
3073 YYSYMBOL_380_31 = 380, /* @31 */
3074 YYSYMBOL_381_32 = 381, /* @32 */
3075 YYSYMBOL_382_33 = 382, /* @33 */
3076 YYSYMBOL_383_34 = 383, /* @34 */
3077 YYSYMBOL_string_dend = 384, /* string_dend */
3078 YYSYMBOL_string_dvar = 385, /* string_dvar */
3079 YYSYMBOL_symbol = 386, /* symbol */
3080 YYSYMBOL_ssym = 387, /* ssym */
3081 YYSYMBOL_sym = 388, /* sym */
3082 YYSYMBOL_dsym = 389, /* dsym */
3083 YYSYMBOL_numeric = 390, /* numeric */
3084 YYSYMBOL_simple_numeric = 391, /* simple_numeric */
3085 YYSYMBOL_nonlocal_var = 392, /* nonlocal_var */
3086 YYSYMBOL_user_variable = 393, /* user_variable */
3087 YYSYMBOL_keyword_variable = 394, /* keyword_variable */
3088 YYSYMBOL_var_ref = 395, /* var_ref */
3089 YYSYMBOL_var_lhs = 396, /* var_lhs */
3090 YYSYMBOL_backref = 397, /* backref */
3091 YYSYMBOL_398_35 = 398, /* $@35 */
3092 YYSYMBOL_superclass = 399, /* superclass */
3093 YYSYMBOL_f_opt_paren_args = 400, /* f_opt_paren_args */
3094 YYSYMBOL_f_paren_args = 401, /* f_paren_args */
3095 YYSYMBOL_f_arglist = 402, /* f_arglist */
3096 YYSYMBOL_403_36 = 403, /* @36 */
3097 YYSYMBOL_f_kwarg_f_kw = 404, /* f_kwarg_f_kw */
3098 YYSYMBOL_args_tail = 405, /* args_tail */
3099 YYSYMBOL_f_opt_arg_value = 406, /* f_opt_arg_value */
3100 YYSYMBOL_f_optarg_arg_value = 407, /* f_optarg_arg_value */
3101 YYSYMBOL_opt_args_tail_args_tail = 408, /* opt_args_tail_args_tail */
3102 YYSYMBOL_f_args = 409, /* f_args */
3103 YYSYMBOL_args_forward = 410, /* args_forward */
3104 YYSYMBOL_f_bad_arg = 411, /* f_bad_arg */
3105 YYSYMBOL_f_norm_arg = 412, /* f_norm_arg */
3106 YYSYMBOL_f_arg_asgn = 413, /* f_arg_asgn */
3107 YYSYMBOL_f_arg_item = 414, /* f_arg_item */
3108 YYSYMBOL_f_arg = 415, /* f_arg */
3109 YYSYMBOL_f_label = 416, /* f_label */
3110 YYSYMBOL_f_kw = 417, /* f_kw */
3111 YYSYMBOL_f_block_kw = 418, /* f_block_kw */
3112 YYSYMBOL_kwrest_mark = 419, /* kwrest_mark */
3113 YYSYMBOL_f_no_kwarg = 420, /* f_no_kwarg */
3114 YYSYMBOL_f_kwrest = 421, /* f_kwrest */
3115 YYSYMBOL_restarg_mark = 422, /* restarg_mark */
3116 YYSYMBOL_f_rest_arg = 423, /* f_rest_arg */
3117 YYSYMBOL_blkarg_mark = 424, /* blkarg_mark */
3118 YYSYMBOL_f_block_arg = 425, /* f_block_arg */
3119 YYSYMBOL_opt_f_block_arg = 426, /* opt_f_block_arg */
3120 YYSYMBOL_singleton = 427, /* singleton */
3121 YYSYMBOL_428_37 = 428, /* $@37 */
3122 YYSYMBOL_assoc_list = 429, /* assoc_list */
3123 YYSYMBOL_assocs = 430, /* assocs */
3124 YYSYMBOL_assoc = 431, /* assoc */
3125 YYSYMBOL_operation = 432, /* operation */
3126 YYSYMBOL_operation2 = 433, /* operation2 */
3127 YYSYMBOL_operation3 = 434, /* operation3 */
3128 YYSYMBOL_dot_or_colon = 435, /* dot_or_colon */
3129 YYSYMBOL_call_op = 436, /* call_op */
3130 YYSYMBOL_call_op2 = 437, /* call_op2 */
3131 YYSYMBOL_rparen = 438, /* rparen */
3132 YYSYMBOL_rbracket = 439, /* rbracket */
3133 YYSYMBOL_rbrace = 440, /* rbrace */
3134 YYSYMBOL_trailer = 441, /* trailer */
3135 YYSYMBOL_term = 442, /* term */
3136 YYSYMBOL_terms = 443, /* terms */
3137 YYSYMBOL_none = 444 /* none */
3138};
3139typedef enum yysymbol_kind_t yysymbol_kind_t;
3140
3141
3142
3143
3144#ifdef short
3145# undef short
3146#endif
3147
3148/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
3149 <limits.h> and (if available) <stdint.h> are included
3150 so that the code can choose integer types of a good width. */
3151
3152#ifndef __PTRDIFF_MAX__
3153# include <limits.h> /* INFRINGES ON USER NAME SPACE */
3154# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
3155# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
3156# define YY_STDINT_H
3157# endif
3158#endif
3159
3160/* Narrow types that promote to a signed type and that can represent a
3161 signed or unsigned integer of at least N bits. In tables they can
3162 save space and decrease cache pressure. Promoting to a signed type
3163 helps avoid bugs in integer arithmetic. */
3164
3165#ifdef __INT_LEAST8_MAX__
3166typedef __INT_LEAST8_TYPE__ yytype_int8;
3167#elif defined YY_STDINT_H
3168typedef int_least8_t yytype_int8;
3169#else
3170typedef signed char yytype_int8;
3171#endif
3172
3173#ifdef __INT_LEAST16_MAX__
3174typedef __INT_LEAST16_TYPE__ yytype_int16;
3175#elif defined YY_STDINT_H
3176typedef int_least16_t yytype_int16;
3177#else
3178typedef short yytype_int16;
3179#endif
3180
3181/* Work around bug in HP-UX 11.23, which defines these macros
3182 incorrectly for preprocessor constants. This workaround can likely
3183 be removed in 2023, as HPE has promised support for HP-UX 11.23
3184 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
3185 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
3186#ifdef __hpux
3187# undef UINT_LEAST8_MAX
3188# undef UINT_LEAST16_MAX
3189# define UINT_LEAST8_MAX 255
3190# define UINT_LEAST16_MAX 65535
3191#endif
3192
3193#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
3194typedef __UINT_LEAST8_TYPE__ yytype_uint8;
3195#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
3196 && UINT_LEAST8_MAX <= INT_MAX)
3197typedef uint_least8_t yytype_uint8;
3198#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
3199typedef unsigned char yytype_uint8;
3200#else
3201typedef short yytype_uint8;
3202#endif
3203
3204#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
3205typedef __UINT_LEAST16_TYPE__ yytype_uint16;
3206#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
3207 && UINT_LEAST16_MAX <= INT_MAX)
3208typedef uint_least16_t yytype_uint16;
3209#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
3210typedef unsigned short yytype_uint16;
3211#else
3212typedef int yytype_uint16;
3213#endif
3214
3215#ifndef YYPTRDIFF_T
3216# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
3217# define YYPTRDIFF_T __PTRDIFF_TYPE__
3218# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
3219# elif defined PTRDIFF_MAX
3220# ifndef ptrdiff_t
3221# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
3222# endif
3223# define YYPTRDIFF_T ptrdiff_t
3224# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
3225# else
3226# define YYPTRDIFF_T long
3227# define YYPTRDIFF_MAXIMUM LONG_MAX
3228# endif
3229#endif
3230
3231#ifndef YYSIZE_T
3232# ifdef __SIZE_TYPE__
3233# define YYSIZE_T __SIZE_TYPE__
3234# elif defined size_t
3235# define YYSIZE_T size_t
3236# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
3237# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
3238# define YYSIZE_T size_t
3239# else
3240# define YYSIZE_T unsigned
3241# endif
3242#endif
3243
3244#define YYSIZE_MAXIMUM \
3245 YY_CAST (YYPTRDIFF_T, \
3246 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
3247 ? YYPTRDIFF_MAXIMUM \
3248 : YY_CAST (YYSIZE_T, -1)))
3249
3250#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
3251
3252
3253/* Stored state numbers (used for stacks). */
3254typedef yytype_int16 yy_state_t;
3255
3256/* State numbers in computations. */
3257typedef int yy_state_fast_t;
3258
3259#ifndef YY_
3260# if defined YYENABLE_NLS && YYENABLE_NLS
3261# if ENABLE_NLS
3262# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
3263# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
3264# endif
3265# endif
3266# ifndef YY_
3267# define YY_(Msgid) Msgid
3268# endif
3269#endif
3270
3271
3272#ifndef YY_ATTRIBUTE_PURE
3273# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
3274# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
3275# else
3276# define YY_ATTRIBUTE_PURE
3277# endif
3278#endif
3279
3280#ifndef YY_ATTRIBUTE_UNUSED
3281# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
3282# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
3283# else
3284# define YY_ATTRIBUTE_UNUSED
3285# endif
3286#endif
3287
3288/* Suppress unused-variable warnings by "using" E. */
3289#if ! defined lint || defined __GNUC__
3290# define YY_USE(E) ((void) (E))
3291#else
3292# define YY_USE(E) /* empty */
3293#endif
3294
3295/* Suppress an incorrect diagnostic about yylval being uninitialized. */
3296#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
3297# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
3298# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
3299 _Pragma ("GCC diagnostic push") \
3300 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
3301# else
3302# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
3303 _Pragma ("GCC diagnostic push") \
3304 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
3305 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
3306# endif
3307# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
3308 _Pragma ("GCC diagnostic pop")
3309#else
3310# define YY_INITIAL_VALUE(Value) Value
3311#endif
3312#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3313# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3314# define YY_IGNORE_MAYBE_UNINITIALIZED_END
3315#endif
3316#ifndef YY_INITIAL_VALUE
3317# define YY_INITIAL_VALUE(Value) /* Nothing. */
3318#endif
3319
3320#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
3321# define YY_IGNORE_USELESS_CAST_BEGIN \
3322 _Pragma ("GCC diagnostic push") \
3323 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
3324# define YY_IGNORE_USELESS_CAST_END \
3325 _Pragma ("GCC diagnostic pop")
3326#endif
3327#ifndef YY_IGNORE_USELESS_CAST_BEGIN
3328# define YY_IGNORE_USELESS_CAST_BEGIN
3329# define YY_IGNORE_USELESS_CAST_END
3330#endif
3331
3332
3333#define YY_ASSERT(E) ((void) (0 && (E)))
3334
3335#if 1
3336
3337/* The parser invokes alloca or malloc; define the necessary symbols. */
3338
3339# ifdef YYSTACK_USE_ALLOCA
3340# if YYSTACK_USE_ALLOCA
3341# ifdef __GNUC__
3342# define YYSTACK_ALLOC __builtin_alloca
3343# elif defined __BUILTIN_VA_ARG_INCR
3344# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
3345# elif defined _AIX
3346# define YYSTACK_ALLOC __alloca
3347# elif defined _MSC_VER
3348# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
3349# define alloca _alloca
3350# else
3351# define YYSTACK_ALLOC alloca
3352# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
3353# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
3354 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
3355# ifndef EXIT_SUCCESS
3356# define EXIT_SUCCESS 0
3357# endif
3358# endif
3359# endif
3360# endif
3361# endif
3362
3363# ifdef YYSTACK_ALLOC
3364 /* Pacify GCC's 'empty if-body' warning. */
3365# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
3366# ifndef YYSTACK_ALLOC_MAXIMUM
3367 /* The OS might guarantee only one guard page at the bottom of the stack,
3368 and a page size can be as small as 4096 bytes. So we cannot safely
3369 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
3370 to allow for a few compiler-allocated temporary stack slots. */
3371# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
3372# endif
3373# else
3374# define YYSTACK_ALLOC YYMALLOC
3375# define YYSTACK_FREE YYFREE
3376# ifndef YYSTACK_ALLOC_MAXIMUM
3377# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
3378# endif
3379# if (defined __cplusplus && ! defined EXIT_SUCCESS \
3380 && ! ((defined YYMALLOC || defined malloc) \
3381 && (defined YYFREE || defined free)))
3382# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
3383# ifndef EXIT_SUCCESS
3384# define EXIT_SUCCESS 0
3385# endif
3386# endif
3387# ifndef YYMALLOC
3388# define YYMALLOC malloc
3389# if ! defined malloc && ! defined EXIT_SUCCESS
3390void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
3391# endif
3392# endif
3393# ifndef YYFREE
3394# define YYFREE free
3395# if ! defined free && ! defined EXIT_SUCCESS
3396void free (void *); /* INFRINGES ON USER NAME SPACE */
3397# endif
3398# endif
3399# endif
3400#endif /* 1 */
3401
3402#if (! defined yyoverflow \
3403 && (! defined __cplusplus \
3404 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
3405 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
3406
3407/* A type that is properly aligned for any stack member. */
3408union yyalloc
3409{
3410 yy_state_t yyss_alloc;
3411 YYSTYPE yyvs_alloc;
3412 YYLTYPE yyls_alloc;
3413};
3414
3415/* The size of the maximum gap between one aligned stack and the next. */
3416# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
3417
3418/* The size of an array large to enough to hold all stacks, each with
3419 N elements. */
3420# define YYSTACK_BYTES(N) \
3421 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
3422 + YYSIZEOF (YYLTYPE)) \
3423 + 2 * YYSTACK_GAP_MAXIMUM)
3424
3425# define YYCOPY_NEEDED 1
3426
3427/* Relocate STACK from its old location to the new one. The
3428 local variables YYSIZE and YYSTACKSIZE give the old and new number of
3429 elements in the stack, and YYPTR gives the new location of the
3430 stack. Advance YYPTR to a properly aligned location for the next
3431 stack. */
3432# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
3433 do \
3434 { \
3435 YYPTRDIFF_T yynewbytes; \
3436 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
3437 Stack = &yyptr->Stack_alloc; \
3438 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
3439 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
3440 } \
3441 while (0)
3442
3443#endif
3444
3445#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
3446/* Copy COUNT objects from SRC to DST. The source and destination do
3447 not overlap. */
3448# ifndef YYCOPY
3449# if defined __GNUC__ && 1 < __GNUC__
3450# define YYCOPY(Dst, Src, Count) \
3451 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
3452# else
3453# define YYCOPY(Dst, Src, Count) \
3454 do \
3455 { \
3456 YYPTRDIFF_T yyi; \
3457 for (yyi = 0; yyi < (Count); yyi++) \
3458 (Dst)[yyi] = (Src)[yyi]; \
3459 } \
3460 while (0)
3461# endif
3462# endif
3463#endif /* !YYCOPY_NEEDED */
3464
3465/* YYFINAL -- State number of the termination state. */
3466#define YYFINAL 134
3467/* YYLAST -- Last index in YYTABLE. */
3468#define YYLAST 15506
3469
3470/* YYNTOKENS -- Number of terminals. */
3471#define YYNTOKENS 163
3472/* YYNNTS -- Number of nonterminals. */
3473#define YYNNTS 282
3474/* YYNRULES -- Number of rules. */
3475#define YYNRULES 788
3476/* YYNSTATES -- Number of states. */
3477#define YYNSTATES 1349
3478
3479/* YYMAXUTOK -- Last valid token kind. */
3480#define YYMAXUTOK 362
3481
3482
3483/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
3484 as returned by yylex, with out-of-bounds checking. */
3485#define YYTRANSLATE(YYX) \
3486 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
3487 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
3488 : YYSYMBOL_YYUNDEF)
3489
3490/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
3491 as returned by yylex. */
3492static const yytype_uint8 yytranslate[] =
3493{
3494 0, 2, 2, 2, 2, 2, 2, 2, 2, 72,
3495 155, 75, 73, 74, 2, 2, 2, 2, 2, 2,
3496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3497 2, 2, 162, 149, 2, 2, 2, 147, 142, 2,
3498 158, 159, 145, 143, 156, 144, 69, 146, 2, 2,
3499 2, 2, 2, 2, 2, 2, 2, 2, 137, 161,
3500 139, 135, 138, 136, 2, 2, 2, 2, 2, 2,
3501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3503 2, 154, 70, 160, 141, 2, 157, 2, 2, 2,
3504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3506 2, 2, 2, 152, 140, 153, 150, 2, 89, 90,
3507 91, 92, 76, 77, 78, 79, 95, 96, 84, 83,
3508 80, 81, 82, 87, 88, 93, 94, 98, 85, 86,
3509 97, 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, 2, 2, 2, 2,
3519 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
3520 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
3521 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
3522 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
3523 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
3524 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
3525 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
3526 65, 66, 67, 68, 71, 99, 100, 101, 102, 103,
3527 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
3528 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
3529 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
3530 134, 148, 151
3531};
3532
3533#if YYDEBUG
3534/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
3535static const yytype_int16 yyrline[] =
3536{
3537 0, 2968, 2968, 2968, 2994, 2994, 2994, 3000, 3005, 3010,
3538 3017, 3022, 3029, 3031, 3045, 3050, 3041, 3061, 3058, 3071,
3539 3077, 3082, 3087, 3094, 3099, 3098, 3108, 3110, 3117, 3117,
3540 3122, 3127, 3135, 3144, 3151, 3157, 3163, 3174, 3185, 3194,
3541 3207, 3208, 3214, 3219, 3230, 3235, 3236, 3243, 3248, 3253,
3542 3259, 3259, 3264, 3270, 3275, 3286, 3297, 3305, 3306, 3312,
3543 3312, 3312, 3319, 3324, 3332, 3335, 3336, 3341, 3346, 3351,
3544 3357, 3356, 3370, 3369, 3382, 3385, 3397, 3407, 3406, 3420,
3545 3425, 3431, 3431, 3431, 3438, 3439, 3442, 3443, 3450, 3458,
3546 3465, 3472, 3481, 3486, 3491, 3496, 3501, 3507, 3513, 3519,
3547 3524, 3531, 3540, 3541, 3548, 3549, 3556, 3561, 3566, 3571,
3548 3576, 3581, 3586, 3591, 3596, 3601, 3608, 3609, 3616, 3621,
3549 3628, 3633, 3640, 3640, 3645, 3650, 3656, 3661, 3667, 3672,
3550 3677, 3685, 3685, 3690, 3695, 3700, 3705, 3710, 3715, 3720,
3551 3728, 3736, 3739, 3744, 3749, 3756, 3756, 3757, 3758, 3763,
3552 3766, 3771, 3774, 3779, 3779, 3787, 3788, 3789, 3790, 3791,
3553 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801,
3554 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811,
3555 3812, 3813, 3814, 3815, 3816, 3819, 3819, 3819, 3820, 3820,
3556 3821, 3821, 3821, 3822, 3822, 3822, 3822, 3823, 3823, 3823,
3557 3823, 3824, 3824, 3824, 3825, 3825, 3825, 3825, 3826, 3826,
3558 3826, 3826, 3827, 3827, 3827, 3827, 3828, 3828, 3828, 3828,
3559 3829, 3829, 3829, 3829, 3830, 3830, 3833, 3838, 3843, 3848,
3560 3853, 3858, 3863, 3869, 3875, 3881, 3888, 3895, 3901, 3907,
3561 3913, 3919, 3924, 3929, 3934, 3939, 3944, 3949, 3954, 3959,
3562 3964, 3969, 3974, 3979, 3984, 3985, 3990, 3995, 4000, 4005,
3563 4010, 4015, 4020, 4025, 4030, 4035, 4040, 4046, 4053, 4064,
3564 4075, 4081, 4082, 4088, 4095, 4096, 4097, 4098, 4101, 4106,
3565 4114, 4120, 4127, 4134, 4141, 4142, 4146, 4151, 4158, 4163,
3566 4172, 4177, 4187, 4199, 4200, 4206, 4207, 4208, 4212, 4217,
3567 4224, 4230, 4235, 4241, 4247, 4251, 4251, 4289, 4294, 4302,
3568 4307, 4315, 4320, 4325, 4330, 4338, 4343, 4352, 4353, 4357,
3569 4362, 4367, 4385, 4385, 4385, 4385, 4385, 4385, 4385, 4385,
3570 4386, 4387, 4388, 4394, 4393, 4406, 4406, 4412, 4418, 4423,
3571 4428, 4433, 4439, 4444, 4449, 4454, 4459, 4465, 4470, 4475,
3572 4480, 4481, 4487, 4488, 4497, 4506, 4515, 4525, 4524, 4539,
3573 4538, 4551, 4558, 4601, 4600, 4618, 4617, 4637, 4636, 4655,
3574 4653, 4670, 4668, 4683, 4688, 4693, 4698, 4713, 4720, 4727,
3575 4745, 4752, 4760, 4768, 4775, 4783, 4792, 4801, 4809, 4816,
3576 4823, 4831, 4838, 4844, 4859, 4866, 4871, 4877, 4884, 4891,
3577 4892, 4893, 4896, 4897, 4900, 4901, 4911, 4912, 4919, 4920,
3578 4923, 4928, 4935, 4940, 4947, 4952, 4957, 4962, 4967, 4974,
3579 4980, 4987, 4988, 4995, 4995, 4997, 4997, 4997, 5002, 5007,
3580 5012, 5019, 5027, 5027, 5027, 5027, 5027, 5027, 5032, 5037,
3581 5042, 5047, 5052, 5058, 5063, 5068, 5073, 5078, 5083, 5088,
3582 5093, 5098, 5105, 5106, 5112, 5119, 5129, 5134, 5141, 5143,
3583 5147, 5152, 5158, 5164, 5169, 5176, 5182, 5175, 5208, 5215,
3584 5224, 5231, 5230, 5241, 5249, 5261, 5271, 5280, 5287, 5294,
3585 5305, 5311, 5316, 5322, 5328, 5333, 5338, 5346, 5352, 5360,
3586 5360, 5377, 5377, 5398, 5404, 5409, 5415, 5422, 5432, 5433,
3587 5436, 5437, 5439, 5450, 5447, 5463, 5464, 5467, 5468, 5474,
3588 5482, 5483, 5489, 5495, 5500, 5505, 5512, 5515, 5522, 5525,
3589 5530, 5533, 5540, 5547, 5548, 5549, 5556, 5563, 5570, 5576,
3590 5583, 5590, 5597, 5603, 5608, 5613, 5620, 5619, 5630, 5636,
3591 5644, 5650, 5655, 5660, 5665, 5670, 5673, 5677, 5684, 5689,
3592 5696, 5704, 5710, 5717, 5718, 5725, 5732, 5737, 5742, 5747,
3593 5754, 5756, 5763, 5769, 5781, 5782, 5797, 5802, 5809, 5815,
3594 5816, 5823, 5824, 5831, 5838, 5844, 5850, 5851, 5852, 5853,
3595 5859, 5867, 5867, 5867, 5867, 5867, 5867, 5867, 5867, 5868,
3596 5873, 5876, 5884, 5896, 5903, 5910, 5915, 5920, 5927, 5948,
3597 5951, 5956, 5960, 5963, 5968, 5971, 5978, 5981, 5982, 5985,
3598 5999, 6000, 6001, 6008, 6021, 6033, 6040, 6040, 6040, 6040,
3599 6044, 6048, 6055, 6057, 6064, 6064, 6068, 6072, 6079, 6079,
3600 6082, 6082, 6086, 6090, 6098, 6102, 6110, 6114, 6122, 6126,
3601 6134, 6138, 6164, 6167, 6166, 6181, 6189, 6193, 6180, 6212,
3602 6213, 6216, 6221, 6224, 6225, 6228, 6244, 6245, 6248, 6256,
3603 6257, 6265, 6266, 6267, 6268, 6271, 6272, 6273, 6276, 6276,
3604 6277, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 6289, 6299,
3605 6306, 6306, 6313, 6314, 6318, 6317, 6328, 6334, 6335, 6344,
3606 6354, 6355, 6355, 6372, 6372, 6372, 6377, 6382, 6387, 6392,
3607 6409, 6409, 6409, 6409, 6409, 6409, 6414, 6419, 6424, 6429,
3608 6434, 6439, 6444, 6449, 6454, 6459, 6464, 6469, 6474, 6480,
3609 6487, 6498, 6507, 6516, 6525, 6536, 6537, 6547, 6555, 6560,
3610 6579, 6581, 6592, 6612, 6618, 6626, 6632, 6640, 6641, 6644,
3611 6650, 6656, 6664, 6665, 6668, 6674, 6682, 6683, 6686, 6692,
3612 6700, 6705, 6712, 6718, 6717, 6755, 6756, 6763, 6765, 6790,
3613 6795, 6800, 6807, 6813, 6818, 6827, 6827, 6828, 6831, 6832,
3614 6835, 6836, 6837, 6840, 6841, 6844, 6845, 6848, 6849, 6852,
3615 6855, 6858, 6861, 6862, 6865, 6866, 6873, 6874, 6878
3616};
3617#endif
3618
3620#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
3621
3622#if 1
3623/* The user-facing name of the symbol whose (internal) number is
3624 YYSYMBOL. No bounds checking. */
3625static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
3626
3627/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
3628 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
3629static const char *const yytname[] =
3630{
3631 "\"end-of-input\"", "error", "\"invalid token\"", "\"'class'\"",
3632 "\"'module'\"", "\"'def'\"", "\"'undef'\"", "\"'begin'\"",
3633 "\"'rescue'\"", "\"'ensure'\"", "\"'end'\"", "\"'if'\"", "\"'unless'\"",
3634 "\"'then'\"", "\"'elsif'\"", "\"'else'\"", "\"'case'\"", "\"'when'\"",
3635 "\"'while'\"", "\"'until'\"", "\"'for'\"", "\"'break'\"", "\"'next'\"",
3636 "\"'redo'\"", "\"'retry'\"", "\"'in'\"", "\"'do'\"",
3637 "\"'do' for condition\"", "\"'do' for block\"", "\"'do' for lambda\"",
3638 "\"'return'\"", "\"'yield'\"", "\"'super'\"", "\"'self'\"", "\"'nil'\"",
3639 "\"'true'\"", "\"'false'\"", "\"'and'\"", "\"'or'\"", "\"'not'\"",
3640 "\"'if' modifier\"", "\"'unless' modifier\"", "\"'while' modifier\"",
3641 "\"'until' modifier\"", "\"'rescue' modifier\"", "\"'alias'\"",
3642 "\"'defined?'\"", "\"'BEGIN'\"", "\"'END'\"", "\"'__LINE__'\"",
3643 "\"'__FILE__'\"", "\"'__ENCODING__'\"", "\"local variable or method\"",
3644 "\"method\"", "\"global variable\"", "\"instance variable\"",
3645 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
3646 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
3647 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
3648 "\"literal content\"", "tREGEXP_END", "\"dummy end\"", "'.'",
3649 "\"backslash\"", "\"escaped space\"", "\"escaped horizontal tab\"",
3650 "\"escaped form feed\"", "\"escaped carriage return\"",
3651 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
3652 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
3653 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
3654 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
3655 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
3656 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
3657 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
3658 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
3659 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
3660 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "\"'#{'\"",
3661 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tIGNORED_NL", "tCOMMENT",
3662 "tEMBDOC_BEG", "tEMBDOC", "tEMBDOC_END", "tHEREDOC_BEG", "tHEREDOC_END",
3663 "k__END__", "tLOWEST", "'='", "'?'", "':'", "'>'", "'<'", "'|'", "'^'",
3664 "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "tUMINUS_NUM", "'!'", "'~'",
3665 "tLAST_TOKEN", "'{'", "'}'", "'['", "'\\n'", "','", "'`'", "'('", "')'",
3666 "']'", "';'", "' '", "$accept", "$@1", "program", "option_terms",
3667 "top_compstmt", "top_stmts", "top_stmt", "block_open", "begin_block",
3668 "$@2", "$@3", "bodystmt", "$@4", "compstmt", "stmts", "stmt_or_begin",
3669 "$@5", "allow_exits", "k_END", "$@6", "stmt", "command_asgn",
3670 "endless_command", "option_'\\n'", "command_rhs", "expr", "$@7", "$@8",
3671 "def_name", "defn_head", "$@9", "defs_head", "expr_value", "$@10",
3672 "$@11", "expr_value_do", "command_call", "block_command",
3673 "cmd_brace_block", "fcall", "command", "mlhs", "mlhs_inner",
3674 "mlhs_basic", "mlhs_item", "mlhs_head", "mlhs_post", "mlhs_node", "lhs",
3675 "cname", "cpath", "fname", "fitem", "undef_list", "$@12", "op",
3676 "reswords", "arg", "endless_arg", "relop", "rel_expr", "lex_ctxt",
3677 "begin_defined", "after_rescue", "arg_value", "aref_args", "arg_rhs",
3678 "paren_args", "opt_paren_args", "opt_call_args", "call_args", "$@13",
3679 "command_args", "block_arg", "opt_block_arg", "args", "arg_splat",
3680 "mrhs_arg", "mrhs", "primary", "$@14", "$@15", "@16", "@17", "$@18",
3681 "$@19", "$@20", "$@21", "$@22", "primary_value", "k_begin", "k_if",
3682 "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
3683 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
3684 "k_when", "k_else", "k_elsif", "k_end", "k_return", "k_yield", "then",
3685 "do", "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list",
3686 "f_margs", "f_rest_marg", "f_any_kwrest", "$@23", "f_eq",
3687 "f_kwarg_f_block_kw", "block_args_tail", "excessed_comma",
3688 "f_opt_primary_value", "f_optarg_primary_value",
3689 "opt_args_tail_block_args_tail", "block_param", "opt_block_param",
3690 "block_param_def", "opt_bv_decl", "bv_decls", "bvar", "max_numparam",
3691 "numparam", "it_id", "@24", "$@25", "lambda", "f_larglist",
3692 "lambda_body", "$@26", "do_block", "block_call", "method_call",
3693 "brace_block", "@27", "brace_body", "@28", "do_body", "case_args",
3694 "case_body", "cases", "p_pvtbl", "p_pktbl", "p_in_kwarg", "$@29",
3695 "p_case_body", "p_cases", "p_top_expr", "p_top_expr_body", "p_expr",
3696 "p_as", "p_alt", "p_lparen", "p_lbracket", "p_expr_basic", "$@30",
3697 "p_args", "p_args_head", "p_args_tail", "p_find", "p_rest",
3698 "p_args_post", "p_arg", "p_kwargs", "p_kwarg", "p_kw", "p_kw_label",
3699 "p_kwrest", "p_kwnorest", "p_any_kwrest", "p_value", "p_primitive",
3700 "p_variable", "p_var_ref", "p_expr_ref", "p_const", "opt_rescue",
3701 "exc_list", "exc_var", "opt_ensure", "literal", "strings", "string",
3702 "string1", "xstring", "regexp", "nonempty_list_' '",
3703 "words_tWORDS_BEG_word_list", "words", "word_list", "word",
3704 "words_tSYMBOLS_BEG_symbol_list", "symbols", "symbol_list",
3705 "words_tQWORDS_BEG_qword_list", "qwords",
3706 "words_tQSYMBOLS_BEG_qsym_list", "qsymbols", "qword_list", "qsym_list",
3707 "string_contents", "xstring_contents", "regexp_contents",
3708 "string_content", "@31", "@32", "@33", "@34", "string_dend",
3709 "string_dvar", "symbol", "ssym", "sym", "dsym", "numeric",
3710 "simple_numeric", "nonlocal_var", "user_variable", "keyword_variable",
3711 "var_ref", "var_lhs", "backref", "$@35", "superclass",
3712 "f_opt_paren_args", "f_paren_args", "f_arglist", "@36", "f_kwarg_f_kw",
3713 "args_tail", "f_opt_arg_value", "f_optarg_arg_value",
3714 "opt_args_tail_args_tail", "f_args", "args_forward", "f_bad_arg",
3715 "f_norm_arg", "f_arg_asgn", "f_arg_item", "f_arg", "f_label", "f_kw",
3716 "f_block_kw", "kwrest_mark", "f_no_kwarg", "f_kwrest", "restarg_mark",
3717 "f_rest_arg", "blkarg_mark", "f_block_arg", "opt_f_block_arg",
3718 "singleton", "$@37", "assoc_list", "assocs", "assoc", "operation",
3719 "operation2", "operation3", "dot_or_colon", "call_op", "call_op2",
3720 "rparen", "rbracket", "rbrace", "trailer", "term", "terms", "none", YY_NULLPTR
3721};
3722
3723static const char *
3724yysymbol_name (yysymbol_kind_t yysymbol)
3725{
3726 return yytname[yysymbol];
3727}
3728#endif
3729
3730#define YYPACT_NINF (-1105)
3731
3732#define yypact_value_is_default(Yyn) \
3733 ((Yyn) == YYPACT_NINF)
3734
3735#define YYTABLE_NINF (-789)
3736
3737#define yytable_value_is_error(Yyn) \
3738 ((Yyn) == YYTABLE_NINF)
3739
3740/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
3741 STATE-NUM. */
3742static const yytype_int16 yypact[] =
3743{
3744 -1105, 5137, 116, -1105, -1105, -1105, -1105, 9782, -1105, -1105,
3745 -1105, -1105, -1105, -1105, -1105, 10845, 10845, -1105, -1105, -1105,
3746 -1105, 6047, -1105, -1105, -1105, -1105, 577, 9627, 14, 2,
3747 -1105, -1105, -1105, -1105, 4430, 6204, -1105, -1105, 5576, -1105,
3748 -1105, -1105, -1105, -1105, -1105, -1105, -1105, 12297, 12297, 12297,
3749 12297, 176, 8533, 8692, 11329, 11571, 10085, -1105, 9472, -1105,
3750 -1105, -1105, 117, 117, 117, 117, 1370, 12418, 12297, -1105,
3751 646, -1105, -1105, 1384, -1105, 776, 314, 314, -1105, -1105,
3752 260, 148, 160, -1105, 186, 12902, -1105, 268, 2773, 925,
3753 370, 385, -1105, 10724, 10724, -1105, -1105, 9157, 13021, 13140,
3754 13259, 9316, 10845, 6675, -1105, 683, 78, -1105, -1105, 366,
3755 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3756 -1105, -1105, -1105, -1105, -1105, -1105, -1105, 320, 420, -1105,
3757 308, 427, -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, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3765 -1105, 333, -1105, -1105, -1105, -1105, -1105, -1105, 336, 12297,
3766 448, 8692, 12297, 12297, 12297, -1105, 12297, 314, 314, -1105,
3767 393, 5546, 480, -1105, -1105, 435, -1105, 432, 52, 53,
3768 500, 70, 465, -1105, -1105, 10966, -1105, 10845, -1105, -1105,
3769 10463, 12539, 614, -1105, 474, -1105, 8851, -1105, -1105, -1105,
3770 -1105, -1105, 519, 260, -1105, 546, -1105, 572, 621, 5703,
3771 5703, 611, -1105, 8533, 561, 646, -1105, 1384, 14, 602,
3772 -1105, -1105, 590, 720, 819, -1105, 480, 616, 819, -1105,
3773 14, 704, 1370, 13378, 613, 613, 627, -1105, 658, 731,
3774 741, 746, -1105, -1105, 818, -1105, -1105, 972, 1002, 547,
3775 -1105, 630, 630, 630, 630, 716, -1105, -1105, -1105, -1105,
3776 -1105, -1105, -1105, 5290, 672, 10724, 10724, 10724, 10724, -1105,
3777 12539, 12539, 2275, 691, 710, -1105, 2275, -1105, 752, -1105,
3778 -1105, -1105, -1105, 747, -1105, -1105, -1105, -1105, -1105, -1105,
3779 -1105, 8533, 10204, 743, -1105, -1105, 12297, 12297, 12297, 12297,
3780 12297, -1105, -1105, 12297, 12297, 12297, 12297, 12297, 12297, 12297,
3781 12297, -1105, 12297, -1105, -1105, 12297, 12297, 12297, 12297, 12297,
3782 12297, 12297, 12297, 12297, 12297, -1105, -1105, 4541, 10845, 13864,
3783 7462, -1105, 776, 88, 88, 10724, 8380, 8380, -1105, 646,
3784 733, 854, -1105, -1105, 749, 883, 81, 135, 140, 879,
3785 887, 10724, 634, -1105, 778, 793, -1105, -1105, -1105, -1105,
3786 59, 92, 526, 584, 624, 649, 719, 724, 742, -1105,
3787 -1105, -1105, -1105, 788, -1105, 10323, -1105, -1105, -1105, 15349,
3788 -1105, -1105, -1105, -1105, -1105, -1105, 410, -1105, -1105, -1105,
3789 730, 804, 807, -1105, 12297, 11087, -1105, -1105, 13963, 10845,
3790 14062, -1105, -1105, 11450, -1105, 12297, 14, -1105, 789, 14,
3791 797, -1105, -1105, 799, 177, -1105, -1105, -1105, -1105, -1105,
3792 9782, -1105, -1105, 12297, 815, 14161, 14062, -1105, 2, 14,
3793 -1105, -1105, 4702, 834, 841, -1105, 11329, -1105, -1105, 11571,
3794 -1105, -1105, -1105, 474, 809, -1105, -1105, 869, -1105, 13378,
3795 14260, 10845, 14359, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3796 -1105, -1105, -1105, -1105, -1105, 1050, 297, 1081, 326, 12297,
3797 -1105, -1105, 9004, -1105, -1105, -1105, -1105, -1105, 10603, -1105,
3798 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 1300,
3799 -1105, -1105, -1105, -1105, -1105, 876, -1105, 880, -1105, -1105,
3800 886, 14, -1105, -1105, -1105, 913, -1105, 900, 12297, -1105,
3801 115, -1105, -1105, 1007, 904, 1010, -1105, 12660, 7462, 646,
3802 12660, 7462, -1105, 914, -1105, -1105, -1105, 134, 134, 11692,
3803 14, 13378, 916, -1105, 11692, -1105, 621, 4975, 4975, 4975,
3804 4975, 5128, 4761, 4975, 4975, 5703, 5703, 529, 529, -1105,
3805 5389, 1270, 1270, 1294, 406, 406, 621, 621, 621, 1457,
3806 1457, 6832, 5733, 7146, 5890, -1105, -1105, 519, -1105, 14,
3807 920, 643, -1105, 685, -1105, -1105, 6361, 134, -1105, -1105,
3808 7615, 1056, 8074, 170, 134, 134, 1062, 1057, 164, 14458,
3809 10845, 14557, -1105, -1105, -1105, 809, -1105, -1105, -1105, 14656,
3810 10845, 14755, 7462, 12539, -1105, -1105, -1105, 14, -1105, -1105,
3811 -1105, 3926, 12418, 12418, 9782, 12297, 12781, 12781, 12297, -1105,
3812 480, -1105, -1105, 465, 5419, 6518, 14, 413, 422, 12297,
3813 12297, -1105, -1105, 11208, -1105, 11450, -1105, -1105, -1105, 12539,
3814 5546, -1105, 50, 519, 519, 12297, -1105, 259, -1105, -1105,
3815 819, 13378, 869, 305, 344, 14, 391, 423, -1105, -1105,
3816 1151, -1105, 315, -1105, 117, -1105, -1105, 315, 117, -1105,
3817 621, 931, -1105, 1300, 1251, -1105, 929, 14, 930, -1105,
3818 291, -1105, -1105, 68, -1105, 2275, -1105, -1105, 955, 12297,
3819 2275, -1105, -1105, -1105, -1105, -1105, 1777, -1105, -1105, 577,
3820 1047, -1105, 5546, 1053, 134, -1105, 1047, 1053, 134, -1105,
3821 -1105, 946, -1105, -1105, -1105, -1105, -1105, 12297, -1105, 950,
3822 951, 1071, -1105, -1105, 869, 13378, -1105, -1105, 1076, 991,
3823 4088, -1105, -1105, -1105, 852, 461, -1105, -1105, 994, -1105,
3824 -1105, -1105, -1105, 747, 968, 878, 11087, -1105, -1105, -1105,
3825 -1105, 747, -1105, -1105, 1124, 965, -1105, 1122, -1105, -1105,
3826 -1105, -1105, -1105, -1105, 11813, 134, -1105, 1062, 134, 349,
3827 359, 14, 171, 178, 8380, 646, 10724, 7462, 1242, 344,
3828 -1105, 14, 134, 177, 9937, -1105, 78, 148, -1105, 4172,
3829 -1105, -1105, -1105, -1105, -1105, 577, -1105, -1105, -1105, 527,
3830 -1105, -1105, 14, 983, 177, -1105, -1105, -1105, 467, -1105,
3831 -1105, -1105, -1105, -1105, 630, -1105, 630, 630, 630, -1105,
3832 14, -1105, 1300, -1105, 1261, -1105, -1105, 1090, 876, -1105,
3833 -1105, 987, 988, -1105, -1105, 992, -1105, 993, -1105, 987,
3834 12660, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 999, 11934,
3835 -1105, 869, -1105, -1105, -1105, 14854, 10845, 14953, -1105, -1105,
3836 12297, 12418, 12418, 997, -1105, -1105, -1105, 12418, 12418, -1105,
3837 -1105, 12055, 1122, -1105, -1105, -1105, 8380, 10724, 134, -1105,
3838 -1105, 134, -1105, 12297, -1105, 98, -1105, -1105, 134, -1105,
3839 191, 134, 7462, 646, 134, -1105, -1105, -1105, -1105, -1105,
3840 -1105, 12781, 12297, 12297, -1105, 12297, 12297, -1105, 11450, -1105,
3841 1672, 4984, -1105, -1105, 1018, 1021, -1105, 1777, -1105, 1777,
3842 -1105, 2275, -1105, 1777, -1105, -1105, 1047, 1053, 12297, 12297,
3843 -1105, -1105, 12297, 1029, 10603, 10603, 12418, 12297, 6989, 7303,
3844 14, 549, 589, 13690, 13690, 5546, -1105, -1105, -1105, -1105,
3845 -1105, 12418, -1105, -1105, -1105, -1105, 950, -1105, 1065, -1105,
3846 1178, -1105, -1105, 88, -1105, -1105, -1105, 12176, 7768, -1105,
3847 -1105, -1105, 134, -1105, -1105, 12297, 2275, -1105, -1105, 137,
3848 1261, 1261, 987, 987, 1035, 987, 5546, 5546, 1059, 1059,
3849 999, -1105, -1105, 5546, 607, -1105, -1105, -1105, 3518, 3518,
3850 779, -1105, 4010, 272, 1150, -1105, 1225, -1105, -1105, 35,
3851 -1105, 1067, -1105, -1105, -1105, 1054, -1105, 1058, -1105, 13876,
3852 -1105, -1105, -1105, -1105, 908, -1105, -1105, -1105, 41, -1105,
3853 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 469, -1105,
3854 -1105, -1105, 13497, 88, -1105, -1105, 8380, -1105, -1105, 8227,
3855 7615, 12297, -1105, 494, 13690, -1105, 14, 89, -1105, -1105,
3856 -1105, 1021, -1105, -1105, 1777, -1105, -1105, 1993, 9004, -1105,
3857 -1105, 7462, -1105, -1105, -1105, -1105, 13876, 251, 14, 13783,
3858 -1105, 14, 1064, -1105, 1068, -1105, -1105, -1105, 738, -1105,
3859 10724, -1105, 1157, 13783, 13876, 13876, 696, 1111, 3518, 3518,
3860 779, -13, 712, 13690, 13690, -1105, 1166, -1105, 875, 106,
3861 120, 188, 7462, 646, -1105, 965, -1105, -1105, -1105, -1105,
3862 88, 979, 1063, 1066, -1105, 9004, -1105, 987, 876, 1072,
3863 -1105, -1105, 1073, 14, 1093, 913, 1079, 13616, -1105, 1082,
3864 -1105, -1105, -1105, 74, -1105, 1111, 1083, 1085, -1105, -1105,
3865 -1105, -1105, -1105, 14, -1105, -1105, 1086, -1105, 1089, -1105,
3866 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
3867 14, 14, 14, 14, 14, 14, 209, 15052, 10845, 15151,
3868 1124, -1105, 1178, -1105, -1105, 10724, 10724, 1290, -1105, 7462,
3869 1101, -1105, -1105, 68, -1105, 1854, -1105, 1116, -1105, 13616,
3870 1854, -1105, -1105, 1204, 890, 1697, -1105, -1105, 13876, -1105,
3871 696, -1105, 13876, 13783, 832, -1105, -1105, -1105, -1105, -1105,
3872 -1105, 227, 232, 14, 243, 244, -1105, -1105, 7921, -1105,
3873 -1105, -1105, 895, -1105, -1105, 134, -1105, -1105, 876, -1105,
3874 -1105, 1105, 1114, -1105, 890, 1119, 1120, -1105, 15250, 1105,
3875 1129, 14, 1129, -1105, -1105, 267, 409, 1290, -1105, -1105,
3876 -1105, 1697, -1105, 1697, -1105, 1854, -1105, 1697, -1105, 1130,
3877 1132, -1105, 13876, -1105, -1105, -1105, -1105, -1105, 1105, 1105,
3878 1135, 1105, -1105, -1105, 1697, -1105, -1105, 1105, -1105
3879};
3880
3881/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
3882 Performed when YYTABLE does not specify something else to do. Zero
3883 means the default is an error. */
3884static const yytype_int16 yydefact[] =
3885{
3886 2, 0, 0, 46, 385, 386, 387, 0, 378, 379,
3887 380, 383, 26, 26, 26, 373, 374, 375, 376, 397,
3888 398, 305, 672, 671, 673, 674, 59, 0, 59, 0,
3889 788, 676, 675, 677, 765, 767, 666, 665, 766, 667,
3890 661, 662, 663, 664, 610, 682, 683, 0, 0, 0,
3891 0, 0, 0, 0, 788, 788, 114, 465, 636, 636,
3892 638, 640, 0, 0, 0, 0, 0, 0, 0, 3,
3893 4, 8, 26, 10, 40, 45, 691, 691, 65, 85,
3894 305, 84, 0, 102, 0, 106, 116, 0, 74, 254,
3895 270, 0, 333, 0, 0, 81, 81, 0, 0, 0,
3896 0, 0, 342, 305, 352, 86, 350, 322, 323, 609,
3897 611, 324, 325, 619, 326, 625, 328, 629, 327, 631,
3898 329, 608, 653, 654, 607, 659, 670, 678, 679, 330,
3899 0, 331, 89, 7, 1, 195, 206, 196, 219, 192,
3900 212, 202, 201, 222, 223, 217, 200, 199, 194, 220,
3901 224, 225, 204, 193, 207, 211, 213, 205, 198, 214,
3902 221, 216, 215, 208, 218, 203, 191, 210, 209, 190,
3903 197, 188, 189, 185, 186, 187, 145, 147, 146, 180,
3904 181, 176, 158, 159, 160, 167, 164, 166, 161, 162,
3905 182, 183, 168, 169, 173, 177, 163, 165, 155, 156,
3906 157, 170, 171, 172, 174, 175, 178, 179, 184, 150,
3907 152, 33, 148, 149, 151, 381, 382, 384, 0, 761,
3908 0, 0, 316, 764, 308, 636, 0, 691, 691, 300,
3909 0, 283, 311, 100, 304, 788, 312, 0, 678, 679,
3910 0, 331, 788, 757, 101, 788, 484, 0, 97, 60,
3911 59, 0, 0, 28, 788, 12, 0, 11, 27, 280,
3912 373, 374, 485, 0, 248, 0, 342, 345, 249, 239,
3913 240, 339, 24, 0, 0, 4, 21, 23, 59, 104,
3914 20, 335, 0, 59, 59, 284, 0, 0, 59, 755,
3915 59, 0, 0, 0, 691, 691, 112, 377, 0, 122,
3916 123, 130, 462, 656, 0, 655, 657, 0, 0, 0,
3917 616, 620, 632, 626, 634, 660, 69, 260, 261, 785,
3918 784, 6, 786, 0, 0, 0, 0, 0, 0, 788,
3919 0, 0, 719, 0, 690, 369, 719, 688, 0, 371,
3920 388, 489, 478, 90, 491, 349, 389, 491, 474, 788,
3921 118, 0, 110, 107, 788, 72, 0, 0, 0, 0,
3922 0, 276, 277, 0, 0, 0, 0, 237, 238, 0,
3923 0, 70, 0, 274, 275, 0, 0, 0, 0, 0,
3924 0, 0, 0, 0, 0, 775, 776, 0, 788, 0,
3925 0, 80, 79, 0, 0, 0, 0, 0, 359, 4,
3926 5, 0, 409, 408, 0, 0, 678, 679, 331, 140,
3927 141, 0, 0, 143, 686, 0, 678, 679, 331, 367,
3928 215, 208, 218, 203, 185, 186, 187, 145, 146, 753,
3929 76, 75, 752, 0, 99, 59, 98, 778, 777, 0,
3930 351, 612, 788, 788, 153, 760, 339, 315, 763, 307,
3931 0, 0, 0, 788, 0, 0, 301, 310, 0, 788,
3932 0, 788, 788, 0, 302, 720, 59, 296, 788, 59,
3933 788, 295, 306, 0, 59, 348, 68, 30, 32, 31,
3934 0, 788, 281, 0, 0, 0, 0, 788, 0, 59,
3935 337, 19, 0, 103, 0, 340, 783, 782, 285, 783,
3936 287, 341, 756, 0, 129, 660, 120, 115, 690, 0,
3937 0, 788, 0, 463, 642, 658, 645, 643, 637, 613,
3938 614, 639, 615, 641, 617, 0, 0, 0, 0, 0,
3939 787, 9, 0, 34, 35, 36, 37, 282, 0, 66,
3940 67, 726, 723, 722, 721, 724, 732, 737, 720, 0,
3941 743, 738, 747, 746, 742, 788, 739, 788, 718, 701,
3942 704, 59, 699, 725, 727, 728, 730, 704, 734, 693,
3943 741, 422, 421, 745, 704, 749, 698, 0, 0, 0,
3944 0, 0, 462, 0, 489, 91, 462, 0, 0, 0,
3945 59, 0, 108, 119, 0, 502, 246, 253, 255, 256,
3946 257, 264, 265, 258, 259, 235, 236, 262, 263, 502,
3947 59, 250, 251, 252, 241, 242, 243, 244, 245, 278,
3948 279, 765, 767, 766, 769, 483, 768, 305, 481, 59,
3949 788, 765, 767, 766, 769, 482, 305, 0, 788, 400,
3950 0, 399, 0, 0, 0, 0, 0, 357, 339, 0,
3951 788, 0, 81, 365, 140, 141, 142, 684, 363, 0,
3952 788, 0, 0, 0, 773, 774, 77, 59, 344, 765,
3953 766, 305, 0, 0, 0, 0, 0, 0, 0, 759,
3954 313, 309, 314, 788, 765, 766, 59, 765, 766, 0,
3955 0, 758, 290, 297, 292, 299, 779, 347, 29, 0,
3956 266, 13, 338, 0, 788, 0, 25, 105, 22, 336,
3957 59, 0, 113, 770, 128, 59, 765, 766, 464, 646,
3958 0, 618, 0, 622, 0, 628, 624, 0, 0, 630,
3959 247, 0, 38, 0, 420, 412, 414, 59, 417, 410,
3960 0, 697, 751, 0, 696, 0, 714, 689, 0, 0,
3961 0, 711, 733, 568, 740, 744, 0, 716, 748, 59,
3962 54, 57, 271, 268, 0, 692, 55, 269, 0, 463,
3963 487, 0, 463, 395, 396, 488, 473, 316, 41, 318,
3964 0, 44, 317, 117, 111, 0, 64, 47, 62, 0,
3965 288, 311, 226, 42, 0, 331, 500, 500, 0, 788,
3966 788, 489, 480, 94, 0, 486, 297, 788, 788, 294,
3967 479, 92, 293, 334, 788, 788, 401, 788, 403, 82,
3968 402, 355, 356, 392, 0, 0, 502, 0, 0, 770,
3969 338, 59, 765, 766, 0, 0, 0, 0, 140, 141,
3970 144, 59, 0, 59, 0, 343, 475, 87, 48, 288,
3971 227, 56, 234, 154, 762, 59, 303, 788, 788, 486,
3972 788, 788, 59, 788, 59, 233, 286, 121, 486, 26,
3973 647, 644, 651, 652, 621, 623, 633, 627, 635, 39,
3974 59, 419, 0, 729, 0, 750, 694, 741, 788, 703,
3975 702, 704, 704, 424, 700, 704, 731, 704, 728, 704,
3976 0, 788, 788, 370, 372, 464, 88, 464, 321, 0,
3977 788, 109, 788, 788, 788, 0, 788, 0, 501, 501,
3978 0, 0, 0, 0, 95, 780, 788, 0, 0, 93,
3979 390, 788, 17, 599, 394, 393, 0, 0, 0, 404,
3980 406, 0, 83, 0, 493, 0, 360, 500, 0, 361,
3981 486, 0, 0, 0, 0, 486, 368, 754, 78, 476,
3982 477, 0, 0, 0, 788, 0, 0, 291, 298, 346,
3983 719, 0, 411, 413, 415, 418, 695, 0, 715, 0,
3984 712, 0, 707, 0, 709, 717, 61, 273, 0, 0,
3985 26, 26, 316, 319, 0, 0, 0, 0, 765, 766,
3986 59, 765, 766, 0, 0, 267, 53, 231, 52, 232,
3987 96, 0, 50, 229, 51, 230, 600, 601, 788, 602,
3988 788, 14, 407, 0, 353, 354, 494, 0, 0, 501,
3989 358, 362, 0, 685, 364, 0, 719, 466, 469, 0,
3990 0, 0, 704, 704, 704, 704, 58, 272, 788, 788,
3991 320, 43, 63, 289, 486, 591, 597, 564, 0, 0,
3992 0, 501, 59, 501, 552, 636, 0, 590, 73, 510,
3993 516, 518, 520, 514, 513, 548, 515, 557, 560, 563,
3994 569, 570, 559, 523, 571, 524, 576, 577, 578, 581,
3995 582, 583, 584, 585, 587, 586, 588, 589, 567, 71,
3996 49, 228, 0, 0, 604, 391, 0, 18, 606, 0,
3997 0, 0, 495, 788, 0, 366, 59, 0, 650, 649,
3998 648, 416, 713, 708, 0, 705, 710, 59, 0, 453,
3999 452, 0, 579, 580, 141, 595, 0, 540, 59, 541,
4000 545, 59, 0, 535, 0, 788, 538, 551, 0, 592,
4001 0, 593, 0, 511, 0, 0, 558, 562, 574, 575,
4002 0, 501, 501, 0, 0, 566, 0, 603, 0, 678,
4003 679, 331, 0, 4, 15, 788, 496, 498, 499, 497,
4004 0, 507, 456, 0, 471, 0, 467, 704, 788, 788,
4005 451, 433, 436, 59, 0, 728, 436, 736, 425, 436,
4006 430, 490, 492, 59, 533, 555, 543, 542, 534, 546,
4007 781, 536, 565, 59, 517, 512, 548, 519, 549, 553,
4008 636, 561, 556, 572, 573, 596, 522, 532, 521, 528,
4009 59, 59, 59, 59, 59, 59, 339, 0, 788, 0,
4010 788, 605, 788, 405, 503, 0, 0, 0, 468, 0,
4011 0, 706, 429, 0, 428, 0, 447, 0, 454, 0,
4012 431, 442, 444, 0, 735, 0, 449, 539, 0, 547,
4013 0, 594, 0, 0, 0, 525, 526, 527, 529, 530,
4014 531, 770, 338, 59, 765, 766, 598, 16, 0, 508,
4015 509, 460, 59, 458, 461, 0, 470, 426, 788, 435,
4016 434, 436, 436, 455, 432, 436, 436, 339, 0, 436,
4017 544, 59, 549, 550, 554, 486, 788, 0, 457, 472,
4018 427, 0, 448, 0, 445, 0, 439, 0, 441, 770,
4019 338, 450, 0, 537, 505, 506, 504, 459, 436, 436,
4020 436, 436, 446, 440, 0, 437, 443, 436, 438
4021};
4022
4023/* YYPGOTO[NTERM-NUM]. */
4024static const yytype_int16 yypgoto[] =
4025{
4026 -1105, -1105, -1105, -96, 1038, -1105, 973, -1105, 811, -1105,
4027 -1105, -533, -1105, -39, 194, 817, -1105, 5, -1105, -1105,
4028 22, 254, -520, 18, -492, -57, -1105, -1105, 470, 2485,
4029 -1105, 2614, -9, -1105, -1105, -58, 125, -1105, -244, 1231,
4030 -12, 1221, -153, 21, -51, -1105, -417, 10, 1013, -395,
4031 1220, -38, -18, -1105, -1105, 20, -1105, 3966, -547, 1232,
4032 -1105, 562, 842, 541, 2850, -1105, 702, -16, 659, -373,
4033 60, -1105, 65, -328, -226, 15, -353, -1105, -540, -28,
4034 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, 867,
4035 -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105, -1105,
4036 -1105, -1105, -1105, -1105, -1105, 402, -1105, 629, 1595, 2113,
4037 -372, -1105, 162, -767, -1105, -793, -801, 605, 453, -502,
4038 -1105, 146, -1105, 231, -1105, -1104, 100, 184, -1105, 318,
4039 -1105, -993, -1105, 51, 295, 161, -389, -1105, -1105, 581,
4040 -1105, -1105, -1105, 530, -1105, -1105, -95, -1105, -516, -1105,
4041 1026, -1105, -769, -1105, -706, -825, -513, -1105, 63, -1105,
4042 -1105, -891, -753, -1105, -1105, -1105, -1105, 228, -1105, -142,
4043 -1105, -779, -957, -980, -343, -984, -732, -1105, 225, -1105,
4044 -1105, -785, 239, -1105, -584, 235, -1105, -1105, -1105, 158,
4045 -1105, -1105, 159, 1133, 1320, -1105, 1279, 1660, 1842, 17,
4046 -1105, 2023, -1105, 877, -1105, 2256, -1105, -1105, 2643, -1105,
4047 2725, -1105, -1105, -53, -1105, -1105, -186, -1105, -1105, -1105,
4048 -1105, -1105, -1105, 32, -1105, -1105, -1105, -1105, 29, -56,
4049 3112, -1, 1305, 3168, 1958, -1105, -1105, 132, 760, 38,
4050 -1105, -1105, -311, -683, 661, -426, -307, -196, -1089, -507,
4051 -324, -663, -493, -225, 675, 168, -374, -1105, -711, -1105,
4052 -671, -1105, -557, -522, -1105, -1105, -1105, 109, -396, 263,
4053 -346, -1105, -1105, -81, -1105, 119, 151, 122, -223, -44,
4054 -63, 55
4055};
4056
4057/* YYDEFGOTO[NTERM-NUM]. */
4058static const yytype_int16 yydefgoto[] =
4059{
4060 0, 1, 2, 321, 69, 70, 71, 256, 257, 1109,
4061 1242, 637, 1020, 638, 275, 276, 488, 215, 72, 480,
4062 277, 74, 760, 473, 787, 75, 609, 595, 430, 227,
4063 844, 228, 393, 395, 942, 396, 78, 79, 585, 263,
4064 81, 82, 278, 83, 84, 85, 507, 86, 230, 413,
4065 414, 209, 210, 211, 674, 624, 213, 88, 763, 383,
4066 89, 537, 483, 538, 232, 282, 792, 625, 810, 466,
4067 467, 247, 248, 234, 456, 630, 236, 781, 782, 90,
4068 390, 494, 827, 646, 837, 835, 662, 578, 581, 265,
4069 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
4070 344, 347, 931, 1106, 824, 936, 937, 775, 266, 267,
4071 640, 819, 938, 939, 405, 735, 736, 737, 738, 555,
4072 748, 749, 1189, 1299, 1261, 1191, 1192, 1256, 1193, 1128,
4073 1129, 1183, 1292, 1293, 513, 718, 869, 302, 1117, 104,
4074 1037, 1186, 1249, 348, 105, 106, 345, 582, 583, 586,
4075 587, 945, 825, 1179, 918, 1003, 796, 1288, 828, 1336,
4076 1180, 1068, 1205, 1070, 1071, 1163, 1164, 1072, 1270, 1138,
4077 1139, 1140, 1074, 1075, 1218, 1142, 1076, 1077, 1078, 1079,
4078 1080, 556, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 932,
4079 1018, 1103, 1107, 107, 108, 109, 110, 111, 112, 311,
4080 113, 114, 525, 722, 115, 116, 527, 117, 118, 119,
4081 120, 526, 528, 304, 308, 309, 518, 720, 719, 870,
4082 971, 1120, 871, 121, 122, 305, 123, 124, 125, 126,
4083 238, 239, 129, 240, 241, 836, 658, 333, 334, 335,
4084 336, 557, 889, 559, 560, 746, 561, 562, 563, 564,
4085 898, 566, 567, 568, 569, 1198, 570, 571, 572, 573,
4086 574, 575, 576, 741, 433, 663, 287, 470, 243, 132,
4087 703, 628, 666, 661, 439, 475, 805, 1146, 498, 641,
4088 400, 259
4089};
4090
4091/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
4092 positive, shift that token. If negative, reduce the rule whose
4093 number is the opposite. If YYTABLE_NINF, syntax error. */
4094static const yytype_int16 yytable[] =
4095{
4096 128, 398, 306, 229, 229, 246, 307, 323, 565, 253,
4097 389, 440, 565, 274, 281, 629, 464, 656, 216, 217,
4098 303, 558, 642, 73, 438, 558, 322, 212, 297, 579,
4099 235, 235, 888, 767, 353, 744, 392, 392, 397, 214,
4100 392, 627, 739, 636, 251, 764, 254, 212, 768, 469,
4101 941, 128, 128, 322, 793, 300, 133, 297, 948, 214,
4102 766, 500, 890, 431, 342, 502, 296, 691, 771, 283,
4103 297, 297, 297, 279, 892, 233, 244, 324, 212, 897,
4104 312, 313, 314, 975, 300, 394, 686, 896, 399, 973,
4105 229, 919, 712, 671, 1004, 315, 797, 407, 417, 417,
4106 417, 639, 682, 691, 340, 1141, -131, 280, 280, 285,
4107 289, 639, 627, 1099, 636, 339, 134, 235, 1184, -131,
4108 489, 212, 521, 523, 242, 242, 546, 681, -672, 842,
4109 767, 337, 337, -132, 1194, 681, 1152, 1118, 715, 1160,
4110 704, 751, 249, 682, 773, 343, 547, -59, 757, 753,
4111 858, 1300, -680, -681, 255, 1207, 460, -672, 1294, 1206,
4112 -132, -671, 434, 284, 288, -139, 704, 754, 436, 249,
4113 462, 1219, 450, 1216, 784, 1152, 346, 551, 552, 491,
4114 848, 851, 274, 885, 486, -137, 885, -131, -132, -138,
4115 -671, 1153, 316, 474, 476, 1161, -134, 818, 590, 1162,
4116 1257, -139, 774, -136, 1114, -139, 1231, 1234, -766, 338,
4117 553, 242, 492, 1185, 330, 331, -133, 512, 1081, 1081,
4118 128, 1300, -138, 1181, 1073, 1073, 739, 881, 1294, 249,
4119 341, 322, 271, 229, 274, 229, 1136, -122, 1145, 1121,
4120 -135, 1029, 506, 319, 464, -137, 246, 342, 973, 320,
4121 1069, 1069, 891, 319, 1027, 128, -134, -136, 1119, 320,
4122 468, -131, 235, 899, 840, 297, 339, -131, 392, 392,
4123 392, 392, 128, 539, 540, -132, 280, 831, 73, 310,
4124 -133, -132, 337, 337, 1219, 923, 340, 841, 1219, 1314,
4125 457, -123, 300, 1313, 279, 349, -130, 457, 890, 691,
4126 471, 497, 497, 647, 954, 704, 497, 472, 503, 1137,
4127 1044, 133, 274, 947, 896, 704, 533, 534, 535, 536,
4128 -129, 505, 128, 651, 297, 319, 1157, -125, 280, 1081,
4129 -126, 320, 249, 339, -127, 1073, 1226, 1228, 392, 723,
4130 682, 723, 350, -139, 1178, 73, 1177, -124, 1314, -139,
4131 128, 300, 1152, 987, 392, 322, 242, 644, 645, 451,
4132 452, 1069, 592, 724, -138, 681, 976, 681, 911, 887,
4133 -138, 1081, 279, 635, -135, 739, 229, 739, 1081, 1081,
4134 986, 514, -135, 1203, -137, -765, 643, -137, -135, 128,
4135 -766, 1017, 728, -137, -103, 128, 128, 493, -134, -136,
4136 1137, 552, 653, 354, -134, -136, 280, -555, 442, 634,
4137 1137, 1137, 341, -338, 987, -117, -125, 725, 245, 1032,
4138 -680, 565, -133, 229, 935, -59, 565, 249, -133, 1006,
4139 1008, 1232, 1235, 553, 826, 1012, 1014, 516, 517, -377,
4140 -126, -338, -338, 471, 635, 280, 729, 229, -127, -788,
4141 235, 280, 280, 682, 385, -131, 1199, 856, 506, 634,
4142 -126, -126, 698, -765, -126, 978, 980, -377, -377, 982,
4143 635, 984, 332, 985, 1132, 1133, -122, 310, 681, 59,
4144 634, 297, 386, 387, 356, 1081, 1042, 866, 1043, 444,
4145 1045, 128, -124, 731, 250, 667, 635, 862, -338, 229,
4146 212, 385, -766, 753, 446, -126, 634, -765, 300, 935,
4147 487, 823, 214, 860, 471, -128, 990, -766, 991, 1100,
4148 -681, 1165, 861, 457, -377, 457, -125, 443, 453, 386,
4149 458, 128, 634, 739, 739, 765, 875, 128, 1311, 388,
4150 506, 875, 1298, 1000, 242, -138, -125, -125, -134, 1334,
4151 -125, 380, 381, 382, 668, -132, 682, -136, -127, 924,
4152 732, 443, -139, 297, 683, 761, 471, 929, 761, 627,
4153 1200, 636, 691, 1028, 1223, 1224, -123, 128, -127, -127,
4154 128, 454, -127, -130, 1302, 692, 459, 280, 694, 1306,
4155 300, 455, 258, 697, 834, -673, -139, 896, 1202, 820,
4156 461, 815, -124, 817, 780, 710, 843, 356, 707, 780,
4157 742, 802, 742, 514, 522, 385, 1122, 1123, 1125, 1126,
4158 809, 463, -124, -124, -673, 1188, -124, 964, 798, 1098,
4159 1098, 1187, 481, 280, 1196, 635, 280, 856, 229, 128,
4160 681, 128, 864, 386, 485, 635, 565, 804, 229, 807,
4161 626, 1110, 626, -674, 1340, 809, 853, 565, 896, 558,
4162 867, 128, -133, 1038, 872, 1135, 1252, 1254, 477, 516,
4163 517, 634, 378, 379, 380, 381, 382, 245, 478, 479,
4164 747, 634, -674, 297, -134, 457, 654, 802, 809, 808,
4165 655, 812, 803, -676, 212, 280, 885, 280, 1200, 356,
4166 459, 811, 626, 1200, 804, 471, 214, 926, 1200, 783,
4167 300, 487, 565, 917, 778, 471, 1295, 280, -675, 788,
4168 490, 626, -676, 626, -136, 558, 812, 385, 497, 1116,
4169 435, 1172, 249, 804, 506, 250, 847, -102, 457, 874,
4170 1098, 876, -133, 807, 877, 878, -138, -675, 626, 626,
4171 495, 959, 385, 1188, 1057, 386, 510, 297, 1188, 812,
4172 504, 1251, 1301, 1188, 1200, 1225, 1200, -129, 1200, 501,
4173 1200, 332, 1309, 626, 547, 626, 1320, 900, -134, 392,
4174 386, 437, 1098, 509, 300, 808, 845, 1200, -677, 1098,
4175 1098, 952, 524, -668, 529, 951, 514, 788, 788, -125,
4176 -678, 319, 863, 1195, 514, 551, 431, 320, 1244, 1220,
4177 -679, -669, 511, 330, 331, -331, 482, -677, 385, 1188,
4178 -136, 1188, -668, 1188, 532, 1188, 577, 953, -678, -678,
4179 1338, 654, 1339, 128, 1341, 1134, 128, 859, -679, -679,
4180 -669, -127, 1188, -331, -331, -687, 386, 649, 786, 804,
4181 519, 1347, 516, 517, 584, 675, 883, 664, 519, 804,
4182 516, 517, 385, 1212, 212, 1283, 868, 249, 91, 933,
4183 940, -59, 940, 961, 970, 249, 496, 769, -339, 887,
4184 392, 772, 237, 237, 514, -678, 665, 580, 761, 280,
4185 386, 659, 280, 704, 530, -679, 1098, 1022, 514, 593,
4186 -331, 635, 1197, 650, 229, -765, -339, -339, 652, 1033,
4187 648, 589, 626, -766, 626, 863, 594, 657, 457, 91,
4188 91, 385, 626, 298, 626, 1310, 786, 786, 1023, 1312,
4189 905, 1195, 1039, 907, 237, 128, 1195, 634, 515, 676,
4190 516, 517, 677, 742, 385, 693, 780, 660, -668, 386,
4191 915, 128, 298, 695, 516, 517, -669, 1212, 696, 385,
4192 237, 237, 957, -339, 237, 404, 415, 415, 701, 237,
4193 128, 471, 386, 1237, 249, 499, -668, -668, 926, 934,
4194 935, 967, 950, 969, -669, -669, 1019, 386, 1308, 1113,
4195 -117, 280, 955, 128, 128, 1048, 1049, 1158, 1159, 972,
4196 709, 1195, 1097, 1097, 672, 673, 916, 280, 361, 362,
4197 1151, 1215, 1148, -133, 87, 678, 1051, 1052, 804, 1245,
4198 1246, 1230, 1233, 689, 690, 711, 280, 128, 1197, 1238,
4199 1197, -765, 740, -668, -124, 1197, 743, -765, 514, -766,
4200 1197, -669, 745, 482, 660, -766, 788, 788, -423, 705,
4201 249, 1317, 788, 788, 508, 508, 750, 1097, 1097, 755,
4202 756, 1097, 758, 373, 374, 87, 87, 770, 514, 816,
4203 1174, 1175, 785, 1104, 297, 1108, 806, 1241, 1097, 823,
4204 804, 1144, 826, 280, 879, 882, 884, 1239, 91, 1201,
4205 893, 901, 519, 392, 516, 517, 1197, 902, 1197, 906,
4206 1197, 1170, 1197, 1130, 1130, 128, -311, 909, 128, 128,
4207 492, 403, 237, 1097, 237, 910, 514, 237, 237, 1197,
4208 912, 788, 520, 91, 516, 517, 913, 128, 925, 322,
4209 128, 920, 930, 1240, 1182, 1097, 788, 935, 1097, 968,
4210 91, 1213, 754, 977, 979, 1182, 1250, 514, 981, 983,
4211 1010, 1054, 1097, 1097, 1097, -315, 804, 1097, 1097, 804,
4212 298, 280, 1097, 1097, 280, 280, 1102, 1274, 940, 297,
4213 721, 128, 516, 517, 1040, 786, 786, 1041, 626, 804,
4214 626, 786, 786, 280, 128, -313, 280, 1105, 392, 392,
4215 91, 1124, 237, 237, 237, 237, 417, 237, 237, 1127,
4216 814, 726, 1147, 516, 517, 36, 37, 1154, 39, 1055,
4217 1155, 1182, 1152, 1143, 1156, 45, 46, 776, 91, 298,
4218 1209, 1210, 1236, 635, 1247, 1248, 229, 280, 1253, 1255,
4219 940, 297, 80, 1258, 87, 1260, 1289, 1290, 1265, 1268,
4220 280, 1269, 1272, 742, 742, 1273, 80, 80, 128, 1316,
4221 786, 804, 804, 804, 1296, 237, 1303, 91, 417, 634,
4222 1307, 1321, 237, 91, 91, 786, 813, 1097, -770, 87,
4223 1323, 1097, 1097, 821, 822, 1325, 1327, 1149, 237, 36,
4224 37, 1229, 39, 80, 80, 1332, 87, 128, -765, 1204,
4225 -766, 1344, 1208, 471, 484, 933, 531, 1108, 80, 706,
4226 1173, 804, 237, 541, 280, 542, 543, 544, 545, 708,
4227 1318, -770, 1227, 541, 958, 542, 543, 544, 545, 402,
4228 419, 384, 1267, 699, 80, 80, 237, 1150, 80, 1144,
4229 846, 1097, 1271, 80, 1021, 974, 87, 1243, 880, -770,
4230 -770, 1259, 1291, 280, 542, 543, 544, 545, 356, 1275,
4231 1276, 1277, 541, 742, 542, 543, 544, 545, 1190, 91,
4232 1305, 921, 922, 733, 87, 369, 370, 1131, 1337, 927,
4233 928, 940, 356, 588, 850, 852, 298, 960, 237, 1335,
4234 1262, 1221, 1217, 1266, 1278, 1279, 1280, 1214, 441, 369,
4235 370, 850, 852, 903, -770, 1222, -770, 904, 1286, 91,
4236 -765, 1287, 733, 87, 727, 91, 432, 865, 734, 87,
4237 87, 895, 377, 378, 379, 380, 381, 382, 886, 962,
4238 963, 1297, 965, 966, 325, 326, 327, 328, 329, 40,
4239 41, 42, 43, 1333, 1315, 0, 0, 378, 379, 380,
4240 381, 382, 988, 989, 237, 91, 0, 237, 91, 0,
4241 0, 994, 80, 995, 946, 997, 237, 949, 298, 0,
4242 0, 794, 0, 0, 0, 0, 0, 0, 0, 0,
4243 0, 956, 0, 0, 0, 996, 80, 0, 80, 0,
4244 0, 80, 80, 0, 0, 1322, 1324, 80, 1011, 1326,
4245 1328, 0, 0, 1331, 0, 0, 0, 0, 0, 0,
4246 626, 0, 626, 0, 80, 87, 0, 91, 0, 91,
4247 0, 0, 0, 0, 0, 0, 0, 237, 0, 0,
4248 0, 0, 1342, 1343, 1345, 1346, 1035, 237, 0, 91,
4249 237, 1348, 0, 0, 0, 356, 0, 0, 0, 794,
4250 794, 0, 0, 0, 0, 87, 0, 0, 0, 0,
4251 0, 87, 369, 370, 80, 0, 80, 80, 80, 80,
4252 0, 80, 80, 0, 0, 0, 237, 1024, 0, 0,
4253 1025, 626, 0, 0, 0, 0, 0, 1030, 298, 0,
4254 1031, 0, 80, 1034, 1067, 1067, 0, 0, 0, 0,
4255 0, 87, 0, 0, 87, 0, 102, 375, 376, 377,
4256 378, 379, 380, 381, 382, 0, 0, 789, 0, 0,
4257 102, 102, 0, 0, 0, 0, 0, 0, 0, 80,
4258 0, 80, 0, 1007, 1009, 0, 80, 80, 80, 1013,
4259 1015, 0, 0, 0, 0, 0, 0, 0, 0, 1067,
4260 1067, 0, 80, 1067, 0, 0, 0, 102, 102, 0,
4261 0, 0, 298, 87, 0, 87, 0, 0, 0, 0,
4262 1067, 1115, 102, 0, 1007, 1009, 80, 1013, 1015, 0,
4263 0, 0, 0, 0, 0, 87, 0, 0, 0, 0,
4264 0, 0, 0, 0, 0, 789, 789, 0, 102, 102,
4265 80, 0, 102, 0, 0, 1067, 0, 102, 0, 0,
4266 0, 91, 0, 237, 91, 0, 0, 1211, 0, 0,
4267 0, 0, 0, 1101, 0, 0, 0, 1067, 0, 0,
4268 1067, 0, 0, 80, 541, 0, 542, 543, 544, 545,
4269 546, 0, 0, 0, 1067, 1067, 1067, 1101, 0, 1067,
4270 1067, 0, 80, 0, 1067, 1067, 0, 0, 0, 541,
4271 547, 542, 543, 544, 545, 546, 0, 0, 0, 0,
4272 0, 0, 0, 80, 548, 0, 0, 237, 0, 80,
4273 0, 0, 0, 0, 549, 547, 0, 0, 0, 0,
4274 550, 551, 552, 237, 0, 0, 0, 0, 794, 794,
4275 0, 0, 0, 0, 794, 794, 0, 0, 0, 549,
4276 0, 0, 0, 91, 237, 0, 551, 552, 80, 80,
4277 0, 80, 80, 0, 553, 0, 102, 554, 0, 91,
4278 80, 0, 0, 0, 0, 80, 0, 0, 0, 541,
4279 1036, 542, 543, 544, 545, 546, 0, 0, 91, 553,
4280 102, 0, 102, 0, 0, 102, 102, 87, 0, 1067,
4281 87, 102, 0, 1067, 1067, 547, 0, 0, 0, 0,
4282 0, 91, 91, 794, 0, 0, 0, 0, 102, 548,
4283 0, 80, 0, 80, 0, 0, 0, 0, 794, 549,
4284 0, 80, 0, 0, 0, 0, 551, 552, 0, 0,
4285 0, 80, 0, 80, 80, 91, 0, 0, 0, 0,
4286 0, 0, 0, 80, 80, 0, 541, 0, 542, 543,
4287 544, 545, 546, 1067, 0, 0, 0, 0, 102, 553,
4288 102, 102, 102, 102, 1319, 102, 102, 0, 0, 0,
4289 80, 0, 547, 0, 789, 789, 0, 0, 0, 0,
4290 789, 789, 0, 0, 0, 0, 102, 0, 0, 87,
4291 0, 0, 0, 0, 0, 0, 549, 0, 0, 131,
4292 0, 0, 550, 551, 552, 87, 0, 0, 0, 1168,
4293 0, 0, 0, 91, 0, 0, 91, 91, 0, 0,
4294 0, 0, 0, 102, 87, 102, 0, 0, 0, 0,
4295 102, 102, 102, 0, 0, 91, 553, 0, 91, 554,
4296 0, 0, 0, 0, 0, 0, 102, 87, 87, 789,
4297 131, 131, 0, 0, 301, 0, 0, 237, 0, 0,
4298 0, 0, 0, 0, 789, 0, 0, 0, 0, 0,
4299 102, 0, 0, 0, 0, 0, 0, 0, 0, 91,
4300 0, 87, 0, 301, 0, 541, 0, 542, 543, 544,
4301 545, 546, 91, 0, 102, 0, 408, 418, 418, 0,
4302 0, 0, 0, 0, 1264, 80, 0, 80, 80, 0,
4303 0, 547, 0, 0, 0, 0, 0, 0, 0, 0,
4304 0, 0, 0, 0, 0, 0, 0, 102, 0, 0,
4305 0, 0, 0, 0, 0, 549, 0, 0, 0, 0,
4306 0, 550, 551, 552, 0, 237, 102, 0, 0, 0,
4307 0, 0, 237, 237, 103, 1167, 91, 0, 0, 87,
4308 0, 0, 87, 87, 0, 0, 1304, 102, 103, 103,
4309 0, 80, 0, 102, 0, 553, 1089, 1089, 554, 0,
4310 0, 87, 0, 0, 87, 0, 0, 80, 249, 0,
4311 0, 0, 80, 80, 0, 91, 0, 0, 80, 80,
4312 0, 0, 0, 0, 0, 103, 103, 80, 80, 0,
4313 0, 0, 102, 102, 0, 102, 102, 0, 0, 131,
4314 103, 0, 0, 80, 102, 87, 0, 0, 0, 102,
4315 0, 1089, 1089, 0, 0, 1089, 0, 0, 87, 0,
4316 0, 0, 80, 0, 0, 0, 103, 103, 0, 0,
4317 103, 0, 1089, 0, 131, 103, 0, 0, 0, 0,
4318 0, 0, 0, 0, 0, 80, 80, 80, 0, 0,
4319 0, 131, 0, 0, 0, 102, 0, 102, 0, 0,
4320 0, 0, 80, 0, 0, 102, 0, 1089, 0, 0,
4321 0, 301, 0, 0, 0, 102, 0, 102, 102, 80,
4322 0, 0, 87, 0, 0, 0, 0, 102, 102, 1089,
4323 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0,
4324 0, 131, 0, 0, 0, 0, 1089, 1089, 1089, 0,
4325 0, 1089, 1089, 0, 102, 0, 1089, 1089, 0, 0,
4326 0, 87, 0, 0, 0, 0, 0, 0, 0, 131,
4327 301, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4328 0, 0, 0, 1090, 1090, 0, 0, 541, 0, 542,
4329 543, 544, 545, 546, 103, 0, 0, 80, 0, 0,
4330 80, 80, 0, 0, 0, 0, 0, 0, 131, 0,
4331 0, 0, 0, 547, 131, 131, 0, 0, 103, 80,
4332 103, 0, 80, 103, 103, 0, 0, 548, 0, 103,
4333 0, 0, 0, 0, 0, 0, 0, 549, 1090, 1090,
4334 0, 80, 1090, 550, 551, 552, 103, 0, 0, 0,
4335 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090,
4336 0, 1089, 0, 80, 0, 1089, 1089, 0, 0, 0,
4337 0, 0, 0, 0, 0, 0, 80, 553, 0, 0,
4338 554, 0, 0, 0, 0, 0, 0, 0, 0, 102,
4339 0, 102, 102, 0, 1090, 0, 103, 0, 103, 103,
4340 103, 103, 0, 103, 103, 0, 0, 0, 0, 0,
4341 131, 0, 0, 0, 0, 0, 1090, 0, 0, 1090,
4342 0, 0, 0, 0, 103, 1089, 0, 301, 0, 80,
4343 0, 0, 0, 1090, 1090, 1090, 80, 80, 1090, 1090,
4344 80, 0, 0, 1090, 1090, 0, 76, 0, 0, 0,
4345 131, 0, 0, 0, 0, 102, 131, 0, 0, 0,
4346 0, 103, 0, 103, 0, 0, 0, 0, 103, 103,
4347 103, 102, 0, 0, 0, 0, 102, 102, 0, 80,
4348 0, 0, 102, 102, 103, 0, 0, 0, 0, 0,
4349 0, 102, 102, 0, 0, 0, 131, 76, 76, 131,
4350 0, 294, 0, 0, 0, 0, 0, 102, 103, 301,
4351 0, 0, 795, 0, 0, 0, 0, 0, 0, 0,
4352 0, 0, 0, 0, 0, 0, 102, 0, 0, 0,
4353 294, 0, 103, 0, 0, 0, 0, 0, 0, 0,
4354 0, 0, 0, 294, 294, 294, 0, 0, 1090, 102,
4355 102, 102, 1090, 1090, 0, 0, 0, 0, 131, 0,
4356 131, 0, 0, 0, 0, 103, 102, 0, 0, 0,
4357 0, 0, 0, 0, 0, 77, 0, 0, 0, 0,
4358 131, 0, 0, 102, 103, 0, 0, 0, 0, 0,
4359 795, 795, 0, 0, 0, 0, 0, 0, 0, 0,
4360 0, 0, 0, 0, 0, 103, 0, 0, 0, 0,
4361 0, 103, 1090, 0, 0, 0, 0, 0, 0, 0,
4362 0, 0, 0, 1091, 1091, 0, 77, 77, 0, 301,
4363 295, 0, 0, 0, 0, 0, 0, 0, 873, 0,
4364 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4365 103, 103, 0, 103, 103, 0, 0, 0, 0, 295,
4366 0, 102, 103, 0, 102, 102, 76, 103, 0, 0,
4367 0, 0, 295, 295, 295, 0, 0, 0, 1091, 1091,
4368 0, 0, 1091, 102, 0, 0, 102, 0, 0, 0,
4369 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091,
4370 0, 76, 0, 301, 0, 102, 0, 0, 0, 0,
4371 0, 0, 0, 103, 0, 103, 0, 0, 76, 0,
4372 0, 0, 0, 103, 0, 0, 0, 102, 0, 0,
4373 0, 0, 0, 103, 1091, 103, 103, 0, 294, 0,
4374 102, 0, 0, 0, 0, 103, 103, 0, 0, 0,
4375 0, 0, 131, 0, 0, 131, 1091, 0, 355, 1091,
4376 0, 0, 0, 0, 0, 0, 0, 0, 76, 0,
4377 0, 0, 103, 1091, 1091, 1091, 0, 0, 1091, 1091,
4378 0, 0, 0, 1091, 1091, 0, 0, 0, 0, 0,
4379 0, 0, 0, 102, 0, 77, 76, 294, 0, 0,
4380 102, 102, 0, 0, 102, 1092, 1092, 0, 0, 0,
4381 0, 356, 357, 358, 359, 360, 361, 362, 363, 364,
4382 365, 366, 367, 368, 0, 0, 0, 0, 369, 370,
4383 77, 0, 0, 0, 371, 76, 0, 0, 0, 795,
4384 795, 76, 76, 102, 0, 795, 795, 77, 0, 0,
4385 0, 0, 0, 0, 131, 0, 0, 0, 0, 0,
4386 1092, 1092, 0, 0, 1092, 286, 0, 295, 0, 372,
4387 131, 373, 374, 375, 376, 377, 378, 379, 380, 381,
4388 382, 1092, 0, 0, 0, 0, 0, 0, 1091, 131,
4389 0, 0, 1091, 1091, 0, 0, 0, 77, 0, 0,
4390 0, 0, 0, 0, 0, 0, 0, 103, 0, 103,
4391 103, 0, 131, 131, 795, 0, 1092, 0, 0, 0,
4392 0, 0, 0, 0, 0, 77, 295, 0, 0, 795,
4393 0, 0, 0, 0, 0, 0, 0, 76, 1092, 0,
4394 0, 1092, 0, 0, 0, 0, 131, 0, 0, 0,
4395 0, 0, 1091, 0, 294, 1092, 1092, 1092, 0, 0,
4396 1092, 1092, 0, 0, 77, 1092, 1092, 0, 0, 0,
4397 77, 77, 0, 103, 0, 0, 0, 76, 0, 0,
4398 0, 0, 0, 76, 0, 0, 1093, 1093, 0, 103,
4399 0, 0, 0, 0, 103, 103, 0, 0, 0, 0,
4400 103, 103, 0, 0, 0, 0, 0, 0, 0, 103,
4401 103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4402 1171, 0, 0, 76, 131, 103, 76, 131, 131, 445,
4403 0, 0, 447, 448, 449, 0, 294, 0, 0, 76,
4404 0, 1093, 1093, 0, 103, 1093, 131, 0, 0, 131,
4405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4406 0, 0, 1093, 0, 0, 0, 77, 103, 103, 103,
4407 1092, 0, 0, 127, 1092, 1092, 0, 0, 0, 0,
4408 0, 0, 0, 295, 103, 76, 0, 76, 0, 0,
4409 131, 0, 0, 0, 0, 0, 0, 1093, 0, 0,
4410 0, 103, 0, 131, 0, 0, 77, 76, 0, 0,
4411 0, 0, 77, 0, 0, 418, 0, 76, 76, 1093,
4412 0, 0, 1093, 0, 127, 127, 0, 0, 299, 130,
4413 0, 0, 0, 0, 1092, 0, 1093, 1093, 1093, 0,
4414 0, 1093, 1093, 0, 0, 0, 1093, 1093, 0, 0,
4415 0, 0, 77, 0, 0, 77, 294, 299, 0, 0,
4416 0, 0, 0, 0, 0, 295, 0, 131, 77, 0,
4417 406, 416, 416, 416, 0, 0, 0, 418, 0, 103,
4418 130, 130, 103, 103, 0, 0, 0, 0, 0, 0,
4419 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4420 0, 103, 0, 0, 103, 0, 131, 0, 0, 0,
4421 0, 0, 0, 0, 77, 0, 77, 0, 0, 1094,
4422 1094, 0, 0, 103, 0, 0, 0, 0, 0, 0,
4423 294, 0, 0, 0, 0, 0, 77, 0, 0, 0,
4424 0, 0, 0, 0, 0, 103, 77, 77, 0, 0,
4425 0, 1093, 0, 0, 0, 1093, 1093, 0, 103, 0,
4426 0, 0, 0, 0, 679, 680, 0, 0, 0, 0,
4427 0, 0, 0, 286, 1094, 1094, 0, 0, 1094, 76,
4428 0, 0, 76, 0, 0, 295, 0, 0, 0, 0,
4429 0, 0, 0, 127, 0, 1094, 0, 0, 0, 0,
4430 0, 0, 0, 0, 0, 0, 680, 0, 0, 286,
4431 0, 103, 0, 0, 0, 1093, 0, 0, 103, 103,
4432 0, 0, 103, 0, 0, 0, 0, 0, 127, 0,
4433 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4434 0, 0, 0, 0, 0, 127, 0, 0, 0, 130,
4435 0, 0, 1094, 0, 0, 1094, 0, 0, 0, 295,
4436 0, 103, 0, 0, 0, 299, 76, 76, 0, 1094,
4437 1094, 1094, 76, 76, 1094, 1094, 0, 0, 752, 1094,
4438 1094, 76, 0, 0, 130, 0, 0, 0, 0, 0,
4439 0, 0, 0, 0, 0, 127, 0, 76, 0, 779,
4440 0, 130, 0, 0, 791, 0, 0, 0, 77, 0,
4441 0, 77, 0, 0, 0, 0, 76, 0, 0, 0,
4442 0, 0, 0, 127, 299, 0, 0, 0, 0, 0,
4443 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,
4444 76, 76, 0, 0, 0, 0, 0, 0, 0, 0,
4445 0, 130, 0, 0, 0, 0, 76, 0, 0, 0,
4446 0, 0, 127, 0, 0, 0, 0, 0, 127, 127,
4447 0, 0, 0, 76, 0, 0, 0, 0, 0, 130,
4448 0, 0, 0, 0, 1094, 854, 0, 0, 1094, 1094,
4449 0, 0, 0, 0, 0, 77, 77, 0, 0, 0,
4450 0, 77, 77, 680, 0, 286, 0, 0, 0, 0,
4451 77, 22, 23, 24, 25, 0, 0, 0, 130, 0,
4452 0, 0, 0, 0, 130, 130, 77, 31, 32, 33,
4453 0, 0, 0, 0, 0, 0, 0, 40, 41, 42,
4454 43, 44, 0, 0, 0, 77, 0, 294, 1094, 0,
4455 0, 76, 0, 0, 76, 76, 0, 0, 0, 894,
4456 0, 0, 0, 0, 127, 0, 0, 0, 77, 77,
4457 77, 0, 0, 76, 0, 0, 76, 0, 0, 0,
4458 0, 299, 0, 0, 0, 77, 0, 908, 0, 57,
4459 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
4460 0, 0, 77, 0, 127, 0, 1095, 1095, 0, 0,
4461 127, 0, 0, 0, 0, 0, 680, 76, 0, 0,
4462 130, 0, 0, 0, 0, 0, 292, 0, 0, 0,
4463 76, 0, 0, 0, 944, 0, 0, 0, 0, 0,
4464 0, 0, 294, 0, 0, 0, 0, 0, 0, 0,
4465 127, 0, 0, 127, 0, 0, 0, 0, 0, 0,
4466 130, 1095, 1095, 299, 0, 1095, 130, 0, 0, 0,
4467 0, 0, 0, 0, 0, 0, 295, 0, 0, 0,
4468 77, 0, 1095, 77, 77, 0, 0, 0, 1096, 1096,
4469 0, 0, 0, 0, 76, 0, 0, 0, 0, 0,
4470 0, 0, 77, 0, 294, 77, 130, 0, 0, 130,
4471 0, 0, 127, 0, 127, 0, 0, 1095, 0, 993,
4472 0, 0, 130, 0, 0, 0, 0, 0, 0, 0,
4473 0, 0, 0, 76, 127, 0, 0, 0, 0, 1095,
4474 0, 1016, 1095, 1096, 1096, 0, 77, 1096, 0, 0,
4475 0, 0, 0, 1026, 0, 0, 1095, 1095, 1095, 77,
4476 0, 1095, 1095, 0, 1096, 0, 1095, 1095, 130, 0,
4477 130, 295, 0, 0, 0, 0, 0, 0, 286, 0,
4478 0, 0, 0, 299, 0, 0, 0, 0, 0, 0,
4479 130, 0, 0, 0, 0, 0, 0, 0, 0, 1096,
4480 130, 130, 1050, 0, 0, 0, 0, 0, 0, 0,
4481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4482 0, 1096, 0, 77, 1096, 0, 0, 0, 0, 0,
4483 0, 0, 0, 295, 0, 0, 0, 1112, 1096, 1096,
4484 1096, 0, 0, 1096, 1096, 0, 0, 0, 1096, 1096,
4485 0, 0, 0, 0, 0, 0, 0, 299, 0, 0,
4486 0, 0, 77, 0, 0, 0, 0, 0, 0, 0,
4487 0, 1095, 0, 0, 0, 1095, 1095, 0, 0, 0,
4488 0, 0, 0, 0, 0, 0, -788, 0, 0, 0,
4489 0, 0, 0, 0, -788, -788, -788, 0, 0, -788,
4490 -788, -788, 0, -788, 0, 0, 127, 0, 0, 127,
4491 0, -788, -788, -788, 0, 0, 0, 0, 0, 0,
4492 0, 1176, 0, -788, -788, 0, -788, -788, -788, -788,
4493 -788, 0, 0, 0, 0, 1095, 0, 0, 0, 0,
4494 0, 231, 231, 0, 0, 0, 0, 0, 0, 0,
4495 0, 0, 0, 1096, -788, -788, 0, 1096, 1096, 0,
4496 0, 0, 130, 0, 0, 130, 0, 0, 0, 0,
4497 0, 0, 0, 264, 268, 269, 270, 0, 0, 0,
4498 231, 231, 0, -788, -788, 0, 0, 0, 0, 0,
4499 0, 0, 0, 317, 318, 0, 0, 0, 0, 0,
4500 0, 0, 0, 22, 23, 24, 25, -788, 127, 0,
4501 0, 0, 0, 0, 0, 0, 0, 1096, 0, 31,
4502 32, 33, 1055, 0, 127, 0, 1056, 0, 231, 40,
4503 41, 42, 43, 44, 0, 0, 0, 0, -788, -788,
4504 0, -788, 0, 127, 245, -788, 0, -788, 0, 130,
4505 130, 0, 0, 0, 0, 130, 130, 0, 0, 0,
4506 0, 1058, 1059, 0, 130, 0, 127, 127, 0, 1060,
4507 0, 0, 1061, 0, 0, 1062, 1063, 0, 1064, 0,
4508 130, 57, 58, 59, 60, 61, 62, 63, 64, 65,
4509 0, 0, 914, 0, 0, 0, 0, 0, 0, 130,
4510 127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4511 0, 1066, 0, 0, 0, 0, 0, 0, 292, 0,
4512 0, 0, 130, 130, 130, 249, 356, 357, 358, 359,
4513 360, 361, 362, 363, 364, 365, 366, 367, 368, 130,
4514 0, 0, 0, 369, 370, 231, 0, 0, 231, 231,
4515 231, 0, 317, 0, 0, 0, 130, 0, 0, 0,
4516 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4517 0, 231, 0, 231, 1169, 0, 914, 0, 127, 0,
4518 0, 127, 127, 0, 372, 0, 373, 374, 375, 376,
4519 377, 378, 379, 380, 381, 382, 0, 0, 0, 0,
4520 127, 0, 0, 127, -283, 0, 0, 0, 0, 0,
4521 356, 357, 358, 359, 360, 361, 362, 363, 364, 365,
4522 366, 367, 368, 0, 0, 0, 0, 369, 370, 0,
4523 0, 0, 0, 0, 130, 0, 0, 130, 130, 0,
4524 0, 0, 0, 0, 127, 0, 0, 0, 0, 0,
4525 0, 0, 0, 0, 0, 0, 130, 127, 0, 130,
4526 0, 0, 0, 0, 0, 0, 0, 0, 372, 416,
4527 373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
4528 0, 0, 596, 597, 598, 599, 600, 0, 0, 601,
4529 602, 603, 604, 605, 606, 607, 608, 0, 610, 0,
4530 130, 611, 612, 613, 614, 615, 616, 617, 618, 619,
4531 620, 0, 0, 130, 231, 0, 0, 0, 0, 0,
4532 0, 127, 0, 0, 0, 0, 0, 0, 0, 0,
4533 0, 416, 0, 0, 0, 0, 0, 0, 0, 0,
4534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4535 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4536 127, 231, 0, 0, 0, 0, 0, 0, 0, 0,
4537 0, 0, 0, 0, 0, 0, 0, 130, 0, 0,
4538 231, 231, 0, 0, 0, 231, 0, 0, 0, 231,
4539 -668, 270, 0, 0, 0, 0, 0, 0, -668, -668,
4540 -668, 0, 0, -668, -668, -668, 0, -668, 0, 700,
4541 0, 0, 0, 0, 0, -668, 130, -668, -668, -668,
4542 0, 0, 231, 0, 0, 231, 0, -668, -668, 0,
4543 -668, -668, -668, -668, -668, 0, 0, 231, 0, 0,
4544 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4545 0, 0, 0, 0, 0, 730, 0, 0, -668, -668,
4546 0, 0, 0, 0, 0, 0, 0, 0, -668, -668,
4547 -668, -668, -668, -668, -668, -668, -668, -668, -668, -668,
4548 -668, 0, 0, 0, 0, -668, -668, -668, -668, 0,
4549 -668, -668, 0, 0, 231, 0, 0, -668, 0, 0,
4550 0, 0, 0, 762, 0, 0, 762, 0, 0, 0,
4551 0, -668, 0, 0, -668, 231, 0, 0, 0, 0,
4552 790, 0, 0, 0, 0, -668, -668, -668, -668, -668,
4553 -668, -668, -668, -668, -668, -668, -668, -668, 0, 0,
4554 0, 0, 0, -668, -668, -668, -668, 0, 0, -668,
4555 -668, -668, 0, 621, 622, 0, 0, 623, 0, 0,
4556 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4557 0, 0, 0, 0, 0, 0, 231, 179, 180, 181,
4558 182, 183, 184, 185, 186, 187, 231, 0, 188, 189,
4559 0, 0, 0, 0, 190, 191, 192, 193, 849, 849,
4560 0, 231, 762, 762, 849, 0, 0, 0, 0, 194,
4561 195, 0, 0, 0, 0, 849, 849, 0, 0, 231,
4562 0, 231, 0, 0, 0, 0, 0, 0, 0, 0,
4563 0, 849, 0, 0, 0, 0, 0, 0, 0, 196,
4564 197, 198, 199, 200, 201, 202, 203, 204, 205, 0,
4565 206, 207, 0, 0, 0, 0, 0, 0, 208, 245,
4566 0, 0, -5, 3, 0, 4, 5, 6, 7, 8,
4567 -5, -5, -5, 9, 10, 231, -5, -5, 11, -5,
4568 12, 13, 14, 15, 16, 17, 18, -5, 0, 0,
4569 0, 0, 19, 20, 21, 22, 23, 24, 25, 0,
4570 0, 26, 0, 231, 0, 0, 0, 27, 28, 272,
4571 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4572 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
4573 -5, 0, 231, 0, 0, 0, 0, 0, 47, 48,
4574 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4575 231, 0, 0, 49, 50, 0, 0, 0, 0, 0,
4576 0, 51, 0, 0, 52, 53, 0, 54, 55, 0,
4577 56, 0, 0, 57, 58, 59, 60, 61, 62, 63,
4578 64, 65, 0, -5, 0, 0, 0, 0, 0, 0,
4579 0, 0, 0, 0, 0, 0, 0, 0, 0, 356,
4580 357, 358, 359, 360, 361, 362, 363, 0, 365, 366,
4581 66, 67, 68, 0, 0, -5, 369, 370, 0, 0,
4582 0, -5, 0, 530, 0, 0, 762, 0, 0, 0,
4583 0, 0, 0, 0, 0, 231, 0, 0, 0, 0,
4584 0, 0, 231, 0, 0, 0, 1005, 849, 849, 0,
4585 0, 0, 0, 849, 849, 0, 0, 231, 0, 373,
4586 374, 375, 376, 377, 378, 379, 380, 381, 382, 231,
4587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4588 0, 0, 0, 0, 0, 0, 0, 762, 849, 849,
4589 0, 849, 849, 0, 231, 0, 0, 0, 0, 0,
4590 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4591 0, 0, 0, 0, 1046, 1047, 0, 0, 231, 0,
4592 0, 0, 849, 1053, 0, 0, 0, 0, 0, 0,
4593 0, 0, 0, 0, 0, 0, 0, 849, 0, 0,
4594 0, 0, 0, 0, -788, 3, 0, 4, 5, 6,
4595 7, 8, 0, 231, 0, 9, 10, 0, 0, 0,
4596 11, 849, 12, 13, 14, 15, 16, 17, 18, 0,
4597 0, 0, 0, 0, 19, 20, 21, 22, 23, 24,
4598 25, 0, 0, 26, 0, 0, 0, 0, 0, 27,
4599 28, 272, 30, 31, 32, 33, 34, 35, 36, 37,
4600 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
4601 0, 0, 0, 356, -789, -789, -789, -789, 361, 362,
4602 47, 48, -789, -789, 0, 0, 0, 0, 0, 0,
4603 369, 370, 0, 0, 0, 49, 50, 231, 0, 0,
4604 0, 0, 0, 51, 0, 0, 52, 53, 0, 54,
4605 55, 0, 56, 0, 0, 57, 58, 59, 60, 61,
4606 62, 63, 64, 65, 0, -788, 0, 0, 0, 0,
4607 0, 0, 0, 373, 374, 375, 376, 377, 378, 379,
4608 380, 381, 382, 0, 0, 0, 0, 0, 0, 0,
4609 0, 0, 66, 67, 68, 0, 0, -788, 3, -788,
4610 4, 5, 6, 7, 8, -788, 0, 0, 9, 10,
4611 0, 0, 0, 11, 0, 12, 13, 14, 15, 16,
4612 17, 18, 0, 0, 0, 0, 0, 19, 20, 21,
4613 22, 23, 24, 25, 0, 0, 26, 0, 0, 0,
4614 0, 0, 27, 28, 29, 30, 31, 32, 33, 34,
4615 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
4616 44, 45, 46, 0, 231, 0, 356, 357, 358, 359,
4617 360, 361, 362, 47, 48, 365, 366, 0, 0, 0,
4618 0, 0, 0, 369, 370, 0, 0, 0, 49, 50,
4619 0, 0, 0, 0, 0, 0, 51, 0, 0, 52,
4620 53, 0, 54, 55, 0, 56, 0, 0, 57, 58,
4621 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
4622 0, 0, 0, 0, 0, 0, 373, 374, 375, 376,
4623 377, 378, 379, 380, 381, 382, 0, 0, 0, 0,
4624 0, 0, 0, 0, 0, 66, 67, 68, 0, 0,
4625 -5, 3, -788, 4, 5, 6, 7, 8, -788, 0,
4626 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
4627 14, 15, 16, 17, 18, 0, 0, 0, 0, 0,
4628 19, 20, 21, 22, 23, 24, 25, 0, 0, 26,
4629 0, 0, 0, 0, 0, 27, 28, 29, 30, 31,
4630 32, 33, 34, 35, 36, 37, 38, 39, 0, 40,
4631 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
4632 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
4633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4634 0, 49, 50, 0, 0, 0, 0, 0, 0, 51,
4635 0, 0, 52, 53, 0, 54, 55, 0, 56, 0,
4636 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
4637 0, 0, 0, 0, 0, 0, 0, 0, 0, -770,
4638 0, 0, 0, 0, 0, 0, 0, -770, -770, -770,
4639 0, 0, -770, -770, -770, 0, -770, 0, 66, 67,
4640 68, 0, 0, -5, -770, -770, -770, -770, -770, 0,
4641 0, 530, 0, 0, 0, 0, -770, -770, 0, -770,
4642 -770, -770, -770, -770, 0, 0, 0, 356, 357, 358,
4643 359, 360, 361, 362, 363, 364, 365, 366, 367, 368,
4644 0, 0, 0, 0, 369, 370, 0, -770, -770, 0,
4645 0, 0, 0, 0, 0, 0, 0, -770, -770, -770,
4646 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4647 0, 0, 0, 0, -770, -770, -770, -770, 0, 857,
4648 -770, 0, 0, 0, 0, 372, -770, 373, 374, 375,
4649 376, 377, 378, 379, 380, 381, 382, 0, 0, 0,
4650 -770, 0, 0, -770, 249, 0, 0, 0, 0, 0,
4651 0, 0, 0, 0, -135, -770, -770, -770, -770, -770,
4652 -770, -770, -770, -770, -770, -770, -770, 0, 0, 0,
4653 0, -770, -770, -770, -770, -770, -669, 0, -770, -770,
4654 -770, 0, 0, 0, -669, -669, -669, 0, 0, -669,
4655 -669, -669, 0, -669, 0, 0, 0, 0, 0, 0,
4656 0, -669, 0, -669, -669, -669, 0, 0, 0, 0,
4657 0, 0, 0, -669, -669, 0, -669, -669, -669, -669,
4658 -669, 0, 0, 0, 356, 357, 358, 359, 360, 361,
4659 362, 363, 364, 365, 366, 367, 368, 0, 0, 0,
4660 0, 369, 370, 0, -669, -669, 0, 0, 0, 0,
4661 0, 0, 0, 0, -669, -669, -669, -669, -669, -669,
4662 -669, -669, -669, -669, -669, -669, -669, 0, 0, 0,
4663 0, -669, -669, -669, -669, 0, -669, -669, 0, 0,
4664 0, 0, 372, -669, 373, 374, 375, 376, 377, 378,
4665 379, 380, 381, 382, 0, 0, 0, -669, 0, 0,
4666 -669, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4667 0, -669, -669, -669, -669, -669, -669, -669, -669, -669,
4668 -669, -669, -669, -669, 0, 0, 0, 0, 0, -669,
4669 -669, -669, -669, -771, 0, -669, -669, -669, 0, 0,
4670 0, -771, -771, -771, 0, 0, -771, -771, -771, 0,
4671 -771, 0, 0, 0, 0, 0, 0, 0, -771, -771,
4672 -771, -771, -771, 0, 0, 0, 0, 0, 0, 0,
4673 -771, -771, 0, -771, -771, -771, -771, -771, 0, 0,
4674 0, 356, 357, 358, 359, 360, 361, 362, 363, 364,
4675 365, 366, -789, -789, 0, 0, 0, 0, 369, 370,
4676 0, -771, -771, 0, 0, 0, 0, 0, 0, 0,
4677 0, -771, -771, -771, -771, -771, -771, -771, -771, -771,
4678 -771, -771, -771, -771, 0, 0, 0, 0, -771, -771,
4679 -771, -771, 0, 0, -771, 0, 0, 0, 0, 0,
4680 -771, 373, 374, 375, 376, 377, 378, 379, 380, 381,
4681 382, 0, 0, 0, -771, 0, 0, -771, 0, 0,
4682 0, 0, 0, 0, 0, 0, 0, 0, 0, -771,
4683 -771, -771, -771, -771, -771, -771, -771, -771, -771, -771,
4684 -771, 0, 0, 0, 0, -771, -771, -771, -771, -771,
4685 -772, 0, -771, -771, -771, 0, 0, 0, -772, -772,
4686 -772, 0, 0, -772, -772, -772, 0, -772, 0, 0,
4687 0, 0, 0, 0, 0, -772, -772, -772, -772, -772,
4688 0, 0, 0, 0, 0, 0, 0, -772, -772, 0,
4689 -772, -772, -772, -772, -772, 0, 0, 0, 0, 0,
4690 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4691 0, 0, 0, 0, 0, 0, 0, 0, -772, -772,
4692 0, 0, 0, 0, 0, 0, 0, 0, -772, -772,
4693 -772, -772, -772, -772, -772, -772, -772, -772, -772, -772,
4694 -772, 0, 0, 0, 0, -772, -772, -772, -772, 0,
4695 0, -772, 0, 0, 0, 0, 0, -772, 0, 0,
4696 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4697 0, -772, 0, 0, -772, 0, 0, 0, 0, 0,
4698 0, 0, 0, 0, 0, 0, -772, -772, -772, -772,
4699 -772, -772, -772, -772, -772, -772, -772, -772, 0, 0,
4700 0, 0, -772, -772, -772, -772, -772, -485, 0, -772,
4701 -772, -772, 0, 0, 0, -485, -485, -485, 0, 0,
4702 -485, -485, -485, 0, -485, 0, 0, 0, 0, 0,
4703 0, 0, -485, -485, -485, -485, 0, 0, 0, 0,
4704 0, 0, 0, 0, -485, -485, 0, -485, -485, -485,
4705 -485, -485, 0, 0, 0, 0, 0, 0, 0, 0,
4706 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4707 0, 0, 0, 0, 0, -485, -485, 0, 0, 0,
4708 0, 0, 0, 0, 0, -485, -485, -485, -485, -485,
4709 -485, -485, -485, -485, -485, -485, -485, -485, 0, 0,
4710 0, 0, -485, -485, -485, -485, 0, 0, -485, 0,
4711 0, 0, 0, 0, -485, 0, 0, 0, 0, 0,
4712 0, 0, 0, 0, 0, 0, 0, 0, -485, 0,
4713 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4714 0, 0, 0, -485, 0, -485, -485, -485, -485, -485,
4715 -485, -485, -485, -485, -485, 0, 0, 0, 0, -485,
4716 -485, -485, -485, -485, -332, 245, -485, -485, -485, 0,
4717 0, 0, -332, -332, -332, 0, 0, -332, -332, -332,
4718 0, -332, 0, 0, 0, 0, 0, 0, 0, -332,
4719 0, -332, -332, -332, 0, 0, 0, 0, 0, 0,
4720 0, -332, -332, 0, -332, -332, -332, -332, -332, 0,
4721 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4722 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4723 0, 0, -332, -332, 0, 0, 0, 0, 0, 0,
4724 0, 0, -332, -332, -332, -332, -332, -332, -332, -332,
4725 -332, -332, -332, -332, -332, 0, 0, 0, 0, -332,
4726 -332, -332, -332, 0, 0, -332, 0, 0, 0, 0,
4727 0, -332, 0, 0, 0, 0, 0, 0, 0, 0,
4728 0, 0, 0, 0, 0, -332, 0, 0, -332, 0,
4729 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4730 -332, -332, -332, -332, -332, -332, -332, -332, -332, -332,
4731 -332, -332, 0, 0, 0, 0, 0, -332, -332, -332,
4732 -332, -788, 0, -332, -332, -332, 0, 0, 0, -788,
4733 -788, -788, 0, 0, -788, -788, -788, 0, -788, 0,
4734 0, 0, 0, 0, 0, 0, -788, -788, -788, -788,
4735 0, 0, 0, 0, 0, 0, 0, 0, -788, -788,
4736 0, -788, -788, -788, -788, -788, 0, 0, 0, 0,
4737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4738 0, 0, 0, 0, 0, 0, 0, 0, 0, -788,
4739 -788, 0, 0, 0, 0, 0, 0, 0, 0, -788,
4740 -788, -788, -788, -788, -788, -788, -788, -788, -788, -788,
4741 -788, -788, 0, 0, 0, 0, -788, -788, -788, -788,
4742 0, 0, -788, 0, 0, 0, 0, 0, -788, 0,
4743 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4744 0, 0, -788, 0, 0, 0, 0, 0, 0, 0,
4745 0, 0, 0, 0, 0, 0, 0, -788, 0, -788,
4746 -788, -788, -788, -788, -788, -788, -788, -788, -788, 0,
4747 0, 0, 0, -788, -788, -788, -788, -788, -338, 245,
4748 -788, -788, -788, 0, 0, 0, -338, -338, -338, 0,
4749 0, -338, -338, -338, 0, -338, 0, 0, 0, 0,
4750 0, 0, 0, -338, 0, -338, -338, 0, 0, 0,
4751 0, 0, 0, 0, 0, -338, -338, 0, -338, -338,
4752 -338, -338, -338, 0, 0, 0, 0, 0, 0, 0,
4753 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4754 0, 0, 0, 0, 0, 0, -338, -338, 0, 0,
4755 0, 0, 0, 0, 0, 0, -338, -338, -338, -338,
4756 -338, -338, -338, -338, -338, -338, -338, -338, -338, 0,
4757 0, 0, 0, -338, -338, -338, -338, 0, 858, -338,
4758 0, 0, 0, 0, 0, -338, 0, 0, 0, 0,
4759 0, 0, 0, 0, 0, 0, 0, 0, 0, -338,
4760 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4761 0, 0, 0, -137, -338, 0, -338, -338, -338, -338,
4762 -338, -338, -338, -338, -338, -338, 0, 0, 0, 0,
4763 801, -338, -338, -338, -338, -345, 0, -338, -338, -338,
4764 0, 0, 0, -345, -345, -345, 0, 0, -345, -345,
4765 -345, 0, -345, 0, 0, 0, 0, 0, 0, 0,
4766 -345, 0, -345, -345, 0, 0, 0, 0, 0, 0,
4767 0, 0, -345, -345, 0, -345, -345, -345, -345, -345,
4768 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4769 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4770 0, 0, 0, -345, -345, 0, 0, 0, 0, 0,
4771 0, 0, 0, -345, -345, -345, -345, -345, -345, -345,
4772 -345, -345, -345, -345, -345, -345, 0, 0, 0, 0,
4773 -345, -345, -345, -345, 0, 0, -345, 0, 0, 0,
4774 0, 0, -345, 0, 0, 0, 0, 0, 0, 0,
4775 0, 0, 0, 0, 0, 0, -345, 0, 0, 0,
4776 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4777 0, -345, 0, -345, -345, -345, -345, -345, -345, -345,
4778 -345, -345, -345, 0, 0, 0, 0, 0, -345, -345,
4779 -345, -345, -770, 435, -345, -345, -345, 0, 0, 0,
4780 -770, -770, -770, 0, 0, 0, -770, -770, 0, -770,
4781 0, 0, 0, 0, 0, 0, 0, -770, -770, 0,
4782 0, 0, 0, 0, 0, 0, 0, 0, 0, -770,
4783 -770, 0, -770, -770, -770, -770, -770, 0, 0, 0,
4784 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4785 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4786 -770, -770, 0, 0, 0, 0, 0, 0, 0, 0,
4787 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4788 -770, -770, -770, 0, 0, 0, 0, -770, -770, -770,
4789 -770, 0, 799, -770, 0, 0, 0, 0, 0, 0,
4790 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4791 0, 0, 0, -770, 0, 0, 0, 0, 0, 0,
4792 0, 0, 0, 0, 0, 0, 0, -135, -770, 0,
4793 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4794 0, 0, 0, 0, -770, -770, -770, -770, -126, -770,
4795 0, -770, 0, -770, 0, 0, 0, -770, -770, -770,
4796 0, 0, 0, -770, -770, 0, -770, 0, 0, 0,
4797 0, 0, 0, 0, -770, -770, 0, 0, 0, 0,
4798 0, 0, 0, 0, 0, 0, -770, -770, 0, -770,
4799 -770, -770, -770, -770, 0, 0, 0, 0, 0, 0,
4800 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4801 0, 0, 0, 0, 0, 0, 0, -770, -770, 0,
4802 0, 0, 0, 0, 0, 0, 0, -770, -770, -770,
4803 -770, -770, -770, -770, -770, -770, -770, -770, -770, -770,
4804 0, 0, 0, 0, -770, -770, -770, -770, 0, 799,
4805 -770, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4806 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4807 -770, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4808 0, 0, 0, 0, -135, -770, 0, -770, -770, -770,
4809 -770, -770, -770, -770, -770, -770, -770, 0, 0, 0,
4810 0, -770, -770, -770, -770, -770, -338, 0, -770, 0,
4811 -770, 0, 0, 0, -338, -338, -338, 0, 0, 0,
4812 -338, -338, 0, -338, 0, 0, 0, 0, 0, 0,
4813 0, -338, 0, 0, 0, 0, 0, 0, 0, 0,
4814 0, 0, 0, -338, -338, 0, -338, -338, -338, -338,
4815 -338, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4816 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4817 0, 0, 0, 0, -338, -338, 0, 0, 0, 0,
4818 0, 0, 0, 0, -338, -338, -338, -338, -338, -338,
4819 -338, -338, -338, -338, -338, -338, -338, 0, 0, 0,
4820 0, -338, -338, -338, -338, 0, 800, -338, 0, 0,
4821 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4822 0, 0, 0, 0, 0, 0, 0, -338, 0, 0,
4823 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4824 0, -137, -338, 0, -338, -338, -338, -338, -338, -338,
4825 -338, -338, -338, -338, 0, 0, 0, 0, 801, -338,
4826 -338, -338, -128, -338, 0, -338, 0, -338, 0, 0,
4827 0, -338, -338, -338, 0, 0, 0, -338, -338, 0,
4828 -338, 0, 0, 0, 0, 0, 0, 0, -338, 0,
4829 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4830 -338, -338, 0, -338, -338, -338, -338, -338, 0, 0,
4831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4832 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4833 0, -338, -338, 0, 0, 0, 0, 0, 0, 0,
4834 0, -338, -338, -338, -338, -338, -338, -338, -338, -338,
4835 -338, -338, -338, -338, 0, 0, 0, 0, -338, -338,
4836 -338, -338, 0, 800, -338, 0, 0, 0, 0, 0,
4837 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4838 0, 0, 0, 0, -338, 0, 0, 0, 0, 0,
4839 0, 0, 0, 0, 0, 0, 0, 0, -137, -338,
4840 0, -338, -338, -338, -338, -338, -338, -338, -338, -338,
4841 -338, 0, 0, 0, 0, 801, -338, -338, -338, -338,
4842 0, 0, -338, 3, -338, 4, 5, 6, 7, 8,
4843 -788, -788, -788, 9, 10, 0, 0, -788, 11, 0,
4844 12, 13, 14, 15, 16, 17, 18, 0, 0, 0,
4845 0, 0, 19, 20, 21, 22, 23, 24, 25, 0,
4846 0, 26, 0, 0, 0, 0, 0, 27, 28, 272,
4847 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4848 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
4849 -788, 0, 0, 0, 0, 0, 0, 0, 47, 48,
4850 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4851 0, 0, 0, 49, 50, 0, 0, 0, 0, 0,
4852 0, 51, 0, 0, 52, 53, 0, 54, 55, 0,
4853 56, 0, 0, 57, 58, 59, 60, 61, 62, 63,
4854 64, 65, 0, 0, 0, 0, 0, 0, 0, 0,
4855 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4856 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4857 66, 67, 68, 0, 0, 0, 3, -788, 4, 5,
4858 6, 7, 8, -788, 0, -788, 9, 10, 0, -788,
4859 -788, 11, 0, 12, 13, 14, 15, 16, 17, 18,
4860 0, 0, 0, 0, 0, 19, 20, 21, 22, 23,
4861 24, 25, 0, 0, 26, 0, 0, 0, 0, 0,
4862 27, 28, 272, 30, 31, 32, 33, 34, 35, 36,
4863 37, 38, 39, 0, 40, 41, 42, 43, 44, 45,
4864 46, 0, 0, -788, 0, 0, 0, 0, 0, 0,
4865 0, 47, 48, 0, 0, 0, 0, 0, 0, 0,
4866 0, 0, 0, 0, 0, 0, 49, 50, 0, 0,
4867 0, 0, 0, 0, 51, 0, 0, 52, 53, 0,
4868 54, 55, 0, 56, 0, 0, 57, 58, 59, 60,
4869 61, 62, 63, 64, 65, 0, 0, 0, 0, 0,
4870 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4871 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4872 0, 0, 0, 66, 67, 68, 0, 0, 0, 3,
4873 -788, 4, 5, 6, 7, 8, -788, 0, -788, 9,
4874 10, 0, 0, -788, 11, -788, 12, 13, 14, 15,
4875 16, 17, 18, 0, 0, 0, 0, 0, 19, 20,
4876 21, 22, 23, 24, 25, 0, 0, 26, 0, 0,
4877 0, 0, 0, 27, 28, 272, 30, 31, 32, 33,
4878 34, 35, 36, 37, 38, 39, 0, 40, 41, 42,
4879 43, 44, 45, 46, 0, 0, -788, 0, 0, 0,
4880 0, 0, 0, 0, 47, 48, 0, 0, 0, 0,
4881 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
4882 50, 0, 0, 0, 0, 0, 0, 51, 0, 0,
4883 52, 53, 0, 54, 55, 0, 56, 0, 0, 57,
4884 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
4885 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4886 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4887 0, 0, 0, 0, 0, 0, 66, 67, 68, 0,
4888 0, 0, 3, -788, 4, 5, 6, 7, 8, -788,
4889 0, -788, 9, 10, 0, 0, -788, 11, 0, 12,
4890 13, 14, 15, 16, 17, 18, -788, 0, 0, 0,
4891 0, 19, 20, 21, 22, 23, 24, 25, 0, 0,
4892 26, 0, 0, 0, 0, 0, 27, 28, 272, 30,
4893 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
4894 40, 41, 42, 43, 44, 45, 46, 0, 0, -788,
4895 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
4896 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4897 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
4898 51, 0, 0, 52, 53, 0, 54, 55, 0, 56,
4899 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
4900 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4901 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4902 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,
4903 67, 68, 0, 0, 0, 3, -788, 4, 5, 6,
4904 7, 8, -788, 0, -788, 9, 10, 0, 0, -788,
4905 11, 0, 12, 13, 14, 15, 16, 17, 18, 0,
4906 0, 0, 0, 0, 19, 20, 21, 22, 23, 24,
4907 25, 0, 0, 26, 0, 0, 0, 0, 0, 27,
4908 28, 272, 30, 31, 32, 33, 34, 35, 36, 37,
4909 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
4910 0, 0, -788, 0, 0, 0, 0, 0, 0, 0,
4911 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
4912 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
4913 0, 0, 0, 51, 0, 0, 52, 53, 0, 54,
4914 55, 0, 56, 0, 0, 57, 58, 59, 60, 61,
4915 62, 63, 64, 65, 0, 0, 0, 0, 0, 0,
4916 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4917 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4918 0, 0, 66, 67, 68, 0, 0, 0, 3, -788,
4919 4, 5, 6, 7, 8, -788, -788, -788, 9, 10,
4920 0, 0, 0, 11, 0, 12, 13, 14, 15, 16,
4921 17, 18, 0, 0, 0, 0, 0, 19, 20, 21,
4922 22, 23, 24, 25, 0, 0, 26, 0, 0, 0,
4923 0, 0, 27, 28, 272, 30, 31, 32, 33, 34,
4924 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
4925 44, 45, 46, 0, 0, -788, 0, 0, 0, 0,
4926 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
4927 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
4928 0, 0, 0, 0, 0, 0, 51, 0, 0, 52,
4929 53, 0, 54, 55, 0, 56, 0, 0, 57, 58,
4930 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
4931 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4932 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4933 0, 0, 0, 0, 0, 66, 67, 68, 0, 0,
4934 0, 3, -788, 4, 5, 6, 7, 8, -788, 0,
4935 -788, 9, 10, 0, 0, 0, 11, 0, 12, 13,
4936 14, 15, 16, 17, 18, 0, 0, 0, 0, 0,
4937 19, 20, 21, 22, 23, 24, 25, 0, 0, 26,
4938 0, 0, 0, 0, 0, 27, 28, 272, 30, 31,
4939 32, 33, 34, 35, 36, 37, 38, 39, 0, 40,
4940 41, 42, 43, 44, 45, 46, 0, 0, -788, 0,
4941 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
4942 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4943 0, 49, 50, 0, 0, 0, 0, 0, 0, 51,
4944 0, 0, 52, 53, 0, 54, 55, 0, 56, 0,
4945 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
4946 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4947 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4948 0, 0, 0, 0, 0, 0, 0, 0, 66, 67,
4949 68, 0, 0, 0, 3, -788, 4, 5, 6, 7,
4950 8, -788, 0, 0, 9, 10, 0, 0, 0, 11,
4951 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
4952 0, 0, 0, 19, 20, 21, 22, 23, 24, 25,
4953 0, 0, 26, 0, 0, 0, 0, 0, 27, 28,
4954 272, 30, 31, 32, 33, 34, 35, 36, 37, 38,
4955 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
4956 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
4957 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4958 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
4959 0, 0, 51, 0, 0, 273, 53, 0, 54, 55,
4960 0, 56, 0, 0, 57, 58, 59, 60, 61, 62,
4961 63, 64, 65, 0, 0, 0, 0, 0, 0, 0,
4962 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4963 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4964 0, 66, 67, 68, 0, 0, 0, 0, -788, 0,
4965 0, 0, -788, 3, -788, 4, 5, 6, 7, 8,
4966 0, 0, 0, 9, 10, 0, 0, 0, 11, 0,
4967 12, 13, 14, 15, 16, 17, 18, 0, 0, 0,
4968 0, 0, 19, 20, 21, 22, 23, 24, 25, 0,
4969 0, 26, 0, 0, 0, 0, 0, 27, 28, 272,
4970 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4971 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
4972 0, 0, 0, 0, 0, 0, 0, 0, 47, 48,
4973 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4974 0, 0, 0, 49, 50, 0, 0, 0, 0, 0,
4975 0, 51, 0, 0, 52, 53, 0, 54, 55, 0,
4976 56, 0, 0, 57, 58, 59, 60, 61, 62, 63,
4977 64, 65, 0, 0, 0, 0, 0, 0, 0, 0,
4978 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4979 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4980 66, 67, 68, 0, 0, 0, 0, -788, 0, 0,
4981 0, -788, 3, -788, 4, 5, 6, 7, 8, 0,
4982 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
4983 13, 14, 15, 16, 17, 18, 0, 0, 0, 0,
4984 0, 19, 20, 21, 22, 23, 24, 25, 0, 0,
4985 26, 0, 0, 0, 0, 0, 27, 28, 29, 30,
4986 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
4987 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
4988 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
4989 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4990 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
4991 51, 0, 0, 52, 53, 0, 54, 55, 0, 56,
4992 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
4993 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4994 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4995 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,
4996 67, 68, 0, 0, -788, 3, -788, 4, 5, 6,
4997 7, 8, -788, 0, 0, 9, 10, 0, 0, 0,
4998 11, 0, 12, 13, 14, 15, 16, 17, 18, 0,
4999 0, 0, 0, 0, 19, 20, 21, 22, 23, 24,
5000 25, 0, 0, 26, 0, 0, 0, 0, 0, 27,
5001 28, 272, 30, 31, 32, 33, 34, 35, 36, 37,
5002 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
5003 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5004 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
5005 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
5006 0, 0, 0, 51, 0, 0, 52, 53, 0, 54,
5007 55, 0, 56, 0, 0, 57, 58, 59, 60, 61,
5008 62, 63, 64, 65, 0, 0, 0, 0, 0, 0,
5009 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5010 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5011 0, 0, 66, 67, 68, 0, 0, -788, 391, -788,
5012 4, 5, 6, 0, 8, -788, 0, 0, 9, 10,
5013 0, 0, 0, 11, -4, 12, 13, 14, 15, 16,
5014 17, 18, 0, 0, 0, 0, 0, 19, 20, 21,
5015 22, 23, 24, 25, 0, 0, 26, 0, 0, 0,
5016 0, 0, 0, 28, 0, 0, 31, 32, 33, 34,
5017 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
5018 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
5019 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
5020 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
5021 0, 0, 0, 0, 0, 0, 220, 0, 0, 221,
5022 53, 0, 54, 55, 0, 0, 0, 0, 57, 58,
5023 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
5024 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5025 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5026 0, 0, 0, 0, 0, 66, 67, 68, 0, 0,
5027 0, 0, 319, 0, 0, 0, 0, 0, 320, 135,
5028 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5029 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
5030 156, 157, 158, 0, 0, 0, 159, 160, 161, 420,
5031 421, 422, 423, 166, 167, 168, 0, 0, 0, 0,
5032 0, 169, 170, 171, 172, 424, 425, 426, 427, 177,
5033 36, 37, 428, 39, 0, 0, 0, 0, 0, 0,
5034 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5035 0, 0, 179, 180, 181, 182, 183, 184, 185, 186,
5036 187, 0, 0, 188, 189, 0, 0, 0, 0, 190,
5037 191, 192, 193, 0, 0, 0, 0, 0, 0, 0,
5038 0, 0, 0, 0, 194, 195, 0, 0, 0, 0,
5039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5040 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5041 0, 0, 0, 0, 196, 197, 198, 199, 200, 201,
5042 202, 203, 204, 205, 0, 206, 207, 0, 0, 0,
5043 0, 0, 0, 208, 429, 135, 136, 137, 138, 139,
5044 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
5045 150, 151, 152, 153, 154, 155, 156, 157, 158, 0,
5046 0, 0, 159, 160, 161, 162, 163, 164, 165, 166,
5047 167, 168, 0, 0, 0, 0, 0, 169, 170, 171,
5048 172, 173, 174, 175, 176, 177, 36, 37, 178, 39,
5049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5050 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5051 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5052 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5053 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5054 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
5055 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5056 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5057 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5058 0, 206, 207, 0, 0, 0, 0, 0, 0, 208,
5059 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
5060 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
5061 155, 156, 157, 158, 0, 0, 0, 159, 160, 161,
5062 162, 163, 164, 165, 166, 167, 168, 0, 0, 0,
5063 0, 0, 169, 170, 171, 172, 173, 174, 175, 176,
5064 177, 252, 0, 178, 0, 0, 0, 0, 0, 0,
5065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5066 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
5067 186, 187, 0, 0, 188, 189, 0, 0, 0, 0,
5068 190, 191, 192, 193, 0, 0, 0, 0, 0, 0,
5069 0, 0, 0, 0, 0, 194, 195, 0, 0, 58,
5070 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5071 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5072 0, 0, 0, 0, 0, 196, 197, 198, 199, 200,
5073 201, 202, 203, 204, 205, 0, 206, 207, 0, 0,
5074 0, 0, 0, 0, 208, 135, 136, 137, 138, 139,
5075 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
5076 150, 151, 152, 153, 154, 155, 156, 157, 158, 0,
5077 0, 0, 159, 160, 161, 162, 163, 164, 165, 166,
5078 167, 168, 0, 0, 0, 0, 0, 169, 170, 171,
5079 172, 173, 174, 175, 176, 177, 0, 0, 178, 0,
5080 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5081 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5082 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5083 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5084 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5085 194, 195, 0, 0, 58, 0, 0, 0, 0, 0,
5086 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5087 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5088 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5089 0, 206, 207, 0, 0, 0, 0, 0, 0, 208,
5090 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
5091 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
5092 155, 156, 157, 158, 0, 0, 0, 159, 160, 161,
5093 162, 163, 164, 165, 166, 167, 168, 0, 0, 0,
5094 0, 0, 169, 170, 171, 172, 173, 174, 175, 176,
5095 177, 0, 0, 178, 0, 0, 0, 0, 0, 0,
5096 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5097 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
5098 186, 187, 0, 0, 188, 189, 0, 0, 0, 0,
5099 190, 191, 192, 193, 0, 0, 0, 0, 0, 0,
5100 0, 0, 0, 0, 0, 194, 195, 0, 0, 0,
5101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5103 0, 0, 0, 0, 0, 196, 197, 198, 199, 200,
5104 201, 202, 203, 204, 205, 0, 206, 207, 4, 5,
5105 6, 0, 8, 0, 208, 0, 9, 10, 0, 0,
5106 0, 11, 0, 12, 13, 14, 260, 261, 17, 18,
5107 0, 0, 0, 0, 0, 19, 20, 262, 22, 23,
5108 24, 25, 0, 0, 218, 0, 0, 0, 0, 0,
5109 0, 290, 0, 0, 31, 32, 33, 34, 35, 36,
5110 37, 38, 39, 0, 40, 41, 42, 43, 44, 45,
5111 46, 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, 0, 0, 0, 0, 0, 0,
5114 0, 0, 0, 0, 291, 0, 0, 221, 53, 0,
5115 54, 55, 0, 0, 0, 0, 57, 58, 59, 60,
5116 61, 62, 63, 64, 65, 0, 0, 4, 5, 6,
5117 0, 8, 0, 0, 0, 9, 10, 0, 0, 0,
5118 11, 0, 12, 13, 14, 260, 261, 17, 18, 0,
5119 0, 0, 0, 292, 19, 20, 262, 22, 23, 24,
5120 25, 293, 0, 218, 0, 0, 0, 0, 0, 0,
5121 290, 0, 0, 31, 32, 33, 34, 35, 36, 37,
5122 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
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, 0, 0, 0, 0, 0, 0, 0,
5126 0, 0, 0, 291, 0, 0, 221, 53, 0, 54,
5127 55, 0, 0, 0, 0, 57, 58, 59, 60, 61,
5128 62, 63, 64, 65, 0, 0, 4, 5, 6, 0,
5129 8, 0, 0, 0, 9, 10, 0, 0, 0, 11,
5130 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
5131 0, 0, 292, 19, 20, 21, 22, 23, 24, 25,
5132 591, 0, 218, 0, 0, 0, 0, 0, 0, 28,
5133 0, 0, 31, 32, 33, 34, 35, 36, 37, 38,
5134 39, 219, 40, 41, 42, 43, 44, 45, 46, 0,
5135 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5136 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5137 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5138 0, 0, 220, 0, 0, 221, 53, 0, 54, 55,
5139 0, 222, 223, 224, 57, 58, 225, 60, 61, 62,
5140 63, 64, 65, 0, 0, 0, 0, 0, 0, 0,
5141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5142 0, 0, 0, 0, 0, 0, 4, 5, 6, 0,
5143 8, 66, 226, 68, 9, 10, 0, 0, 249, 11,
5144 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
5145 0, 0, 0, 19, 20, 21, 22, 23, 24, 25,
5146 0, 0, 26, 0, 0, 0, 0, 0, 0, 28,
5147 0, 0, 31, 32, 33, 34, 35, 36, 37, 38,
5148 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
5149 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5150 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5151 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5152 0, 0, 220, 0, 0, 221, 53, 0, 54, 55,
5153 0, 0, 0, 0, 57, 58, 59, 60, 61, 62,
5154 63, 64, 65, 0, 0, 0, 0, 0, 0, 0,
5155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5156 0, 0, 0, 0, 3, 0, 4, 5, 6, 7,
5157 8, 66, 67, 68, 9, 10, 0, 0, 249, 11,
5158 0, 12, 13, 14, 15, 16, 17, 18, 0, 0,
5159 0, 0, 0, 19, 20, 21, 22, 23, 24, 25,
5160 0, 0, 26, 0, 0, 0, 0, 0, 27, 28,
5161 0, 30, 31, 32, 33, 34, 35, 36, 37, 38,
5162 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
5163 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5164 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5165 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5166 0, 0, 51, 0, 0, 52, 53, 0, 54, 55,
5167 0, 56, 0, 0, 57, 58, 59, 60, 61, 62,
5168 63, 64, 65, 0, 0, 391, 0, 4, 5, 6,
5169 0, 8, 0, 0, 0, 9, 10, 0, 0, 0,
5170 11, 0, 12, 13, 14, 15, 16, 17, 18, 0,
5171 0, 66, 67, 68, 19, 20, 21, 22, 23, 24,
5172 25, 0, 0, 26, 0, 0, 0, 0, 0, 0,
5173 28, 0, 0, 31, 32, 33, 34, 35, 36, 37,
5174 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
5175 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5176 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
5177 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
5178 0, 0, 0, 220, 0, 0, 221, 53, 0, 54,
5179 55, 0, 0, 0, 0, 57, 58, 59, 60, 61,
5180 62, 63, 64, 65, 0, 0, 0, 0, 4, 5,
5181 6, 0, 8, 0, 0, 0, 9, 10, 0, 0,
5182 0, 11, 0, 12, 13, 14, 15, 16, 17, 18,
5183 0, 0, 66, 67, 68, 19, 20, 21, 22, 23,
5184 24, 25, 0, 0, 218, 0, 0, 0, 0, 0,
5185 0, 28, 0, 0, 31, 32, 33, 34, 35, 36,
5186 37, 38, 39, 219, 40, 41, 42, 43, 44, 45,
5187 46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5188 0, 47, 48, 0, 0, 0, 0, 0, 0, 0,
5189 0, 0, 0, 0, 0, 0, 49, 50, 0, 0,
5190 0, 0, 0, 0, 220, 0, 0, 221, 53, 0,
5191 54, 55, 0, 222, 223, 224, 57, 58, 225, 60,
5192 61, 62, 63, 64, 65, 0, 0, 0, 0, 4,
5193 5, 6, 0, 8, 0, 0, 0, 9, 10, 0,
5194 0, 0, 11, 0, 12, 13, 14, 15, 16, 17,
5195 18, 0, 0, 66, 226, 68, 19, 20, 21, 22,
5196 23, 24, 25, 0, 0, 218, 0, 0, 0, 0,
5197 0, 0, 28, 0, 0, 31, 32, 33, 34, 35,
5198 36, 37, 38, 39, 219, 40, 41, 42, 43, 44,
5199 45, 46, 0, 0, 0, 0, 0, 0, 0, 0,
5200 0, 0, 47, 48, 0, 0, 0, 0, 0, 0,
5201 0, 0, 0, 0, 0, 0, 0, 49, 465, 0,
5202 0, 0, 0, 0, 0, 220, 0, 0, 221, 53,
5203 0, 54, 55, 0, 222, 223, 224, 57, 58, 225,
5204 60, 61, 62, 63, 64, 65, 0, 0, 0, 0,
5205 4, 5, 6, 0, 8, 0, 0, 0, 9, 10,
5206 0, 0, 0, 11, 0, 12, 13, 14, 260, 261,
5207 17, 18, 0, 0, 66, 226, 68, 19, 20, 262,
5208 22, 23, 24, 25, 0, 0, 218, 0, 0, 0,
5209 0, 0, 0, 28, 0, 0, 31, 32, 33, 34,
5210 35, 36, 37, 38, 39, 219, 40, 41, 42, 43,
5211 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
5212 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
5213 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
5214 0, 0, 0, 0, 0, 0, 220, 0, 0, 221,
5215 53, 0, 54, 55, 0, 222, 223, 224, 57, 58,
5216 225, 60, 61, 62, 63, 64, 65, 0, 0, 0,
5217 0, 4, 5, 6, 0, 8, 0, 0, 0, 9,
5218 10, 0, 0, 0, 11, 0, 12, 13, 14, 260,
5219 261, 17, 18, 0, 0, 66, 226, 68, 19, 20,
5220 262, 22, 23, 24, 25, 0, 0, 218, 0, 0,
5221 0, 0, 0, 0, 28, 0, 0, 31, 32, 33,
5222 34, 35, 36, 37, 38, 39, 219, 40, 41, 42,
5223 43, 44, 45, 46, 0, 0, 0, 0, 0, 0,
5224 0, 0, 0, 0, 47, 48, 0, 0, 0, 0,
5225 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
5226 465, 0, 0, 0, 0, 0, 0, 220, 0, 0,
5227 221, 53, 0, 54, 55, 0, 222, 223, 224, 57,
5228 58, 225, 60, 61, 62, 63, 64, 65, 0, 0,
5229 0, 0, 4, 5, 6, 0, 8, 0, 0, 0,
5230 9, 10, 0, 0, 0, 11, 0, 12, 13, 14,
5231 260, 261, 17, 18, 0, 0, 66, 226, 68, 19,
5232 20, 262, 22, 23, 24, 25, 0, 0, 218, 0,
5233 0, 0, 0, 0, 0, 28, 0, 0, 31, 32,
5234 33, 34, 35, 36, 37, 38, 39, 219, 40, 41,
5235 42, 43, 44, 45, 46, 0, 0, 0, 0, 0,
5236 0, 0, 0, 0, 0, 47, 48, 0, 0, 0,
5237 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5238 49, 50, 0, 0, 0, 0, 0, 0, 220, 0,
5239 0, 221, 53, 0, 54, 55, 0, 222, 223, 0,
5240 57, 58, 225, 60, 61, 62, 63, 64, 65, 0,
5241 0, 0, 0, 4, 5, 6, 0, 8, 0, 0,
5242 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
5243 14, 260, 261, 17, 18, 0, 0, 66, 226, 68,
5244 19, 20, 262, 22, 23, 24, 25, 0, 0, 218,
5245 0, 0, 0, 0, 0, 0, 28, 0, 0, 31,
5246 32, 33, 34, 35, 36, 37, 38, 39, 219, 40,
5247 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
5248 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
5249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5250 0, 49, 50, 0, 0, 0, 0, 0, 0, 220,
5251 0, 0, 221, 53, 0, 54, 55, 0, 0, 223,
5252 224, 57, 58, 225, 60, 61, 62, 63, 64, 65,
5253 0, 0, 0, 0, 4, 5, 6, 0, 8, 0,
5254 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
5255 13, 14, 260, 261, 17, 18, 0, 0, 66, 226,
5256 68, 19, 20, 262, 22, 23, 24, 25, 0, 0,
5257 218, 0, 0, 0, 0, 0, 0, 28, 0, 0,
5258 31, 32, 33, 34, 35, 36, 37, 38, 39, 219,
5259 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
5260 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
5261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5262 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
5263 220, 0, 0, 221, 53, 0, 54, 55, 0, 0,
5264 223, 0, 57, 58, 225, 60, 61, 62, 63, 64,
5265 65, 0, 0, 0, 0, 4, 5, 6, 0, 8,
5266 0, 0, 0, 9, 10, 0, 0, 0, 11, 0,
5267 12, 13, 14, 15, 16, 17, 18, 0, 0, 66,
5268 226, 68, 19, 20, 21, 22, 23, 24, 25, 0,
5269 0, 218, 0, 0, 0, 0, 0, 0, 28, 0,
5270 0, 31, 32, 33, 34, 35, 36, 37, 38, 39,
5271 0, 40, 41, 42, 43, 44, 45, 46, 0, 0,
5272 0, 0, 0, 0, 0, 0, 0, 0, 47, 48,
5273 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5274 0, 0, 0, 49, 50, 0, 0, 0, 0, 0,
5275 0, 220, 0, 0, 221, 53, 0, 54, 55, 0,
5276 777, 0, 0, 57, 58, 59, 60, 61, 62, 63,
5277 64, 65, 0, 0, 0, 0, 4, 5, 6, 0,
5278 8, 0, 0, 0, 9, 10, 0, 0, 0, 11,
5279 0, 12, 13, 14, 260, 261, 17, 18, 0, 0,
5280 66, 226, 68, 19, 20, 262, 22, 23, 24, 25,
5281 0, 0, 218, 0, 0, 0, 0, 0, 0, 28,
5282 0, 0, 31, 32, 33, 34, 35, 36, 37, 38,
5283 39, 0, 40, 41, 42, 43, 44, 45, 46, 0,
5284 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
5285 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5286 0, 0, 0, 0, 49, 50, 0, 0, 0, 0,
5287 0, 0, 220, 0, 0, 221, 53, 0, 54, 55,
5288 0, 943, 0, 0, 57, 58, 59, 60, 61, 62,
5289 63, 64, 65, 0, 0, 0, 0, 4, 5, 6,
5290 0, 8, 0, 0, 0, 9, 10, 0, 0, 0,
5291 11, 0, 12, 13, 14, 260, 261, 17, 18, 0,
5292 0, 66, 226, 68, 19, 20, 262, 22, 23, 24,
5293 25, 0, 0, 218, 0, 0, 0, 0, 0, 0,
5294 28, 0, 0, 31, 32, 33, 34, 35, 36, 37,
5295 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
5296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5297 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
5298 0, 0, 0, 0, 0, 49, 50, 0, 0, 0,
5299 0, 0, 0, 220, 0, 0, 221, 53, 0, 54,
5300 55, 0, 992, 0, 0, 57, 58, 59, 60, 61,
5301 62, 63, 64, 65, 0, 0, 0, 0, 4, 5,
5302 6, 0, 8, 0, 0, 0, 9, 10, 0, 0,
5303 0, 11, 0, 12, 13, 14, 260, 261, 17, 18,
5304 0, 0, 66, 226, 68, 19, 20, 262, 22, 23,
5305 24, 25, 0, 0, 218, 0, 0, 0, 0, 0,
5306 0, 28, 0, 0, 31, 32, 33, 34, 35, 36,
5307 37, 38, 39, 0, 40, 41, 42, 43, 44, 45,
5308 46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5309 0, 47, 48, 0, 0, 0, 0, 0, 0, 0,
5310 0, 0, 0, 0, 0, 0, 49, 50, 0, 0,
5311 0, 0, 0, 0, 220, 0, 0, 221, 53, 0,
5312 54, 55, 0, 777, 0, 0, 57, 58, 59, 60,
5313 61, 62, 63, 64, 65, 0, 0, 0, 0, 4,
5314 5, 6, 0, 8, 0, 0, 0, 9, 10, 0,
5315 0, 0, 11, 0, 12, 13, 14, 260, 261, 17,
5316 18, 0, 0, 66, 226, 68, 19, 20, 262, 22,
5317 23, 24, 25, 0, 0, 218, 0, 0, 0, 0,
5318 0, 0, 28, 0, 0, 31, 32, 33, 34, 35,
5319 36, 37, 38, 39, 0, 40, 41, 42, 43, 44,
5320 45, 46, 0, 0, 0, 0, 0, 0, 0, 0,
5321 0, 0, 47, 48, 0, 0, 0, 0, 0, 0,
5322 0, 0, 0, 0, 0, 0, 0, 49, 50, 0,
5323 0, 0, 0, 0, 0, 220, 0, 0, 221, 53,
5324 0, 54, 55, 0, 1111, 0, 0, 57, 58, 59,
5325 60, 61, 62, 63, 64, 65, 0, 0, 0, 0,
5326 4, 5, 6, 0, 8, 0, 0, 0, 9, 10,
5327 0, 0, 0, 11, 0, 12, 13, 14, 260, 261,
5328 17, 18, 0, 0, 66, 226, 68, 19, 20, 262,
5329 22, 23, 24, 25, 0, 0, 218, 0, 0, 0,
5330 0, 0, 0, 28, 0, 0, 31, 32, 33, 34,
5331 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
5332 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
5333 0, 0, 0, 47, 48, 0, 0, 0, 0, 0,
5334 0, 0, 0, 0, 0, 0, 0, 0, 49, 50,
5335 0, 0, 0, 0, 0, 0, 220, 0, 0, 221,
5336 53, 0, 54, 55, 0, 0, 0, 0, 57, 58,
5337 59, 60, 61, 62, 63, 64, 65, 0, 0, 0,
5338 0, 4, 5, 6, 0, 8, 0, 0, 0, 9,
5339 10, 0, 0, 0, 11, 0, 12, 13, 14, 15,
5340 16, 17, 18, 0, 0, 66, 226, 68, 19, 20,
5341 21, 22, 23, 24, 25, 0, 0, 218, 0, 0,
5342 0, 0, 0, 0, 28, 0, 0, 31, 32, 33,
5343 34, 35, 36, 37, 38, 39, 0, 40, 41, 42,
5344 43, 44, 45, 46, 0, 0, 0, 0, 0, 0,
5345 0, 0, 0, 0, 47, 48, 0, 0, 0, 0,
5346 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
5347 50, 0, 0, 0, 0, 0, 0, 220, 0, 0,
5348 221, 53, 0, 54, 55, 0, 0, 0, 0, 57,
5349 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
5350 0, 0, 4, 5, 6, 0, 8, 0, 0, 0,
5351 9, 10, 0, 0, 0, 11, 0, 12, 13, 14,
5352 15, 16, 17, 18, 0, 0, 66, 226, 68, 19,
5353 20, 21, 22, 23, 24, 25, 0, 0, 26, 0,
5354 0, 0, 0, 0, 0, 28, 0, 0, 31, 32,
5355 33, 34, 35, 36, 37, 38, 39, 0, 40, 41,
5356 42, 43, 44, 45, 46, 0, 0, 0, 0, 0,
5357 0, 0, 0, 0, 0, 47, 48, 0, 0, 0,
5358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5359 49, 50, 0, 0, 0, 0, 0, 0, 220, 0,
5360 0, 221, 53, 0, 54, 55, 0, 0, 0, 0,
5361 57, 58, 59, 60, 61, 62, 63, 64, 65, 0,
5362 0, 0, 0, 4, 5, 6, 0, 8, 0, 0,
5363 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
5364 14, 15, 16, 17, 18, 0, 0, 66, 67, 68,
5365 19, 20, 21, 22, 23, 24, 25, 0, 0, 759,
5366 0, 0, 0, 0, 0, 0, 28, 0, 0, 31,
5367 32, 33, 34, 35, 36, 37, 38, 39, 0, 40,
5368 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
5369 0, 0, 0, 0, 0, 0, 47, 48, 0, 0,
5370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5371 0, 49, 50, 0, 0, 0, 0, 0, 0, 220,
5372 0, 0, 221, 53, 0, 54, 55, 0, 0, 0,
5373 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
5374 0, 0, 0, 0, 4, 5, 6, 0, 8, 0,
5375 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
5376 13, 14, 260, 261, 17, 18, 0, 0, 66, 226,
5377 68, 19, 20, 262, 22, 23, 24, 25, 0, 0,
5378 855, 0, 0, 0, 0, 0, 0, 28, 0, 0,
5379 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
5380 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
5381 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
5382 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5383 0, 0, 49, 50, 0, 0, 0, 0, 0, 0,
5384 220, 0, 0, 221, 53, 0, 54, 55, 0, 0,
5385 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
5386 65, 0, 0, 0, 0, 4, 5, 6, 0, 8,
5387 0, 0, 0, 9, 10, 0, 0, 0, 11, 0,
5388 12, 13, 14, 260, 261, 17, 18, 0, 0, 66,
5389 226, 68, 19, 20, 262, 22, 23, 24, 25, 0,
5390 0, 218, 0, 0, 0, 0, 0, 0, 290, 0,
5391 0, 31, 32, 33, 34, 35, 36, 37, 38, 39,
5392 0, 40, 41, 42, 43, 44, 45, 46, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5396 0, 291, 0, 0, 351, 53, 0, 54, 55, 0,
5397 352, 0, 0, 57, 58, 59, 60, 61, 62, 63,
5398 64, 65, 0, 0, 4, 5, 6, 0, 8, 0,
5399 0, 0, 9, 10, 0, 0, 0, 11, 0, 12,
5400 13, 14, 260, 261, 17, 18, 0, 0, 0, 0,
5401 292, 19, 20, 262, 22, 23, 24, 25, 0, 0,
5402 218, 0, 0, 0, 0, 0, 0, 290, 0, 0,
5403 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
5404 40, 41, 42, 43, 44, 45, 46, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5408 401, 0, 0, 52, 53, 0, 54, 55, 0, 56,
5409 0, 0, 57, 58, 59, 60, 61, 62, 63, 64,
5410 65, 0, 0, 4, 5, 6, 0, 8, 0, 0,
5411 0, 9, 10, 0, 0, 0, 11, 0, 12, 13,
5412 14, 260, 261, 17, 18, 0, 0, 0, 0, 292,
5413 19, 20, 262, 22, 23, 24, 25, 0, 0, 218,
5414 0, 0, 0, 0, 0, 0, 290, 0, 0, 31,
5415 32, 33, 409, 35, 36, 37, 410, 39, 0, 40,
5416 41, 42, 43, 44, 45, 46, 0, 0, 0, 0,
5417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5419 0, 0, 0, 0, 0, 411, 0, 0, 0, 412,
5420 0, 0, 221, 53, 0, 54, 55, 0, 0, 0,
5421 0, 57, 58, 59, 60, 61, 62, 63, 64, 65,
5422 0, 0, 4, 5, 6, 0, 8, 0, 0, 0,
5423 9, 10, 0, 0, 0, 11, 0, 12, 13, 14,
5424 260, 261, 17, 18, 0, 0, 0, 0, 292, 19,
5425 20, 262, 22, 23, 24, 25, 0, 0, 218, 0,
5426 0, 0, 0, 0, 0, 290, 0, 0, 31, 32,
5427 33, 409, 35, 36, 37, 410, 39, 0, 40, 41,
5428 42, 43, 44, 45, 46, 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, 0, 0,
5431 0, 0, 0, 0, 0, 0, 0, 0, 412, 0,
5432 0, 221, 53, 0, 54, 55, 0, 0, 0, 0,
5433 57, 58, 59, 60, 61, 62, 63, 64, 65, 0,
5434 0, 4, 5, 6, 0, 8, 0, 0, 0, 9,
5435 10, 0, 0, 0, 11, 0, 12, 13, 14, 260,
5436 261, 17, 18, 0, 0, 0, 0, 292, 19, 20,
5437 262, 22, 23, 24, 25, 0, 0, 218, 0, 0,
5438 0, 0, 0, 0, 290, 0, 0, 31, 32, 33,
5439 34, 35, 36, 37, 38, 39, 0, 40, 41, 42,
5440 43, 44, 45, 46, 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, 0, 0, 0,
5443 0, 0, 0, 0, 0, 0, 0, 291, 0, 0,
5444 351, 53, 0, 54, 55, 0, 0, 0, 0, 57,
5445 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
5446 4, 5, 6, 0, 8, 0, 0, 0, 9, 10,
5447 0, 0, 0, 11, 0, 12, 13, 14, 260, 261,
5448 17, 18, 0, 0, 0, 0, 292, 19, 20, 262,
5449 22, 23, 24, 25, 0, 0, 218, 0, 0, 0,
5450 0, 0, 0, 290, 0, 0, 31, 32, 33, 34,
5451 35, 36, 37, 38, 39, 0, 40, 41, 42, 43,
5452 44, 45, 46, 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, 0, 0, 0, 0,
5455 0, 0, 0, 0, 0, 0, 1166, 0, 0, 221,
5456 53, 0, 54, 55, 0, 0, 0, 0, 57, 58,
5457 59, 60, 61, 62, 63, 64, 65, 0, 0, 4,
5458 5, 6, 0, 8, 0, 0, 0, 9, 10, 0,
5459 0, 0, 11, 0, 12, 13, 14, 260, 261, 17,
5460 18, 0, 0, 0, 0, 292, 19, 20, 262, 22,
5461 23, 24, 25, 0, 0, 218, 0, 0, 0, 0,
5462 0, 0, 290, 0, 0, 31, 32, 33, 34, 35,
5463 36, 37, 38, 39, 0, 40, 41, 42, 43, 44,
5464 45, 46, 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, 0, 0, 0, 0, 0,
5467 0, 0, 0, 0, 0, 1263, 0, 0, 221, 53,
5468 0, 54, 55, 22, 23, 24, 25, 57, 58, 59,
5469 60, 61, 62, 63, 64, 65, 0, 0, 0, 31,
5470 32, 33, 1055, 0, 0, 0, 1056, 0, 1057, 40,
5471 41, 42, 43, 44, 0, 0, 0, 0, 0, 0,
5472 0, 0, 0, 0, 292, 0, 0, 0, 547, 0,
5473 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5474 0, 1058, 1059, 0, 0, 0, 0, 0, 0, 1060,
5475 0, 0, 1061, 0, 0, 1062, 1063, 0, 1064, 551,
5476 0, 57, 58, 1065, 60, 61, 62, 63, 64, 65,
5477 0, 0, 0, 0, 0, 0, 22, 23, 24, 25,
5478 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5479 0, 1066, 31, 32, 33, 1055, 0, 0, 292, 1056,
5480 0, 0, 40, 41, 42, 43, 44, 0, 0, 0,
5481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5482 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5483 0, 0, 0, 0, 1058, 1059, 0, 0, 0, 0,
5484 0, 0, 1060, 0, 0, 1061, 0, 0, 1062, 1063,
5485 0, 1064, 0, 0, 57, 58, 59, 60, 61, 62,
5486 63, 64, 65, 0, 0, 0, 0, 0, 0, 22,
5487 23, 24, 25, 0, 0, 0, 631, 632, 0, 0,
5488 633, 0, 0, 0, 1066, 31, 32, 33, 1055, 0,
5489 0, 292, 1056, 0, 0, 40, 41, 42, 43, 44,
5490 179, 180, 181, 182, 183, 184, 185, 186, 187, 0,
5491 0, 188, 189, 0, 0, 0, 0, 190, 191, 192,
5492 193, 0, 0, 0, 0, 0, 0, 1058, 1059, 0,
5493 0, 0, 194, 195, 0, 1060, 0, 0, 1061, 0,
5494 0, 1062, 1063, 0, 0, 0, 0, 57, 58, 59,
5495 60, 61, 62, 63, 64, 65, 0, 0, 0, 0,
5496 0, 0, 196, 197, 198, 199, 200, 201, 202, 203,
5497 204, 205, 0, 206, 207, 684, 622, 1066, 0, 685,
5498 0, 208, 245, 0, 292, 0, 0, 0, 0, 0,
5499 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
5500 180, 181, 182, 183, 184, 185, 186, 187, 0, 0,
5501 188, 189, 0, 0, 0, 0, 190, 191, 192, 193,
5502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5503 0, 194, 195, 0, 0, 0, 0, 0, 0, 0,
5504 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5505 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5506 0, 196, 197, 198, 199, 200, 201, 202, 203, 204,
5507 205, 0, 206, 207, 687, 632, 0, 0, 688, 0,
5508 208, 245, 0, 0, 0, 0, 0, 0, 0, 0,
5509 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5510 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5511 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5512 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5513 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
5514 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5515 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5516 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5517 0, 206, 207, 684, 622, 0, 0, 702, 0, 208,
5518 245, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5519 0, 0, 0, 0, 0, 0, 0, 179, 180, 181,
5520 182, 183, 184, 185, 186, 187, 0, 0, 188, 189,
5521 0, 0, 0, 0, 190, 191, 192, 193, 0, 0,
5522 0, 0, 0, 0, 0, 0, 0, 0, 0, 194,
5523 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5524 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5525 0, 0, 0, 0, 0, 0, 0, 0, 0, 196,
5526 197, 198, 199, 200, 201, 202, 203, 204, 205, 0,
5527 206, 207, 713, 622, 0, 0, 714, 0, 208, 245,
5528 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5529 0, 0, 0, 0, 0, 0, 179, 180, 181, 182,
5530 183, 184, 185, 186, 187, 0, 0, 188, 189, 0,
5531 0, 0, 0, 190, 191, 192, 193, 0, 0, 0,
5532 0, 0, 0, 0, 0, 0, 0, 0, 194, 195,
5533 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5535 0, 0, 0, 0, 0, 0, 0, 0, 196, 197,
5536 198, 199, 200, 201, 202, 203, 204, 205, 0, 206,
5537 207, 716, 632, 0, 0, 717, 0, 208, 245, 0,
5538 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5539 0, 0, 0, 0, 0, 179, 180, 181, 182, 183,
5540 184, 185, 186, 187, 0, 0, 188, 189, 0, 0,
5541 0, 0, 190, 191, 192, 193, 0, 0, 0, 0,
5542 0, 0, 0, 0, 0, 0, 0, 194, 195, 0,
5543 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5544 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5545 0, 0, 0, 0, 0, 0, 0, 196, 197, 198,
5546 199, 200, 201, 202, 203, 204, 205, 0, 206, 207,
5547 829, 622, 0, 0, 830, 0, 208, 245, 0, 0,
5548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5549 0, 0, 0, 0, 179, 180, 181, 182, 183, 184,
5550 185, 186, 187, 0, 0, 188, 189, 0, 0, 0,
5551 0, 190, 191, 192, 193, 0, 0, 0, 0, 0,
5552 0, 0, 0, 0, 0, 0, 194, 195, 0, 0,
5553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5554 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5555 0, 0, 0, 0, 0, 0, 196, 197, 198, 199,
5556 200, 201, 202, 203, 204, 205, 0, 206, 207, 832,
5557 632, 0, 0, 833, 0, 208, 245, 0, 0, 0,
5558 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5559 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
5560 186, 187, 0, 0, 188, 189, 0, 0, 0, 0,
5561 190, 191, 192, 193, 0, 0, 0, 0, 0, 0,
5562 0, 0, 0, 0, 0, 194, 195, 0, 0, 0,
5563 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5564 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5565 0, 0, 0, 0, 0, 196, 197, 198, 199, 200,
5566 201, 202, 203, 204, 205, 0, 206, 207, 838, 622,
5567 0, 0, 839, 0, 208, 245, 0, 0, 0, 0,
5568 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5569 0, 0, 179, 180, 181, 182, 183, 184, 185, 186,
5570 187, 0, 0, 188, 189, 0, 0, 0, 0, 190,
5571 191, 192, 193, 0, 0, 0, 0, 0, 0, 0,
5572 0, 0, 0, 0, 194, 195, 0, 0, 0, 0,
5573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5574 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5575 0, 0, 0, 0, 196, 197, 198, 199, 200, 201,
5576 202, 203, 204, 205, 0, 206, 207, 669, 632, 0,
5577 0, 670, 0, 208, 245, 0, 0, 0, 0, 0,
5578 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5579 0, 179, 180, 181, 182, 183, 184, 185, 186, 187,
5580 0, 0, 188, 189, 0, 0, 0, 0, 190, 191,
5581 192, 193, 0, 0, 0, 0, 0, 0, 0, 0,
5582 0, 0, 0, 194, 195, 0, 0, 0, 0, 0,
5583 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5584 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5585 0, 0, 0, 196, 197, 198, 199, 200, 201, 202,
5586 203, 204, 205, 0, 206, 207, 998, 622, 0, 0,
5587 999, 0, 208, 245, 0, 0, 0, 0, 0, 0,
5588 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5589 179, 180, 181, 182, 183, 184, 185, 186, 187, 0,
5590 0, 188, 189, 0, 0, 0, 0, 190, 191, 192,
5591 193, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5592 0, 0, 194, 195, 0, 0, 0, 0, 0, 0,
5593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5595 0, 0, 196, 197, 198, 199, 200, 201, 202, 203,
5596 204, 205, 0, 206, 207, 1001, 632, 0, 0, 1002,
5597 0, 208, 245, 0, 0, 0, 0, 0, 0, 0,
5598 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
5599 180, 181, 182, 183, 184, 185, 186, 187, 0, 0,
5600 188, 189, 0, 0, 0, 0, 190, 191, 192, 193,
5601 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5602 0, 194, 195, 0, 0, 0, 0, 0, 0, 0,
5603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5604 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5605 0, 196, 197, 198, 199, 200, 201, 202, 203, 204,
5606 205, 0, 206, 207, 1281, 622, 0, 0, 1282, 0,
5607 208, 245, 0, 0, 0, 0, 0, 0, 0, 0,
5608 0, 0, 0, 0, 0, 0, 0, 0, 179, 180,
5609 181, 182, 183, 184, 185, 186, 187, 0, 0, 188,
5610 189, 0, 0, 0, 0, 190, 191, 192, 193, 0,
5611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5612 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
5613 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5614 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5615 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
5616 0, 206, 207, 1284, 632, 0, 0, 1285, 0, 208,
5617 245, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5618 0, 0, 0, 0, 0, 0, 0, 179, 180, 181,
5619 182, 183, 184, 185, 186, 187, 0, 0, 188, 189,
5620 0, 0, 0, 0, 190, 191, 192, 193, 0, 0,
5621 0, 0, 0, 0, 0, 0, 0, 0, 0, 194,
5622 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5623 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5624 0, 0, 0, 0, 0, 0, 0, 0, 0, 196,
5625 197, 198, 199, 200, 201, 202, 203, 204, 205, 0,
5626 206, 207, 1329, 622, 0, 0, 1330, 0, 208, 245,
5627 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5628 0, 0, 0, 0, 0, 0, 179, 180, 181, 182,
5629 183, 184, 185, 186, 187, 0, 0, 188, 189, 0,
5630 0, 0, 0, 190, 191, 192, 193, 0, 0, 0,
5631 0, 0, 0, 0, 0, 0, 0, 0, 194, 195,
5632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5634 0, 0, 0, 0, 0, 0, 0, 0, 196, 197,
5635 198, 199, 200, 201, 202, 203, 204, 205, 0, 206,
5636 207, 669, 632, 0, 0, 670, 0, 208, 245, 0,
5637 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5638 0, 0, 0, 0, 0, 179, 180, 181, 182, 183,
5639 184, 185, 186, 187, 0, 0, 188, 189, 0, 0,
5640 0, 0, 190, 191, 192, 193, 0, 0, 0, 0,
5641 0, 0, 0, 0, 0, 0, 0, 194, 195, 0,
5642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5644 0, 0, 0, 0, 0, 0, 0, 196, 197, 198,
5645 199, 200, 201, 202, 203, 204, 205, 0, 206, 207,
5646 0, 0, 0, 0, 0, 0, 208
5647};
5648
5649static const yytype_int16 yycheck[] =
5650{
5651 1, 97, 58, 15, 16, 21, 59, 70, 332, 27,
5652 91, 106, 336, 52, 53, 388, 242, 412, 13, 14,
5653 58, 332, 394, 1, 105, 336, 70, 7, 56, 336,
5654 15, 16, 743, 580, 85, 557, 93, 94, 96, 7,
5655 97, 387, 549, 389, 26, 578, 28, 27, 581, 245,
5656 817, 52, 53, 97, 594, 56, 1, 85, 827, 27,
5657 580, 284, 745, 101, 80, 288, 56, 463, 584, 54,
5658 98, 99, 100, 52, 745, 15, 16, 72, 58, 750,
5659 63, 64, 65, 884, 85, 94, 459, 750, 97, 882,
5660 102, 797, 509, 439, 919, 66, 609, 98, 99, 100,
5661 101, 13, 455, 499, 26, 1062, 25, 52, 53, 54,
5662 55, 13, 458, 1004, 460, 77, 0, 102, 29, 13,
5663 273, 101, 308, 309, 15, 16, 58, 455, 69, 662,
5664 677, 76, 77, 13, 1127, 463, 101, 0, 511, 98,
5665 486, 567, 155, 496, 10, 80, 78, 160, 574, 34,
5666 100, 1255, 100, 100, 152, 1139, 237, 98, 1247, 1139,
5667 25, 69, 102, 54, 55, 25, 512, 52, 103, 155,
5668 100, 1155, 225, 1153, 591, 101, 28, 109, 110, 275,
5669 672, 673, 221, 740, 265, 135, 743, 135, 135, 25,
5670 98, 156, 67, 250, 251, 154, 25, 27, 351, 158,
5671 1193, 13, 68, 25, 1029, 135, 1163, 1164, 158, 77,
5672 142, 102, 275, 124, 37, 38, 25, 298, 1003, 1004,
5673 221, 1325, 13, 1114, 1003, 1004, 733, 734, 1317, 155,
5674 152, 275, 56, 245, 273, 247, 1061, 156, 1063, 1040,
5675 13, 947, 293, 155, 470, 13, 262, 263, 1041, 161,
5676 1003, 1004, 745, 155, 156, 256, 13, 13, 121, 161,
5677 245, 155, 247, 756, 659, 293, 228, 161, 325, 326,
5678 327, 328, 273, 330, 331, 155, 221, 650, 256, 162,
5679 13, 161, 227, 228, 1268, 801, 26, 660, 1272, 1273,
5680 235, 156, 293, 1273, 273, 135, 156, 242, 981, 695,
5681 245, 283, 284, 399, 837, 651, 288, 247, 290, 1062,
5682 981, 256, 351, 826, 977, 661, 325, 326, 327, 328,
5683 156, 292, 323, 404, 352, 155, 1079, 156, 273, 1114,
5684 25, 161, 155, 295, 156, 1114, 1161, 1162, 395, 525,
5685 693, 527, 156, 155, 1113, 323, 1113, 156, 1332, 161,
5686 351, 352, 101, 900, 411, 399, 247, 396, 397, 227,
5687 228, 1114, 352, 66, 155, 693, 888, 695, 785, 743,
5688 161, 1156, 351, 389, 25, 882, 388, 884, 1163, 1164,
5689 900, 66, 155, 1136, 25, 158, 395, 155, 161, 390,
5690 158, 931, 66, 161, 135, 396, 397, 278, 155, 155,
5691 1153, 110, 411, 135, 161, 161, 351, 156, 100, 389,
5692 1163, 1164, 152, 69, 961, 156, 25, 120, 158, 952,
5693 100, 745, 155, 435, 15, 153, 750, 155, 161, 921,
5694 922, 1163, 1164, 142, 25, 927, 928, 122, 123, 69,
5695 135, 97, 98, 388, 460, 390, 120, 459, 25, 135,
5696 435, 396, 397, 806, 69, 135, 1127, 683, 509, 439,
5697 155, 156, 480, 158, 159, 891, 892, 97, 98, 895,
5698 486, 897, 158, 899, 1058, 1059, 156, 162, 806, 113,
5699 460, 509, 97, 98, 78, 1270, 979, 710, 981, 156,
5700 983, 492, 25, 532, 158, 435, 512, 693, 154, 511,
5701 480, 69, 158, 34, 56, 156, 486, 158, 509, 15,
5702 100, 17, 480, 100, 459, 156, 905, 158, 907, 1011,
5703 100, 52, 100, 468, 154, 470, 135, 100, 135, 97,
5704 98, 532, 512, 1040, 1041, 579, 722, 538, 1270, 154,
5705 591, 727, 1253, 916, 435, 135, 155, 156, 135, 1316,
5706 159, 145, 146, 147, 435, 135, 909, 135, 135, 803,
5707 538, 100, 135, 591, 455, 577, 511, 811, 580, 915,
5708 1127, 917, 968, 945, 1158, 1159, 156, 578, 155, 156,
5709 581, 101, 159, 156, 1255, 466, 154, 532, 469, 1260,
5710 591, 156, 30, 474, 652, 69, 135, 1260, 1131, 643,
5711 100, 640, 135, 642, 589, 496, 663, 78, 489, 594,
5712 555, 627, 557, 66, 67, 69, 1042, 1043, 1044, 1045,
5713 636, 156, 155, 156, 98, 1127, 159, 100, 610, 1003,
5714 1004, 1124, 158, 578, 1127, 651, 581, 863, 650, 640,
5715 968, 642, 699, 97, 98, 661, 970, 629, 660, 100,
5716 387, 1023, 389, 69, 1325, 671, 674, 981, 1321, 970,
5717 711, 662, 135, 970, 720, 1060, 1188, 1189, 54, 122,
5718 123, 651, 143, 144, 145, 146, 147, 158, 64, 65,
5719 561, 661, 98, 711, 135, 630, 52, 703, 704, 100,
5720 56, 636, 627, 69, 674, 640, 1253, 642, 1255, 78,
5721 154, 636, 439, 1260, 686, 650, 674, 100, 1265, 590,
5722 711, 100, 1036, 794, 589, 660, 1249, 662, 69, 594,
5723 159, 458, 98, 460, 135, 1036, 671, 69, 710, 1036,
5724 158, 1103, 155, 715, 785, 158, 671, 135, 683, 722,
5725 1114, 724, 135, 100, 727, 728, 135, 98, 485, 486,
5726 160, 846, 69, 1255, 58, 97, 98, 785, 1260, 704,
5727 56, 1187, 1255, 1265, 1321, 1160, 1323, 156, 1325, 153,
5728 1327, 158, 1265, 510, 78, 512, 1298, 759, 135, 836,
5729 97, 98, 1156, 156, 785, 100, 667, 1344, 69, 1163,
5730 1164, 835, 162, 69, 78, 834, 66, 672, 673, 156,
5731 69, 155, 693, 1127, 66, 109, 844, 161, 1180, 113,
5732 69, 69, 154, 37, 38, 69, 254, 98, 69, 1321,
5733 135, 1323, 98, 1325, 152, 1327, 135, 836, 97, 98,
5734 1323, 52, 1325, 834, 1327, 56, 837, 686, 97, 98,
5735 98, 156, 1344, 97, 98, 135, 97, 98, 594, 831,
5736 120, 1344, 122, 123, 107, 125, 737, 69, 120, 841,
5737 122, 123, 69, 125, 844, 1238, 715, 155, 1, 814,
5738 815, 159, 817, 855, 869, 155, 156, 582, 69, 1253,
5739 937, 586, 15, 16, 66, 154, 98, 135, 900, 834,
5740 97, 98, 837, 1239, 161, 154, 1270, 936, 66, 156,
5741 154, 917, 1127, 154, 916, 26, 97, 98, 25, 953,
5742 56, 349, 649, 26, 651, 806, 354, 139, 863, 52,
5743 53, 69, 659, 56, 661, 1268, 672, 673, 937, 1272,
5744 769, 1255, 971, 772, 67, 936, 1260, 917, 120, 135,
5745 122, 123, 135, 888, 69, 156, 931, 154, 69, 97,
5746 98, 952, 85, 156, 122, 123, 69, 125, 159, 69,
5747 93, 94, 843, 154, 97, 98, 99, 100, 153, 102,
5748 971, 916, 97, 98, 155, 156, 97, 98, 100, 14,
5749 15, 862, 831, 864, 97, 98, 931, 97, 98, 1028,
5750 156, 936, 841, 994, 995, 990, 991, 89, 90, 880,
5751 159, 1325, 1003, 1004, 442, 443, 154, 952, 83, 84,
5752 1066, 1153, 1065, 135, 1, 453, 994, 995, 1000, 40,
5753 41, 1163, 1164, 461, 462, 156, 971, 1028, 1253, 154,
5754 1255, 152, 156, 154, 156, 1260, 156, 158, 66, 152,
5755 1265, 154, 156, 481, 154, 158, 921, 922, 135, 487,
5756 155, 156, 927, 928, 294, 295, 156, 1058, 1059, 52,
5757 156, 1062, 52, 138, 139, 52, 53, 153, 66, 13,
5758 1109, 1110, 156, 1018, 1102, 1020, 156, 1173, 1079, 17,
5759 1062, 1063, 25, 1028, 153, 156, 156, 1168, 221, 1128,
5760 135, 44, 120, 1150, 122, 123, 1321, 44, 1323, 153,
5761 1325, 1102, 1327, 1048, 1049, 1106, 156, 156, 1109, 1110,
5762 1173, 98, 245, 1114, 247, 44, 66, 250, 251, 1344,
5763 44, 996, 120, 256, 122, 123, 135, 1128, 160, 1173,
5764 1131, 137, 8, 1172, 1116, 1136, 1011, 15, 1139, 156,
5765 273, 1150, 52, 156, 156, 1127, 1185, 66, 156, 156,
5766 153, 1000, 1153, 1154, 1155, 156, 1138, 1158, 1159, 1141,
5767 293, 1106, 1163, 1164, 1109, 1110, 101, 1220, 1113, 1197,
5768 120, 1172, 122, 123, 156, 921, 922, 156, 915, 1161,
5769 917, 927, 928, 1128, 1185, 156, 1131, 9, 1245, 1246,
5770 323, 156, 325, 326, 327, 328, 1197, 330, 331, 140,
5771 638, 120, 52, 122, 123, 54, 55, 140, 57, 52,
5772 156, 1193, 101, 1062, 156, 64, 65, 588, 351, 352,
5773 156, 153, 56, 1239, 161, 159, 1238, 1172, 156, 156,
5774 1175, 1259, 1, 140, 221, 156, 1245, 1246, 156, 156,
5775 1185, 156, 156, 1188, 1189, 156, 15, 16, 1249, 1288,
5776 996, 1233, 1234, 1235, 153, 388, 140, 390, 1259, 1239,
5777 56, 156, 395, 396, 397, 1011, 637, 1268, 26, 256,
5778 156, 1272, 1273, 644, 645, 156, 156, 52, 411, 54,
5779 55, 1162, 57, 52, 53, 156, 273, 1288, 158, 1138,
5780 158, 156, 1141, 1238, 256, 1240, 323, 1242, 67, 488,
5781 1106, 1283, 435, 52, 1249, 54, 55, 56, 57, 492,
5782 1292, 69, 1161, 52, 844, 54, 55, 56, 57, 98,
5783 100, 89, 1203, 481, 93, 94, 459, 102, 97, 1311,
5784 671, 1332, 1213, 102, 932, 882, 323, 1175, 733, 97,
5785 98, 1195, 52, 1288, 54, 55, 56, 57, 78, 1230,
5786 1231, 1232, 52, 1298, 54, 55, 56, 57, 1127, 492,
5787 1260, 799, 800, 102, 351, 95, 96, 1049, 1317, 807,
5788 808, 1316, 78, 347, 672, 673, 509, 847, 511, 1316,
5789 1196, 1156, 1154, 1199, 1233, 1234, 1235, 1152, 109, 95,
5790 96, 689, 690, 764, 152, 1156, 154, 768, 1240, 532,
5791 158, 1242, 102, 390, 527, 538, 101, 705, 108, 396,
5792 397, 750, 142, 143, 144, 145, 146, 147, 743, 857,
5793 858, 1253, 860, 861, 40, 41, 42, 43, 44, 59,
5794 60, 61, 62, 1311, 1283, -1, -1, 143, 144, 145,
5795 146, 147, 901, 902, 577, 578, -1, 580, 581, -1,
5796 -1, 910, 221, 912, 825, 914, 589, 828, 591, -1,
5797 -1, 594, -1, -1, -1, -1, -1, -1, -1, -1,
5798 -1, 842, -1, -1, -1, 913, 245, -1, 247, -1,
5799 -1, 250, 251, -1, -1, 1301, 1302, 256, 926, 1305,
5800 1306, -1, -1, 1309, -1, -1, -1, -1, -1, -1,
5801 1237, -1, 1239, -1, 273, 492, -1, 640, -1, 642,
5802 -1, -1, -1, -1, -1, -1, -1, 650, -1, -1,
5803 -1, -1, 1338, 1339, 1340, 1341, 964, 660, -1, 662,
5804 663, 1347, -1, -1, -1, 78, -1, -1, -1, 672,
5805 673, -1, -1, -1, -1, 532, -1, -1, -1, -1,
5806 -1, 538, 95, 96, 323, -1, 325, 326, 327, 328,
5807 -1, 330, 331, -1, -1, -1, 699, 938, -1, -1,
5808 941, 1308, -1, -1, -1, -1, -1, 948, 711, -1,
5809 951, -1, 351, 954, 1003, 1004, -1, -1, -1, -1,
5810 -1, 578, -1, -1, 581, -1, 1, 140, 141, 142,
5811 143, 144, 145, 146, 147, -1, -1, 594, -1, -1,
5812 15, 16, -1, -1, -1, -1, -1, -1, -1, 388,
5813 -1, 390, -1, 921, 922, -1, 395, 396, 397, 927,
5814 928, -1, -1, -1, -1, -1, -1, -1, -1, 1058,
5815 1059, -1, 411, 1062, -1, -1, -1, 52, 53, -1,
5816 -1, -1, 785, 640, -1, 642, -1, -1, -1, -1,
5817 1079, 1032, 67, -1, 962, 963, 435, 965, 966, -1,
5818 -1, -1, -1, -1, -1, 662, -1, -1, -1, -1,
5819 -1, -1, -1, -1, -1, 672, 673, -1, 93, 94,
5820 459, -1, 97, -1, -1, 1114, -1, 102, -1, -1,
5821 -1, 834, -1, 836, 837, -1, -1, 1145, -1, -1,
5822 -1, -1, -1, 1011, -1, -1, -1, 1136, -1, -1,
5823 1139, -1, -1, 492, 52, -1, 54, 55, 56, 57,
5824 58, -1, -1, -1, 1153, 1154, 1155, 1035, -1, 1158,
5825 1159, -1, 511, -1, 1163, 1164, -1, -1, -1, 52,
5826 78, 54, 55, 56, 57, 58, -1, -1, -1, -1,
5827 -1, -1, -1, 532, 92, -1, -1, 900, -1, 538,
5828 -1, -1, -1, -1, 102, 78, -1, -1, -1, -1,
5829 108, 109, 110, 916, -1, -1, -1, -1, 921, 922,
5830 -1, -1, -1, -1, 927, 928, -1, -1, -1, 102,
5831 -1, -1, -1, 936, 937, -1, 109, 110, 577, 578,
5832 -1, 580, 581, -1, 142, -1, 221, 145, -1, 952,
5833 589, -1, -1, -1, -1, 594, -1, -1, -1, 52,
5834 158, 54, 55, 56, 57, 58, -1, -1, 971, 142,
5835 245, -1, 247, -1, -1, 250, 251, 834, -1, 1268,
5836 837, 256, -1, 1272, 1273, 78, -1, -1, -1, -1,
5837 -1, 994, 995, 996, -1, -1, -1, -1, 273, 92,
5838 -1, 640, -1, 642, -1, -1, -1, -1, 1011, 102,
5839 -1, 650, -1, -1, -1, -1, 109, 110, -1, -1,
5840 -1, 660, -1, 662, 663, 1028, -1, -1, -1, -1,
5841 -1, -1, -1, 672, 673, -1, 52, -1, 54, 55,
5842 56, 57, 58, 1332, -1, -1, -1, -1, 323, 142,
5843 325, 326, 327, 328, 1295, 330, 331, -1, -1, -1,
5844 699, -1, 78, -1, 921, 922, -1, -1, -1, -1,
5845 927, 928, -1, -1, -1, -1, 351, -1, -1, 936,
5846 -1, -1, -1, -1, -1, -1, 102, -1, -1, 1,
5847 -1, -1, 108, 109, 110, 952, -1, -1, -1, 1102,
5848 -1, -1, -1, 1106, -1, -1, 1109, 1110, -1, -1,
5849 -1, -1, -1, 388, 971, 390, -1, -1, -1, -1,
5850 395, 396, 397, -1, -1, 1128, 142, -1, 1131, 145,
5851 -1, -1, -1, -1, -1, -1, 411, 994, 995, 996,
5852 52, 53, -1, -1, 56, -1, -1, 1150, -1, -1,
5853 -1, -1, -1, -1, 1011, -1, -1, -1, -1, -1,
5854 435, -1, -1, -1, -1, -1, -1, -1, -1, 1172,
5855 -1, 1028, -1, 85, -1, 52, -1, 54, 55, 56,
5856 57, 58, 1185, -1, 459, -1, 98, 99, 100, -1,
5857 -1, -1, -1, -1, 1197, 834, -1, 836, 837, -1,
5858 -1, 78, -1, -1, -1, -1, -1, -1, -1, -1,
5859 -1, -1, -1, -1, -1, -1, -1, 492, -1, -1,
5860 -1, -1, -1, -1, -1, 102, -1, -1, -1, -1,
5861 -1, 108, 109, 110, -1, 1238, 511, -1, -1, -1,
5862 -1, -1, 1245, 1246, 1, 1102, 1249, -1, -1, 1106,
5863 -1, -1, 1109, 1110, -1, -1, 1259, 532, 15, 16,
5864 -1, 900, -1, 538, -1, 142, 1003, 1004, 145, -1,
5865 -1, 1128, -1, -1, 1131, -1, -1, 916, 155, -1,
5866 -1, -1, 921, 922, -1, 1288, -1, -1, 927, 928,
5867 -1, -1, -1, -1, -1, 52, 53, 936, 937, -1,
5868 -1, -1, 577, 578, -1, 580, 581, -1, -1, 221,
5869 67, -1, -1, 952, 589, 1172, -1, -1, -1, 594,
5870 -1, 1058, 1059, -1, -1, 1062, -1, -1, 1185, -1,
5871 -1, -1, 971, -1, -1, -1, 93, 94, -1, -1,
5872 97, -1, 1079, -1, 256, 102, -1, -1, -1, -1,
5873 -1, -1, -1, -1, -1, 994, 995, 996, -1, -1,
5874 -1, 273, -1, -1, -1, 640, -1, 642, -1, -1,
5875 -1, -1, 1011, -1, -1, 650, -1, 1114, -1, -1,
5876 -1, 293, -1, -1, -1, 660, -1, 662, 663, 1028,
5877 -1, -1, 1249, -1, -1, -1, -1, 672, 673, 1136,
5878 -1, -1, 1139, -1, -1, -1, -1, -1, -1, -1,
5879 -1, 323, -1, -1, -1, -1, 1153, 1154, 1155, -1,
5880 -1, 1158, 1159, -1, 699, -1, 1163, 1164, -1, -1,
5881 -1, 1288, -1, -1, -1, -1, -1, -1, -1, 351,
5882 352, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5883 -1, -1, -1, 1003, 1004, -1, -1, 52, -1, 54,
5884 55, 56, 57, 58, 221, -1, -1, 1106, -1, -1,
5885 1109, 1110, -1, -1, -1, -1, -1, -1, 390, -1,
5886 -1, -1, -1, 78, 396, 397, -1, -1, 245, 1128,
5887 247, -1, 1131, 250, 251, -1, -1, 92, -1, 256,
5888 -1, -1, -1, -1, -1, -1, -1, 102, 1058, 1059,
5889 -1, 1150, 1062, 108, 109, 110, 273, -1, -1, -1,
5890 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1079,
5891 -1, 1268, -1, 1172, -1, 1272, 1273, -1, -1, -1,
5892 -1, -1, -1, -1, -1, -1, 1185, 142, -1, -1,
5893 145, -1, -1, -1, -1, -1, -1, -1, -1, 834,
5894 -1, 836, 837, -1, 1114, -1, 323, -1, 325, 326,
5895 327, 328, -1, 330, 331, -1, -1, -1, -1, -1,
5896 492, -1, -1, -1, -1, -1, 1136, -1, -1, 1139,
5897 -1, -1, -1, -1, 351, 1332, -1, 509, -1, 1238,
5898 -1, -1, -1, 1153, 1154, 1155, 1245, 1246, 1158, 1159,
5899 1249, -1, -1, 1163, 1164, -1, 1, -1, -1, -1,
5900 532, -1, -1, -1, -1, 900, 538, -1, -1, -1,
5901 -1, 388, -1, 390, -1, -1, -1, -1, 395, 396,
5902 397, 916, -1, -1, -1, -1, 921, 922, -1, 1288,
5903 -1, -1, 927, 928, 411, -1, -1, -1, -1, -1,
5904 -1, 936, 937, -1, -1, -1, 578, 52, 53, 581,
5905 -1, 56, -1, -1, -1, -1, -1, 952, 435, 591,
5906 -1, -1, 594, -1, -1, -1, -1, -1, -1, -1,
5907 -1, -1, -1, -1, -1, -1, 971, -1, -1, -1,
5908 85, -1, 459, -1, -1, -1, -1, -1, -1, -1,
5909 -1, -1, -1, 98, 99, 100, -1, -1, 1268, 994,
5910 995, 996, 1272, 1273, -1, -1, -1, -1, 640, -1,
5911 642, -1, -1, -1, -1, 492, 1011, -1, -1, -1,
5912 -1, -1, -1, -1, -1, 1, -1, -1, -1, -1,
5913 662, -1, -1, 1028, 511, -1, -1, -1, -1, -1,
5914 672, 673, -1, -1, -1, -1, -1, -1, -1, -1,
5915 -1, -1, -1, -1, -1, 532, -1, -1, -1, -1,
5916 -1, 538, 1332, -1, -1, -1, -1, -1, -1, -1,
5917 -1, -1, -1, 1003, 1004, -1, 52, 53, -1, 711,
5918 56, -1, -1, -1, -1, -1, -1, -1, 720, -1,
5919 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5920 577, 578, -1, 580, 581, -1, -1, -1, -1, 85,
5921 -1, 1106, 589, -1, 1109, 1110, 221, 594, -1, -1,
5922 -1, -1, 98, 99, 100, -1, -1, -1, 1058, 1059,
5923 -1, -1, 1062, 1128, -1, -1, 1131, -1, -1, -1,
5924 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1079,
5925 -1, 256, -1, 785, -1, 1150, -1, -1, -1, -1,
5926 -1, -1, -1, 640, -1, 642, -1, -1, 273, -1,
5927 -1, -1, -1, 650, -1, -1, -1, 1172, -1, -1,
5928 -1, -1, -1, 660, 1114, 662, 663, -1, 293, -1,
5929 1185, -1, -1, -1, -1, 672, 673, -1, -1, -1,
5930 -1, -1, 834, -1, -1, 837, 1136, -1, 25, 1139,
5931 -1, -1, -1, -1, -1, -1, -1, -1, 323, -1,
5932 -1, -1, 699, 1153, 1154, 1155, -1, -1, 1158, 1159,
5933 -1, -1, -1, 1163, 1164, -1, -1, -1, -1, -1,
5934 -1, -1, -1, 1238, -1, 221, 351, 352, -1, -1,
5935 1245, 1246, -1, -1, 1249, 1003, 1004, -1, -1, -1,
5936 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
5937 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
5938 256, -1, -1, -1, 101, 390, -1, -1, -1, 921,
5939 922, 396, 397, 1288, -1, 927, 928, 273, -1, -1,
5940 -1, -1, -1, -1, 936, -1, -1, -1, -1, -1,
5941 1058, 1059, -1, -1, 1062, 55, -1, 293, -1, 136,
5942 952, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5943 147, 1079, -1, -1, -1, -1, -1, -1, 1268, 971,
5944 -1, -1, 1272, 1273, -1, -1, -1, 323, -1, -1,
5945 -1, -1, -1, -1, -1, -1, -1, 834, -1, 836,
5946 837, -1, 994, 995, 996, -1, 1114, -1, -1, -1,
5947 -1, -1, -1, -1, -1, 351, 352, -1, -1, 1011,
5948 -1, -1, -1, -1, -1, -1, -1, 492, 1136, -1,
5949 -1, 1139, -1, -1, -1, -1, 1028, -1, -1, -1,
5950 -1, -1, 1332, -1, 509, 1153, 1154, 1155, -1, -1,
5951 1158, 1159, -1, -1, 390, 1163, 1164, -1, -1, -1,
5952 396, 397, -1, 900, -1, -1, -1, 532, -1, -1,
5953 -1, -1, -1, 538, -1, -1, 1003, 1004, -1, 916,
5954 -1, -1, -1, -1, 921, 922, -1, -1, -1, -1,
5955 927, 928, -1, -1, -1, -1, -1, -1, -1, 936,
5956 937, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5957 1102, -1, -1, 578, 1106, 952, 581, 1109, 1110, 219,
5958 -1, -1, 222, 223, 224, -1, 591, -1, -1, 594,
5959 -1, 1058, 1059, -1, 971, 1062, 1128, -1, -1, 1131,
5960 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5961 -1, -1, 1079, -1, -1, -1, 492, 994, 995, 996,
5962 1268, -1, -1, 1, 1272, 1273, -1, -1, -1, -1,
5963 -1, -1, -1, 509, 1011, 640, -1, 642, -1, -1,
5964 1172, -1, -1, -1, -1, -1, -1, 1114, -1, -1,
5965 -1, 1028, -1, 1185, -1, -1, 532, 662, -1, -1,
5966 -1, -1, 538, -1, -1, 1197, -1, 672, 673, 1136,
5967 -1, -1, 1139, -1, 52, 53, -1, -1, 56, 1,
5968 -1, -1, -1, -1, 1332, -1, 1153, 1154, 1155, -1,
5969 -1, 1158, 1159, -1, -1, -1, 1163, 1164, -1, -1,
5970 -1, -1, 578, -1, -1, 581, 711, 85, -1, -1,
5971 -1, -1, -1, -1, -1, 591, -1, 1249, 594, -1,
5972 98, 99, 100, 101, -1, -1, -1, 1259, -1, 1106,
5973 52, 53, 1109, 1110, -1, -1, -1, -1, -1, -1,
5974 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5975 -1, 1128, -1, -1, 1131, -1, 1288, -1, -1, -1,
5976 -1, -1, -1, -1, 640, -1, 642, -1, -1, 1003,
5977 1004, -1, -1, 1150, -1, -1, -1, -1, -1, -1,
5978 785, -1, -1, -1, -1, -1, 662, -1, -1, -1,
5979 -1, -1, -1, -1, -1, 1172, 672, 673, -1, -1,
5980 -1, 1268, -1, -1, -1, 1272, 1273, -1, 1185, -1,
5981 -1, -1, -1, -1, 454, 455, -1, -1, -1, -1,
5982 -1, -1, -1, 463, 1058, 1059, -1, -1, 1062, 834,
5983 -1, -1, 837, -1, -1, 711, -1, -1, -1, -1,
5984 -1, -1, -1, 221, -1, 1079, -1, -1, -1, -1,
5985 -1, -1, -1, -1, -1, -1, 496, -1, -1, 499,
5986 -1, 1238, -1, -1, -1, 1332, -1, -1, 1245, 1246,
5987 -1, -1, 1249, -1, -1, -1, -1, -1, 256, -1,
5988 1114, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5989 -1, -1, -1, -1, -1, 273, -1, -1, -1, 221,
5990 -1, -1, 1136, -1, -1, 1139, -1, -1, -1, 785,
5991 -1, 1288, -1, -1, -1, 293, 921, 922, -1, 1153,
5992 1154, 1155, 927, 928, 1158, 1159, -1, -1, 568, 1163,
5993 1164, 936, -1, -1, 256, -1, -1, -1, -1, -1,
5994 -1, -1, -1, -1, -1, 323, -1, 952, -1, 589,
5995 -1, 273, -1, -1, 594, -1, -1, -1, 834, -1,
5996 -1, 837, -1, -1, -1, -1, 971, -1, -1, -1,
5997 -1, -1, -1, 351, 352, -1, -1, -1, -1, -1,
5998 -1, -1, -1, -1, -1, -1, -1, -1, -1, 994,
5999 995, 996, -1, -1, -1, -1, -1, -1, -1, -1,
6000 -1, 323, -1, -1, -1, -1, 1011, -1, -1, -1,
6001 -1, -1, 390, -1, -1, -1, -1, -1, 396, 397,
6002 -1, -1, -1, 1028, -1, -1, -1, -1, -1, 351,
6003 -1, -1, -1, -1, 1268, 675, -1, -1, 1272, 1273,
6004 -1, -1, -1, -1, -1, 921, 922, -1, -1, -1,
6005 -1, 927, 928, 693, -1, 695, -1, -1, -1, -1,
6006 936, 33, 34, 35, 36, -1, -1, -1, 390, -1,
6007 -1, -1, -1, -1, 396, 397, 952, 49, 50, 51,
6008 -1, -1, -1, -1, -1, -1, -1, 59, 60, 61,
6009 62, 63, -1, -1, -1, 971, -1, 1102, 1332, -1,
6010 -1, 1106, -1, -1, 1109, 1110, -1, -1, -1, 749,
6011 -1, -1, -1, -1, 492, -1, -1, -1, 994, 995,
6012 996, -1, -1, 1128, -1, -1, 1131, -1, -1, -1,
6013 -1, 509, -1, -1, -1, 1011, -1, 777, -1, 111,
6014 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6015 -1, -1, 1028, -1, 532, -1, 1003, 1004, -1, -1,
6016 538, -1, -1, -1, -1, -1, 806, 1172, -1, -1,
6017 492, -1, -1, -1, -1, -1, 148, -1, -1, -1,
6018 1185, -1, -1, -1, 824, -1, -1, -1, -1, -1,
6019 -1, -1, 1197, -1, -1, -1, -1, -1, -1, -1,
6020 578, -1, -1, 581, -1, -1, -1, -1, -1, -1,
6021 532, 1058, 1059, 591, -1, 1062, 538, -1, -1, -1,
6022 -1, -1, -1, -1, -1, -1, 1102, -1, -1, -1,
6023 1106, -1, 1079, 1109, 1110, -1, -1, -1, 1003, 1004,
6024 -1, -1, -1, -1, 1249, -1, -1, -1, -1, -1,
6025 -1, -1, 1128, -1, 1259, 1131, 578, -1, -1, 581,
6026 -1, -1, 640, -1, 642, -1, -1, 1114, -1, 909,
6027 -1, -1, 594, -1, -1, -1, -1, -1, -1, -1,
6028 -1, -1, -1, 1288, 662, -1, -1, -1, -1, 1136,
6029 -1, 931, 1139, 1058, 1059, -1, 1172, 1062, -1, -1,
6030 -1, -1, -1, 943, -1, -1, 1153, 1154, 1155, 1185,
6031 -1, 1158, 1159, -1, 1079, -1, 1163, 1164, 640, -1,
6032 642, 1197, -1, -1, -1, -1, -1, -1, 968, -1,
6033 -1, -1, -1, 711, -1, -1, -1, -1, -1, -1,
6034 662, -1, -1, -1, -1, -1, -1, -1, -1, 1114,
6035 672, 673, 992, -1, -1, -1, -1, -1, -1, -1,
6036 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6037 -1, 1136, -1, 1249, 1139, -1, -1, -1, -1, -1,
6038 -1, -1, -1, 1259, -1, -1, -1, 1027, 1153, 1154,
6039 1155, -1, -1, 1158, 1159, -1, -1, -1, 1163, 1164,
6040 -1, -1, -1, -1, -1, -1, -1, 785, -1, -1,
6041 -1, -1, 1288, -1, -1, -1, -1, -1, -1, -1,
6042 -1, 1268, -1, -1, -1, 1272, 1273, -1, -1, -1,
6043 -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
6044 -1, -1, -1, -1, 8, 9, 10, -1, -1, 13,
6045 14, 15, -1, 17, -1, -1, 834, -1, -1, 837,
6046 -1, 25, 26, 27, -1, -1, -1, -1, -1, -1,
6047 -1, 1111, -1, 37, 38, -1, 40, 41, 42, 43,
6048 44, -1, -1, -1, -1, 1332, -1, -1, -1, -1,
6049 -1, 15, 16, -1, -1, -1, -1, -1, -1, -1,
6050 -1, -1, -1, 1268, 68, 69, -1, 1272, 1273, -1,
6051 -1, -1, 834, -1, -1, 837, -1, -1, -1, -1,
6052 -1, -1, -1, 47, 48, 49, 50, -1, -1, -1,
6053 54, 55, -1, 97, 98, -1, -1, -1, -1, -1,
6054 -1, -1, -1, 67, 68, -1, -1, -1, -1, -1,
6055 -1, -1, -1, 33, 34, 35, 36, 121, 936, -1,
6056 -1, -1, -1, -1, -1, -1, -1, 1332, -1, 49,
6057 50, 51, 52, -1, 952, -1, 56, -1, 102, 59,
6058 60, 61, 62, 63, -1, -1, -1, -1, 152, 153,
6059 -1, 155, -1, 971, 158, 159, -1, 161, -1, 921,
6060 922, -1, -1, -1, -1, 927, 928, -1, -1, -1,
6061 -1, 91, 92, -1, 936, -1, 994, 995, -1, 99,
6062 -1, -1, 102, -1, -1, 105, 106, -1, 108, -1,
6063 952, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6064 -1, -1, 44, -1, -1, -1, -1, -1, -1, 971,
6065 1028, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6066 -1, 141, -1, -1, -1, -1, -1, -1, 148, -1,
6067 -1, -1, 994, 995, 996, 155, 78, 79, 80, 81,
6068 82, 83, 84, 85, 86, 87, 88, 89, 90, 1011,
6069 -1, -1, -1, 95, 96, 219, -1, -1, 222, 223,
6070 224, -1, 226, -1, -1, -1, 1028, -1, -1, -1,
6071 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6072 -1, 245, -1, 247, 1102, -1, 44, -1, 1106, -1,
6073 -1, 1109, 1110, -1, 136, -1, 138, 139, 140, 141,
6074 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
6075 1128, -1, -1, 1131, 156, -1, -1, -1, -1, -1,
6076 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
6077 88, 89, 90, -1, -1, -1, -1, 95, 96, -1,
6078 -1, -1, -1, -1, 1106, -1, -1, 1109, 1110, -1,
6079 -1, -1, -1, -1, 1172, -1, -1, -1, -1, -1,
6080 -1, -1, -1, -1, -1, -1, 1128, 1185, -1, 1131,
6081 -1, -1, -1, -1, -1, -1, -1, -1, 136, 1197,
6082 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6083 -1, -1, 356, 357, 358, 359, 360, -1, -1, 363,
6084 364, 365, 366, 367, 368, 369, 370, -1, 372, -1,
6085 1172, 375, 376, 377, 378, 379, 380, 381, 382, 383,
6086 384, -1, -1, 1185, 388, -1, -1, -1, -1, -1,
6087 -1, 1249, -1, -1, -1, -1, -1, -1, -1, -1,
6088 -1, 1259, -1, -1, -1, -1, -1, -1, -1, -1,
6089 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6090 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6091 1288, 435, -1, -1, -1, -1, -1, -1, -1, -1,
6092 -1, -1, -1, -1, -1, -1, -1, 1249, -1, -1,
6093 454, 455, -1, -1, -1, 459, -1, -1, -1, 463,
6094 0, 465, -1, -1, -1, -1, -1, -1, 8, 9,
6095 10, -1, -1, 13, 14, 15, -1, 17, -1, 483,
6096 -1, -1, -1, -1, -1, 25, 1288, 27, 28, 29,
6097 -1, -1, 496, -1, -1, 499, -1, 37, 38, -1,
6098 40, 41, 42, 43, 44, -1, -1, 511, -1, -1,
6099 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6100 -1, -1, -1, -1, -1, 529, -1, -1, 68, 69,
6101 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
6102 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
6103 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
6104 100, 101, -1, -1, 568, -1, -1, 107, -1, -1,
6105 -1, -1, -1, 577, -1, -1, 580, -1, -1, -1,
6106 -1, 121, -1, -1, 124, 589, -1, -1, -1, -1,
6107 594, -1, -1, -1, -1, 135, 136, 137, 138, 139,
6108 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
6109 -1, -1, -1, 153, 154, 155, 156, -1, -1, 159,
6110 160, 161, -1, 52, 53, -1, -1, 56, -1, -1,
6111 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6112 -1, -1, -1, -1, -1, -1, 650, 76, 77, 78,
6113 79, 80, 81, 82, 83, 84, 660, -1, 87, 88,
6114 -1, -1, -1, -1, 93, 94, 95, 96, 672, 673,
6115 -1, 675, 676, 677, 678, -1, -1, -1, -1, 108,
6116 109, -1, -1, -1, -1, 689, 690, -1, -1, 693,
6117 -1, 695, -1, -1, -1, -1, -1, -1, -1, -1,
6118 -1, 705, -1, -1, -1, -1, -1, -1, -1, 138,
6119 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6120 149, 150, -1, -1, -1, -1, -1, -1, 157, 158,
6121 -1, -1, 0, 1, -1, 3, 4, 5, 6, 7,
6122 8, 9, 10, 11, 12, 749, 14, 15, 16, 17,
6123 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
6124 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
6125 -1, 39, -1, 777, -1, -1, -1, 45, 46, 47,
6126 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6127 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6128 68, -1, 806, -1, -1, -1, -1, -1, 76, 77,
6129 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6130 824, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6131 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6132 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6133 118, 119, -1, 121, -1, -1, -1, -1, -1, -1,
6134 -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
6135 79, 80, 81, 82, 83, 84, 85, -1, 87, 88,
6136 148, 149, 150, -1, -1, 153, 95, 96, -1, -1,
6137 -1, 159, -1, 161, -1, -1, 900, -1, -1, -1,
6138 -1, -1, -1, -1, -1, 909, -1, -1, -1, -1,
6139 -1, -1, 916, -1, -1, -1, 920, 921, 922, -1,
6140 -1, -1, -1, 927, 928, -1, -1, 931, -1, 138,
6141 139, 140, 141, 142, 143, 144, 145, 146, 147, 943,
6142 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6143 -1, -1, -1, -1, -1, -1, -1, 961, 962, 963,
6144 -1, 965, 966, -1, 968, -1, -1, -1, -1, -1,
6145 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6146 -1, -1, -1, -1, 988, 989, -1, -1, 992, -1,
6147 -1, -1, 996, 997, -1, -1, -1, -1, -1, -1,
6148 -1, -1, -1, -1, -1, -1, -1, 1011, -1, -1,
6149 -1, -1, -1, -1, 0, 1, -1, 3, 4, 5,
6150 6, 7, -1, 1027, -1, 11, 12, -1, -1, -1,
6151 16, 1035, 18, 19, 20, 21, 22, 23, 24, -1,
6152 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
6153 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
6154 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
6155 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6156 -1, -1, -1, 78, 79, 80, 81, 82, 83, 84,
6157 76, 77, 87, 88, -1, -1, -1, -1, -1, -1,
6158 95, 96, -1, -1, -1, 91, 92, 1111, -1, -1,
6159 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6160 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6161 116, 117, 118, 119, -1, 121, -1, -1, -1, -1,
6162 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
6163 145, 146, 147, -1, -1, -1, -1, -1, -1, -1,
6164 -1, -1, 148, 149, 150, -1, -1, 0, 1, 155,
6165 3, 4, 5, 6, 7, 161, -1, -1, 11, 12,
6166 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6167 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
6168 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6169 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6170 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6171 63, 64, 65, -1, 1238, -1, 78, 79, 80, 81,
6172 82, 83, 84, 76, 77, 87, 88, -1, -1, -1,
6173 -1, -1, -1, 95, 96, -1, -1, -1, 91, 92,
6174 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6175 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
6176 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6177 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
6178 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
6179 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
6180 0, 1, 155, 3, 4, 5, 6, 7, 161, -1,
6181 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6182 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
6183 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6184 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
6185 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6186 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6187 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6188 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6189 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6190 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
6191 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6192 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
6193 -1, -1, -1, -1, -1, -1, -1, 8, 9, 10,
6194 -1, -1, 13, 14, 15, -1, 17, -1, 148, 149,
6195 150, -1, -1, 153, 25, 26, 27, 28, 29, -1,
6196 -1, 161, -1, -1, -1, -1, 37, 38, -1, 40,
6197 41, 42, 43, 44, -1, -1, -1, 78, 79, 80,
6198 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
6199 -1, -1, -1, -1, 95, 96, -1, 68, 69, -1,
6200 -1, -1, -1, -1, -1, -1, -1, 78, 79, 80,
6201 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
6202 -1, -1, -1, -1, 95, 96, 97, 98, -1, 100,
6203 101, -1, -1, -1, -1, 136, 107, 138, 139, 140,
6204 141, 142, 143, 144, 145, 146, 147, -1, -1, -1,
6205 121, -1, -1, 124, 155, -1, -1, -1, -1, -1,
6206 -1, -1, -1, -1, 135, 136, 137, 138, 139, 140,
6207 141, 142, 143, 144, 145, 146, 147, -1, -1, -1,
6208 -1, 152, 153, 154, 155, 156, 0, -1, 159, 160,
6209 161, -1, -1, -1, 8, 9, 10, -1, -1, 13,
6210 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
6211 -1, 25, -1, 27, 28, 29, -1, -1, -1, -1,
6212 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
6213 44, -1, -1, -1, 78, 79, 80, 81, 82, 83,
6214 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
6215 -1, 95, 96, -1, 68, 69, -1, -1, -1, -1,
6216 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
6217 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
6218 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
6219 -1, -1, 136, 107, 138, 139, 140, 141, 142, 143,
6220 144, 145, 146, 147, -1, -1, -1, 121, -1, -1,
6221 124, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6222 -1, 135, 136, 137, 138, 139, 140, 141, 142, 143,
6223 144, 145, 146, 147, -1, -1, -1, -1, -1, 153,
6224 154, 155, 156, 0, -1, 159, 160, 161, -1, -1,
6225 -1, 8, 9, 10, -1, -1, 13, 14, 15, -1,
6226 17, -1, -1, -1, -1, -1, -1, -1, 25, 26,
6227 27, 28, 29, -1, -1, -1, -1, -1, -1, -1,
6228 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
6229 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
6230 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
6231 -1, 68, 69, -1, -1, -1, -1, -1, -1, -1,
6232 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
6233 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
6234 97, 98, -1, -1, 101, -1, -1, -1, -1, -1,
6235 107, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6236 147, -1, -1, -1, 121, -1, -1, 124, -1, -1,
6237 -1, -1, -1, -1, -1, -1, -1, -1, -1, 136,
6238 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6239 147, -1, -1, -1, -1, 152, 153, 154, 155, 156,
6240 0, -1, 159, 160, 161, -1, -1, -1, 8, 9,
6241 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
6242 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
6243 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
6244 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
6245 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6246 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
6247 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
6248 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
6249 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
6250 -1, 101, -1, -1, -1, -1, -1, 107, -1, -1,
6251 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6252 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
6253 -1, -1, -1, -1, -1, -1, 136, 137, 138, 139,
6254 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
6255 -1, -1, 152, 153, 154, 155, 156, 0, -1, 159,
6256 160, 161, -1, -1, -1, 8, 9, 10, -1, -1,
6257 13, 14, 15, -1, 17, -1, -1, -1, -1, -1,
6258 -1, -1, 25, 26, 27, 28, -1, -1, -1, -1,
6259 -1, -1, -1, -1, 37, 38, -1, 40, 41, 42,
6260 43, 44, -1, -1, -1, -1, -1, -1, -1, -1,
6261 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6262 -1, -1, -1, -1, -1, 68, 69, -1, -1, -1,
6263 -1, -1, -1, -1, -1, 78, 79, 80, 81, 82,
6264 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
6265 -1, -1, 95, 96, 97, 98, -1, -1, 101, -1,
6266 -1, -1, -1, -1, 107, -1, -1, -1, -1, -1,
6267 -1, -1, -1, -1, -1, -1, -1, -1, 121, -1,
6268 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6269 -1, -1, -1, 136, -1, 138, 139, 140, 141, 142,
6270 143, 144, 145, 146, 147, -1, -1, -1, -1, 152,
6271 153, 154, 155, 156, 0, 158, 159, 160, 161, -1,
6272 -1, -1, 8, 9, 10, -1, -1, 13, 14, 15,
6273 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
6274 -1, 27, 28, 29, -1, -1, -1, -1, -1, -1,
6275 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
6276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6278 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
6279 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
6280 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
6281 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
6282 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
6283 -1, -1, -1, -1, -1, 121, -1, -1, 124, -1,
6284 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6285 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
6286 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
6287 156, 0, -1, 159, 160, 161, -1, -1, -1, 8,
6288 9, 10, -1, -1, 13, 14, 15, -1, 17, -1,
6289 -1, -1, -1, -1, -1, -1, 25, 26, 27, 28,
6290 -1, -1, -1, -1, -1, -1, -1, -1, 37, 38,
6291 -1, 40, 41, 42, 43, 44, -1, -1, -1, -1,
6292 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6293 -1, -1, -1, -1, -1, -1, -1, -1, -1, 68,
6294 69, -1, -1, -1, -1, -1, -1, -1, -1, 78,
6295 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
6296 89, 90, -1, -1, -1, -1, 95, 96, 97, 98,
6297 -1, -1, 101, -1, -1, -1, -1, -1, 107, -1,
6298 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6299 -1, -1, 121, -1, -1, -1, -1, -1, -1, -1,
6300 -1, -1, -1, -1, -1, -1, -1, 136, -1, 138,
6301 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6302 -1, -1, -1, 152, 153, 154, 155, 156, 0, 158,
6303 159, 160, 161, -1, -1, -1, 8, 9, 10, -1,
6304 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
6305 -1, -1, -1, 25, -1, 27, 28, -1, -1, -1,
6306 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
6307 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
6308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6309 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
6310 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
6311 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
6312 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
6313 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
6314 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
6315 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6316 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
6317 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
6318 152, 153, 154, 155, 156, 0, -1, 159, 160, 161,
6319 -1, -1, -1, 8, 9, 10, -1, -1, 13, 14,
6320 15, -1, 17, -1, -1, -1, -1, -1, -1, -1,
6321 25, -1, 27, 28, -1, -1, -1, -1, -1, -1,
6322 -1, -1, 37, 38, -1, 40, 41, 42, 43, 44,
6323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6324 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6325 -1, -1, -1, 68, 69, -1, -1, -1, -1, -1,
6326 -1, -1, -1, 78, 79, 80, 81, 82, 83, 84,
6327 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
6328 95, 96, 97, 98, -1, -1, 101, -1, -1, -1,
6329 -1, -1, 107, -1, -1, -1, -1, -1, -1, -1,
6330 -1, -1, -1, -1, -1, -1, 121, -1, -1, -1,
6331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6332 -1, 136, -1, 138, 139, 140, 141, 142, 143, 144,
6333 145, 146, 147, -1, -1, -1, -1, -1, 153, 154,
6334 155, 156, 0, 158, 159, 160, 161, -1, -1, -1,
6335 8, 9, 10, -1, -1, -1, 14, 15, -1, 17,
6336 -1, -1, -1, -1, -1, -1, -1, 25, 26, -1,
6337 -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
6338 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
6339 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6340 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6341 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
6342 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
6343 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
6344 98, -1, 100, 101, -1, -1, -1, -1, -1, -1,
6345 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6346 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
6347 -1, -1, -1, -1, -1, -1, -1, 135, 136, -1,
6348 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6349 -1, -1, -1, -1, 152, 153, 154, 155, 156, 0,
6350 -1, 159, -1, 161, -1, -1, -1, 8, 9, 10,
6351 -1, -1, -1, 14, 15, -1, 17, -1, -1, -1,
6352 -1, -1, -1, -1, 25, 26, -1, -1, -1, -1,
6353 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
6354 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
6355 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6356 -1, -1, -1, -1, -1, -1, -1, 68, 69, -1,
6357 -1, -1, -1, -1, -1, -1, -1, 78, 79, 80,
6358 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
6359 -1, -1, -1, -1, 95, 96, 97, 98, -1, 100,
6360 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6361 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6362 121, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6363 -1, -1, -1, -1, 135, 136, -1, 138, 139, 140,
6364 141, 142, 143, 144, 145, 146, 147, -1, -1, -1,
6365 -1, 152, 153, 154, 155, 156, 0, -1, 159, -1,
6366 161, -1, -1, -1, 8, 9, 10, -1, -1, -1,
6367 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
6368 -1, 25, -1, -1, -1, -1, -1, -1, -1, -1,
6369 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
6370 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6371 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6372 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
6373 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
6374 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
6375 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
6376 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6377 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
6378 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6379 -1, 135, 136, -1, 138, 139, 140, 141, 142, 143,
6380 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
6381 154, 155, 156, 0, -1, 159, -1, 161, -1, -1,
6382 -1, 8, 9, 10, -1, -1, -1, 14, 15, -1,
6383 17, -1, -1, -1, -1, -1, -1, -1, 25, -1,
6384 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6385 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
6386 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6387 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6388 -1, 68, 69, -1, -1, -1, -1, -1, -1, -1,
6389 -1, 78, 79, 80, 81, 82, 83, 84, 85, 86,
6390 87, 88, 89, 90, -1, -1, -1, -1, 95, 96,
6391 97, 98, -1, 100, 101, -1, -1, -1, -1, -1,
6392 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6393 -1, -1, -1, -1, 121, -1, -1, -1, -1, -1,
6394 -1, -1, -1, -1, -1, -1, -1, -1, 135, 136,
6395 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6396 147, -1, -1, -1, -1, 152, 153, 154, 155, 156,
6397 -1, -1, 159, 1, 161, 3, 4, 5, 6, 7,
6398 8, 9, 10, 11, 12, -1, -1, 15, 16, -1,
6399 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
6400 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
6401 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6402 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6403 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6404 68, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6405 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6406 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6407 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6408 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6409 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
6410 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6411 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6412 148, 149, 150, -1, -1, -1, 1, 155, 3, 4,
6413 5, 6, 7, 161, -1, 10, 11, 12, -1, 14,
6414 15, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6415 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
6416 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6417 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
6418 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6419 65, -1, -1, 68, -1, -1, -1, -1, -1, -1,
6420 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6421 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6422 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6423 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
6424 115, 116, 117, 118, 119, -1, -1, -1, -1, -1,
6425 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6426 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6427 -1, -1, -1, 148, 149, 150, -1, -1, -1, 1,
6428 155, 3, 4, 5, 6, 7, 161, -1, 10, 11,
6429 12, -1, -1, 15, 16, 17, 18, 19, 20, 21,
6430 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
6431 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6432 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
6433 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6434 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
6435 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6436 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6437 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6438 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
6439 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6440 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6441 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6442 -1, -1, -1, -1, -1, -1, 148, 149, 150, -1,
6443 -1, -1, 1, 155, 3, 4, 5, 6, 7, 161,
6444 -1, 10, 11, 12, -1, -1, 15, 16, -1, 18,
6445 19, 20, 21, 22, 23, 24, 25, -1, -1, -1,
6446 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6447 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
6448 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6449 59, 60, 61, 62, 63, 64, 65, -1, -1, 68,
6450 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6451 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6452 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6453 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6454 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6455 119, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6456 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6457 -1, -1, -1, -1, -1, -1, -1, -1, -1, 148,
6458 149, 150, -1, -1, -1, 1, 155, 3, 4, 5,
6459 6, 7, 161, -1, 10, 11, 12, -1, -1, 15,
6460 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6461 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
6462 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
6463 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
6464 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6465 -1, -1, 68, -1, -1, -1, -1, -1, -1, -1,
6466 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6467 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6468 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6469 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6470 116, 117, 118, 119, -1, -1, -1, -1, -1, -1,
6471 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6472 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6473 -1, -1, 148, 149, 150, -1, -1, -1, 1, 155,
6474 3, 4, 5, 6, 7, 161, 9, 10, 11, 12,
6475 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6476 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
6477 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6478 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6479 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6480 63, 64, 65, -1, -1, 68, -1, -1, -1, -1,
6481 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6482 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6483 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6484 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
6485 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6486 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6487 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6488 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
6489 -1, 1, 155, 3, 4, 5, 6, 7, 161, -1,
6490 10, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6491 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
6492 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6493 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
6494 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6495 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
6496 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6497 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6498 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6499 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
6500 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6501 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6502 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6503 -1, -1, -1, -1, -1, -1, -1, -1, 148, 149,
6504 150, -1, -1, -1, 1, 155, 3, 4, 5, 6,
6505 7, 161, -1, -1, 11, 12, -1, -1, -1, 16,
6506 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6507 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6508 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
6509 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6510 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6511 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6512 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6513 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6514 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6515 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6516 117, 118, 119, -1, -1, -1, -1, -1, -1, -1,
6517 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6518 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6519 -1, 148, 149, 150, -1, -1, -1, -1, 155, -1,
6520 -1, -1, 159, 1, 161, 3, 4, 5, 6, 7,
6521 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6522 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
6523 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
6524 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6525 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6526 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6527 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6528 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6529 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6530 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6531 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6532 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
6533 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6534 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6535 148, 149, 150, -1, -1, -1, -1, 155, -1, -1,
6536 -1, 159, 1, 161, 3, 4, 5, 6, 7, -1,
6537 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6538 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
6539 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6540 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
6541 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6542 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6543 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6544 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6545 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6546 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6547 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6548 119, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6549 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6550 -1, -1, -1, -1, -1, -1, -1, -1, -1, 148,
6551 149, 150, -1, -1, 153, 1, 155, 3, 4, 5,
6552 6, 7, 161, -1, -1, 11, 12, -1, -1, -1,
6553 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6554 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
6555 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
6556 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
6557 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6558 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6559 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6560 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6561 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6562 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6563 116, 117, 118, 119, -1, -1, -1, -1, -1, -1,
6564 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6565 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6566 -1, -1, 148, 149, 150, -1, -1, 153, 1, 155,
6567 3, 4, 5, -1, 7, 161, -1, -1, 11, 12,
6568 -1, -1, -1, 16, 17, 18, 19, 20, 21, 22,
6569 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
6570 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6571 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6572 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6573 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6574 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6575 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6576 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6577 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6578 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6579 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6580 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6581 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
6582 -1, -1, 155, -1, -1, -1, -1, -1, 161, 3,
6583 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
6584 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
6585 24, 25, 26, -1, -1, -1, 30, 31, 32, 33,
6586 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
6587 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
6588 54, 55, 56, 57, -1, -1, -1, -1, -1, -1,
6589 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6590 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
6591 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
6592 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
6593 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
6594 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6595 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6596 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
6597 144, 145, 146, 147, -1, 149, 150, -1, -1, -1,
6598 -1, -1, -1, 157, 158, 3, 4, 5, 6, 7,
6599 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
6600 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
6601 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
6602 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6603 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6604 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6605 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6606 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6607 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6608 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6609 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
6610 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6611 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6612 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6613 -1, 149, 150, -1, -1, -1, -1, -1, -1, 157,
6614 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
6615 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
6616 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
6617 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
6618 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6619 53, 54, -1, 56, -1, -1, -1, -1, -1, -1,
6620 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6621 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
6622 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
6623 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
6624 -1, -1, -1, -1, -1, 108, 109, -1, -1, 112,
6625 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6627 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
6628 143, 144, 145, 146, 147, -1, 149, 150, -1, -1,
6629 -1, -1, -1, -1, 157, 3, 4, 5, 6, 7,
6630 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
6631 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
6632 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
6633 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
6634 48, 49, 50, 51, 52, 53, -1, -1, 56, -1,
6635 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6636 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6637 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6638 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6639 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6640 108, 109, -1, -1, 112, -1, -1, -1, -1, -1,
6641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6642 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6643 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6644 -1, 149, 150, -1, -1, -1, -1, -1, -1, 157,
6645 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
6646 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
6647 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
6648 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
6649 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
6650 53, -1, -1, 56, -1, -1, -1, -1, -1, -1,
6651 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6652 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
6653 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
6654 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
6655 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
6656 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6657 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6658 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
6659 143, 144, 145, 146, 147, -1, 149, 150, 3, 4,
6660 5, -1, 7, -1, 157, -1, 11, 12, -1, -1,
6661 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6662 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
6663 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6664 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6665 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6666 65, -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, -1, -1, -1, -1, -1, -1,
6669 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6670 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
6671 115, 116, 117, 118, 119, -1, -1, 3, 4, 5,
6672 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6673 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6674 -1, -1, -1, 148, 30, 31, 32, 33, 34, 35,
6675 36, 156, -1, 39, -1, -1, -1, -1, -1, -1,
6676 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6677 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
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, -1, -1, -1, -1, -1, -1, -1,
6681 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6682 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
6683 116, 117, 118, 119, -1, -1, 3, 4, 5, -1,
6684 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
6685 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6686 -1, -1, 148, 30, 31, 32, 33, 34, 35, 36,
6687 156, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6688 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6689 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
6690 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6691 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6692 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6693 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6694 -1, 108, 109, 110, 111, 112, 113, 114, 115, 116,
6695 117, 118, 119, -1, -1, -1, -1, -1, -1, -1,
6696 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6697 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
6698 7, 148, 149, 150, 11, 12, -1, -1, 155, 16,
6699 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6700 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6701 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6702 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6703 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6704 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6705 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6706 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6707 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6708 -1, -1, -1, -1, 111, 112, 113, 114, 115, 116,
6709 117, 118, 119, -1, -1, -1, -1, -1, -1, -1,
6710 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6711 -1, -1, -1, -1, 1, -1, 3, 4, 5, 6,
6712 7, 148, 149, 150, 11, 12, -1, -1, 155, 16,
6713 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6714 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6715 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
6716 -1, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6717 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6718 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6719 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6720 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6721 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6722 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6723 117, 118, 119, -1, -1, 1, -1, 3, 4, 5,
6724 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6725 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6726 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6727 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6728 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6729 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6730 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6731 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6732 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6733 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6734 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
6735 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6736 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6737 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6738 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6739 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6740 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6741 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
6742 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6743 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6744 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6745 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6746 105, 106, -1, 108, 109, 110, 111, 112, 113, 114,
6747 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6748 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6749 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6750 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6751 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6752 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6753 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
6754 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6755 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6756 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6757 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6758 -1, 105, 106, -1, 108, 109, 110, 111, 112, 113,
6759 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6760 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6761 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6762 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6763 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6764 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6765 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
6766 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6767 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6768 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6769 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6770 103, -1, 105, 106, -1, 108, 109, 110, 111, 112,
6771 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6772 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6773 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6774 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6775 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6776 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6777 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
6778 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6779 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6780 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6781 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6782 102, 103, -1, 105, 106, -1, 108, 109, 110, 111,
6783 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6784 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6785 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6786 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6787 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6788 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6789 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
6790 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6791 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6792 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6793 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6794 -1, 102, 103, -1, 105, 106, -1, 108, 109, -1,
6795 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6796 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6797 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6798 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6799 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6800 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6801 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
6802 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6803 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6804 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6805 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6806 -1, -1, 102, 103, -1, 105, 106, -1, -1, 109,
6807 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6808 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6809 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6810 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6811 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6812 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6813 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
6814 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6815 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6816 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6817 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6818 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6819 109, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6820 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6821 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6822 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6823 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6824 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6825 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6826 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6827 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6828 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6829 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6830 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6831 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6832 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
6833 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
6834 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6835 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
6836 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6837 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6838 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6839 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6840 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6841 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6842 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6843 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6844 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
6845 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6846 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6847 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6848 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6849 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6850 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6851 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6852 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6853 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6854 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6855 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6856 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6857 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6858 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6859 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6860 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6861 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6862 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6863 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6864 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6865 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6866 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6867 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
6868 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6869 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6870 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6871 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6872 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6873 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6874 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
6875 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6876 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6877 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6878 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6879 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
6880 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6881 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6882 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6883 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6884 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6885 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6886 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6887 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6888 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6889 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6890 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6891 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6892 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6893 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6894 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6895 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6896 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6897 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6898 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6899 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6900 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6901 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6902 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6903 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
6904 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6905 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6906 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6907 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6908 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6909 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6910 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6911 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6912 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6913 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6914 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6915 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6916 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6917 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6918 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6919 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6920 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6921 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6922 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6923 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6924 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6925 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6926 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6927 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6928 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6929 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6930 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6931 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6932 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6933 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6934 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6935 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6936 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6937 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6938 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6939 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6940 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6941 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6942 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6943 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6944 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6945 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6946 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6947 -1, 59, 60, 61, 62, 63, 64, 65, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6951 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6952 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6953 118, 119, -1, -1, 3, 4, 5, -1, 7, -1,
6954 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6955 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
6956 148, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6957 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6958 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6959 59, 60, 61, 62, 63, 64, 65, -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 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6963 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6964 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6965 119, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6966 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6967 20, 21, 22, 23, 24, -1, -1, -1, -1, 148,
6968 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6969 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6970 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6971 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6972 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6973 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6974 -1, -1, -1, -1, -1, 95, -1, -1, -1, 99,
6975 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6976 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6977 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6978 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6979 21, 22, 23, 24, -1, -1, -1, -1, 148, 30,
6980 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6981 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6982 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6983 61, 62, 63, 64, 65, -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, -1, -1,
6986 -1, -1, -1, -1, -1, -1, -1, -1, 99, -1,
6987 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6988 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6989 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6990 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6991 22, 23, 24, -1, -1, -1, -1, 148, 30, 31,
6992 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6993 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6994 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6995 62, 63, 64, 65, -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, -1, -1, -1,
6998 -1, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6999 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
7000 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
7001 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
7002 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
7003 23, 24, -1, -1, -1, -1, 148, 30, 31, 32,
7004 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
7005 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
7006 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
7007 63, 64, 65, -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, -1, -1, -1, -1,
7010 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
7011 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
7012 113, 114, 115, 116, 117, 118, 119, -1, -1, 3,
7013 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
7014 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
7015 24, -1, -1, -1, -1, 148, 30, 31, 32, 33,
7016 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
7017 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
7018 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
7019 64, 65, -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, -1, -1, -1, -1, -1,
7022 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
7023 -1, 105, 106, 33, 34, 35, 36, 111, 112, 113,
7024 114, 115, 116, 117, 118, 119, -1, -1, -1, 49,
7025 50, 51, 52, -1, -1, -1, 56, -1, 58, 59,
7026 60, 61, 62, 63, -1, -1, -1, -1, -1, -1,
7027 -1, -1, -1, -1, 148, -1, -1, -1, 78, -1,
7028 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7029 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
7030 -1, -1, 102, -1, -1, 105, 106, -1, 108, 109,
7031 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
7032 -1, -1, -1, -1, -1, -1, 33, 34, 35, 36,
7033 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7034 -1, 141, 49, 50, 51, 52, -1, -1, 148, 56,
7035 -1, -1, 59, 60, 61, 62, 63, -1, -1, -1,
7036 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7037 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7038 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
7039 -1, -1, 99, -1, -1, 102, -1, -1, 105, 106,
7040 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
7041 117, 118, 119, -1, -1, -1, -1, -1, -1, 33,
7042 34, 35, 36, -1, -1, -1, 52, 53, -1, -1,
7043 56, -1, -1, -1, 141, 49, 50, 51, 52, -1,
7044 -1, 148, 56, -1, -1, 59, 60, 61, 62, 63,
7045 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
7046 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
7047 96, -1, -1, -1, -1, -1, -1, 91, 92, -1,
7048 -1, -1, 108, 109, -1, 99, -1, -1, 102, -1,
7049 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
7050 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
7051 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
7052 146, 147, -1, 149, 150, 52, 53, 141, -1, 56,
7053 -1, 157, 158, -1, 148, -1, -1, -1, -1, -1,
7054 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
7055 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
7056 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
7057 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7058 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
7059 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7060 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7061 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
7062 147, -1, 149, 150, 52, 53, -1, -1, 56, -1,
7063 157, 158, -1, -1, -1, -1, -1, -1, -1, -1,
7064 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
7065 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
7066 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
7067 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7068 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
7069 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7070 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7071 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
7072 -1, 149, 150, 52, 53, -1, -1, 56, -1, 157,
7073 158, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7074 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
7075 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
7076 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
7077 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
7078 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7079 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7080 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
7081 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
7082 149, 150, 52, 53, -1, -1, 56, -1, 157, 158,
7083 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7084 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
7085 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
7086 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
7087 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
7088 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7089 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7090 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
7091 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
7092 150, 52, 53, -1, -1, 56, -1, 157, 158, -1,
7093 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7094 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
7095 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
7096 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
7097 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
7098 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7099 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7100 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
7101 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
7102 52, 53, -1, -1, 56, -1, 157, 158, -1, -1,
7103 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7104 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
7105 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
7106 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
7107 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
7108 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7109 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7110 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
7111 142, 143, 144, 145, 146, 147, -1, 149, 150, 52,
7112 53, -1, -1, 56, -1, 157, 158, -1, -1, -1,
7113 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7114 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
7115 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
7116 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
7117 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
7118 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7119 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7120 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
7121 143, 144, 145, 146, 147, -1, 149, 150, 52, 53,
7122 -1, -1, 56, -1, 157, 158, -1, -1, -1, -1,
7123 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7124 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
7125 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
7126 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
7127 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
7128 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7129 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7130 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
7131 144, 145, 146, 147, -1, 149, 150, 52, 53, -1,
7132 -1, 56, -1, 157, 158, -1, -1, -1, -1, -1,
7133 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7134 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
7135 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
7136 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
7137 -1, -1, -1, 108, 109, -1, -1, -1, -1, -1,
7138 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7139 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7140 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
7141 145, 146, 147, -1, 149, 150, 52, 53, -1, -1,
7142 56, -1, 157, 158, -1, -1, -1, -1, -1, -1,
7143 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7144 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
7145 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
7146 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7147 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
7148 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7149 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7150 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
7151 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
7152 -1, 157, 158, -1, -1, -1, -1, -1, -1, -1,
7153 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
7154 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
7155 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
7156 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7157 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
7158 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7159 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7160 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
7161 147, -1, 149, 150, 52, 53, -1, -1, 56, -1,
7162 157, 158, -1, -1, -1, -1, -1, -1, -1, -1,
7163 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
7164 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
7165 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
7166 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7167 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
7168 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7169 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7170 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
7171 -1, 149, 150, 52, 53, -1, -1, 56, -1, 157,
7172 158, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7173 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
7174 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
7175 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
7176 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
7177 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7178 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7179 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
7180 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
7181 149, 150, 52, 53, -1, -1, 56, -1, 157, 158,
7182 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7183 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
7184 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
7185 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
7186 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
7187 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7188 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7189 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
7190 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
7191 150, 52, 53, -1, -1, 56, -1, 157, 158, -1,
7192 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7193 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
7194 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
7195 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
7196 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
7197 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7198 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
7199 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
7200 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
7201 -1, -1, -1, -1, -1, -1, 157
7202};
7203
7204/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
7205 state STATE-NUM. */
7206static const yytype_int16 yystos[] =
7207{
7208 0, 164, 165, 1, 3, 4, 5, 6, 7, 11,
7209 12, 16, 18, 19, 20, 21, 22, 23, 24, 30,
7210 31, 32, 33, 34, 35, 36, 39, 45, 46, 47,
7211 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
7212 59, 60, 61, 62, 63, 64, 65, 76, 77, 91,
7213 92, 99, 102, 103, 105, 106, 108, 111, 112, 113,
7214 114, 115, 116, 117, 118, 119, 148, 149, 150, 167,
7215 168, 169, 181, 183, 184, 188, 192, 194, 199, 200,
7216 202, 203, 204, 206, 207, 208, 210, 211, 220, 223,
7217 242, 252, 253, 254, 255, 256, 257, 258, 259, 260,
7218 261, 262, 271, 272, 302, 307, 308, 356, 357, 358,
7219 359, 360, 361, 363, 364, 367, 368, 370, 371, 372,
7220 373, 386, 387, 389, 390, 391, 392, 393, 394, 395,
7221 396, 397, 432, 444, 0, 3, 4, 5, 6, 7,
7222 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
7223 18, 19, 20, 21, 22, 23, 24, 25, 26, 30,
7224 31, 32, 33, 34, 35, 36, 37, 38, 39, 45,
7225 46, 47, 48, 49, 50, 51, 52, 53, 56, 76,
7226 77, 78, 79, 80, 81, 82, 83, 84, 87, 88,
7227 93, 94, 95, 96, 108, 109, 138, 139, 140, 141,
7228 142, 143, 144, 145, 146, 147, 149, 150, 157, 214,
7229 215, 216, 218, 219, 386, 180, 180, 180, 39, 58,
7230 99, 102, 108, 109, 110, 113, 149, 192, 194, 203,
7231 211, 220, 227, 233, 236, 238, 239, 252, 393, 394,
7232 396, 397, 430, 431, 233, 158, 230, 234, 235, 155,
7233 158, 186, 54, 215, 186, 152, 170, 171, 224, 444,
7234 21, 22, 32, 202, 220, 252, 271, 272, 220, 220,
7235 220, 56, 47, 102, 176, 177, 178, 183, 205, 206,
7236 444, 176, 228, 238, 430, 444, 227, 429, 430, 444,
7237 46, 99, 148, 156, 192, 194, 210, 242, 252, 393,
7238 394, 397, 300, 214, 376, 388, 392, 376, 377, 378,
7239 162, 362, 362, 362, 362, 391, 199, 220, 220, 155,
7240 161, 166, 442, 443, 180, 40, 41, 42, 43, 44,
7241 37, 38, 158, 400, 401, 402, 403, 444, 400, 402,
7242 26, 152, 230, 235, 263, 309, 28, 264, 306, 135,
7243 156, 102, 108, 207, 135, 25, 78, 79, 80, 81,
7244 82, 83, 84, 85, 86, 87, 88, 89, 90, 95,
7245 96, 101, 136, 138, 139, 140, 141, 142, 143, 144,
7246 145, 146, 147, 222, 222, 69, 97, 98, 154, 436,
7247 243, 1, 188, 195, 195, 196, 198, 198, 166, 195,
7248 443, 99, 204, 211, 252, 277, 393, 394, 397, 52,
7249 56, 95, 99, 212, 213, 252, 393, 394, 397, 213,
7250 33, 34, 35, 36, 49, 50, 51, 52, 56, 158,
7251 191, 214, 395, 427, 233, 158, 235, 98, 436, 437,
7252 309, 359, 100, 100, 156, 227, 56, 227, 227, 227,
7253 376, 400, 400, 135, 101, 156, 237, 444, 98, 154,
7254 436, 100, 100, 156, 237, 92, 232, 233, 238, 410,
7255 430, 444, 233, 186, 188, 438, 188, 54, 64, 65,
7256 182, 158, 224, 225, 167, 98, 436, 100, 179, 205,
7257 159, 166, 443, 438, 244, 160, 156, 186, 441, 156,
7258 441, 153, 441, 186, 56, 391, 207, 209, 401, 156,
7259 98, 154, 436, 297, 66, 120, 122, 123, 379, 120,
7260 120, 379, 67, 379, 162, 365, 374, 369, 375, 78,
7261 161, 169, 152, 195, 195, 195, 195, 224, 226, 188,
7262 188, 52, 54, 55, 56, 57, 58, 78, 92, 102,
7263 108, 109, 110, 142, 145, 282, 344, 404, 405, 406,
7264 407, 409, 410, 411, 412, 413, 414, 415, 416, 417,
7265 419, 420, 421, 422, 423, 424, 425, 135, 250, 409,
7266 135, 251, 310, 311, 107, 201, 312, 313, 313, 224,
7267 205, 156, 210, 156, 224, 190, 220, 220, 220, 220,
7268 220, 220, 220, 220, 220, 220, 220, 220, 220, 189,
7269 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
7270 220, 52, 53, 56, 218, 230, 432, 433, 434, 232,
7271 238, 52, 53, 56, 218, 230, 433, 174, 176, 13,
7272 273, 442, 273, 195, 176, 176, 246, 166, 56, 98,
7273 154, 436, 25, 195, 52, 56, 212, 139, 399, 98,
7274 154, 436, 249, 428, 69, 98, 435, 233, 438, 52,
7275 56, 433, 224, 224, 217, 125, 135, 135, 224, 227,
7276 227, 236, 239, 430, 52, 56, 232, 52, 56, 224,
7277 224, 431, 438, 156, 438, 156, 159, 438, 215, 225,
7278 220, 153, 56, 433, 433, 224, 171, 438, 178, 159,
7279 430, 156, 209, 52, 56, 232, 52, 56, 298, 381,
7280 380, 120, 366, 379, 66, 120, 120, 366, 66, 120,
7281 220, 176, 183, 102, 108, 278, 279, 280, 281, 412,
7282 156, 426, 444, 156, 426, 156, 408, 438, 283, 284,
7283 156, 408, 227, 34, 52, 52, 156, 408, 52, 39,
7284 185, 203, 220, 221, 174, 442, 185, 221, 174, 297,
7285 153, 311, 297, 10, 68, 270, 270, 108, 199, 227,
7286 238, 240, 241, 438, 209, 156, 184, 187, 199, 211,
7287 220, 227, 229, 241, 252, 397, 319, 319, 186, 100,
7288 100, 152, 230, 235, 186, 439, 156, 100, 100, 230,
7289 231, 235, 444, 270, 224, 176, 13, 176, 27, 274,
7290 442, 270, 270, 17, 267, 315, 25, 245, 321, 52,
7291 56, 232, 52, 56, 198, 248, 398, 247, 52, 56,
7292 212, 232, 174, 188, 193, 438, 231, 235, 187, 220,
7293 229, 187, 229, 215, 227, 39, 237, 100, 100, 439,
7294 100, 100, 410, 430, 188, 229, 441, 207, 439, 299,
7295 382, 385, 392, 397, 362, 379, 362, 362, 362, 153,
7296 280, 412, 156, 438, 156, 425, 417, 419, 421, 405,
7297 406, 415, 423, 135, 227, 407, 414, 423, 413, 415,
7298 186, 44, 44, 270, 270, 298, 153, 298, 227, 156,
7299 44, 209, 44, 135, 44, 98, 154, 436, 317, 317,
7300 137, 224, 224, 311, 201, 160, 100, 224, 224, 201,
7301 8, 265, 352, 444, 14, 15, 268, 269, 275, 276,
7302 444, 276, 197, 108, 227, 314, 270, 319, 315, 270,
7303 439, 176, 442, 195, 174, 439, 270, 438, 191, 309,
7304 306, 186, 224, 224, 100, 224, 224, 438, 156, 438,
7305 180, 383, 438, 278, 281, 279, 426, 156, 408, 156,
7306 408, 156, 408, 156, 408, 408, 185, 221, 226, 226,
7307 299, 299, 108, 227, 226, 226, 224, 226, 52, 56,
7308 232, 52, 56, 318, 318, 220, 187, 229, 187, 229,
7309 153, 224, 187, 229, 187, 229, 227, 241, 353, 444,
7310 175, 268, 176, 195, 270, 270, 227, 156, 273, 317,
7311 270, 270, 174, 442, 270, 224, 158, 303, 409, 176,
7312 156, 156, 415, 415, 423, 415, 220, 220, 180, 180,
7313 227, 183, 183, 220, 439, 52, 56, 58, 91, 92,
7314 99, 102, 105, 106, 108, 113, 141, 302, 324, 325,
7315 326, 327, 330, 334, 335, 336, 339, 340, 341, 342,
7316 343, 344, 345, 346, 347, 348, 349, 350, 351, 356,
7317 357, 360, 361, 364, 368, 371, 373, 394, 419, 324,
7318 187, 229, 101, 354, 444, 9, 266, 355, 444, 172,
7319 273, 108, 227, 176, 318, 270, 409, 301, 0, 121,
7320 384, 279, 408, 408, 156, 408, 408, 140, 292, 293,
7321 444, 292, 347, 347, 56, 212, 318, 325, 332, 333,
7322 334, 335, 338, 439, 186, 318, 440, 52, 376, 52,
7323 102, 392, 101, 156, 140, 156, 156, 325, 89, 90,
7324 98, 154, 158, 328, 329, 52, 99, 211, 252, 393,
7325 394, 397, 273, 177, 176, 176, 227, 276, 315, 316,
7326 323, 324, 186, 294, 29, 124, 304, 415, 282, 285,
7327 286, 288, 289, 291, 294, 413, 415, 416, 418, 423,
7328 425, 176, 174, 325, 439, 325, 336, 338, 439, 156,
7329 153, 224, 125, 195, 348, 332, 336, 330, 337, 338,
7330 113, 341, 345, 347, 347, 212, 318, 439, 318, 438,
7331 332, 335, 339, 332, 335, 339, 56, 98, 154, 436,
7332 176, 166, 173, 275, 273, 40, 41, 161, 159, 305,
7333 176, 408, 426, 156, 426, 156, 290, 294, 140, 284,
7334 156, 287, 290, 99, 252, 156, 290, 438, 156, 156,
7335 331, 438, 156, 156, 376, 438, 438, 438, 439, 439,
7336 439, 52, 56, 232, 52, 56, 352, 355, 320, 195,
7337 195, 52, 295, 296, 411, 174, 153, 418, 421, 286,
7338 288, 415, 423, 140, 252, 289, 423, 56, 98, 415,
7339 337, 339, 337, 336, 338, 439, 176, 156, 186, 270,
7340 426, 156, 290, 156, 290, 156, 290, 156, 290, 52,
7341 56, 290, 156, 440, 276, 321, 322, 296, 415, 415,
7342 423, 415, 290, 290, 156, 290, 290, 415, 290
7343};
7344
7345/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
7346static const yytype_int16 yyr1[] =
7347{
7348 0, 163, 164, 165, 166, 166, 167, 168, 168, 168,
7349 169, 169, 170, 171, 172, 173, 174, 175, 174, 176,
7350 177, 177, 177, 178, 179, 178, 180, 181, 182, 183,
7351 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
7352 183, 183, 183, 183, 183, 183, 183, 184, 184, 184,
7353 184, 184, 184, 184, 184, 184, 184, 185, 185, 186,
7354 186, 185, 187, 187, 187, 188, 188, 188, 188, 188,
7355 189, 188, 190, 188, 188, 191, 192, 193, 194, 195,
7356 195, 196, 197, 198, 199, 199, 200, 200, 201, 202,
7357 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
7358 203, 203, 204, 204, 205, 205, 206, 206, 206, 206,
7359 206, 206, 206, 206, 206, 206, 207, 207, 208, 208,
7360 209, 209, 210, 210, 210, 210, 210, 210, 210, 210,
7361 210, 211, 211, 211, 211, 211, 211, 211, 211, 211,
7362 212, 212, 213, 213, 213, 214, 214, 214, 214, 214,
7363 215, 215, 216, 217, 216, 218, 218, 218, 218, 218,
7364 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
7365 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
7366 218, 218, 218, 218, 218, 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, 219, 219, 219, 219,
7370 219, 219, 219, 219, 219, 219, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220,
7375 220, 221, 221, 221, 222, 222, 222, 222, 223, 223,
7376 224, 225, 226, 227, 228, 228, 228, 228, 229, 229,
7377 230, 230, 230, 231, 231, 232, 232, 232, 232, 232,
7378 233, 233, 233, 233, 233, 234, 235, 236, 236, 237,
7379 237, 238, 238, 238, 238, 239, 239, 240, 240, 241,
7380 241, 241, 242, 242, 242, 242, 242, 242, 242, 242,
7381 242, 242, 242, 243, 242, 244, 242, 242, 242, 242,
7382 242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
7383 242, 242, 242, 242, 242, 242, 242, 245, 242, 246,
7384 242, 242, 242, 247, 242, 248, 242, 249, 242, 250,
7385 242, 251, 242, 242, 242, 242, 242, 252, 253, 254,
7386 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
7387 265, 266, 267, 268, 269, 270, 270, 271, 272, 273,
7388 273, 273, 274, 274, 275, 275, 276, 276, 277, 277,
7389 278, 278, 279, 279, 280, 280, 280, 280, 280, 281,
7390 281, 282, 282, 283, 284, 285, 285, 286, 286, 286,
7391 286, 287, 288, 289, 289, 290, 290, 291, 291, 291,
7392 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
7393 291, 291, 292, 292, 293, 293, 294, 294, 295, 295,
7394 296, 296, 297, 298, 299, 300, 301, 302, 303, 303,
7395 304, 305, 304, 306, 307, 307, 307, 307, 308, 308,
7396 308, 308, 308, 308, 308, 308, 308, 309, 309, 310,
7397 311, 312, 313, 314, 314, 314, 314, 315, 316, 316,
7398 317, 318, 319, 320, 321, 322, 322, 323, 323, 323,
7399 324, 324, 324, 324, 324, 324, 325, 326, 326, 327,
7400 327, 328, 329, 330, 330, 330, 330, 330, 330, 330,
7401 330, 330, 330, 330, 330, 330, 331, 330, 330, 330,
7402 332, 332, 332, 332, 332, 332, 333, 333, 334, 334,
7403 335, 336, 336, 337, 337, 338, 339, 339, 339, 339,
7404 340, 340, 341, 341, 342, 342, 343, 343, 344, 345,
7405 345, 346, 346, 346, 346, 346, 346, 346, 346, 346,
7406 346, 347, 347, 347, 347, 347, 347, 347, 347, 347,
7407 347, 348, 349, 349, 350, 351, 351, 351, 352, 352,
7408 353, 353, 353, 354, 354, 355, 355, 356, 356, 357,
7409 358, 358, 358, 359, 360, 361, 362, 362, 363, 364,
7410 365, 365, 366, 366, 367, 368, 369, 369, 370, 371,
7411 372, 373, 374, 374, 375, 375, 376, 376, 377, 377,
7412 378, 378, 379, 380, 379, 381, 382, 383, 379, 384,
7413 384, 385, 385, 386, 386, 387, 388, 388, 389, 390,
7414 390, 391, 391, 391, 391, 392, 392, 392, 393, 393,
7415 393, 394, 394, 394, 394, 394, 394, 394, 395, 395,
7416 396, 396, 397, 397, 398, 399, 399, 400, 400, 401,
7417 402, 403, 402, 404, 404, 405, 405, 405, 405, 405,
7418 406, 407, 407, 408, 408, 409, 409, 409, 409, 409,
7419 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
7420 410, 411, 411, 411, 411, 412, 412, 413, 414, 414,
7421 415, 415, 416, 417, 417, 418, 418, 419, 419, 420,
7422 421, 421, 422, 422, 423, 423, 424, 424, 425, 425,
7423 426, 426, 427, 428, 427, 429, 429, 430, 430, 431,
7424 431, 431, 431, 431, 431, 432, 432, 432, 433, 433,
7425 434, 434, 434, 435, 435, 436, 436, 437, 437, 438,
7426 439, 440, 441, 441, 442, 442, 443, 443, 444
7427};
7428
7429/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
7430static const yytype_int8 yyr2[] =
7431{
7432 0, 2, 0, 2, 0, 1, 2, 1, 1, 3,
7433 1, 2, 1, 3, 0, 0, 8, 0, 5, 2,
7434 1, 1, 3, 1, 0, 3, 0, 2, 0, 4,
7435 3, 3, 3, 2, 3, 3, 3, 3, 4, 5,
7436 1, 4, 4, 7, 4, 1, 1, 4, 4, 7,
7437 6, 6, 6, 6, 4, 4, 4, 1, 4, 0,
7438 1, 3, 1, 4, 1, 1, 3, 3, 3, 2,
7439 0, 7, 0, 7, 1, 1, 2, 0, 5, 1,
7440 1, 0, 0, 4, 1, 1, 1, 4, 3, 1,
7441 2, 3, 4, 5, 4, 5, 6, 2, 2, 2,
7442 2, 2, 1, 3, 1, 3, 1, 2, 3, 5,
7443 2, 4, 2, 4, 1, 3, 1, 3, 2, 3,
7444 1, 3, 1, 1, 4, 3, 3, 3, 3, 2,
7445 1, 1, 1, 4, 3, 3, 3, 3, 2, 1,
7446 1, 1, 2, 1, 3, 1, 1, 1, 1, 1,
7447 1, 1, 1, 0, 4, 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, 1, 1, 1, 1,
7454 1, 1, 1, 1, 1, 1, 4, 4, 7, 6,
7455 6, 6, 6, 5, 4, 3, 3, 2, 2, 2,
7456 2, 3, 3, 3, 3, 3, 3, 4, 2, 2,
7457 3, 3, 3, 3, 1, 3, 3, 3, 3, 3,
7458 2, 2, 3, 3, 3, 3, 4, 6, 4, 4,
7459 1, 1, 4, 3, 1, 1, 1, 1, 3, 3,
7460 1, 1, 1, 1, 1, 2, 4, 2, 1, 4,
7461 3, 5, 3, 1, 1, 1, 1, 2, 4, 2,
7462 1, 2, 2, 4, 1, 0, 2, 2, 1, 2,
7463 1, 1, 1, 3, 3, 2, 1, 1, 1, 3,
7464 4, 2, 1, 1, 1, 1, 1, 1, 1, 1,
7465 1, 1, 1, 0, 4, 0, 4, 3, 3, 2,
7466 3, 3, 1, 4, 3, 1, 6, 4, 3, 2,
7467 1, 2, 1, 6, 6, 4, 4, 0, 6, 0,
7468 5, 5, 6, 0, 6, 0, 7, 0, 5, 0,
7469 5, 0, 5, 1, 1, 1, 1, 1, 1, 1,
7470 1, 2, 2, 1, 2, 1, 1, 1, 1, 1,
7471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7472 1, 2, 1, 1, 1, 5, 1, 2, 1, 1,
7473 1, 3, 1, 3, 1, 3, 5, 1, 3, 2,
7474 1, 1, 1, 0, 2, 1, 3, 4, 2, 2,
7475 1, 1, 3, 1, 3, 2, 0, 6, 8, 4,
7476 6, 4, 2, 6, 2, 4, 6, 2, 4, 2,
7477 4, 1, 1, 1, 3, 4, 1, 4, 1, 3,
7478 1, 1, 0, 0, 0, 0, 0, 9, 4, 1,
7479 3, 0, 4, 3, 2, 4, 5, 5, 2, 4,
7480 4, 3, 3, 3, 2, 1, 4, 3, 3, 0,
7481 7, 0, 7, 1, 2, 3, 4, 5, 1, 1,
7482 0, 0, 0, 0, 9, 1, 1, 1, 3, 3,
7483 1, 2, 3, 1, 1, 1, 1, 3, 1, 3,
7484 1, 2, 2, 1, 1, 4, 4, 4, 3, 4,
7485 4, 4, 3, 3, 3, 2, 0, 6, 2, 4,
7486 1, 1, 2, 2, 4, 1, 2, 3, 1, 3,
7487 5, 2, 1, 1, 3, 1, 3, 1, 2, 1,
7488 1, 3, 2, 1, 1, 3, 2, 1, 2, 1,
7489 1, 1, 3, 3, 2, 2, 1, 1, 1, 2,
7490 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7491 1, 1, 2, 2, 4, 2, 3, 1, 6, 1,
7492 1, 1, 1, 2, 1, 3, 1, 1, 1, 1,
7493 1, 1, 2, 3, 3, 3, 1, 2, 4, 1,
7494 0, 3, 1, 2, 4, 1, 0, 3, 4, 1,
7495 4, 1, 0, 3, 0, 3, 0, 2, 0, 2,
7496 0, 2, 1, 0, 3, 0, 0, 0, 6, 1,
7497 1, 1, 1, 1, 1, 2, 1, 1, 3, 1,
7498 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7499 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7500 1, 1, 1, 1, 0, 4, 0, 1, 1, 3,
7501 1, 0, 3, 1, 3, 4, 2, 2, 1, 1,
7502 3, 1, 3, 2, 0, 6, 8, 4, 6, 4,
7503 6, 2, 4, 6, 2, 4, 2, 4, 1, 0,
7504 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
7505 1, 3, 1, 2, 1, 2, 1, 1, 1, 1,
7506 2, 1, 1, 1, 2, 1, 1, 1, 2, 1,
7507 2, 1, 1, 0, 4, 1, 2, 1, 3, 3,
7508 2, 1, 4, 2, 1, 1, 1, 1, 1, 1,
7509 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
7510 2, 2, 1, 1, 1, 1, 1, 2, 0
7511};
7512
7513
7514enum { YYENOMEM = -2 };
7515
7516#define yyerrok (yyerrstatus = 0)
7517#define yyclearin (yychar = YYEMPTY)
7518
7519#define YYACCEPT goto yyacceptlab
7520#define YYABORT goto yyabortlab
7521#define YYERROR goto yyerrorlab
7522#define YYNOMEM goto yyexhaustedlab
7523
7524
7525#define YYRECOVERING() (!!yyerrstatus)
7526
7527#define YYBACKUP(Token, Value) \
7528 do \
7529 if (yychar == YYEMPTY) \
7530 { \
7531 yychar = (Token); \
7532 yylval = (Value); \
7533 YYPOPSTACK (yylen); \
7534 yystate = *yyssp; \
7535 goto yybackup; \
7536 } \
7537 else \
7538 { \
7539 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
7540 YYERROR; \
7541 } \
7542 while (0)
7543
7544/* Backward compatibility with an undocumented macro.
7545 Use YYerror or YYUNDEF. */
7546#define YYERRCODE YYUNDEF
7547
7548/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
7549 If N is 0, then set CURRENT to the empty location which ends
7550 the previous symbol: RHS[0] (always defined). */
7551
7552#ifndef YYLLOC_DEFAULT
7553# define YYLLOC_DEFAULT(Current, Rhs, N) \
7554 do \
7555 if (N) \
7556 { \
7557 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
7558 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
7559 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
7560 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
7561 } \
7562 else \
7563 { \
7564 (Current).first_line = (Current).last_line = \
7565 YYRHSLOC (Rhs, 0).last_line; \
7566 (Current).first_column = (Current).last_column = \
7567 YYRHSLOC (Rhs, 0).last_column; \
7568 } \
7569 while (0)
7570#endif
7571
7572#define YYRHSLOC(Rhs, K) ((Rhs)[K])
7573
7574
7575/* Enable debugging if requested. */
7576#if YYDEBUG
7577
7578# ifndef YYFPRINTF
7579# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
7580# define YYFPRINTF fprintf
7581# endif
7582
7583# define YYDPRINTF(Args) \
7584do { \
7585 if (yydebug) \
7586 YYFPRINTF Args; \
7587} while (0)
7588
7589
7590/* YYLOCATION_PRINT -- Print the location on the stream.
7591 This macro was not mandated originally: define only if we know
7592 we won't break user code: when these are the locations we know. */
7593
7594# ifndef YYLOCATION_PRINT
7595
7596# if defined YY_LOCATION_PRINT
7597
7598 /* Temporary convenience wrapper in case some people defined the
7599 undocumented and private YY_LOCATION_PRINT macros. */
7600# define YYLOCATION_PRINT(File, Loc, p) YY_LOCATION_PRINT(File, *(Loc), p)
7601
7602# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
7603
7604/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
7605
7606YY_ATTRIBUTE_UNUSED
7607static int
7608yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
7609{
7610 int res = 0;
7611 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
7612 if (0 <= yylocp->first_line)
7613 {
7614 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
7615 if (0 <= yylocp->first_column)
7616 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
7617 }
7618 if (0 <= yylocp->last_line)
7619 {
7620 if (yylocp->first_line < yylocp->last_line)
7621 {
7622 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
7623 if (0 <= end_col)
7624 res += YYFPRINTF (yyo, ".%d", end_col);
7625 }
7626 else if (0 <= end_col && yylocp->first_column < end_col)
7627 res += YYFPRINTF (yyo, "-%d", end_col);
7628 }
7629 return res;
7630}
7631
7632# define YYLOCATION_PRINT yy_location_print_
7633
7634 /* Temporary convenience wrapper in case some people defined the
7635 undocumented and private YY_LOCATION_PRINT macros. */
7636# define YY_LOCATION_PRINT(File, Loc, p) YYLOCATION_PRINT(File, &(Loc), p)
7637
7638# else
7639
7640# define YYLOCATION_PRINT(File, Loc, p) ((void) 0)
7641 /* Temporary convenience wrapper in case some people defined the
7642 undocumented and private YY_LOCATION_PRINT macros. */
7643# define YY_LOCATION_PRINT YYLOCATION_PRINT
7644
7645# endif
7646# endif /* !defined YYLOCATION_PRINT */
7647
7648
7649# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p) \
7650do { \
7651 if (yydebug) \
7652 { \
7653 YYFPRINTF (stderr, "%s ", Title); \
7654 yy_symbol_print (stderr, \
7655 Kind, Value, Location, p); \
7656 YYFPRINTF (stderr, "\n"); \
7657 } \
7658} while (0)
7659
7660
7661/*-----------------------------------.
7662| Print this symbol's value on YYO. |
7663`-----------------------------------*/
7664
7665static void
7666yy_symbol_value_print (FILE *yyo,
7667 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
7668{
7669 FILE *yyoutput = yyo;
7670 YY_USE (yyoutput);
7671 YY_USE (yylocationp);
7672 YY_USE (p);
7673 if (!yyvaluep)
7674 return;
7675 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
7676switch (yykind)
7677 {
7678 case YYSYMBOL_keyword_class: /* "'class'" */
7679#line 2621 "parse.y"
7680 {
7681 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7682}
7683#line 7684 "parse.c"
7684 break;
7685
7686 case YYSYMBOL_keyword_module: /* "'module'" */
7687#line 2621 "parse.y"
7688 {
7689 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7690}
7691#line 7692 "parse.c"
7692 break;
7693
7694 case YYSYMBOL_keyword_def: /* "'def'" */
7695#line 2621 "parse.y"
7696 {
7697 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7698}
7699#line 7700 "parse.c"
7700 break;
7701
7702 case YYSYMBOL_keyword_undef: /* "'undef'" */
7703#line 2621 "parse.y"
7704 {
7705 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7706}
7707#line 7708 "parse.c"
7708 break;
7709
7710 case YYSYMBOL_keyword_begin: /* "'begin'" */
7711#line 2621 "parse.y"
7712 {
7713 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7714}
7715#line 7716 "parse.c"
7716 break;
7717
7718 case YYSYMBOL_keyword_rescue: /* "'rescue'" */
7719#line 2621 "parse.y"
7720 {
7721 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7722}
7723#line 7724 "parse.c"
7724 break;
7725
7726 case YYSYMBOL_keyword_ensure: /* "'ensure'" */
7727#line 2621 "parse.y"
7728 {
7729 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7730}
7731#line 7732 "parse.c"
7732 break;
7733
7734 case YYSYMBOL_keyword_end: /* "'end'" */
7735#line 2621 "parse.y"
7736 {
7737 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7738}
7739#line 7740 "parse.c"
7740 break;
7741
7742 case YYSYMBOL_keyword_if: /* "'if'" */
7743#line 2621 "parse.y"
7744 {
7745 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7746}
7747#line 7748 "parse.c"
7748 break;
7749
7750 case YYSYMBOL_keyword_unless: /* "'unless'" */
7751#line 2621 "parse.y"
7752 {
7753 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7754}
7755#line 7756 "parse.c"
7756 break;
7757
7758 case YYSYMBOL_keyword_then: /* "'then'" */
7759#line 2621 "parse.y"
7760 {
7761 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7762}
7763#line 7764 "parse.c"
7764 break;
7765
7766 case YYSYMBOL_keyword_elsif: /* "'elsif'" */
7767#line 2621 "parse.y"
7768 {
7769 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7770}
7771#line 7772 "parse.c"
7772 break;
7773
7774 case YYSYMBOL_keyword_else: /* "'else'" */
7775#line 2621 "parse.y"
7776 {
7777 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7778}
7779#line 7780 "parse.c"
7780 break;
7781
7782 case YYSYMBOL_keyword_case: /* "'case'" */
7783#line 2621 "parse.y"
7784 {
7785 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7786}
7787#line 7788 "parse.c"
7788 break;
7789
7790 case YYSYMBOL_keyword_when: /* "'when'" */
7791#line 2621 "parse.y"
7792 {
7793 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7794}
7795#line 7796 "parse.c"
7796 break;
7797
7798 case YYSYMBOL_keyword_while: /* "'while'" */
7799#line 2621 "parse.y"
7800 {
7801 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7802}
7803#line 7804 "parse.c"
7804 break;
7805
7806 case YYSYMBOL_keyword_until: /* "'until'" */
7807#line 2621 "parse.y"
7808 {
7809 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7810}
7811#line 7812 "parse.c"
7812 break;
7813
7814 case YYSYMBOL_keyword_for: /* "'for'" */
7815#line 2621 "parse.y"
7816 {
7817 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7818}
7819#line 7820 "parse.c"
7820 break;
7821
7822 case YYSYMBOL_keyword_break: /* "'break'" */
7823#line 2621 "parse.y"
7824 {
7825 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7826}
7827#line 7828 "parse.c"
7828 break;
7829
7830 case YYSYMBOL_keyword_next: /* "'next'" */
7831#line 2621 "parse.y"
7832 {
7833 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7834}
7835#line 7836 "parse.c"
7836 break;
7837
7838 case YYSYMBOL_keyword_redo: /* "'redo'" */
7839#line 2621 "parse.y"
7840 {
7841 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7842}
7843#line 7844 "parse.c"
7844 break;
7845
7846 case YYSYMBOL_keyword_retry: /* "'retry'" */
7847#line 2621 "parse.y"
7848 {
7849 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7850}
7851#line 7852 "parse.c"
7852 break;
7853
7854 case YYSYMBOL_keyword_in: /* "'in'" */
7855#line 2621 "parse.y"
7856 {
7857 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7858}
7859#line 7860 "parse.c"
7860 break;
7861
7862 case YYSYMBOL_keyword_do: /* "'do'" */
7863#line 2621 "parse.y"
7864 {
7865 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7866}
7867#line 7868 "parse.c"
7868 break;
7869
7870 case YYSYMBOL_keyword_do_cond: /* "'do' for condition" */
7871#line 2621 "parse.y"
7872 {
7873 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7874}
7875#line 7876 "parse.c"
7876 break;
7877
7878 case YYSYMBOL_keyword_do_block: /* "'do' for block" */
7879#line 2621 "parse.y"
7880 {
7881 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7882}
7883#line 7884 "parse.c"
7884 break;
7885
7886 case YYSYMBOL_keyword_do_LAMBDA: /* "'do' for lambda" */
7887#line 2621 "parse.y"
7888 {
7889 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7890}
7891#line 7892 "parse.c"
7892 break;
7893
7894 case YYSYMBOL_keyword_return: /* "'return'" */
7895#line 2621 "parse.y"
7896 {
7897 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7898}
7899#line 7900 "parse.c"
7900 break;
7901
7902 case YYSYMBOL_keyword_yield: /* "'yield'" */
7903#line 2621 "parse.y"
7904 {
7905 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7906}
7907#line 7908 "parse.c"
7908 break;
7909
7910 case YYSYMBOL_keyword_super: /* "'super'" */
7911#line 2621 "parse.y"
7912 {
7913 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7914}
7915#line 7916 "parse.c"
7916 break;
7917
7918 case YYSYMBOL_keyword_self: /* "'self'" */
7919#line 2621 "parse.y"
7920 {
7921 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7922}
7923#line 7924 "parse.c"
7924 break;
7925
7926 case YYSYMBOL_keyword_nil: /* "'nil'" */
7927#line 2621 "parse.y"
7928 {
7929 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7930}
7931#line 7932 "parse.c"
7932 break;
7933
7934 case YYSYMBOL_keyword_true: /* "'true'" */
7935#line 2621 "parse.y"
7936 {
7937 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7938}
7939#line 7940 "parse.c"
7940 break;
7941
7942 case YYSYMBOL_keyword_false: /* "'false'" */
7943#line 2621 "parse.y"
7944 {
7945 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7946}
7947#line 7948 "parse.c"
7948 break;
7949
7950 case YYSYMBOL_keyword_and: /* "'and'" */
7951#line 2621 "parse.y"
7952 {
7953 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7954}
7955#line 7956 "parse.c"
7956 break;
7957
7958 case YYSYMBOL_keyword_or: /* "'or'" */
7959#line 2621 "parse.y"
7960 {
7961 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7962}
7963#line 7964 "parse.c"
7964 break;
7965
7966 case YYSYMBOL_keyword_not: /* "'not'" */
7967#line 2621 "parse.y"
7968 {
7969 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7970}
7971#line 7972 "parse.c"
7972 break;
7973
7974 case YYSYMBOL_modifier_if: /* "'if' modifier" */
7975#line 2621 "parse.y"
7976 {
7977 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7978}
7979#line 7980 "parse.c"
7980 break;
7981
7982 case YYSYMBOL_modifier_unless: /* "'unless' modifier" */
7983#line 2621 "parse.y"
7984 {
7985 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7986}
7987#line 7988 "parse.c"
7988 break;
7989
7990 case YYSYMBOL_modifier_while: /* "'while' modifier" */
7991#line 2621 "parse.y"
7992 {
7993 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7994}
7995#line 7996 "parse.c"
7996 break;
7997
7998 case YYSYMBOL_modifier_until: /* "'until' modifier" */
7999#line 2621 "parse.y"
8000 {
8001 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8002}
8003#line 8004 "parse.c"
8004 break;
8005
8006 case YYSYMBOL_modifier_rescue: /* "'rescue' modifier" */
8007#line 2621 "parse.y"
8008 {
8009 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8010}
8011#line 8012 "parse.c"
8012 break;
8013
8014 case YYSYMBOL_keyword_alias: /* "'alias'" */
8015#line 2621 "parse.y"
8016 {
8017 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8018}
8019#line 8020 "parse.c"
8020 break;
8021
8022 case YYSYMBOL_keyword_defined: /* "'defined?'" */
8023#line 2621 "parse.y"
8024 {
8025 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8026}
8027#line 8028 "parse.c"
8028 break;
8029
8030 case YYSYMBOL_keyword_BEGIN: /* "'BEGIN'" */
8031#line 2621 "parse.y"
8032 {
8033 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8034}
8035#line 8036 "parse.c"
8036 break;
8037
8038 case YYSYMBOL_keyword_END: /* "'END'" */
8039#line 2621 "parse.y"
8040 {
8041 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8042}
8043#line 8044 "parse.c"
8044 break;
8045
8046 case YYSYMBOL_keyword__LINE__: /* "'__LINE__'" */
8047#line 2621 "parse.y"
8048 {
8049 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8050}
8051#line 8052 "parse.c"
8052 break;
8053
8054 case YYSYMBOL_keyword__FILE__: /* "'__FILE__'" */
8055#line 2621 "parse.y"
8056 {
8057 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8058}
8059#line 8060 "parse.c"
8060 break;
8061
8062 case YYSYMBOL_keyword__ENCODING__: /* "'__ENCODING__'" */
8063#line 2621 "parse.y"
8064 {
8065 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8066}
8067#line 8068 "parse.c"
8068 break;
8069
8070 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
8071#line 2621 "parse.y"
8072 {
8073 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8074}
8075#line 8076 "parse.c"
8076 break;
8077
8078 case YYSYMBOL_tFID: /* "method" */
8079#line 2621 "parse.y"
8080 {
8081 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8082}
8083#line 8084 "parse.c"
8084 break;
8085
8086 case YYSYMBOL_tGVAR: /* "global variable" */
8087#line 2621 "parse.y"
8088 {
8089 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8090}
8091#line 8092 "parse.c"
8092 break;
8093
8094 case YYSYMBOL_tIVAR: /* "instance variable" */
8095#line 2621 "parse.y"
8096 {
8097 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8098}
8099#line 8100 "parse.c"
8100 break;
8101
8102 case YYSYMBOL_tCONSTANT: /* "constant" */
8103#line 2621 "parse.y"
8104 {
8105 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8106}
8107#line 8108 "parse.c"
8108 break;
8109
8110 case YYSYMBOL_tCVAR: /* "class variable" */
8111#line 2621 "parse.y"
8112 {
8113 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8114}
8115#line 8116 "parse.c"
8116 break;
8117
8118 case YYSYMBOL_tLABEL: /* "label" */
8119#line 2621 "parse.y"
8120 {
8121 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8122}
8123#line 8124 "parse.c"
8124 break;
8125
8126 case YYSYMBOL_tINTEGER: /* "integer literal" */
8127#line 2624 "parse.y"
8128 {
8129 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8130 case NODE_INTEGER:
8131 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8132 break;
8133 case NODE_FLOAT:
8134 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8135 break;
8136 case NODE_RATIONAL:
8137 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8138 break;
8139 case NODE_IMAGINARY:
8140 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8141 break;
8142 default:
8143 break;
8144 }
8145}
8146#line 8147 "parse.c"
8147 break;
8148
8149 case YYSYMBOL_tFLOAT: /* "float literal" */
8150#line 2624 "parse.y"
8151 {
8152 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8153 case NODE_INTEGER:
8154 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8155 break;
8156 case NODE_FLOAT:
8157 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8158 break;
8159 case NODE_RATIONAL:
8160 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8161 break;
8162 case NODE_IMAGINARY:
8163 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8164 break;
8165 default:
8166 break;
8167 }
8168}
8169#line 8170 "parse.c"
8170 break;
8171
8172 case YYSYMBOL_tRATIONAL: /* "rational literal" */
8173#line 2624 "parse.y"
8174 {
8175 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8176 case NODE_INTEGER:
8177 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8178 break;
8179 case NODE_FLOAT:
8180 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8181 break;
8182 case NODE_RATIONAL:
8183 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8184 break;
8185 case NODE_IMAGINARY:
8186 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8187 break;
8188 default:
8189 break;
8190 }
8191}
8192#line 8193 "parse.c"
8193 break;
8194
8195 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
8196#line 2624 "parse.y"
8197 {
8198 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8199 case NODE_INTEGER:
8200 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8201 break;
8202 case NODE_FLOAT:
8203 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8204 break;
8205 case NODE_RATIONAL:
8206 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8207 break;
8208 case NODE_IMAGINARY:
8209 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8210 break;
8211 default:
8212 break;
8213 }
8214}
8215#line 8216 "parse.c"
8216 break;
8217
8218 case YYSYMBOL_tCHAR: /* "char literal" */
8219#line 2624 "parse.y"
8220 {
8221 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8222 case NODE_INTEGER:
8223 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8224 break;
8225 case NODE_FLOAT:
8226 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8227 break;
8228 case NODE_RATIONAL:
8229 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8230 break;
8231 case NODE_IMAGINARY:
8232 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8233 break;
8234 default:
8235 break;
8236 }
8237}
8238#line 8239 "parse.c"
8239 break;
8240
8241 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
8242#line 2642 "parse.y"
8243 {
8244 rb_parser_printf(p, "$%ld", RNODE_NTH_REF(((*yyvaluep).node))->nd_nth);
8245}
8246#line 8247 "parse.c"
8247 break;
8248
8249 case YYSYMBOL_tBACK_REF: /* "back reference" */
8250#line 2645 "parse.y"
8251 {
8252 rb_parser_printf(p, "$%c", (int)RNODE_BACK_REF(((*yyvaluep).node))->nd_nth);
8253}
8254#line 8255 "parse.c"
8255 break;
8256
8257 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
8258#line 2624 "parse.y"
8259 {
8260 switch (nd_type(RNODE(((*yyvaluep).node)))) {
8261 case NODE_INTEGER:
8262 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_integer_literal_val(((*yyvaluep).node)));
8263 break;
8264 case NODE_FLOAT:
8265 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_float_literal_val(((*yyvaluep).node)));
8266 break;
8267 case NODE_RATIONAL:
8268 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_rational_literal_val(((*yyvaluep).node)));
8269 break;
8270 case NODE_IMAGINARY:
8271 rb_parser_printf(p, "%+"PRIsVALUE, rb_node_imaginary_literal_val(((*yyvaluep).node)));
8272 break;
8273 default:
8274 break;
8275 }
8276}
8277#line 8278 "parse.c"
8278 break;
8279
8280 case YYSYMBOL_69_: /* '.' */
8281#line 2621 "parse.y"
8282 {
8283 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8284}
8285#line 8286 "parse.c"
8286 break;
8287
8288 case YYSYMBOL_70_backslash_: /* "backslash" */
8289#line 2621 "parse.y"
8290 {
8291 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8292}
8293#line 8294 "parse.c"
8294 break;
8295
8296 case YYSYMBOL_72_escaped_horizontal_tab_: /* "escaped horizontal tab" */
8297#line 2621 "parse.y"
8298 {
8299 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8300}
8301#line 8302 "parse.c"
8302 break;
8303
8304 case YYSYMBOL_73_escaped_form_feed_: /* "escaped form feed" */
8305#line 2621 "parse.y"
8306 {
8307 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8308}
8309#line 8310 "parse.c"
8310 break;
8311
8312 case YYSYMBOL_74_escaped_carriage_return_: /* "escaped carriage return" */
8313#line 2621 "parse.y"
8314 {
8315 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8316}
8317#line 8318 "parse.c"
8318 break;
8319
8320 case YYSYMBOL_75_escaped_vertical_tab_: /* "escaped vertical tab" */
8321#line 2621 "parse.y"
8322 {
8323 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8324}
8325#line 8326 "parse.c"
8326 break;
8327
8328 case YYSYMBOL_tANDDOT: /* "&." */
8329#line 2621 "parse.y"
8330 {
8331 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8332}
8333#line 8334 "parse.c"
8334 break;
8335
8336 case YYSYMBOL_tCOLON2: /* "::" */
8337#line 2621 "parse.y"
8338 {
8339 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8340}
8341#line 8342 "parse.c"
8342 break;
8343
8344 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
8345#line 2621 "parse.y"
8346 {
8347 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8348}
8349#line 8350 "parse.c"
8350 break;
8351
8352 case YYSYMBOL_top_compstmt: /* top_compstmt */
8353#line 2612 "parse.y"
8354 {
8355 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8356 rb_parser_printf(p, "NODE_SPECIAL");
8357 }
8358 else if (((*yyvaluep).node)) {
8359 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8360 }
8361}
8362#line 8363 "parse.c"
8363 break;
8364
8365 case YYSYMBOL_top_stmts: /* top_stmts */
8366#line 2612 "parse.y"
8367 {
8368 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8369 rb_parser_printf(p, "NODE_SPECIAL");
8370 }
8371 else if (((*yyvaluep).node)) {
8372 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8373 }
8374}
8375#line 8376 "parse.c"
8376 break;
8377
8378 case YYSYMBOL_top_stmt: /* top_stmt */
8379#line 2612 "parse.y"
8380 {
8381 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8382 rb_parser_printf(p, "NODE_SPECIAL");
8383 }
8384 else if (((*yyvaluep).node)) {
8385 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8386 }
8387}
8388#line 8389 "parse.c"
8389 break;
8390
8391 case YYSYMBOL_block_open: /* block_open */
8392#line 2612 "parse.y"
8393 {
8394 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
8395 rb_parser_printf(p, "NODE_SPECIAL");
8396 }
8397 else if (((*yyvaluep).node_exits)) {
8398 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
8399 }
8400}
8401#line 8402 "parse.c"
8402 break;
8403
8404 case YYSYMBOL_begin_block: /* begin_block */
8405#line 2612 "parse.y"
8406 {
8407 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8408 rb_parser_printf(p, "NODE_SPECIAL");
8409 }
8410 else if (((*yyvaluep).node)) {
8411 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8412 }
8413}
8414#line 8415 "parse.c"
8415 break;
8416
8417 case YYSYMBOL_bodystmt: /* bodystmt */
8418#line 2612 "parse.y"
8419 {
8420 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8421 rb_parser_printf(p, "NODE_SPECIAL");
8422 }
8423 else if (((*yyvaluep).node)) {
8424 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8425 }
8426}
8427#line 8428 "parse.c"
8428 break;
8429
8430 case YYSYMBOL_compstmt: /* compstmt */
8431#line 2612 "parse.y"
8432 {
8433 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8434 rb_parser_printf(p, "NODE_SPECIAL");
8435 }
8436 else if (((*yyvaluep).node)) {
8437 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8438 }
8439}
8440#line 8441 "parse.c"
8441 break;
8442
8443 case YYSYMBOL_stmts: /* stmts */
8444#line 2612 "parse.y"
8445 {
8446 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8447 rb_parser_printf(p, "NODE_SPECIAL");
8448 }
8449 else if (((*yyvaluep).node)) {
8450 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8451 }
8452}
8453#line 8454 "parse.c"
8454 break;
8455
8456 case YYSYMBOL_stmt_or_begin: /* stmt_or_begin */
8457#line 2612 "parse.y"
8458 {
8459 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8460 rb_parser_printf(p, "NODE_SPECIAL");
8461 }
8462 else if (((*yyvaluep).node)) {
8463 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8464 }
8465}
8466#line 8467 "parse.c"
8467 break;
8468
8469 case YYSYMBOL_allow_exits: /* allow_exits */
8470#line 2612 "parse.y"
8471 {
8472 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
8473 rb_parser_printf(p, "NODE_SPECIAL");
8474 }
8475 else if (((*yyvaluep).node_exits)) {
8476 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
8477 }
8478}
8479#line 8480 "parse.c"
8480 break;
8481
8482 case YYSYMBOL_stmt: /* stmt */
8483#line 2612 "parse.y"
8484 {
8485 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8486 rb_parser_printf(p, "NODE_SPECIAL");
8487 }
8488 else if (((*yyvaluep).node)) {
8489 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8490 }
8491}
8492#line 8493 "parse.c"
8493 break;
8494
8495 case YYSYMBOL_command_asgn: /* command_asgn */
8496#line 2612 "parse.y"
8497 {
8498 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8499 rb_parser_printf(p, "NODE_SPECIAL");
8500 }
8501 else if (((*yyvaluep).node)) {
8502 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8503 }
8504}
8505#line 8506 "parse.c"
8506 break;
8507
8508 case YYSYMBOL_endless_command: /* endless_command */
8509#line 2612 "parse.y"
8510 {
8511 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8512 rb_parser_printf(p, "NODE_SPECIAL");
8513 }
8514 else if (((*yyvaluep).node)) {
8515 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8516 }
8517}
8518#line 8519 "parse.c"
8519 break;
8520
8521 case YYSYMBOL_command_rhs: /* command_rhs */
8522#line 2612 "parse.y"
8523 {
8524 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8525 rb_parser_printf(p, "NODE_SPECIAL");
8526 }
8527 else if (((*yyvaluep).node)) {
8528 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8529 }
8530}
8531#line 8532 "parse.c"
8532 break;
8533
8534 case YYSYMBOL_expr: /* expr */
8535#line 2612 "parse.y"
8536 {
8537 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8538 rb_parser_printf(p, "NODE_SPECIAL");
8539 }
8540 else if (((*yyvaluep).node)) {
8541 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8542 }
8543}
8544#line 8545 "parse.c"
8545 break;
8546
8547 case YYSYMBOL_def_name: /* def_name */
8548#line 2621 "parse.y"
8549 {
8550 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8551}
8552#line 8553 "parse.c"
8553 break;
8554
8555 case YYSYMBOL_defn_head: /* defn_head */
8556#line 2612 "parse.y"
8557 {
8558 if ((NODE *)((*yyvaluep).node_def_temp) == (NODE *)-1) {
8559 rb_parser_printf(p, "NODE_SPECIAL");
8560 }
8561 else if (((*yyvaluep).node_def_temp)) {
8562 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_def_temp)))));
8563 }
8564}
8565#line 8566 "parse.c"
8566 break;
8567
8568 case YYSYMBOL_defs_head: /* defs_head */
8569#line 2612 "parse.y"
8570 {
8571 if ((NODE *)((*yyvaluep).node_def_temp) == (NODE *)-1) {
8572 rb_parser_printf(p, "NODE_SPECIAL");
8573 }
8574 else if (((*yyvaluep).node_def_temp)) {
8575 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_def_temp)))));
8576 }
8577}
8578#line 8579 "parse.c"
8579 break;
8580
8581 case YYSYMBOL_expr_value: /* expr_value */
8582#line 2612 "parse.y"
8583 {
8584 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8585 rb_parser_printf(p, "NODE_SPECIAL");
8586 }
8587 else if (((*yyvaluep).node)) {
8588 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8589 }
8590}
8591#line 8592 "parse.c"
8592 break;
8593
8594 case YYSYMBOL_expr_value_do: /* expr_value_do */
8595#line 2612 "parse.y"
8596 {
8597 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8598 rb_parser_printf(p, "NODE_SPECIAL");
8599 }
8600 else if (((*yyvaluep).node)) {
8601 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8602 }
8603}
8604#line 8605 "parse.c"
8605 break;
8606
8607 case YYSYMBOL_command_call: /* command_call */
8608#line 2612 "parse.y"
8609 {
8610 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8611 rb_parser_printf(p, "NODE_SPECIAL");
8612 }
8613 else if (((*yyvaluep).node)) {
8614 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8615 }
8616}
8617#line 8618 "parse.c"
8618 break;
8619
8620 case YYSYMBOL_block_command: /* block_command */
8621#line 2612 "parse.y"
8622 {
8623 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8624 rb_parser_printf(p, "NODE_SPECIAL");
8625 }
8626 else if (((*yyvaluep).node)) {
8627 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8628 }
8629}
8630#line 8631 "parse.c"
8631 break;
8632
8633 case YYSYMBOL_cmd_brace_block: /* cmd_brace_block */
8634#line 2612 "parse.y"
8635 {
8636 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8637 rb_parser_printf(p, "NODE_SPECIAL");
8638 }
8639 else if (((*yyvaluep).node)) {
8640 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8641 }
8642}
8643#line 8644 "parse.c"
8644 break;
8645
8646 case YYSYMBOL_fcall: /* fcall */
8647#line 2612 "parse.y"
8648 {
8649 if ((NODE *)((*yyvaluep).node_fcall) == (NODE *)-1) {
8650 rb_parser_printf(p, "NODE_SPECIAL");
8651 }
8652 else if (((*yyvaluep).node_fcall)) {
8653 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_fcall)))));
8654 }
8655}
8656#line 8657 "parse.c"
8657 break;
8658
8659 case YYSYMBOL_command: /* command */
8660#line 2612 "parse.y"
8661 {
8662 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8663 rb_parser_printf(p, "NODE_SPECIAL");
8664 }
8665 else if (((*yyvaluep).node)) {
8666 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8667 }
8668}
8669#line 8670 "parse.c"
8670 break;
8671
8672 case YYSYMBOL_mlhs: /* mlhs */
8673#line 2612 "parse.y"
8674 {
8675 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
8676 rb_parser_printf(p, "NODE_SPECIAL");
8677 }
8678 else if (((*yyvaluep).node_masgn)) {
8679 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
8680 }
8681}
8682#line 8683 "parse.c"
8683 break;
8684
8685 case YYSYMBOL_mlhs_inner: /* mlhs_inner */
8686#line 2612 "parse.y"
8687 {
8688 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
8689 rb_parser_printf(p, "NODE_SPECIAL");
8690 }
8691 else if (((*yyvaluep).node_masgn)) {
8692 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
8693 }
8694}
8695#line 8696 "parse.c"
8696 break;
8697
8698 case YYSYMBOL_mlhs_basic: /* mlhs_basic */
8699#line 2612 "parse.y"
8700 {
8701 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
8702 rb_parser_printf(p, "NODE_SPECIAL");
8703 }
8704 else if (((*yyvaluep).node_masgn)) {
8705 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
8706 }
8707}
8708#line 8709 "parse.c"
8709 break;
8710
8711 case YYSYMBOL_mlhs_item: /* mlhs_item */
8712#line 2612 "parse.y"
8713 {
8714 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8715 rb_parser_printf(p, "NODE_SPECIAL");
8716 }
8717 else if (((*yyvaluep).node)) {
8718 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8719 }
8720}
8721#line 8722 "parse.c"
8722 break;
8723
8724 case YYSYMBOL_mlhs_head: /* mlhs_head */
8725#line 2612 "parse.y"
8726 {
8727 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8728 rb_parser_printf(p, "NODE_SPECIAL");
8729 }
8730 else if (((*yyvaluep).node)) {
8731 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8732 }
8733}
8734#line 8735 "parse.c"
8735 break;
8736
8737 case YYSYMBOL_mlhs_post: /* mlhs_post */
8738#line 2612 "parse.y"
8739 {
8740 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8741 rb_parser_printf(p, "NODE_SPECIAL");
8742 }
8743 else if (((*yyvaluep).node)) {
8744 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8745 }
8746}
8747#line 8748 "parse.c"
8748 break;
8749
8750 case YYSYMBOL_mlhs_node: /* mlhs_node */
8751#line 2612 "parse.y"
8752 {
8753 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8754 rb_parser_printf(p, "NODE_SPECIAL");
8755 }
8756 else if (((*yyvaluep).node)) {
8757 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8758 }
8759}
8760#line 8761 "parse.c"
8761 break;
8762
8763 case YYSYMBOL_lhs: /* lhs */
8764#line 2612 "parse.y"
8765 {
8766 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8767 rb_parser_printf(p, "NODE_SPECIAL");
8768 }
8769 else if (((*yyvaluep).node)) {
8770 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8771 }
8772}
8773#line 8774 "parse.c"
8774 break;
8775
8776 case YYSYMBOL_cname: /* cname */
8777#line 2621 "parse.y"
8778 {
8779 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8780}
8781#line 8782 "parse.c"
8782 break;
8783
8784 case YYSYMBOL_cpath: /* cpath */
8785#line 2612 "parse.y"
8786 {
8787 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8788 rb_parser_printf(p, "NODE_SPECIAL");
8789 }
8790 else if (((*yyvaluep).node)) {
8791 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8792 }
8793}
8794#line 8795 "parse.c"
8795 break;
8796
8797 case YYSYMBOL_fname: /* fname */
8798#line 2621 "parse.y"
8799 {
8800 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8801}
8802#line 8803 "parse.c"
8803 break;
8804
8805 case YYSYMBOL_fitem: /* fitem */
8806#line 2612 "parse.y"
8807 {
8808 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8809 rb_parser_printf(p, "NODE_SPECIAL");
8810 }
8811 else if (((*yyvaluep).node)) {
8812 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8813 }
8814}
8815#line 8816 "parse.c"
8816 break;
8817
8818 case YYSYMBOL_undef_list: /* undef_list */
8819#line 2612 "parse.y"
8820 {
8821 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8822 rb_parser_printf(p, "NODE_SPECIAL");
8823 }
8824 else if (((*yyvaluep).node)) {
8825 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8826 }
8827}
8828#line 8829 "parse.c"
8829 break;
8830
8831 case YYSYMBOL_op: /* op */
8832#line 2621 "parse.y"
8833 {
8834 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8835}
8836#line 8837 "parse.c"
8837 break;
8838
8839 case YYSYMBOL_reswords: /* reswords */
8840#line 2621 "parse.y"
8841 {
8842 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8843}
8844#line 8845 "parse.c"
8845 break;
8846
8847 case YYSYMBOL_arg: /* arg */
8848#line 2612 "parse.y"
8849 {
8850 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8851 rb_parser_printf(p, "NODE_SPECIAL");
8852 }
8853 else if (((*yyvaluep).node)) {
8854 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8855 }
8856}
8857#line 8858 "parse.c"
8858 break;
8859
8860 case YYSYMBOL_endless_arg: /* endless_arg */
8861#line 2612 "parse.y"
8862 {
8863 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8864 rb_parser_printf(p, "NODE_SPECIAL");
8865 }
8866 else if (((*yyvaluep).node)) {
8867 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8868 }
8869}
8870#line 8871 "parse.c"
8871 break;
8872
8873 case YYSYMBOL_relop: /* relop */
8874#line 2621 "parse.y"
8875 {
8876 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
8877}
8878#line 8879 "parse.c"
8879 break;
8880
8881 case YYSYMBOL_rel_expr: /* rel_expr */
8882#line 2612 "parse.y"
8883 {
8884 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8885 rb_parser_printf(p, "NODE_SPECIAL");
8886 }
8887 else if (((*yyvaluep).node)) {
8888 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8889 }
8890}
8891#line 8892 "parse.c"
8892 break;
8893
8894 case YYSYMBOL_arg_value: /* arg_value */
8895#line 2612 "parse.y"
8896 {
8897 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8898 rb_parser_printf(p, "NODE_SPECIAL");
8899 }
8900 else if (((*yyvaluep).node)) {
8901 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8902 }
8903}
8904#line 8905 "parse.c"
8905 break;
8906
8907 case YYSYMBOL_aref_args: /* aref_args */
8908#line 2612 "parse.y"
8909 {
8910 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8911 rb_parser_printf(p, "NODE_SPECIAL");
8912 }
8913 else if (((*yyvaluep).node)) {
8914 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8915 }
8916}
8917#line 8918 "parse.c"
8918 break;
8919
8920 case YYSYMBOL_arg_rhs: /* arg_rhs */
8921#line 2612 "parse.y"
8922 {
8923 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8924 rb_parser_printf(p, "NODE_SPECIAL");
8925 }
8926 else if (((*yyvaluep).node)) {
8927 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8928 }
8929}
8930#line 8931 "parse.c"
8931 break;
8932
8933 case YYSYMBOL_paren_args: /* paren_args */
8934#line 2612 "parse.y"
8935 {
8936 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8937 rb_parser_printf(p, "NODE_SPECIAL");
8938 }
8939 else if (((*yyvaluep).node)) {
8940 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8941 }
8942}
8943#line 8944 "parse.c"
8944 break;
8945
8946 case YYSYMBOL_opt_paren_args: /* opt_paren_args */
8947#line 2612 "parse.y"
8948 {
8949 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8950 rb_parser_printf(p, "NODE_SPECIAL");
8951 }
8952 else if (((*yyvaluep).node)) {
8953 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8954 }
8955}
8956#line 8957 "parse.c"
8957 break;
8958
8959 case YYSYMBOL_opt_call_args: /* opt_call_args */
8960#line 2612 "parse.y"
8961 {
8962 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8963 rb_parser_printf(p, "NODE_SPECIAL");
8964 }
8965 else if (((*yyvaluep).node)) {
8966 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8967 }
8968}
8969#line 8970 "parse.c"
8970 break;
8971
8972 case YYSYMBOL_call_args: /* call_args */
8973#line 2612 "parse.y"
8974 {
8975 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8976 rb_parser_printf(p, "NODE_SPECIAL");
8977 }
8978 else if (((*yyvaluep).node)) {
8979 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8980 }
8981}
8982#line 8983 "parse.c"
8983 break;
8984
8985 case YYSYMBOL_command_args: /* command_args */
8986#line 2612 "parse.y"
8987 {
8988 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8989 rb_parser_printf(p, "NODE_SPECIAL");
8990 }
8991 else if (((*yyvaluep).node)) {
8992 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8993 }
8994}
8995#line 8996 "parse.c"
8996 break;
8997
8998 case YYSYMBOL_block_arg: /* block_arg */
8999#line 2612 "parse.y"
9000 {
9001 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
9002 rb_parser_printf(p, "NODE_SPECIAL");
9003 }
9004 else if (((*yyvaluep).node_block_pass)) {
9005 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
9006 }
9007}
9008#line 9009 "parse.c"
9009 break;
9010
9011 case YYSYMBOL_opt_block_arg: /* opt_block_arg */
9012#line 2612 "parse.y"
9013 {
9014 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
9015 rb_parser_printf(p, "NODE_SPECIAL");
9016 }
9017 else if (((*yyvaluep).node_block_pass)) {
9018 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
9019 }
9020}
9021#line 9022 "parse.c"
9022 break;
9023
9024 case YYSYMBOL_args: /* args */
9025#line 2612 "parse.y"
9026 {
9027 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9028 rb_parser_printf(p, "NODE_SPECIAL");
9029 }
9030 else if (((*yyvaluep).node)) {
9031 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9032 }
9033}
9034#line 9035 "parse.c"
9035 break;
9036
9037 case YYSYMBOL_arg_splat: /* arg_splat */
9038#line 2612 "parse.y"
9039 {
9040 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9041 rb_parser_printf(p, "NODE_SPECIAL");
9042 }
9043 else if (((*yyvaluep).node)) {
9044 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9045 }
9046}
9047#line 9048 "parse.c"
9048 break;
9049
9050 case YYSYMBOL_mrhs_arg: /* mrhs_arg */
9051#line 2612 "parse.y"
9052 {
9053 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9054 rb_parser_printf(p, "NODE_SPECIAL");
9055 }
9056 else if (((*yyvaluep).node)) {
9057 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9058 }
9059}
9060#line 9061 "parse.c"
9061 break;
9062
9063 case YYSYMBOL_mrhs: /* mrhs */
9064#line 2612 "parse.y"
9065 {
9066 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9067 rb_parser_printf(p, "NODE_SPECIAL");
9068 }
9069 else if (((*yyvaluep).node)) {
9070 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9071 }
9072}
9073#line 9074 "parse.c"
9074 break;
9075
9076 case YYSYMBOL_primary: /* primary */
9077#line 2612 "parse.y"
9078 {
9079 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9080 rb_parser_printf(p, "NODE_SPECIAL");
9081 }
9082 else if (((*yyvaluep).node)) {
9083 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9084 }
9085}
9086#line 9087 "parse.c"
9087 break;
9088
9089 case YYSYMBOL_primary_value: /* primary_value */
9090#line 2612 "parse.y"
9091 {
9092 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9093 rb_parser_printf(p, "NODE_SPECIAL");
9094 }
9095 else if (((*yyvaluep).node)) {
9096 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9097 }
9098}
9099#line 9100 "parse.c"
9100 break;
9101
9102 case YYSYMBOL_k_while: /* k_while */
9103#line 2612 "parse.y"
9104 {
9105 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
9106 rb_parser_printf(p, "NODE_SPECIAL");
9107 }
9108 else if (((*yyvaluep).node_exits)) {
9109 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
9110 }
9111}
9112#line 9113 "parse.c"
9113 break;
9114
9115 case YYSYMBOL_k_until: /* k_until */
9116#line 2612 "parse.y"
9117 {
9118 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
9119 rb_parser_printf(p, "NODE_SPECIAL");
9120 }
9121 else if (((*yyvaluep).node_exits)) {
9122 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
9123 }
9124}
9125#line 9126 "parse.c"
9126 break;
9127
9128 case YYSYMBOL_k_for: /* k_for */
9129#line 2612 "parse.y"
9130 {
9131 if ((NODE *)((*yyvaluep).node_exits) == (NODE *)-1) {
9132 rb_parser_printf(p, "NODE_SPECIAL");
9133 }
9134 else if (((*yyvaluep).node_exits)) {
9135 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_exits)))));
9136 }
9137}
9138#line 9139 "parse.c"
9139 break;
9140
9141 case YYSYMBOL_k_def: /* k_def */
9142#line 2612 "parse.y"
9143 {
9144 if ((NODE *)((*yyvaluep).node_def_temp) == (NODE *)-1) {
9145 rb_parser_printf(p, "NODE_SPECIAL");
9146 }
9147 else if (((*yyvaluep).node_def_temp)) {
9148 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_def_temp)))));
9149 }
9150}
9151#line 9152 "parse.c"
9152 break;
9153
9154 case YYSYMBOL_if_tail: /* if_tail */
9155#line 2612 "parse.y"
9156 {
9157 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9158 rb_parser_printf(p, "NODE_SPECIAL");
9159 }
9160 else if (((*yyvaluep).node)) {
9161 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9162 }
9163}
9164#line 9165 "parse.c"
9165 break;
9166
9167 case YYSYMBOL_opt_else: /* opt_else */
9168#line 2612 "parse.y"
9169 {
9170 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9171 rb_parser_printf(p, "NODE_SPECIAL");
9172 }
9173 else if (((*yyvaluep).node)) {
9174 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9175 }
9176}
9177#line 9178 "parse.c"
9178 break;
9179
9180 case YYSYMBOL_for_var: /* for_var */
9181#line 2612 "parse.y"
9182 {
9183 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9184 rb_parser_printf(p, "NODE_SPECIAL");
9185 }
9186 else if (((*yyvaluep).node)) {
9187 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9188 }
9189}
9190#line 9191 "parse.c"
9191 break;
9192
9193 case YYSYMBOL_f_marg: /* f_marg */
9194#line 2612 "parse.y"
9195 {
9196 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9197 rb_parser_printf(p, "NODE_SPECIAL");
9198 }
9199 else if (((*yyvaluep).node)) {
9200 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9201 }
9202}
9203#line 9204 "parse.c"
9204 break;
9205
9206 case YYSYMBOL_f_marg_list: /* f_marg_list */
9207#line 2612 "parse.y"
9208 {
9209 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9210 rb_parser_printf(p, "NODE_SPECIAL");
9211 }
9212 else if (((*yyvaluep).node)) {
9213 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9214 }
9215}
9216#line 9217 "parse.c"
9217 break;
9218
9219 case YYSYMBOL_f_margs: /* f_margs */
9220#line 2612 "parse.y"
9221 {
9222 if ((NODE *)((*yyvaluep).node_masgn) == (NODE *)-1) {
9223 rb_parser_printf(p, "NODE_SPECIAL");
9224 }
9225 else if (((*yyvaluep).node_masgn)) {
9226 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_masgn)))));
9227 }
9228}
9229#line 9230 "parse.c"
9230 break;
9231
9232 case YYSYMBOL_f_rest_marg: /* f_rest_marg */
9233#line 2612 "parse.y"
9234 {
9235 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9236 rb_parser_printf(p, "NODE_SPECIAL");
9237 }
9238 else if (((*yyvaluep).node)) {
9239 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9240 }
9241}
9242#line 9243 "parse.c"
9243 break;
9244
9245 case YYSYMBOL_f_any_kwrest: /* f_any_kwrest */
9246#line 2621 "parse.y"
9247 {
9248 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9249}
9250#line 9251 "parse.c"
9251 break;
9252
9253 case YYSYMBOL_f_kwarg_f_block_kw: /* f_kwarg_f_block_kw */
9254#line 2612 "parse.y"
9255 {
9256 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9257 rb_parser_printf(p, "NODE_SPECIAL");
9258 }
9259 else if (((*yyvaluep).node_kw_arg)) {
9260 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9261 }
9262}
9263#line 9264 "parse.c"
9264 break;
9265
9266 case YYSYMBOL_block_args_tail: /* block_args_tail */
9267#line 2612 "parse.y"
9268 {
9269 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9270 rb_parser_printf(p, "NODE_SPECIAL");
9271 }
9272 else if (((*yyvaluep).node_args)) {
9273 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9274 }
9275}
9276#line 9277 "parse.c"
9277 break;
9278
9279 case YYSYMBOL_excessed_comma: /* excessed_comma */
9280#line 2621 "parse.y"
9281 {
9282 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9283}
9284#line 9285 "parse.c"
9285 break;
9286
9287 case YYSYMBOL_f_opt_primary_value: /* f_opt_primary_value */
9288#line 2612 "parse.y"
9289 {
9290 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9291 rb_parser_printf(p, "NODE_SPECIAL");
9292 }
9293 else if (((*yyvaluep).node_opt_arg)) {
9294 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9295 }
9296}
9297#line 9298 "parse.c"
9298 break;
9299
9300 case YYSYMBOL_f_optarg_primary_value: /* f_optarg_primary_value */
9301#line 2612 "parse.y"
9302 {
9303 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9304 rb_parser_printf(p, "NODE_SPECIAL");
9305 }
9306 else if (((*yyvaluep).node_opt_arg)) {
9307 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9308 }
9309}
9310#line 9311 "parse.c"
9311 break;
9312
9313 case YYSYMBOL_opt_args_tail_block_args_tail: /* opt_args_tail_block_args_tail */
9314#line 2612 "parse.y"
9315 {
9316 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9317 rb_parser_printf(p, "NODE_SPECIAL");
9318 }
9319 else if (((*yyvaluep).node_args)) {
9320 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9321 }
9322}
9323#line 9324 "parse.c"
9324 break;
9325
9326 case YYSYMBOL_block_param: /* block_param */
9327#line 2612 "parse.y"
9328 {
9329 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9330 rb_parser_printf(p, "NODE_SPECIAL");
9331 }
9332 else if (((*yyvaluep).node_args)) {
9333 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9334 }
9335}
9336#line 9337 "parse.c"
9337 break;
9338
9339 case YYSYMBOL_opt_block_param: /* opt_block_param */
9340#line 2612 "parse.y"
9341 {
9342 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9343 rb_parser_printf(p, "NODE_SPECIAL");
9344 }
9345 else if (((*yyvaluep).node_args)) {
9346 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9347 }
9348}
9349#line 9350 "parse.c"
9350 break;
9351
9352 case YYSYMBOL_block_param_def: /* block_param_def */
9353#line 2612 "parse.y"
9354 {
9355 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9356 rb_parser_printf(p, "NODE_SPECIAL");
9357 }
9358 else if (((*yyvaluep).node_args)) {
9359 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9360 }
9361}
9362#line 9363 "parse.c"
9363 break;
9364
9365 case YYSYMBOL_opt_bv_decl: /* opt_bv_decl */
9366#line 2621 "parse.y"
9367 {
9368 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9369}
9370#line 9371 "parse.c"
9371 break;
9372
9373 case YYSYMBOL_bv_decls: /* bv_decls */
9374#line 2621 "parse.y"
9375 {
9376 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9377}
9378#line 9379 "parse.c"
9379 break;
9380
9381 case YYSYMBOL_bvar: /* bvar */
9382#line 2621 "parse.y"
9383 {
9384 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9385}
9386#line 9387 "parse.c"
9387 break;
9388
9389 case YYSYMBOL_numparam: /* numparam */
9390#line 2612 "parse.y"
9391 {
9392 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9393 rb_parser_printf(p, "NODE_SPECIAL");
9394 }
9395 else if (((*yyvaluep).node)) {
9396 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9397 }
9398}
9399#line 9400 "parse.c"
9400 break;
9401
9402 case YYSYMBOL_it_id: /* it_id */
9403#line 2621 "parse.y"
9404 {
9405 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9406}
9407#line 9408 "parse.c"
9408 break;
9409
9410 case YYSYMBOL_lambda: /* lambda */
9411#line 2612 "parse.y"
9412 {
9413 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9414 rb_parser_printf(p, "NODE_SPECIAL");
9415 }
9416 else if (((*yyvaluep).node)) {
9417 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9418 }
9419}
9420#line 9421 "parse.c"
9421 break;
9422
9423 case YYSYMBOL_f_larglist: /* f_larglist */
9424#line 2612 "parse.y"
9425 {
9426 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9427 rb_parser_printf(p, "NODE_SPECIAL");
9428 }
9429 else if (((*yyvaluep).node_args)) {
9430 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9431 }
9432}
9433#line 9434 "parse.c"
9434 break;
9435
9436 case YYSYMBOL_lambda_body: /* lambda_body */
9437#line 2612 "parse.y"
9438 {
9439 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9440 rb_parser_printf(p, "NODE_SPECIAL");
9441 }
9442 else if (((*yyvaluep).node)) {
9443 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9444 }
9445}
9446#line 9447 "parse.c"
9447 break;
9448
9449 case YYSYMBOL_do_block: /* do_block */
9450#line 2612 "parse.y"
9451 {
9452 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9453 rb_parser_printf(p, "NODE_SPECIAL");
9454 }
9455 else if (((*yyvaluep).node)) {
9456 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9457 }
9458}
9459#line 9460 "parse.c"
9460 break;
9461
9462 case YYSYMBOL_block_call: /* block_call */
9463#line 2612 "parse.y"
9464 {
9465 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9466 rb_parser_printf(p, "NODE_SPECIAL");
9467 }
9468 else if (((*yyvaluep).node)) {
9469 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9470 }
9471}
9472#line 9473 "parse.c"
9473 break;
9474
9475 case YYSYMBOL_method_call: /* method_call */
9476#line 2612 "parse.y"
9477 {
9478 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9479 rb_parser_printf(p, "NODE_SPECIAL");
9480 }
9481 else if (((*yyvaluep).node)) {
9482 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9483 }
9484}
9485#line 9486 "parse.c"
9486 break;
9487
9488 case YYSYMBOL_brace_block: /* brace_block */
9489#line 2612 "parse.y"
9490 {
9491 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9492 rb_parser_printf(p, "NODE_SPECIAL");
9493 }
9494 else if (((*yyvaluep).node)) {
9495 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9496 }
9497}
9498#line 9499 "parse.c"
9499 break;
9500
9501 case YYSYMBOL_brace_body: /* brace_body */
9502#line 2612 "parse.y"
9503 {
9504 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9505 rb_parser_printf(p, "NODE_SPECIAL");
9506 }
9507 else if (((*yyvaluep).node)) {
9508 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9509 }
9510}
9511#line 9512 "parse.c"
9512 break;
9513
9514 case YYSYMBOL_do_body: /* do_body */
9515#line 2612 "parse.y"
9516 {
9517 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9518 rb_parser_printf(p, "NODE_SPECIAL");
9519 }
9520 else if (((*yyvaluep).node)) {
9521 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9522 }
9523}
9524#line 9525 "parse.c"
9525 break;
9526
9527 case YYSYMBOL_case_args: /* case_args */
9528#line 2612 "parse.y"
9529 {
9530 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9531 rb_parser_printf(p, "NODE_SPECIAL");
9532 }
9533 else if (((*yyvaluep).node)) {
9534 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9535 }
9536}
9537#line 9538 "parse.c"
9538 break;
9539
9540 case YYSYMBOL_case_body: /* case_body */
9541#line 2612 "parse.y"
9542 {
9543 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9544 rb_parser_printf(p, "NODE_SPECIAL");
9545 }
9546 else if (((*yyvaluep).node)) {
9547 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9548 }
9549}
9550#line 9551 "parse.c"
9551 break;
9552
9553 case YYSYMBOL_cases: /* cases */
9554#line 2612 "parse.y"
9555 {
9556 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9557 rb_parser_printf(p, "NODE_SPECIAL");
9558 }
9559 else if (((*yyvaluep).node)) {
9560 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9561 }
9562}
9563#line 9564 "parse.c"
9564 break;
9565
9566 case YYSYMBOL_p_case_body: /* p_case_body */
9567#line 2612 "parse.y"
9568 {
9569 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9570 rb_parser_printf(p, "NODE_SPECIAL");
9571 }
9572 else if (((*yyvaluep).node)) {
9573 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9574 }
9575}
9576#line 9577 "parse.c"
9577 break;
9578
9579 case YYSYMBOL_p_cases: /* p_cases */
9580#line 2612 "parse.y"
9581 {
9582 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9583 rb_parser_printf(p, "NODE_SPECIAL");
9584 }
9585 else if (((*yyvaluep).node)) {
9586 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9587 }
9588}
9589#line 9590 "parse.c"
9590 break;
9591
9592 case YYSYMBOL_p_top_expr: /* p_top_expr */
9593#line 2612 "parse.y"
9594 {
9595 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9596 rb_parser_printf(p, "NODE_SPECIAL");
9597 }
9598 else if (((*yyvaluep).node)) {
9599 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9600 }
9601}
9602#line 9603 "parse.c"
9603 break;
9604
9605 case YYSYMBOL_p_top_expr_body: /* p_top_expr_body */
9606#line 2612 "parse.y"
9607 {
9608 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9609 rb_parser_printf(p, "NODE_SPECIAL");
9610 }
9611 else if (((*yyvaluep).node)) {
9612 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9613 }
9614}
9615#line 9616 "parse.c"
9616 break;
9617
9618 case YYSYMBOL_p_expr: /* p_expr */
9619#line 2612 "parse.y"
9620 {
9621 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9622 rb_parser_printf(p, "NODE_SPECIAL");
9623 }
9624 else if (((*yyvaluep).node)) {
9625 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9626 }
9627}
9628#line 9629 "parse.c"
9629 break;
9630
9631 case YYSYMBOL_p_as: /* p_as */
9632#line 2612 "parse.y"
9633 {
9634 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9635 rb_parser_printf(p, "NODE_SPECIAL");
9636 }
9637 else if (((*yyvaluep).node)) {
9638 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9639 }
9640}
9641#line 9642 "parse.c"
9642 break;
9643
9644 case YYSYMBOL_p_alt: /* p_alt */
9645#line 2612 "parse.y"
9646 {
9647 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9648 rb_parser_printf(p, "NODE_SPECIAL");
9649 }
9650 else if (((*yyvaluep).node)) {
9651 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9652 }
9653}
9654#line 9655 "parse.c"
9655 break;
9656
9657 case YYSYMBOL_p_expr_basic: /* p_expr_basic */
9658#line 2612 "parse.y"
9659 {
9660 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9661 rb_parser_printf(p, "NODE_SPECIAL");
9662 }
9663 else if (((*yyvaluep).node)) {
9664 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9665 }
9666}
9667#line 9668 "parse.c"
9668 break;
9669
9670 case YYSYMBOL_p_args: /* p_args */
9671#line 2612 "parse.y"
9672 {
9673 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9674 rb_parser_printf(p, "NODE_SPECIAL");
9675 }
9676 else if (((*yyvaluep).node)) {
9677 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9678 }
9679}
9680#line 9681 "parse.c"
9681 break;
9682
9683 case YYSYMBOL_p_args_head: /* p_args_head */
9684#line 2612 "parse.y"
9685 {
9686 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9687 rb_parser_printf(p, "NODE_SPECIAL");
9688 }
9689 else if (((*yyvaluep).node)) {
9690 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9691 }
9692}
9693#line 9694 "parse.c"
9694 break;
9695
9696 case YYSYMBOL_p_args_tail: /* p_args_tail */
9697#line 2612 "parse.y"
9698 {
9699 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9700 rb_parser_printf(p, "NODE_SPECIAL");
9701 }
9702 else if (((*yyvaluep).node)) {
9703 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9704 }
9705}
9706#line 9707 "parse.c"
9707 break;
9708
9709 case YYSYMBOL_p_find: /* p_find */
9710#line 2612 "parse.y"
9711 {
9712 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9713 rb_parser_printf(p, "NODE_SPECIAL");
9714 }
9715 else if (((*yyvaluep).node)) {
9716 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9717 }
9718}
9719#line 9720 "parse.c"
9720 break;
9721
9722 case YYSYMBOL_p_rest: /* p_rest */
9723#line 2612 "parse.y"
9724 {
9725 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9726 rb_parser_printf(p, "NODE_SPECIAL");
9727 }
9728 else if (((*yyvaluep).node)) {
9729 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9730 }
9731}
9732#line 9733 "parse.c"
9733 break;
9734
9735 case YYSYMBOL_p_args_post: /* p_args_post */
9736#line 2612 "parse.y"
9737 {
9738 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9739 rb_parser_printf(p, "NODE_SPECIAL");
9740 }
9741 else if (((*yyvaluep).node)) {
9742 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9743 }
9744}
9745#line 9746 "parse.c"
9746 break;
9747
9748 case YYSYMBOL_p_arg: /* p_arg */
9749#line 2612 "parse.y"
9750 {
9751 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9752 rb_parser_printf(p, "NODE_SPECIAL");
9753 }
9754 else if (((*yyvaluep).node)) {
9755 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9756 }
9757}
9758#line 9759 "parse.c"
9759 break;
9760
9761 case YYSYMBOL_p_kwargs: /* p_kwargs */
9762#line 2612 "parse.y"
9763 {
9764 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9765 rb_parser_printf(p, "NODE_SPECIAL");
9766 }
9767 else if (((*yyvaluep).node)) {
9768 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9769 }
9770}
9771#line 9772 "parse.c"
9772 break;
9773
9774 case YYSYMBOL_p_kwarg: /* p_kwarg */
9775#line 2612 "parse.y"
9776 {
9777 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9778 rb_parser_printf(p, "NODE_SPECIAL");
9779 }
9780 else if (((*yyvaluep).node)) {
9781 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9782 }
9783}
9784#line 9785 "parse.c"
9785 break;
9786
9787 case YYSYMBOL_p_kw: /* p_kw */
9788#line 2612 "parse.y"
9789 {
9790 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9791 rb_parser_printf(p, "NODE_SPECIAL");
9792 }
9793 else if (((*yyvaluep).node)) {
9794 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9795 }
9796}
9797#line 9798 "parse.c"
9798 break;
9799
9800 case YYSYMBOL_p_kw_label: /* p_kw_label */
9801#line 2621 "parse.y"
9802 {
9803 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9804}
9805#line 9806 "parse.c"
9806 break;
9807
9808 case YYSYMBOL_p_kwrest: /* p_kwrest */
9809#line 2621 "parse.y"
9810 {
9811 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9812}
9813#line 9814 "parse.c"
9814 break;
9815
9816 case YYSYMBOL_p_kwnorest: /* p_kwnorest */
9817#line 2621 "parse.y"
9818 {
9819 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9820}
9821#line 9822 "parse.c"
9822 break;
9823
9824 case YYSYMBOL_p_any_kwrest: /* p_any_kwrest */
9825#line 2621 "parse.y"
9826 {
9827 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
9828}
9829#line 9830 "parse.c"
9830 break;
9831
9832 case YYSYMBOL_p_value: /* p_value */
9833#line 2612 "parse.y"
9834 {
9835 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9836 rb_parser_printf(p, "NODE_SPECIAL");
9837 }
9838 else if (((*yyvaluep).node)) {
9839 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9840 }
9841}
9842#line 9843 "parse.c"
9843 break;
9844
9845 case YYSYMBOL_p_primitive: /* p_primitive */
9846#line 2612 "parse.y"
9847 {
9848 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9849 rb_parser_printf(p, "NODE_SPECIAL");
9850 }
9851 else if (((*yyvaluep).node)) {
9852 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9853 }
9854}
9855#line 9856 "parse.c"
9856 break;
9857
9858 case YYSYMBOL_p_variable: /* p_variable */
9859#line 2612 "parse.y"
9860 {
9861 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9862 rb_parser_printf(p, "NODE_SPECIAL");
9863 }
9864 else if (((*yyvaluep).node)) {
9865 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9866 }
9867}
9868#line 9869 "parse.c"
9869 break;
9870
9871 case YYSYMBOL_p_var_ref: /* p_var_ref */
9872#line 2612 "parse.y"
9873 {
9874 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9875 rb_parser_printf(p, "NODE_SPECIAL");
9876 }
9877 else if (((*yyvaluep).node)) {
9878 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9879 }
9880}
9881#line 9882 "parse.c"
9882 break;
9883
9884 case YYSYMBOL_p_expr_ref: /* p_expr_ref */
9885#line 2612 "parse.y"
9886 {
9887 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9888 rb_parser_printf(p, "NODE_SPECIAL");
9889 }
9890 else if (((*yyvaluep).node)) {
9891 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9892 }
9893}
9894#line 9895 "parse.c"
9895 break;
9896
9897 case YYSYMBOL_p_const: /* p_const */
9898#line 2612 "parse.y"
9899 {
9900 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9901 rb_parser_printf(p, "NODE_SPECIAL");
9902 }
9903 else if (((*yyvaluep).node)) {
9904 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9905 }
9906}
9907#line 9908 "parse.c"
9908 break;
9909
9910 case YYSYMBOL_opt_rescue: /* opt_rescue */
9911#line 2612 "parse.y"
9912 {
9913 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9914 rb_parser_printf(p, "NODE_SPECIAL");
9915 }
9916 else if (((*yyvaluep).node)) {
9917 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9918 }
9919}
9920#line 9921 "parse.c"
9921 break;
9922
9923 case YYSYMBOL_exc_list: /* exc_list */
9924#line 2612 "parse.y"
9925 {
9926 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9927 rb_parser_printf(p, "NODE_SPECIAL");
9928 }
9929 else if (((*yyvaluep).node)) {
9930 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9931 }
9932}
9933#line 9934 "parse.c"
9934 break;
9935
9936 case YYSYMBOL_exc_var: /* exc_var */
9937#line 2612 "parse.y"
9938 {
9939 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9940 rb_parser_printf(p, "NODE_SPECIAL");
9941 }
9942 else if (((*yyvaluep).node)) {
9943 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9944 }
9945}
9946#line 9947 "parse.c"
9947 break;
9948
9949 case YYSYMBOL_opt_ensure: /* opt_ensure */
9950#line 2612 "parse.y"
9951 {
9952 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9953 rb_parser_printf(p, "NODE_SPECIAL");
9954 }
9955 else if (((*yyvaluep).node)) {
9956 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9957 }
9958}
9959#line 9960 "parse.c"
9960 break;
9961
9962 case YYSYMBOL_literal: /* literal */
9963#line 2612 "parse.y"
9964 {
9965 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9966 rb_parser_printf(p, "NODE_SPECIAL");
9967 }
9968 else if (((*yyvaluep).node)) {
9969 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9970 }
9971}
9972#line 9973 "parse.c"
9973 break;
9974
9975 case YYSYMBOL_strings: /* strings */
9976#line 2612 "parse.y"
9977 {
9978 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9979 rb_parser_printf(p, "NODE_SPECIAL");
9980 }
9981 else if (((*yyvaluep).node)) {
9982 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9983 }
9984}
9985#line 9986 "parse.c"
9986 break;
9987
9988 case YYSYMBOL_string: /* string */
9989#line 2612 "parse.y"
9990 {
9991 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9992 rb_parser_printf(p, "NODE_SPECIAL");
9993 }
9994 else if (((*yyvaluep).node)) {
9995 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9996 }
9997}
9998#line 9999 "parse.c"
9999 break;
10000
10001 case YYSYMBOL_string1: /* string1 */
10002#line 2612 "parse.y"
10003 {
10004 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10005 rb_parser_printf(p, "NODE_SPECIAL");
10006 }
10007 else if (((*yyvaluep).node)) {
10008 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10009 }
10010}
10011#line 10012 "parse.c"
10012 break;
10013
10014 case YYSYMBOL_xstring: /* xstring */
10015#line 2612 "parse.y"
10016 {
10017 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10018 rb_parser_printf(p, "NODE_SPECIAL");
10019 }
10020 else if (((*yyvaluep).node)) {
10021 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10022 }
10023}
10024#line 10025 "parse.c"
10025 break;
10026
10027 case YYSYMBOL_regexp: /* regexp */
10028#line 2612 "parse.y"
10029 {
10030 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10031 rb_parser_printf(p, "NODE_SPECIAL");
10032 }
10033 else if (((*yyvaluep).node)) {
10034 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10035 }
10036}
10037#line 10038 "parse.c"
10038 break;
10039
10040 case YYSYMBOL_words_tWORDS_BEG_word_list: /* words_tWORDS_BEG_word_list */
10041#line 2612 "parse.y"
10042 {
10043 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10044 rb_parser_printf(p, "NODE_SPECIAL");
10045 }
10046 else if (((*yyvaluep).node)) {
10047 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10048 }
10049}
10050#line 10051 "parse.c"
10051 break;
10052
10053 case YYSYMBOL_words: /* words */
10054#line 2612 "parse.y"
10055 {
10056 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10057 rb_parser_printf(p, "NODE_SPECIAL");
10058 }
10059 else if (((*yyvaluep).node)) {
10060 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10061 }
10062}
10063#line 10064 "parse.c"
10064 break;
10065
10066 case YYSYMBOL_word_list: /* word_list */
10067#line 2612 "parse.y"
10068 {
10069 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10070 rb_parser_printf(p, "NODE_SPECIAL");
10071 }
10072 else if (((*yyvaluep).node)) {
10073 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10074 }
10075}
10076#line 10077 "parse.c"
10077 break;
10078
10079 case YYSYMBOL_word: /* word */
10080#line 2612 "parse.y"
10081 {
10082 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10083 rb_parser_printf(p, "NODE_SPECIAL");
10084 }
10085 else if (((*yyvaluep).node)) {
10086 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10087 }
10088}
10089#line 10090 "parse.c"
10090 break;
10091
10092 case YYSYMBOL_words_tSYMBOLS_BEG_symbol_list: /* words_tSYMBOLS_BEG_symbol_list */
10093#line 2612 "parse.y"
10094 {
10095 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10096 rb_parser_printf(p, "NODE_SPECIAL");
10097 }
10098 else if (((*yyvaluep).node)) {
10099 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10100 }
10101}
10102#line 10103 "parse.c"
10103 break;
10104
10105 case YYSYMBOL_symbols: /* symbols */
10106#line 2612 "parse.y"
10107 {
10108 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10109 rb_parser_printf(p, "NODE_SPECIAL");
10110 }
10111 else if (((*yyvaluep).node)) {
10112 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10113 }
10114}
10115#line 10116 "parse.c"
10116 break;
10117
10118 case YYSYMBOL_symbol_list: /* symbol_list */
10119#line 2612 "parse.y"
10120 {
10121 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10122 rb_parser_printf(p, "NODE_SPECIAL");
10123 }
10124 else if (((*yyvaluep).node)) {
10125 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10126 }
10127}
10128#line 10129 "parse.c"
10129 break;
10130
10131 case YYSYMBOL_words_tQWORDS_BEG_qword_list: /* words_tQWORDS_BEG_qword_list */
10132#line 2612 "parse.y"
10133 {
10134 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10135 rb_parser_printf(p, "NODE_SPECIAL");
10136 }
10137 else if (((*yyvaluep).node)) {
10138 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10139 }
10140}
10141#line 10142 "parse.c"
10142 break;
10143
10144 case YYSYMBOL_qwords: /* qwords */
10145#line 2612 "parse.y"
10146 {
10147 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10148 rb_parser_printf(p, "NODE_SPECIAL");
10149 }
10150 else if (((*yyvaluep).node)) {
10151 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10152 }
10153}
10154#line 10155 "parse.c"
10155 break;
10156
10157 case YYSYMBOL_words_tQSYMBOLS_BEG_qsym_list: /* words_tQSYMBOLS_BEG_qsym_list */
10158#line 2612 "parse.y"
10159 {
10160 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10161 rb_parser_printf(p, "NODE_SPECIAL");
10162 }
10163 else if (((*yyvaluep).node)) {
10164 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10165 }
10166}
10167#line 10168 "parse.c"
10168 break;
10169
10170 case YYSYMBOL_qsymbols: /* qsymbols */
10171#line 2612 "parse.y"
10172 {
10173 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10174 rb_parser_printf(p, "NODE_SPECIAL");
10175 }
10176 else if (((*yyvaluep).node)) {
10177 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10178 }
10179}
10180#line 10181 "parse.c"
10181 break;
10182
10183 case YYSYMBOL_qword_list: /* qword_list */
10184#line 2612 "parse.y"
10185 {
10186 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10187 rb_parser_printf(p, "NODE_SPECIAL");
10188 }
10189 else if (((*yyvaluep).node)) {
10190 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10191 }
10192}
10193#line 10194 "parse.c"
10194 break;
10195
10196 case YYSYMBOL_qsym_list: /* qsym_list */
10197#line 2612 "parse.y"
10198 {
10199 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10200 rb_parser_printf(p, "NODE_SPECIAL");
10201 }
10202 else if (((*yyvaluep).node)) {
10203 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10204 }
10205}
10206#line 10207 "parse.c"
10207 break;
10208
10209 case YYSYMBOL_string_contents: /* string_contents */
10210#line 2612 "parse.y"
10211 {
10212 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10213 rb_parser_printf(p, "NODE_SPECIAL");
10214 }
10215 else if (((*yyvaluep).node)) {
10216 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10217 }
10218}
10219#line 10220 "parse.c"
10220 break;
10221
10222 case YYSYMBOL_xstring_contents: /* xstring_contents */
10223#line 2612 "parse.y"
10224 {
10225 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10226 rb_parser_printf(p, "NODE_SPECIAL");
10227 }
10228 else if (((*yyvaluep).node)) {
10229 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10230 }
10231}
10232#line 10233 "parse.c"
10233 break;
10234
10235 case YYSYMBOL_regexp_contents: /* regexp_contents */
10236#line 2612 "parse.y"
10237 {
10238 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10239 rb_parser_printf(p, "NODE_SPECIAL");
10240 }
10241 else if (((*yyvaluep).node)) {
10242 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10243 }
10244}
10245#line 10246 "parse.c"
10246 break;
10247
10248 case YYSYMBOL_string_content: /* string_content */
10249#line 2612 "parse.y"
10250 {
10251 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10252 rb_parser_printf(p, "NODE_SPECIAL");
10253 }
10254 else if (((*yyvaluep).node)) {
10255 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10256 }
10257}
10258#line 10259 "parse.c"
10259 break;
10260
10261 case YYSYMBOL_string_dvar: /* string_dvar */
10262#line 2612 "parse.y"
10263 {
10264 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10265 rb_parser_printf(p, "NODE_SPECIAL");
10266 }
10267 else if (((*yyvaluep).node)) {
10268 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10269 }
10270}
10271#line 10272 "parse.c"
10272 break;
10273
10274 case YYSYMBOL_symbol: /* symbol */
10275#line 2612 "parse.y"
10276 {
10277 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10278 rb_parser_printf(p, "NODE_SPECIAL");
10279 }
10280 else if (((*yyvaluep).node)) {
10281 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10282 }
10283}
10284#line 10285 "parse.c"
10285 break;
10286
10287 case YYSYMBOL_ssym: /* ssym */
10288#line 2612 "parse.y"
10289 {
10290 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10291 rb_parser_printf(p, "NODE_SPECIAL");
10292 }
10293 else if (((*yyvaluep).node)) {
10294 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10295 }
10296}
10297#line 10298 "parse.c"
10298 break;
10299
10300 case YYSYMBOL_sym: /* sym */
10301#line 2621 "parse.y"
10302 {
10303 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10304}
10305#line 10306 "parse.c"
10306 break;
10307
10308 case YYSYMBOL_dsym: /* dsym */
10309#line 2612 "parse.y"
10310 {
10311 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10312 rb_parser_printf(p, "NODE_SPECIAL");
10313 }
10314 else if (((*yyvaluep).node)) {
10315 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10316 }
10317}
10318#line 10319 "parse.c"
10319 break;
10320
10321 case YYSYMBOL_numeric: /* numeric */
10322#line 2612 "parse.y"
10323 {
10324 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10325 rb_parser_printf(p, "NODE_SPECIAL");
10326 }
10327 else if (((*yyvaluep).node)) {
10328 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10329 }
10330}
10331#line 10332 "parse.c"
10332 break;
10333
10334 case YYSYMBOL_simple_numeric: /* simple_numeric */
10335#line 2612 "parse.y"
10336 {
10337 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10338 rb_parser_printf(p, "NODE_SPECIAL");
10339 }
10340 else if (((*yyvaluep).node)) {
10341 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10342 }
10343}
10344#line 10345 "parse.c"
10345 break;
10346
10347 case YYSYMBOL_nonlocal_var: /* nonlocal_var */
10348#line 2621 "parse.y"
10349 {
10350 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10351}
10352#line 10353 "parse.c"
10353 break;
10354
10355 case YYSYMBOL_user_variable: /* user_variable */
10356#line 2621 "parse.y"
10357 {
10358 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10359}
10360#line 10361 "parse.c"
10361 break;
10362
10363 case YYSYMBOL_keyword_variable: /* keyword_variable */
10364#line 2621 "parse.y"
10365 {
10366 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10367}
10368#line 10369 "parse.c"
10369 break;
10370
10371 case YYSYMBOL_var_ref: /* var_ref */
10372#line 2612 "parse.y"
10373 {
10374 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10375 rb_parser_printf(p, "NODE_SPECIAL");
10376 }
10377 else if (((*yyvaluep).node)) {
10378 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10379 }
10380}
10381#line 10382 "parse.c"
10382 break;
10383
10384 case YYSYMBOL_var_lhs: /* var_lhs */
10385#line 2612 "parse.y"
10386 {
10387 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10388 rb_parser_printf(p, "NODE_SPECIAL");
10389 }
10390 else if (((*yyvaluep).node)) {
10391 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10392 }
10393}
10394#line 10395 "parse.c"
10395 break;
10396
10397 case YYSYMBOL_backref: /* backref */
10398#line 2612 "parse.y"
10399 {
10400 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10401 rb_parser_printf(p, "NODE_SPECIAL");
10402 }
10403 else if (((*yyvaluep).node)) {
10404 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10405 }
10406}
10407#line 10408 "parse.c"
10408 break;
10409
10410 case YYSYMBOL_superclass: /* superclass */
10411#line 2612 "parse.y"
10412 {
10413 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10414 rb_parser_printf(p, "NODE_SPECIAL");
10415 }
10416 else if (((*yyvaluep).node)) {
10417 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10418 }
10419}
10420#line 10421 "parse.c"
10421 break;
10422
10423 case YYSYMBOL_f_opt_paren_args: /* f_opt_paren_args */
10424#line 2612 "parse.y"
10425 {
10426 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10427 rb_parser_printf(p, "NODE_SPECIAL");
10428 }
10429 else if (((*yyvaluep).node_args)) {
10430 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10431 }
10432}
10433#line 10434 "parse.c"
10434 break;
10435
10436 case YYSYMBOL_f_paren_args: /* f_paren_args */
10437#line 2612 "parse.y"
10438 {
10439 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10440 rb_parser_printf(p, "NODE_SPECIAL");
10441 }
10442 else if (((*yyvaluep).node_args)) {
10443 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10444 }
10445}
10446#line 10447 "parse.c"
10447 break;
10448
10449 case YYSYMBOL_f_arglist: /* f_arglist */
10450#line 2612 "parse.y"
10451 {
10452 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10453 rb_parser_printf(p, "NODE_SPECIAL");
10454 }
10455 else if (((*yyvaluep).node_args)) {
10456 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10457 }
10458}
10459#line 10460 "parse.c"
10460 break;
10461
10462 case YYSYMBOL_f_kwarg_f_kw: /* f_kwarg_f_kw */
10463#line 2612 "parse.y"
10464 {
10465 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
10466 rb_parser_printf(p, "NODE_SPECIAL");
10467 }
10468 else if (((*yyvaluep).node_kw_arg)) {
10469 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
10470 }
10471}
10472#line 10473 "parse.c"
10473 break;
10474
10475 case YYSYMBOL_args_tail: /* args_tail */
10476#line 2612 "parse.y"
10477 {
10478 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10479 rb_parser_printf(p, "NODE_SPECIAL");
10480 }
10481 else if (((*yyvaluep).node_args)) {
10482 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10483 }
10484}
10485#line 10486 "parse.c"
10486 break;
10487
10488 case YYSYMBOL_f_opt_arg_value: /* f_opt_arg_value */
10489#line 2612 "parse.y"
10490 {
10491 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
10492 rb_parser_printf(p, "NODE_SPECIAL");
10493 }
10494 else if (((*yyvaluep).node_opt_arg)) {
10495 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
10496 }
10497}
10498#line 10499 "parse.c"
10499 break;
10500
10501 case YYSYMBOL_f_optarg_arg_value: /* f_optarg_arg_value */
10502#line 2612 "parse.y"
10503 {
10504 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
10505 rb_parser_printf(p, "NODE_SPECIAL");
10506 }
10507 else if (((*yyvaluep).node_opt_arg)) {
10508 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
10509 }
10510}
10511#line 10512 "parse.c"
10512 break;
10513
10514 case YYSYMBOL_opt_args_tail_args_tail: /* opt_args_tail_args_tail */
10515#line 2612 "parse.y"
10516 {
10517 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10518 rb_parser_printf(p, "NODE_SPECIAL");
10519 }
10520 else if (((*yyvaluep).node_args)) {
10521 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10522 }
10523}
10524#line 10525 "parse.c"
10525 break;
10526
10527 case YYSYMBOL_f_args: /* f_args */
10528#line 2612 "parse.y"
10529 {
10530 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
10531 rb_parser_printf(p, "NODE_SPECIAL");
10532 }
10533 else if (((*yyvaluep).node_args)) {
10534 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
10535 }
10536}
10537#line 10538 "parse.c"
10538 break;
10539
10540 case YYSYMBOL_args_forward: /* args_forward */
10541#line 2621 "parse.y"
10542 {
10543 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10544}
10545#line 10546 "parse.c"
10546 break;
10547
10548 case YYSYMBOL_f_bad_arg: /* f_bad_arg */
10549#line 2621 "parse.y"
10550 {
10551 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10552}
10553#line 10554 "parse.c"
10554 break;
10555
10556 case YYSYMBOL_f_norm_arg: /* f_norm_arg */
10557#line 2621 "parse.y"
10558 {
10559 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10560}
10561#line 10562 "parse.c"
10562 break;
10563
10564 case YYSYMBOL_f_arg_asgn: /* f_arg_asgn */
10565#line 2621 "parse.y"
10566 {
10567 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10568}
10569#line 10570 "parse.c"
10570 break;
10571
10572 case YYSYMBOL_f_arg_item: /* f_arg_item */
10573#line 2612 "parse.y"
10574 {
10575 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
10576 rb_parser_printf(p, "NODE_SPECIAL");
10577 }
10578 else if (((*yyvaluep).node_args_aux)) {
10579 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
10580 }
10581}
10582#line 10583 "parse.c"
10583 break;
10584
10585 case YYSYMBOL_f_arg: /* f_arg */
10586#line 2612 "parse.y"
10587 {
10588 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
10589 rb_parser_printf(p, "NODE_SPECIAL");
10590 }
10591 else if (((*yyvaluep).node_args_aux)) {
10592 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
10593 }
10594}
10595#line 10596 "parse.c"
10596 break;
10597
10598 case YYSYMBOL_f_label: /* f_label */
10599#line 2621 "parse.y"
10600 {
10601 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10602}
10603#line 10604 "parse.c"
10604 break;
10605
10606 case YYSYMBOL_f_kw: /* f_kw */
10607#line 2612 "parse.y"
10608 {
10609 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
10610 rb_parser_printf(p, "NODE_SPECIAL");
10611 }
10612 else if (((*yyvaluep).node_kw_arg)) {
10613 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
10614 }
10615}
10616#line 10617 "parse.c"
10617 break;
10618
10619 case YYSYMBOL_f_block_kw: /* f_block_kw */
10620#line 2612 "parse.y"
10621 {
10622 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
10623 rb_parser_printf(p, "NODE_SPECIAL");
10624 }
10625 else if (((*yyvaluep).node_kw_arg)) {
10626 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
10627 }
10628}
10629#line 10630 "parse.c"
10630 break;
10631
10632 case YYSYMBOL_f_no_kwarg: /* f_no_kwarg */
10633#line 2621 "parse.y"
10634 {
10635 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10636}
10637#line 10638 "parse.c"
10638 break;
10639
10640 case YYSYMBOL_f_kwrest: /* f_kwrest */
10641#line 2621 "parse.y"
10642 {
10643 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10644}
10645#line 10646 "parse.c"
10646 break;
10647
10648 case YYSYMBOL_f_rest_arg: /* f_rest_arg */
10649#line 2621 "parse.y"
10650 {
10651 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10652}
10653#line 10654 "parse.c"
10654 break;
10655
10656 case YYSYMBOL_f_block_arg: /* f_block_arg */
10657#line 2621 "parse.y"
10658 {
10659 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10660}
10661#line 10662 "parse.c"
10662 break;
10663
10664 case YYSYMBOL_opt_f_block_arg: /* opt_f_block_arg */
10665#line 2621 "parse.y"
10666 {
10667 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10668}
10669#line 10670 "parse.c"
10670 break;
10671
10672 case YYSYMBOL_singleton: /* singleton */
10673#line 2612 "parse.y"
10674 {
10675 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10676 rb_parser_printf(p, "NODE_SPECIAL");
10677 }
10678 else if (((*yyvaluep).node)) {
10679 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10680 }
10681}
10682#line 10683 "parse.c"
10683 break;
10684
10685 case YYSYMBOL_assoc_list: /* assoc_list */
10686#line 2612 "parse.y"
10687 {
10688 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10689 rb_parser_printf(p, "NODE_SPECIAL");
10690 }
10691 else if (((*yyvaluep).node)) {
10692 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10693 }
10694}
10695#line 10696 "parse.c"
10696 break;
10697
10698 case YYSYMBOL_assocs: /* assocs */
10699#line 2612 "parse.y"
10700 {
10701 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10702 rb_parser_printf(p, "NODE_SPECIAL");
10703 }
10704 else if (((*yyvaluep).node)) {
10705 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10706 }
10707}
10708#line 10709 "parse.c"
10709 break;
10710
10711 case YYSYMBOL_assoc: /* assoc */
10712#line 2612 "parse.y"
10713 {
10714 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10715 rb_parser_printf(p, "NODE_SPECIAL");
10716 }
10717 else if (((*yyvaluep).node)) {
10718 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10719 }
10720}
10721#line 10722 "parse.c"
10722 break;
10723
10724 case YYSYMBOL_operation: /* operation */
10725#line 2621 "parse.y"
10726 {
10727 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10728}
10729#line 10730 "parse.c"
10730 break;
10731
10732 case YYSYMBOL_operation2: /* operation2 */
10733#line 2621 "parse.y"
10734 {
10735 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10736}
10737#line 10738 "parse.c"
10738 break;
10739
10740 case YYSYMBOL_operation3: /* operation3 */
10741#line 2621 "parse.y"
10742 {
10743 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10744}
10745#line 10746 "parse.c"
10746 break;
10747
10748 case YYSYMBOL_dot_or_colon: /* dot_or_colon */
10749#line 2621 "parse.y"
10750 {
10751 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10752}
10753#line 10754 "parse.c"
10754 break;
10755
10756 case YYSYMBOL_call_op: /* call_op */
10757#line 2621 "parse.y"
10758 {
10759 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10760}
10761#line 10762 "parse.c"
10762 break;
10763
10764 case YYSYMBOL_call_op2: /* call_op2 */
10765#line 2621 "parse.y"
10766 {
10767 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
10768}
10769#line 10770 "parse.c"
10770 break;
10771
10772 case YYSYMBOL_none: /* none */
10773#line 2612 "parse.y"
10774 {
10775 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
10776 rb_parser_printf(p, "NODE_SPECIAL");
10777 }
10778 else if (((*yyvaluep).node)) {
10779 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
10780 }
10781}
10782#line 10783 "parse.c"
10783 break;
10784
10785 default:
10786 break;
10787 }
10788 YY_IGNORE_MAYBE_UNINITIALIZED_END
10789}
10790
10791
10792/*---------------------------.
10793| Print this symbol on YYO. |
10794`---------------------------*/
10795
10796static void
10797yy_symbol_print (FILE *yyo,
10798 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
10799{
10800 YYFPRINTF (yyo, "%s %s (",
10801 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
10802
10803 YYLOCATION_PRINT (yyo, yylocationp, p);
10804 YYFPRINTF (yyo, ": ");
10805 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
10806 YYFPRINTF (yyo, ")");
10807}
10808
10809/*------------------------------------------------------------------.
10810| yy_stack_print -- Print the state stack from its BOTTOM up to its |
10811| TOP (included). |
10812`------------------------------------------------------------------*/
10813
10814static void
10815yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
10816{
10817 YYFPRINTF (stderr, "Stack now");
10818 for (; yybottom <= yytop; yybottom++)
10819 {
10820 int yybot = *yybottom;
10821 YYFPRINTF (stderr, " %d", yybot);
10822 }
10823 YYFPRINTF (stderr, "\n");
10824}
10825
10826# define YY_STACK_PRINT(Bottom, Top, p) \
10827do { \
10828 if (yydebug) \
10829 yy_stack_print ((Bottom), (Top), p); \
10830} while (0)
10831
10832
10833/*------------------------------------------------.
10834| Report that the YYRULE is going to be reduced. |
10835`------------------------------------------------*/
10836
10837static void
10838yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
10839 int yyrule, struct parser_params *p)
10840{
10841 int yylno = yyrline[yyrule];
10842 int yynrhs = yyr2[yyrule];
10843 int yyi;
10844 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
10845 yyrule - 1, yylno);
10846 /* The symbols being reduced. */
10847 for (yyi = 0; yyi < yynrhs; yyi++)
10848 {
10849 YYFPRINTF (stderr, " $%d = ", yyi + 1);
10850 yy_symbol_print (stderr,
10851 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
10852 &yyvsp[(yyi + 1) - (yynrhs)],
10853 &(yylsp[(yyi + 1) - (yynrhs)]), p);
10854 YYFPRINTF (stderr, "\n");
10855 }
10856}
10857
10858# define YY_REDUCE_PRINT(Rule, p) \
10859do { \
10860 if (yydebug) \
10861 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
10862} while (0)
10863
10864/* Nonzero means print parse trace. It is left uninitialized so that
10865 multiple parsers can coexist. */
10866#ifndef yydebug
10867int yydebug;
10868#endif
10869#else /* !YYDEBUG */
10870# define YYDPRINTF(Args) ((void) 0)
10871# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p)
10872# define YY_STACK_PRINT(Bottom, Top, p)
10873# define YY_REDUCE_PRINT(Rule, p)
10874#endif /* !YYDEBUG */
10875
10876
10877/* YYINITDEPTH -- initial size of the parser's stacks. */
10878#ifndef YYINITDEPTH
10879# define YYINITDEPTH 200
10880#endif
10881
10882/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
10883 if the built-in stack extension method is used).
10884
10885 Do not make this value too large; the results are undefined if
10886 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
10887 evaluated with infinite-precision integer arithmetic. */
10888
10889#ifndef YYMAXDEPTH
10890# define YYMAXDEPTH 10000
10891#endif
10892
10893
10894/* Context of a parse error. */
10895typedef struct
10896{
10897 yy_state_t *yyssp;
10898 yysymbol_kind_t yytoken;
10899 YYLTYPE *yylloc;
10900} yypcontext_t;
10901
10902/* Put in YYARG at most YYARGN of the expected tokens given the
10903 current YYCTX, and return the number of tokens stored in YYARG. If
10904 YYARG is null, return the number of expected tokens (guaranteed to
10905 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
10906 Return 0 if there are more than YYARGN expected tokens, yet fill
10907 YYARG up to YYARGN. */
10908static int
10909yypcontext_expected_tokens (const yypcontext_t *yyctx,
10910 yysymbol_kind_t yyarg[], int yyargn)
10911{
10912 /* Actual size of YYARG. */
10913 int yycount = 0;
10914 int yyn = yypact[+*yyctx->yyssp];
10915 if (!yypact_value_is_default (yyn))
10916 {
10917 /* Start YYX at -YYN if negative to avoid negative indexes in
10918 YYCHECK. In other words, skip the first -YYN actions for
10919 this state because they are default actions. */
10920 int yyxbegin = yyn < 0 ? -yyn : 0;
10921 /* Stay within bounds of both yycheck and yytname. */
10922 int yychecklim = YYLAST - yyn + 1;
10923 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
10924 int yyx;
10925 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
10926 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
10927 && !yytable_value_is_error (yytable[yyx + yyn]))
10928 {
10929 if (!yyarg)
10930 ++yycount;
10931 else if (yycount == yyargn)
10932 return 0;
10933 else
10934 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
10935 }
10936 }
10937 if (yyarg && yycount == 0 && 0 < yyargn)
10938 yyarg[0] = YYSYMBOL_YYEMPTY;
10939 return yycount;
10940}
10941
10942
10943
10944
10945#ifndef yystrlen
10946# if defined __GLIBC__ && defined _STRING_H
10947# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
10948# else
10949/* Return the length of YYSTR. */
10950static YYPTRDIFF_T
10951yystrlen (const char *yystr)
10952{
10953 YYPTRDIFF_T yylen;
10954 for (yylen = 0; yystr[yylen]; yylen++)
10955 continue;
10956 return yylen;
10957}
10958# endif
10959#endif
10960
10961#ifndef yystpcpy
10962# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
10963# define yystpcpy stpcpy
10964# else
10965/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
10966 YYDEST. */
10967static char *
10968yystpcpy (char *yydest, const char *yysrc)
10969{
10970 char *yyd = yydest;
10971 const char *yys = yysrc;
10972
10973 while ((*yyd++ = *yys++) != '\0')
10974 continue;
10975
10976 return yyd - 1;
10977}
10978# endif
10979#endif
10980
10981#ifndef yytnamerr
10982/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
10983 quotes and backslashes, so that it's suitable for yyerror. The
10984 heuristic is that double-quoting is unnecessary unless the string
10985 contains an apostrophe, a comma, or backslash (other than
10986 backslash-backslash). YYSTR is taken from yytname. If YYRES is
10987 null, do not copy; instead, return the length of what the result
10988 would have been. */
10989static YYPTRDIFF_T
10990yytnamerr (char *yyres, const char *yystr)
10991{
10992 if (*yystr == '"')
10993 {
10994 YYPTRDIFF_T yyn = 0;
10995 char const *yyp = yystr;
10996 for (;;)
10997 switch (*++yyp)
10998 {
10999 case '\'':
11000 case ',':
11001 goto do_not_strip_quotes;
11002
11003 case '\\':
11004 if (*++yyp != '\\')
11005 goto do_not_strip_quotes;
11006 else
11007 goto append;
11008
11009 append:
11010 default:
11011 if (yyres)
11012 yyres[yyn] = *yyp;
11013 yyn++;
11014 break;
11015
11016 case '"':
11017 if (yyres)
11018 yyres[yyn] = '\0';
11019 return yyn;
11020 }
11021 do_not_strip_quotes: ;
11022 }
11023
11024 if (yyres)
11025 return yystpcpy (yyres, yystr) - yyres;
11026 else
11027 return yystrlen (yystr);
11028}
11029#endif
11030
11031
11032static int
11033yy_syntax_error_arguments (const yypcontext_t *yyctx,
11034 yysymbol_kind_t yyarg[], int yyargn)
11035{
11036 /* Actual size of YYARG. */
11037 int yycount = 0;
11038 /* There are many possibilities here to consider:
11039 - If this state is a consistent state with a default action, then
11040 the only way this function was invoked is if the default action
11041 is an error action. In that case, don't check for expected
11042 tokens because there are none.
11043 - The only way there can be no lookahead present (in yychar) is if
11044 this state is a consistent state with a default action. Thus,
11045 detecting the absence of a lookahead is sufficient to determine
11046 that there is no unexpected or expected token to report. In that
11047 case, just report a simple "syntax error".
11048 - Don't assume there isn't a lookahead just because this state is a
11049 consistent state with a default action. There might have been a
11050 previous inconsistent state, consistent state with a non-default
11051 action, or user semantic action that manipulated yychar.
11052 - Of course, the expected token list depends on states to have
11053 correct lookahead information, and it depends on the parser not
11054 to perform extra reductions after fetching a lookahead from the
11055 scanner and before detecting a syntax error. Thus, state merging
11056 (from LALR or IELR) and default reductions corrupt the expected
11057 token list. However, the list is correct for canonical LR with
11058 one exception: it will still contain any token that will not be
11059 accepted due to an error action in a later state.
11060 */
11061 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
11062 {
11063 int yyn;
11064 if (yyarg)
11065 yyarg[yycount] = yyctx->yytoken;
11066 ++yycount;
11067 yyn = yypcontext_expected_tokens (yyctx,
11068 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
11069 if (yyn == YYENOMEM)
11070 return YYENOMEM;
11071 else
11072 yycount += yyn;
11073 }
11074 return yycount;
11075}
11076
11077/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
11078 about the unexpected token YYTOKEN for the state stack whose top is
11079 YYSSP.
11080
11081 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
11082 not large enough to hold the message. In that case, also set
11083 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
11084 required number of bytes is too large to store. */
11085static int
11086yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
11087 const yypcontext_t *yyctx, struct parser_params *p)
11088{
11089 enum { YYARGS_MAX = 5 };
11090 /* Internationalized format string. */
11091 const char *yyformat = YY_NULLPTR;
11092 /* Arguments of yyformat: reported tokens (one for the "unexpected",
11093 one per "expected"). */
11094 yysymbol_kind_t yyarg[YYARGS_MAX];
11095 /* Cumulated lengths of YYARG. */
11096 YYPTRDIFF_T yysize = 0;
11097
11098 /* Actual size of YYARG. */
11099 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
11100 if (yycount == YYENOMEM)
11101 return YYENOMEM;
11102
11103 switch (yycount)
11104 {
11105#define YYCASE_(N, S) \
11106 case N: \
11107 yyformat = S; \
11108 break
11109 default: /* Avoid compiler warnings. */
11110 YYCASE_(0, YY_("syntax error"));
11111 YYCASE_(1, YY_("syntax error, unexpected %s"));
11112 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
11113 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
11114 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
11115 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
11116#undef YYCASE_
11117 }
11118
11119 /* Compute error message size. Don't count the "%s"s, but reserve
11120 room for the terminator. */
11121 yysize = yystrlen (yyformat) - 2 * yycount + 1;
11122 {
11123 int yyi;
11124 for (yyi = 0; yyi < yycount; ++yyi)
11125 {
11126 YYPTRDIFF_T yysize1
11127 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
11128 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
11129 yysize = yysize1;
11130 else
11131 return YYENOMEM;
11132 }
11133 }
11134
11135 if (*yymsg_alloc < yysize)
11136 {
11137 *yymsg_alloc = 2 * yysize;
11138 if (! (yysize <= *yymsg_alloc
11139 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
11140 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
11141 return -1;
11142 }
11143
11144 /* Avoid sprintf, as that infringes on the user's name space.
11145 Don't have undefined behavior even if the translation
11146 produced a string with the wrong number of "%s"s. */
11147 {
11148 char *yyp = *yymsg;
11149 int yyi = 0;
11150 while ((*yyp = *yyformat) != '\0')
11151 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
11152 {
11153 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
11154 yyformat += 2;
11155 }
11156 else
11157 {
11158 ++yyp;
11159 ++yyformat;
11160 }
11161 }
11162 return 0;
11163}
11164
11165
11166/*-----------------------------------------------.
11167| Release the memory associated to this symbol. |
11168`-----------------------------------------------*/
11169
11170static void
11171yydestruct (const char *yymsg,
11172 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
11173{
11174 YY_USE (yyvaluep);
11175 YY_USE (yylocationp);
11176 YY_USE (p);
11177 if (!yymsg)
11178 yymsg = "Deleting";
11179 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp, p);
11180
11181 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
11182 switch (yykind)
11183 {
11184 case YYSYMBOL_245_16: /* @16 */
11185#line 2649 "parse.y"
11186 {
11187 if (CASE_LABELS_ENABLED_P(((*yyvaluep).labels))) st_free_table(((*yyvaluep).labels));
11188}
11189#line 11190 "parse.c"
11190 break;
11191
11192 case YYSYMBOL_246_17: /* @17 */
11193#line 2649 "parse.y"
11194 {
11195 if (CASE_LABELS_ENABLED_P(((*yyvaluep).labels))) st_free_table(((*yyvaluep).labels));
11196}
11197#line 11198 "parse.c"
11198 break;
11199
11200 default:
11201 break;
11202 }
11203 YY_IGNORE_MAYBE_UNINITIALIZED_END
11204}
11205
11206
11207
11208
11209
11210
11211/*----------.
11212| yyparse. |
11213`----------*/
11214
11215int
11216yyparse (struct parser_params *p)
11217{
11218/* Lookahead token kind. */
11219int yychar;
11220
11221
11222/* The semantic value of the lookahead symbol. */
11223/* Default value used for initialization, for pacifying older GCCs
11224 or non-GCC compilers. */
11225#ifdef __cplusplus
11226static const YYSTYPE yyval_default = {};
11227(void) yyval_default;
11228#else
11229YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)
11230#endif
11231YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
11232
11233/* Location data for the lookahead symbol. */
11234static const YYLTYPE yyloc_default
11235# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
11236 = { 1, 1, 1, 1 }
11237# endif
11238;
11239YYLTYPE yylloc = yyloc_default;
11240
11241 /* Number of syntax errors so far. */
11242 int yynerrs = 0;
11243 YY_USE (yynerrs); /* Silence compiler warning. */
11244
11245 yy_state_fast_t yystate = 0;
11246 /* Number of tokens to shift before error messages enabled. */
11247 int yyerrstatus = 0;
11248
11249 /* Refer to the stacks through separate pointers, to allow yyoverflow
11250 to reallocate them elsewhere. */
11251
11252 /* Their size. */
11253 YYPTRDIFF_T yystacksize = YYINITDEPTH;
11254
11255 /* The state stack: array, bottom, top. */
11256 yy_state_t yyssa[YYINITDEPTH];
11257 yy_state_t *yyss = yyssa;
11258 yy_state_t *yyssp = yyss;
11259
11260 /* The semantic value stack: array, bottom, top. */
11261 YYSTYPE yyvsa[YYINITDEPTH];
11262 YYSTYPE *yyvs = yyvsa;
11263 YYSTYPE *yyvsp = yyvs;
11264
11265 /* The location stack: array, bottom, top. */
11266 YYLTYPE yylsa[YYINITDEPTH];
11267 YYLTYPE *yyls = yylsa;
11268 YYLTYPE *yylsp = yyls;
11269
11270 int yyn;
11271 /* The return value of yyparse. */
11272 int yyresult;
11273 /* Lookahead symbol kind. */
11274 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
11275 /* The variables used to return semantic value and location from the
11276 action routines. */
11277 YYSTYPE yyval;
11278 YYLTYPE yyloc;
11279
11280 /* The locations where the error started and ended. */
11281 YYLTYPE yyerror_range[3];
11282
11283 /* Buffer for error messages, and its allocated size. */
11284 char yymsgbuf[128];
11285 char *yymsg = yymsgbuf;
11286 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
11287
11288#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
11289
11290 /* The number of symbols on the RHS of the reduced rule.
11291 Keep to zero when no symbol should be popped. */
11292 int yylen = 0;
11293
11294 YYDPRINTF ((stderr, "Starting parse\n"));
11295
11296 yychar = YYEMPTY; /* Cause a token to be read. */
11297
11298
11299 /* User initialization code. */
11300#line 2656 "parse.y"
11301 {
11302 RUBY_SET_YYLLOC_OF_NONE(yylloc);
11303}
11304
11305#line 11306 "parse.c"
11306
11307 yylsp[0] = yylloc;
11308 goto yysetstate;
11309
11310
11311/*------------------------------------------------------------.
11312| yynewstate -- push a new state, which is found in yystate. |
11313`------------------------------------------------------------*/
11314yynewstate:
11315 /* In all cases, when you get here, the value and location stacks
11316 have just been pushed. So pushing a state here evens the stacks. */
11317 yyssp++;
11318
11319
11320/*--------------------------------------------------------------------.
11321| yysetstate -- set current state (the top of the stack) to yystate. |
11322`--------------------------------------------------------------------*/
11323yysetstate:
11324 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
11325 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
11326 YY_IGNORE_USELESS_CAST_BEGIN
11327 *yyssp = YY_CAST (yy_state_t, yystate);
11328 YY_IGNORE_USELESS_CAST_END
11329 YY_STACK_PRINT (yyss, yyssp, p);
11330
11331 if (yyss + yystacksize - 1 <= yyssp)
11332#if !defined yyoverflow && !defined YYSTACK_RELOCATE
11333 YYNOMEM;
11334#else
11335 {
11336 /* Get the current used size of the three stacks, in elements. */
11337 YYPTRDIFF_T yysize = yyssp - yyss + 1;
11338
11339# if defined yyoverflow
11340 {
11341 /* Give user a chance to reallocate the stack. Use copies of
11342 these so that the &'s don't force the real ones into
11343 memory. */
11344 yy_state_t *yyss1 = yyss;
11345 YYSTYPE *yyvs1 = yyvs;
11346 YYLTYPE *yyls1 = yyls;
11347
11348 /* Each stack pointer address is followed by the size of the
11349 data in use in that stack, in bytes. This used to be a
11350 conditional around just the two extra args, but that might
11351 be undefined if yyoverflow is a macro. */
11352 yyoverflow (YY_("memory exhausted"),
11353 &yyss1, yysize * YYSIZEOF (*yyssp),
11354 &yyvs1, yysize * YYSIZEOF (*yyvsp),
11355 &yyls1, yysize * YYSIZEOF (*yylsp),
11356 &yystacksize);
11357 yyss = yyss1;
11358 yyvs = yyvs1;
11359 yyls = yyls1;
11360 }
11361# else /* defined YYSTACK_RELOCATE */
11362 /* Extend the stack our own way. */
11363 if (YYMAXDEPTH <= yystacksize)
11364 YYNOMEM;
11365 yystacksize *= 2;
11366 if (YYMAXDEPTH < yystacksize)
11367 yystacksize = YYMAXDEPTH;
11368
11369 {
11370 yy_state_t *yyss1 = yyss;
11371 union yyalloc *yyptr =
11372 YY_CAST (union yyalloc *,
11373 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
11374 if (! yyptr)
11375 YYNOMEM;
11376 YYSTACK_RELOCATE (yyss_alloc, yyss);
11377 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
11378 YYSTACK_RELOCATE (yyls_alloc, yyls);
11379# undef YYSTACK_RELOCATE
11380 if (yyss1 != yyssa)
11381 YYSTACK_FREE (yyss1);
11382 }
11383# endif
11384
11385 yyssp = yyss + yysize - 1;
11386 yyvsp = yyvs + yysize - 1;
11387 yylsp = yyls + yysize - 1;
11388
11389 YY_IGNORE_USELESS_CAST_BEGIN
11390 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
11391 YY_CAST (long, yystacksize)));
11392 YY_IGNORE_USELESS_CAST_END
11393
11394 if (yyss + yystacksize - 1 <= yyssp)
11395 YYABORT;
11396 }
11397#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
11398
11399
11400 if (yystate == YYFINAL)
11401 YYACCEPT;
11402
11403 goto yybackup;
11404
11405
11406/*-----------.
11407| yybackup. |
11408`-----------*/
11409yybackup:
11410 /* Do appropriate processing given the current state. Read a
11411 lookahead token if we need one and don't already have one. */
11412
11413 /* First try to decide what to do without reference to lookahead token. */
11414 yyn = yypact[yystate];
11415 if (yypact_value_is_default (yyn))
11416 goto yydefault;
11417
11418 /* Not known => get a lookahead token if don't already have one. */
11419
11420 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
11421 if (yychar == YYEMPTY)
11422 {
11423 YYDPRINTF ((stderr, "Reading a token\n"));
11424 yychar = yylex (&yylval, &yylloc, p);
11425 }
11426
11427 if (yychar <= END_OF_INPUT)
11428 {
11429 yychar = END_OF_INPUT;
11430 yytoken = YYSYMBOL_YYEOF;
11431 YYDPRINTF ((stderr, "Now at end of input.\n"));
11432 }
11433 else if (yychar == YYerror)
11434 {
11435 /* The scanner already issued an error message, process directly
11436 to error recovery. But do not keep the error token as
11437 lookahead, it is too special and may lead us to an endless
11438 loop in error recovery. */
11439 yychar = YYUNDEF;
11440 yytoken = YYSYMBOL_YYerror;
11441 yyerror_range[1] = yylloc;
11442 goto yyerrlab1;
11443 }
11444 else
11445 {
11446 yytoken = YYTRANSLATE (yychar);
11447 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc, p);
11448 }
11449
11450 /* If the proper action on seeing token YYTOKEN is to reduce or to
11451 detect an error, take that action. */
11452 yyn += yytoken;
11453 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
11454 goto yydefault;
11455 yyn = yytable[yyn];
11456 if (yyn <= 0)
11457 {
11458 if (yytable_value_is_error (yyn))
11459 goto yyerrlab;
11460 yyn = -yyn;
11461 goto yyreduce;
11462 }
11463
11464 /* Count tokens shifted since error; after three, turn off error
11465 status. */
11466 if (yyerrstatus)
11467 yyerrstatus--;
11468
11469 /* Shift the lookahead token. */
11470 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc, p);
11471 yystate = yyn;
11472 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
11473 *++yyvsp = yylval;
11474 YY_IGNORE_MAYBE_UNINITIALIZED_END
11475 *++yylsp = yylloc;
11476 /* %after-shift code. */
11477#line 2659 "parse.y"
11478 {after_shift(p);}
11479#line 11480 "parse.c"
11480
11481
11482 /* Discard the shifted token. */
11483 yychar = YYEMPTY;
11484 goto yynewstate;
11485
11486
11487/*-----------------------------------------------------------.
11488| yydefault -- do the default action for the current state. |
11489`-----------------------------------------------------------*/
11490yydefault:
11491 yyn = yydefact[yystate];
11492 if (yyn == 0)
11493 goto yyerrlab;
11494 goto yyreduce;
11495
11496
11497/*-----------------------------.
11498| yyreduce -- do a reduction. |
11499`-----------------------------*/
11500yyreduce:
11501 /* yyn is the number of a rule to reduce with. */
11502 yylen = yyr2[yyn];
11503
11504 /* If YYLEN is nonzero, implement the default value of the action:
11505 '$$ = $1'.
11506
11507 Otherwise, the following line sets YYVAL to garbage.
11508 This behavior is undocumented and Bison
11509 users should not rely upon it. Assigning to YYVAL
11510 unconditionally makes the parser a bit smaller, and it avoids a
11511 GCC warning that YYVAL may be used uninitialized. */
11512 yyval = yyvsp[1-yylen];
11513 /* %before-reduce function. */
11514#line 2660 "parse.y"
11515 {before_reduce(yylen, p);}
11516#line 11517 "parse.c"
11517
11518
11519 /* Default location. */
11520 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
11521 yyerror_range[1] = yyloc;
11522 YY_REDUCE_PRINT (yyn, p);
11523 switch (yyn)
11524 {
11525 case 2: /* $@1: %empty */
11526#line 2968 "parse.y"
11527 {
11528 SET_LEX_STATE(EXPR_BEG);
11529 local_push(p, ifndef_ripper(1)+0);
11530 /* jumps are possible in the top-level loop. */
11531 if (!ifndef_ripper(p->do_loop) + 0) init_block_exit(p);
11532 }
11533#line 11534 "parse.c"
11534 break;
11535
11536 case 3: /* program: $@1 top_compstmt */
11537#line 2975 "parse.y"
11538 {
11539 if ((yyvsp[0].node) && !compile_for_eval) {
11540 NODE *node = (yyvsp[0].node);
11541 /* last expression should not be void */
11542 if (nd_type_p(node, NODE_BLOCK)) {
11543 while (RNODE_BLOCK(node)->nd_next) {
11544 node = RNODE_BLOCK(node)->nd_next;
11545 }
11546 node = RNODE_BLOCK(node)->nd_head;
11547 }
11548 node = remove_begin(node);
11549 void_expr(p, node);
11550 }
11551 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
11552 /*% ripper[final]: program!($:2) %*/
11553 local_pop(p);
11554 }
11555#line 11556 "parse.c"
11556 break;
11557
11558 case 6: /* top_compstmt: top_stmts option_terms */
11559#line 2995 "parse.y"
11560 {
11561 void_stmts(p, (yyval.node) = (yyvsp[-1].node));
11562 }
11563#line 11564 "parse.c"
11564 break;
11565
11566 case 7: /* top_stmts: none */
11567#line 3001 "parse.y"
11568 {
11569 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11570 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
11571 }
11572#line 11573 "parse.c"
11573 break;
11574
11575 case 8: /* top_stmts: top_stmt */
11576#line 3006 "parse.y"
11577 {
11578 (yyval.node) = newline_node((yyvsp[0].node));
11579 /*% ripper: stmts_add!(stmts_new!, $:1) %*/
11580 }
11581#line 11582 "parse.c"
11582 break;
11583
11584 case 9: /* top_stmts: top_stmts terms top_stmt */
11585#line 3011 "parse.y"
11586 {
11587 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
11588 /*% ripper: stmts_add!($:1, $:3) %*/
11589 }
11590#line 11591 "parse.c"
11591 break;
11592
11593 case 10: /* top_stmt: stmt */
11594#line 3018 "parse.y"
11595 {
11596 clear_block_exit(p, true);
11597 (yyval.node) = (yyvsp[0].node);
11598 }
11599#line 11600 "parse.c"
11600 break;
11601
11602 case 11: /* top_stmt: "'BEGIN'" begin_block */
11603#line 3023 "parse.y"
11604 {
11605 (yyval.node) = (yyvsp[0].node);
11606 /*% ripper: $:2 %*/
11607 }
11608#line 11609 "parse.c"
11609 break;
11610
11611 case 12: /* block_open: '{' */
11612#line 3029 "parse.y"
11613 {(yyval.node_exits) = init_block_exit(p);}
11614#line 11615 "parse.c"
11615 break;
11616
11617 case 13: /* begin_block: block_open top_compstmt '}' */
11618#line 3032 "parse.y"
11619 {
11620 restore_block_exit(p, (yyvsp[-2].node_exits));
11621 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
11622 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
11623 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11624 /*% ripper: BEGIN!($:2) %*/
11625 }
11626#line 11627 "parse.c"
11627 break;
11628
11629 case 14: /* $@2: %empty */
11630#line 3045 "parse.y"
11631 {
11632 if (!(yyvsp[-1].node)) yyerror1(&(yylsp[0]), "else without rescue is useless");
11633 next_rescue_context(&p->ctxt, &(yyvsp[-2].ctxt), after_else);
11634 }
11635#line 11636 "parse.c"
11636 break;
11637
11638 case 15: /* $@3: %empty */
11639#line 3050 "parse.y"
11640 {
11641 next_rescue_context(&p->ctxt, &(yyvsp[-4].ctxt), after_ensure);
11642 }
11643#line 11644 "parse.c"
11644 break;
11645
11646 case 16: /* bodystmt: compstmt lex_ctxt opt_rescue k_else $@2 compstmt $@3 opt_ensure */
11647#line 3054 "parse.y"
11648 {
11649 (yyval.node) = new_bodystmt(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11650 /*% ripper: bodystmt!($:body, $:opt_rescue, $:elsebody, $:opt_ensure) %*/
11651 }
11652#line 11653 "parse.c"
11653 break;
11654
11655 case 17: /* $@4: %empty */
11656#line 3061 "parse.y"
11657 {
11658 next_rescue_context(&p->ctxt, &(yyvsp[-1].ctxt), after_ensure);
11659 }
11660#line 11661 "parse.c"
11661 break;
11662
11663 case 18: /* bodystmt: compstmt lex_ctxt opt_rescue $@4 opt_ensure */
11664#line 3065 "parse.y"
11665 {
11666 (yyval.node) = new_bodystmt(p, (yyvsp[-4].node), (yyvsp[-2].node), 0, (yyvsp[0].node), &(yyloc));
11667 /*% ripper: bodystmt!($:body, $:opt_rescue, Qnil, $:opt_ensure) %*/
11668 }
11669#line 11670 "parse.c"
11670 break;
11671
11672 case 19: /* compstmt: stmts option_terms */
11673#line 3072 "parse.y"
11674 {
11675 void_stmts(p, (yyval.node) = (yyvsp[-1].node));
11676 }
11677#line 11678 "parse.c"
11678 break;
11679
11680 case 20: /* stmts: none */
11681#line 3078 "parse.y"
11682 {
11683 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11684 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
11685 }
11686#line 11687 "parse.c"
11687 break;
11688
11689 case 21: /* stmts: stmt_or_begin */
11690#line 3083 "parse.y"
11691 {
11692 (yyval.node) = newline_node((yyvsp[0].node));
11693 /*% ripper: stmts_add!(stmts_new!, $:1) %*/
11694 }
11695#line 11696 "parse.c"
11696 break;
11697
11698 case 22: /* stmts: stmts terms stmt_or_begin */
11699#line 3088 "parse.y"
11700 {
11701 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
11702 /*% ripper: stmts_add!($:1, $:3) %*/
11703 }
11704#line 11705 "parse.c"
11705 break;
11706
11707 case 23: /* stmt_or_begin: stmt */
11708#line 3095 "parse.y"
11709 {
11710 (yyval.node) = (yyvsp[0].node);
11711 }
11712#line 11713 "parse.c"
11713 break;
11714
11715 case 24: /* $@5: %empty */
11716#line 3099 "parse.y"
11717 {
11718 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
11719 }
11720#line 11721 "parse.c"
11721 break;
11722
11723 case 25: /* stmt_or_begin: "'BEGIN'" $@5 begin_block */
11724#line 3103 "parse.y"
11725 {
11726 (yyval.node) = (yyvsp[0].node);
11727 }
11728#line 11729 "parse.c"
11729 break;
11730
11731 case 26: /* allow_exits: %empty */
11732#line 3108 "parse.y"
11733 {(yyval.node_exits) = allow_block_exit(p);}
11734#line 11735 "parse.c"
11735 break;
11736
11737 case 27: /* k_END: "'END'" lex_ctxt */
11738#line 3111 "parse.y"
11739 {
11740 (yyval.ctxt) = (yyvsp[0].ctxt);
11741 p->ctxt.in_rescue = before_rescue;
11742 /*% ripper: $:2 %*/
11743 }
11744#line 11745 "parse.c"
11745 break;
11746
11747 case 28: /* $@6: %empty */
11748#line 3117 "parse.y"
11749 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
11750#line 11751 "parse.c"
11751 break;
11752
11753 case 29: /* stmt: "'alias'" fitem $@6 fitem */
11754#line 3118 "parse.y"
11755 {
11756 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc), &(yylsp[-3]));
11757 /*% ripper: alias!($:2, $:4) %*/
11758 }
11759#line 11760 "parse.c"
11760 break;
11761
11762 case 30: /* stmt: "'alias'" "global variable" "global variable" */
11763#line 3123 "parse.y"
11764 {
11765 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc), &(yylsp[-2]));
11766 /*% ripper: var_alias!($:2, $:3) %*/
11767 }
11768#line 11769 "parse.c"
11769 break;
11770
11771 case 31: /* stmt: "'alias'" "global variable" "back reference" */
11772#line 3128 "parse.y"
11773 {
11774 char buf[2];
11775 buf[0] = '$';
11776 buf[1] = (char)RNODE_BACK_REF((yyvsp[0].node))->nd_nth;
11777 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc), &(yylsp[-2]));
11778 /*% ripper: var_alias!($:2, $:3) %*/
11779 }
11780#line 11781 "parse.c"
11781 break;
11782
11783 case 32: /* stmt: "'alias'" "global variable" "numbered reference" */
11784#line 3136 "parse.y"
11785 {
11786 static const char mesg[] = "can't make alias for the number variables";
11787 /*%%%*/
11788 yyerror1(&(yylsp[0]), mesg);
11789 /*% %*/
11790 (yyval.node) = NEW_ERROR(&(yyloc));
11791 /*% ripper[error]: alias_error!(ERR_MESG(), $:3) %*/
11792 }
11793#line 11794 "parse.c"
11794 break;
11795
11796 case 33: /* stmt: "'undef'" undef_list */
11797#line 3145 "parse.y"
11798 {
11799 nd_set_first_loc((yyvsp[0].node), (yylsp[-1]).beg_pos);
11800 RNODE_UNDEF((yyvsp[0].node))->keyword_loc = (yylsp[-1]);
11801 (yyval.node) = (yyvsp[0].node);
11802 /*% ripper: undef!($:2) %*/
11803 }
11804#line 11805 "parse.c"
11805 break;
11806
11807 case 34: /* stmt: stmt "'if' modifier" expr_value */
11808#line 3152 "parse.y"
11809 {
11810 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
11811 fixpos((yyval.node), (yyvsp[0].node));
11812 /*% ripper: if_mod!($:3, $:1) %*/
11813 }
11814#line 11815 "parse.c"
11815 break;
11816
11817 case 35: /* stmt: stmt "'unless' modifier" expr_value */
11818#line 3158 "parse.y"
11819 {
11820 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc), &(yylsp[-1]), &NULL_LOC, &NULL_LOC);
11821 fixpos((yyval.node), (yyvsp[0].node));
11822 /*% ripper: unless_mod!($:3, $:1) %*/
11823 }
11824#line 11825 "parse.c"
11825 break;
11826
11827 case 36: /* stmt: stmt "'while' modifier" expr_value */
11828#line 3164 "parse.y"
11829 {
11830 clear_block_exit(p, false);
11831 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
11832 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11833 }
11834 else {
11835 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11836 }
11837 /*% ripper: while_mod!($:3, $:1) %*/
11838 }
11839#line 11840 "parse.c"
11840 break;
11841
11842 case 37: /* stmt: stmt "'until' modifier" expr_value */
11843#line 3175 "parse.y"
11844 {
11845 clear_block_exit(p, false);
11846 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
11847 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11848 }
11849 else {
11850 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc), &(yylsp[-1]), &NULL_LOC);
11851 }
11852 /*% ripper: until_mod!($:3, $:1) %*/
11853 }
11854#line 11855 "parse.c"
11855 break;
11856
11857 case 38: /* stmt: stmt "'rescue' modifier" after_rescue stmt */
11858#line 3186 "parse.y"
11859 {
11860 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
11861 NODE *resq;
11862 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11863 resq = NEW_RESBODY(0, 0, remove_begin((yyvsp[0].node)), 0, &loc);
11864 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-3].node)), resq, 0, &(yyloc));
11865 /*% ripper: rescue_mod!($:1, $:4) %*/
11866 }
11867#line 11868 "parse.c"
11868 break;
11869
11870 case 39: /* stmt: k_END allow_exits '{' compstmt '}' */
11871#line 3195 "parse.y"
11872 {
11873 if (p->ctxt.in_def) {
11874 rb_warn0("END in method; use at_exit");
11875 }
11876 restore_block_exit(p, (yyvsp[-3].node_exits));
11877 p->ctxt = (yyvsp[-4].ctxt);
11878 {
11879 NODE *scope = NEW_SCOPE2(0 /* tbl */, 0 /* args */, (yyvsp[-1].node) /* body */, &(yyloc));
11880 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
11881 }
11882 /*% ripper: END!($:compstmt) %*/
11883 }
11884#line 11885 "parse.c"
11885 break;
11886
11887 case 41: /* stmt: mlhs '=' lex_ctxt command_call */
11888#line 3209 "parse.y"
11889 {
11890 value_expr((yyvsp[0].node));
11891 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11892 /*% ripper: massign!($:1, $:4) %*/
11893 }
11894#line 11895 "parse.c"
11895 break;
11896
11897 case 42: /* stmt: lhs '=' lex_ctxt mrhs */
11898#line 3215 "parse.y"
11899 {
11900 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11901 /*% ripper: assign!($:1, $:4) %*/
11902 }
11903#line 11904 "parse.c"
11904 break;
11905
11906 case 43: /* stmt: mlhs '=' lex_ctxt mrhs_arg "'rescue' modifier" after_rescue stmt */
11907#line 3221 "parse.y"
11908 {
11909 p->ctxt.in_rescue = (yyvsp[-4].ctxt).in_rescue;
11910 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11911 (yyvsp[0].node) = NEW_RESBODY(0, 0, remove_begin((yyvsp[0].node)), 0, &loc);
11912 loc.beg_pos = (yylsp[-3]).beg_pos;
11913 (yyvsp[-3].node) = NEW_RESCUE((yyvsp[-3].node), (yyvsp[0].node), 0, &loc);
11914 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-6].node_masgn), (yyvsp[-3].node), (yyvsp[-4].ctxt), &(yyloc));
11915 /*% ripper: massign!($:1, rescue_mod!($:4, $:7)) %*/
11916 }
11917#line 11918 "parse.c"
11918 break;
11919
11920 case 44: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
11921#line 3231 "parse.y"
11922 {
11923 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11924 /*% ripper: massign!($:1, $:4) %*/
11925 }
11926#line 11927 "parse.c"
11927 break;
11928
11929 case 46: /* stmt: error */
11930#line 3237 "parse.y"
11931 {
11932 (void)yynerrs;
11933 (yyval.node) = NEW_ERROR(&(yyloc));
11934 }
11935#line 11936 "parse.c"
11936 break;
11937
11938 case 47: /* command_asgn: lhs '=' lex_ctxt command_rhs */
11939#line 3244 "parse.y"
11940 {
11941 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11942 /*% ripper: assign!($:1, $:4) %*/
11943 }
11944#line 11945 "parse.c"
11945 break;
11946
11947 case 48: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
11948#line 3249 "parse.y"
11949 {
11950 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11951 /*% ripper: opassign!($:1, $:2, $:4) %*/
11952 }
11953#line 11954 "parse.c"
11954 break;
11955
11956 case 49: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
11957#line 3254 "parse.y"
11958 {
11959 (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]));
11960 /*% ripper: opassign!(aref_field!($:1, $:3), $:5, $:7) %*/
11961
11962 }
11963#line 11964 "parse.c"
11964 break;
11965
11966 case 50: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
11967#line 3260 "parse.y"
11968 {
11969 (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]));
11970 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
11971 }
11972#line 11973 "parse.c"
11973 break;
11974
11975 case 51: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
11976#line 3260 "parse.y"
11977 {
11978 (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]));
11979 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
11980 }
11981#line 11982 "parse.c"
11982 break;
11983
11984 case 52: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
11985#line 3265 "parse.y"
11986 {
11987 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
11988 (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));
11989 /*% ripper: opassign!(const_path_field!($:1, $:3), $:4, $:6) %*/
11990 }
11991#line 11992 "parse.c"
11992 break;
11993
11994 case 53: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
11995#line 3271 "parse.y"
11996 {
11997 (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]));
11998 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
11999 }
12000#line 12001 "parse.c"
12001 break;
12002
12003 case 54: /* command_asgn: defn_head f_opt_paren_args '=' endless_command */
12004#line 3276 "parse.y"
12005 {
12006 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
12007 restore_defun(p, (yyvsp[-3].node_def_temp));
12008 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12009 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12010 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
12011 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
12012 /*% ripper: def!($:head, $:args, $:$) %*/
12013 local_pop(p);
12014 }
12015#line 12016 "parse.c"
12016 break;
12017
12018 case 55: /* command_asgn: defs_head f_opt_paren_args '=' endless_command */
12019#line 3287 "parse.y"
12020 {
12021 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
12022 restore_defun(p, (yyvsp[-3].node_def_temp));
12023 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12024 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12025 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
12026 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
12027 /*% ripper: defs!(*$:head[0..2], $:args, $:$) %*/
12028 local_pop(p);
12029 }
12030#line 12031 "parse.c"
12031 break;
12032
12033 case 56: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
12034#line 3298 "parse.y"
12035 {
12036 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[-3].node));
12037 (yyval.node) = NEW_ERROR(&(yyloc));
12038 /*% ripper[error]: assign_error!(?e, opassign!(var_field!($:1), $:2, $:4)) %*/
12039 }
12040#line 12041 "parse.c"
12041 break;
12042
12043 case 58: /* endless_command: endless_command "'rescue' modifier" after_rescue arg */
12044#line 3307 "parse.y"
12045 {
12046 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12047 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
12048 /*% ripper: rescue_mod!($:1, $:4) %*/
12049 }
12050#line 12051 "parse.c"
12051 break;
12052
12053 case 61: /* endless_command: "'not'" option_'\n' endless_command */
12054#line 3313 "parse.y"
12055 {
12056 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12057 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
12058 }
12059#line 12060 "parse.c"
12060 break;
12061
12062 case 62: /* command_rhs: command_call */
12063#line 3320 "parse.y"
12064 {
12065 value_expr((yyvsp[0].node));
12066 (yyval.node) = (yyvsp[0].node);
12067 }
12068#line 12069 "parse.c"
12069 break;
12070
12071 case 63: /* command_rhs: command_call "'rescue' modifier" after_rescue stmt */
12072#line 3325 "parse.y"
12073 {
12074 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12075 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
12076 value_expr((yyvsp[-3].node));
12077 (yyval.node) = NEW_RESCUE((yyvsp[-3].node), NEW_RESBODY(0, 0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
12078 /*% ripper: rescue_mod!($:1, $:4) %*/
12079 }
12080#line 12081 "parse.c"
12081 break;
12082
12083 case 66: /* expr: expr "'and'" expr */
12084#line 3337 "parse.y"
12085 {
12086 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12087 /*% ripper: binary!($:1, ID2VAL(idAND), $:3) %*/
12088 }
12089#line 12090 "parse.c"
12090 break;
12091
12092 case 67: /* expr: expr "'or'" expr */
12093#line 3342 "parse.y"
12094 {
12095 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12096 /*% ripper: binary!($:1, ID2VAL(idOR), $:3) %*/
12097 }
12098#line 12099 "parse.c"
12099 break;
12100
12101 case 68: /* expr: "'not'" option_'\n' expr */
12102#line 3347 "parse.y"
12103 {
12104 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12105 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
12106 }
12107#line 12108 "parse.c"
12108 break;
12109
12110 case 69: /* expr: '!' command_call */
12111#line 3352 "parse.y"
12112 {
12113 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
12114 /*% ripper: unary!(ID2VAL('\'!\''), $:2) %*/
12115 }
12116#line 12117 "parse.c"
12117 break;
12118
12119 case 70: /* $@7: %empty */
12120#line 3357 "parse.y"
12121 {
12122 value_expr((yyvsp[-1].node));
12123 }
12124#line 12125 "parse.c"
12125 break;
12126
12127 case 71: /* expr: arg "=>" $@7 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
12128#line 3362 "parse.y"
12129 {
12130 pop_pktbl(p, (yyvsp[-1].tbl));
12131 pop_pvtbl(p, (yyvsp[-2].tbl));
12132 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
12133 (yyval.node) = NEW_CASE3((yyvsp[-6].node), NEW_IN((yyvsp[0].node), 0, 0, &(yylsp[0])), &(yyloc), &NULL_LOC, &NULL_LOC);
12134 /*% ripper: case!($:arg, in!($:body, Qnil, Qnil)) %*/
12135 }
12136#line 12137 "parse.c"
12137 break;
12138
12139 case 72: /* $@8: %empty */
12140#line 3370 "parse.y"
12141 {
12142 value_expr((yyvsp[-1].node));
12143 }
12144#line 12145 "parse.c"
12145 break;
12146
12147 case 73: /* expr: arg "'in'" $@8 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
12148#line 3375 "parse.y"
12149 {
12150 pop_pktbl(p, (yyvsp[-1].tbl));
12151 pop_pvtbl(p, (yyvsp[-2].tbl));
12152 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
12153 (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);
12154 /*% ripper: case!($:arg, in!($:body, Qnil, Qnil)) %*/
12155 }
12156#line 12157 "parse.c"
12157 break;
12158
12159 case 75: /* def_name: fname */
12160#line 3386 "parse.y"
12161 {
12162 ID fname = (yyvsp[0].id);
12163 numparam_name(p, fname);
12164 local_push(p, 0);
12165 p->ctxt.in_def = 1;
12166 p->ctxt.in_rescue = before_rescue;
12167 p->ctxt.cant_return = 0;
12168 (yyval.id) = (yyvsp[0].id);
12169 }
12170#line 12171 "parse.c"
12171 break;
12172
12173 case 76: /* defn_head: k_def def_name */
12174#line 3398 "parse.y"
12175 {
12176 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-1].node_def_temp));
12177 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
12178 (yyval.node_def_temp)->nd_def = NEW_DEFN((yyvsp[0].id), 0, &(yyloc));
12179 /*% ripper: $:def_name %*/
12180 }
12181#line 12182 "parse.c"
12182 break;
12183
12184 case 77: /* $@9: %empty */
12185#line 3407 "parse.y"
12186 {
12187 SET_LEX_STATE(EXPR_FNAME);
12188 }
12189#line 12190 "parse.c"
12190 break;
12191
12192 case 78: /* defs_head: k_def singleton dot_or_colon $@9 def_name */
12193#line 3411 "parse.y"
12194 {
12195 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
12196 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-4].node_def_temp));
12197 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
12198 (yyval.node_def_temp)->nd_def = NEW_DEFS((yyvsp[-3].node), (yyvsp[0].id), 0, &(yyloc));
12199 /*% ripper: [$:singleton, $:dot_or_colon, $:def_name] %*/
12200 }
12201#line 12202 "parse.c"
12202 break;
12203
12204 case 79: /* expr_value: expr */
12205#line 3421 "parse.y"
12206 {
12207 value_expr((yyvsp[0].node));
12208 (yyval.node) = (yyvsp[0].node);
12209 }
12210#line 12211 "parse.c"
12211 break;
12212
12213 case 80: /* expr_value: error */
12214#line 3426 "parse.y"
12215 {
12216 (yyval.node) = NEW_ERROR(&(yyloc));
12217 }
12218#line 12219 "parse.c"
12219 break;
12220
12221 case 81: /* $@10: %empty */
12222#line 3431 "parse.y"
12223 {COND_PUSH(1);}
12224#line 12225 "parse.c"
12225 break;
12226
12227 case 82: /* $@11: %empty */
12228#line 3431 "parse.y"
12229 {COND_POP();}
12230#line 12231 "parse.c"
12231 break;
12232
12233 case 83: /* expr_value_do: $@10 expr_value do $@11 */
12234#line 3432 "parse.y"
12235 {
12236 (yyval.node) = (yyvsp[-2].node);
12237 /*% ripper: $:2 %*/
12238 }
12239#line 12240 "parse.c"
12240 break;
12241
12242 case 87: /* block_command: block_call call_op2 operation2 command_args */
12243#line 3444 "parse.y"
12244 {
12245 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12246 /*% ripper: method_add_arg!(call!($:1, $:2, $:3), $:4) %*/
12247 }
12248#line 12249 "parse.c"
12249 break;
12250
12251 case 88: /* cmd_brace_block: "{ arg" brace_body '}' */
12252#line 3451 "parse.y"
12253 {
12254 (yyval.node) = (yyvsp[-1].node);
12255 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
12256 /*% ripper: $:2 %*/
12257 }
12258#line 12259 "parse.c"
12259 break;
12260
12261 case 89: /* fcall: operation */
12262#line 3459 "parse.y"
12263 {
12264 (yyval.node_fcall) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
12265 /*% ripper: $:1 %*/
12266 }
12267#line 12268 "parse.c"
12268 break;
12269
12270 case 90: /* command: fcall command_args */
12271#line 3466 "parse.y"
12272 {
12273 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
12274 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
12275 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
12276 /*% ripper: command!($:1, $:2) %*/
12277 }
12278#line 12279 "parse.c"
12279 break;
12280
12281 case 91: /* command: fcall command_args cmd_brace_block */
12282#line 3473 "parse.y"
12283 {
12284 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
12285 (yyvsp[-2].node_fcall)->nd_args = (yyvsp[-1].node);
12286 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-2].node_fcall), (yyvsp[0].node), &(yyloc));
12287 fixpos((yyval.node), RNODE((yyvsp[-2].node_fcall)));
12288 nd_set_last_loc((yyvsp[-2].node_fcall), (yylsp[-1]).end_pos);
12289 /*% ripper: method_add_block!(command!($:1, $:2), $:3) %*/
12290 }
12291#line 12292 "parse.c"
12292 break;
12293
12294 case 92: /* command: primary_value call_op operation2 command_args */
12295#line 3482 "parse.y"
12296 {
12297 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), 0, &(yylsp[-1]), &(yyloc));
12298 /*% ripper: command_call!($:1, $:2, $:3, $:4) %*/
12299 }
12300#line 12301 "parse.c"
12301 break;
12302
12303 case 93: /* command: primary_value call_op operation2 command_args cmd_brace_block */
12304#line 3487 "parse.y"
12305 {
12306 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
12307 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, $:4), $:5) %*/
12308 }
12309#line 12310 "parse.c"
12310 break;
12311
12312 case 94: /* command: primary_value "::" operation2 command_args */
12313#line 3492 "parse.y"
12314 {
12315 (yyval.node) = new_command_qcall(p, idCOLON2, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), 0, &(yylsp[-1]), &(yyloc));
12316 /*% ripper: command_call!($:1, $:2, $:3, $:4) %*/
12317 }
12318#line 12319 "parse.c"
12319 break;
12320
12321 case 95: /* command: primary_value "::" operation2 command_args cmd_brace_block */
12322#line 3497 "parse.y"
12323 {
12324 (yyval.node) = new_command_qcall(p, idCOLON2, (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
12325 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, $:4), $:5) %*/
12326 }
12327#line 12328 "parse.c"
12328 break;
12329
12330 case 96: /* command: primary_value "::" "constant" '{' brace_body '}' */
12331#line 3502 "parse.y"
12332 {
12333 set_embraced_location((yyvsp[-1].node), &(yylsp[-2]), &(yylsp[0]));
12334 (yyval.node) = new_command_qcall(p, idCOLON2, (yyvsp[-5].node), (yyvsp[-3].id), 0, (yyvsp[-1].node), &(yylsp[-3]), &(yyloc));
12335 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, Qnil), $:5) %*/
12336 }
12337#line 12338 "parse.c"
12338 break;
12339
12340 case 97: /* command: "'super'" command_args */
12341#line 3508 "parse.y"
12342 {
12343 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
12344 fixpos((yyval.node), (yyvsp[0].node));
12345 /*% ripper: super!($:2) %*/
12346 }
12347#line 12348 "parse.c"
12348 break;
12349
12350 case 98: /* command: k_yield command_args */
12351#line 3514 "parse.y"
12352 {
12353 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
12354 fixpos((yyval.node), (yyvsp[0].node));
12355 /*% ripper: yield!($:2) %*/
12356 }
12357#line 12358 "parse.c"
12358 break;
12359
12360 case 99: /* command: k_return call_args */
12361#line 3520 "parse.y"
12362 {
12363 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc), &(yylsp[-1]));
12364 /*% ripper: return!($:2) %*/
12365 }
12366#line 12367 "parse.c"
12367 break;
12368
12369 case 100: /* command: "'break'" call_args */
12370#line 3525 "parse.y"
12371 {
12372 NODE *args = 0;
12373 args = ret_args(p, (yyvsp[0].node));
12374 (yyval.node) = add_block_exit(p, NEW_BREAK(args, &(yyloc), &(yylsp[-1])));
12375 /*% ripper: break!($:2) %*/
12376 }
12377#line 12378 "parse.c"
12378 break;
12379
12380 case 101: /* command: "'next'" call_args */
12381#line 3532 "parse.y"
12382 {
12383 NODE *args = 0;
12384 args = ret_args(p, (yyvsp[0].node));
12385 (yyval.node) = add_block_exit(p, NEW_NEXT(args, &(yyloc), &(yylsp[-1])));
12386 /*% ripper: next!($:2) %*/
12387 }
12388#line 12389 "parse.c"
12389 break;
12390
12391 case 103: /* mlhs: "(" mlhs_inner rparen */
12392#line 3542 "parse.y"
12393 {
12394 (yyval.node_masgn) = (yyvsp[-1].node_masgn);
12395 /*% ripper: mlhs_paren!($:2) %*/
12396 }
12397#line 12398 "parse.c"
12398 break;
12399
12400 case 105: /* mlhs_inner: "(" mlhs_inner rparen */
12401#line 3550 "parse.y"
12402 {
12403 (yyval.node_masgn) = NEW_MASGN(NEW_LIST((NODE *)(yyvsp[-1].node_masgn), &(yyloc)), 0, &(yyloc));
12404 /*% ripper: mlhs_paren!($:2) %*/
12405 }
12406#line 12407 "parse.c"
12407 break;
12408
12409 case 106: /* mlhs_basic: mlhs_head */
12410#line 3557 "parse.y"
12411 {
12412 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
12413 /*% ripper: $:1 %*/
12414 }
12415#line 12416 "parse.c"
12416 break;
12417
12418 case 107: /* mlhs_basic: mlhs_head mlhs_item */
12419#line 3562 "parse.y"
12420 {
12421 (yyval.node_masgn) = NEW_MASGN(list_append(p, (yyvsp[-1].node), (yyvsp[0].node)), 0, &(yyloc));
12422 /*% ripper: mlhs_add!($:1, $:2) %*/
12423 }
12424#line 12425 "parse.c"
12425 break;
12426
12427 case 108: /* mlhs_basic: mlhs_head "*" mlhs_node */
12428#line 3567 "parse.y"
12429 {
12430 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12431 /*% ripper: mlhs_add_star!($:1, $:3) %*/
12432 }
12433#line 12434 "parse.c"
12434 break;
12435
12436 case 109: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
12437#line 3572 "parse.y"
12438 {
12439 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
12440 /*% ripper: mlhs_add_post!(mlhs_add_star!($:1, $:3), $:5) %*/
12441 }
12442#line 12443 "parse.c"
12443 break;
12444
12445 case 110: /* mlhs_basic: mlhs_head "*" */
12446#line 3577 "parse.y"
12447 {
12448 (yyval.node_masgn) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
12449 /*% ripper: mlhs_add_star!($:1, Qnil) %*/
12450 }
12451#line 12452 "parse.c"
12452 break;
12453
12454 case 111: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
12455#line 3582 "parse.y"
12456 {
12457 (yyval.node_masgn) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
12458 /*% ripper: mlhs_add_post!(mlhs_add_star!($:1, Qnil), $:4) %*/
12459 }
12460#line 12461 "parse.c"
12461 break;
12462
12463 case 112: /* mlhs_basic: "*" mlhs_node */
12464#line 3587 "parse.y"
12465 {
12466 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
12467 /*% ripper: mlhs_add_star!(mlhs_new!, $:2) %*/
12468 }
12469#line 12470 "parse.c"
12470 break;
12471
12472 case 113: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
12473#line 3592 "parse.y"
12474 {
12475 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
12476 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $:2), $:4) %*/
12477 }
12478#line 12479 "parse.c"
12479 break;
12480
12481 case 114: /* mlhs_basic: "*" */
12482#line 3597 "parse.y"
12483 {
12484 (yyval.node_masgn) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
12485 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
12486 }
12487#line 12488 "parse.c"
12488 break;
12489
12490 case 115: /* mlhs_basic: "*" ',' mlhs_post */
12491#line 3602 "parse.y"
12492 {
12493 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
12494 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $:3) %*/
12495 }
12496#line 12497 "parse.c"
12497 break;
12498
12499 case 117: /* mlhs_item: "(" mlhs_inner rparen */
12500#line 3610 "parse.y"
12501 {
12502 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
12503 /*% ripper: mlhs_paren!($:2) %*/
12504 }
12505#line 12506 "parse.c"
12506 break;
12507
12508 case 118: /* mlhs_head: mlhs_item ',' */
12509#line 3617 "parse.y"
12510 {
12511 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
12512 /*% ripper: mlhs_add!(mlhs_new!, $:1) %*/
12513 }
12514#line 12515 "parse.c"
12515 break;
12516
12517 case 119: /* mlhs_head: mlhs_head mlhs_item ',' */
12518#line 3622 "parse.y"
12519 {
12520 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
12521 /*% ripper: mlhs_add!($:1, $:2) %*/
12522 }
12523#line 12524 "parse.c"
12524 break;
12525
12526 case 120: /* mlhs_post: mlhs_item */
12527#line 3629 "parse.y"
12528 {
12529 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12530 /*% ripper: mlhs_add!(mlhs_new!, $:1) %*/
12531 }
12532#line 12533 "parse.c"
12533 break;
12534
12535 case 121: /* mlhs_post: mlhs_post ',' mlhs_item */
12536#line 3634 "parse.y"
12537 {
12538 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
12539 /*% ripper: mlhs_add!($:1, $:3) %*/
12540 }
12541#line 12542 "parse.c"
12542 break;
12543
12544 case 122: /* mlhs_node: user_variable */
12545#line 3641 "parse.y"
12546 {
12547 /*% ripper: var_field!($:1) %*/
12548 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12549 }
12550#line 12551 "parse.c"
12551 break;
12552
12553 case 123: /* mlhs_node: keyword_variable */
12554#line 3641 "parse.y"
12555 {
12556 /*% ripper: var_field!($:1) %*/
12557 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12558 }
12559#line 12560 "parse.c"
12560 break;
12561
12562 case 124: /* mlhs_node: primary_value '[' opt_call_args rbracket */
12563#line 3646 "parse.y"
12564 {
12565 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12566 /*% ripper: aref_field!($:1, $:3) %*/
12567 }
12568#line 12569 "parse.c"
12569 break;
12570
12571 case 125: /* mlhs_node: primary_value call_op "local variable or method" */
12572#line 3651 "parse.y"
12573 {
12574 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
12575 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12576 /*% ripper: field!($:1, $:2, $:3) %*/
12577 }
12578#line 12579 "parse.c"
12579 break;
12580
12581 case 126: /* mlhs_node: primary_value "::" "local variable or method" */
12582#line 3657 "parse.y"
12583 {
12584 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
12585 /*% ripper: const_path_field!($:1, $:3) %*/
12586 }
12587#line 12588 "parse.c"
12588 break;
12589
12590 case 127: /* mlhs_node: primary_value call_op "constant" */
12591#line 3662 "parse.y"
12592 {
12593 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
12594 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12595 /*% ripper: field!($:1, $:2, $:3) %*/
12596 }
12597#line 12598 "parse.c"
12598 break;
12599
12600 case 128: /* mlhs_node: primary_value "::" "constant" */
12601#line 3668 "parse.y"
12602 {
12603 /*% ripper: const_path_field!($:1, $:3) %*/
12604 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
12605 }
12606#line 12607 "parse.c"
12607 break;
12608
12609 case 129: /* mlhs_node: ":: at EXPR_BEG" "constant" */
12610#line 3673 "parse.y"
12611 {
12612 /*% ripper: top_const_field!($:2) %*/
12613 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
12614 }
12615#line 12616 "parse.c"
12616 break;
12617
12618 case 130: /* mlhs_node: backref */
12619#line 3678 "parse.y"
12620 {
12621 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[0].node));
12622 (yyval.node) = NEW_ERROR(&(yyloc));
12623 /*% ripper[error]: assign_error!(?e, var_field!($:1)) %*/
12624 }
12625#line 12626 "parse.c"
12626 break;
12627
12628 case 131: /* lhs: user_variable */
12629#line 3686 "parse.y"
12630 {
12631 /*% ripper: var_field!($:1) %*/
12632 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12633 }
12634#line 12635 "parse.c"
12635 break;
12636
12637 case 132: /* lhs: keyword_variable */
12638#line 3686 "parse.y"
12639 {
12640 /*% ripper: var_field!($:1) %*/
12641 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12642 }
12643#line 12644 "parse.c"
12644 break;
12645
12646 case 133: /* lhs: primary_value '[' opt_call_args rbracket */
12647#line 3691 "parse.y"
12648 {
12649 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12650 /*% ripper: aref_field!($:1, $:3) %*/
12651 }
12652#line 12653 "parse.c"
12653 break;
12654
12655 case 134: /* lhs: primary_value call_op "local variable or method" */
12656#line 3696 "parse.y"
12657 {
12658 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12659 /*% ripper: field!($:1, $:2, $:3) %*/
12660 }
12661#line 12662 "parse.c"
12662 break;
12663
12664 case 135: /* lhs: primary_value "::" "local variable or method" */
12665#line 3701 "parse.y"
12666 {
12667 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
12668 /*% ripper: field!($:1, $:2, $:3) %*/
12669 }
12670#line 12671 "parse.c"
12671 break;
12672
12673 case 136: /* lhs: primary_value call_op "constant" */
12674#line 3706 "parse.y"
12675 {
12676 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
12677 /*% ripper: field!($:1, $:2, $:3) %*/
12678 }
12679#line 12680 "parse.c"
12680 break;
12681
12682 case 137: /* lhs: primary_value "::" "constant" */
12683#line 3711 "parse.y"
12684 {
12685 /*% ripper: const_path_field!($:1, $:3) %*/
12686 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
12687 }
12688#line 12689 "parse.c"
12689 break;
12690
12691 case 138: /* lhs: ":: at EXPR_BEG" "constant" */
12692#line 3716 "parse.y"
12693 {
12694 /*% ripper: top_const_field!($:2) %*/
12695 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
12696 }
12697#line 12698 "parse.c"
12698 break;
12699
12700 case 139: /* lhs: backref */
12701#line 3721 "parse.y"
12702 {
12703 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[0].node));
12704 (yyval.node) = NEW_ERROR(&(yyloc));
12705 /*% ripper[error]: assign_error!(?e, var_field!($:1)) %*/
12706 }
12707#line 12708 "parse.c"
12708 break;
12709
12710 case 140: /* cname: "local variable or method" */
12711#line 3729 "parse.y"
12712 {
12713 static const char mesg[] = "class/module name must be CONSTANT";
12714 /*%%%*/
12715 yyerror1(&(yylsp[0]), mesg);
12716 /*% %*/
12717 /*% ripper[error]: class_name_error!(ERR_MESG(), $:1) %*/
12718 }
12719#line 12720 "parse.c"
12720 break;
12721
12722 case 142: /* cpath: ":: at EXPR_BEG" cname */
12723#line 3740 "parse.y"
12724 {
12725 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
12726 /*% ripper: top_const_ref!($:2) %*/
12727 }
12728#line 12729 "parse.c"
12729 break;
12730
12731 case 143: /* cpath: cname */
12732#line 3745 "parse.y"
12733 {
12734 (yyval.node) = NEW_COLON2(0, (yyvsp[0].id), &(yyloc));
12735 /*% ripper: const_ref!($:1) %*/
12736 }
12737#line 12738 "parse.c"
12738 break;
12739
12740 case 144: /* cpath: primary_value "::" cname */
12741#line 3750 "parse.y"
12742 {
12743 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
12744 /*% ripper: const_path_ref!($:1, $:3) %*/
12745 }
12746#line 12747 "parse.c"
12747 break;
12748
12749 case 148: /* fname: op */
12750#line 3759 "parse.y"
12751 {
12752 SET_LEX_STATE(EXPR_ENDFN);
12753 (yyval.id) = (yyvsp[0].id);
12754 }
12755#line 12756 "parse.c"
12756 break;
12757
12758 case 150: /* fitem: fname */
12759#line 3767 "parse.y"
12760 {
12761 (yyval.node) = NEW_SYM(rb_id2str((yyvsp[0].id)), &(yyloc));
12762 /*% ripper: symbol_literal!($:1) %*/
12763 }
12764#line 12765 "parse.c"
12765 break;
12766
12767 case 152: /* undef_list: fitem */
12768#line 3775 "parse.y"
12769 {
12770 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
12771 /*% ripper: rb_ary_new3(1, $:1) %*/
12772 }
12773#line 12774 "parse.c"
12774 break;
12775
12776 case 153: /* $@12: %empty */
12777#line 3779 "parse.y"
12778 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
12779#line 12780 "parse.c"
12780 break;
12781
12782 case 154: /* undef_list: undef_list ',' $@12 fitem */
12783#line 3780 "parse.y"
12784 {
12785 nd_set_last_loc((yyvsp[-3].node), (yylsp[0]).end_pos);
12786 rb_parser_ary_push_node(p, RNODE_UNDEF((yyvsp[-3].node))->nd_undefs, (yyvsp[0].node));
12787 /*% ripper: rb_ary_push($:1, $:4) %*/
12788 }
12789#line 12790 "parse.c"
12790 break;
12791
12792 case 155: /* op: '|' */
12793#line 3787 "parse.y"
12794 { (yyval.id) = '|'; }
12795#line 12796 "parse.c"
12796 break;
12797
12798 case 156: /* op: '^' */
12799#line 3788 "parse.y"
12800 { (yyval.id) = '^'; }
12801#line 12802 "parse.c"
12802 break;
12803
12804 case 157: /* op: '&' */
12805#line 3789 "parse.y"
12806 { (yyval.id) = '&'; }
12807#line 12808 "parse.c"
12808 break;
12809
12810 case 158: /* op: "<=>" */
12811#line 3790 "parse.y"
12812 { (yyval.id) = tCMP; }
12813#line 12814 "parse.c"
12814 break;
12815
12816 case 159: /* op: "==" */
12817#line 3791 "parse.y"
12818 { (yyval.id) = tEQ; }
12819#line 12820 "parse.c"
12820 break;
12821
12822 case 160: /* op: "===" */
12823#line 3792 "parse.y"
12824 { (yyval.id) = tEQQ; }
12825#line 12826 "parse.c"
12826 break;
12827
12828 case 161: /* op: "=~" */
12829#line 3793 "parse.y"
12830 { (yyval.id) = tMATCH; }
12831#line 12832 "parse.c"
12832 break;
12833
12834 case 162: /* op: "!~" */
12835#line 3794 "parse.y"
12836 { (yyval.id) = tNMATCH; }
12837#line 12838 "parse.c"
12838 break;
12839
12840 case 163: /* op: '>' */
12841#line 3795 "parse.y"
12842 { (yyval.id) = '>'; }
12843#line 12844 "parse.c"
12844 break;
12845
12846 case 164: /* op: ">=" */
12847#line 3796 "parse.y"
12848 { (yyval.id) = tGEQ; }
12849#line 12850 "parse.c"
12850 break;
12851
12852 case 165: /* op: '<' */
12853#line 3797 "parse.y"
12854 { (yyval.id) = '<'; }
12855#line 12856 "parse.c"
12856 break;
12857
12858 case 166: /* op: "<=" */
12859#line 3798 "parse.y"
12860 { (yyval.id) = tLEQ; }
12861#line 12862 "parse.c"
12862 break;
12863
12864 case 167: /* op: "!=" */
12865#line 3799 "parse.y"
12866 { (yyval.id) = tNEQ; }
12867#line 12868 "parse.c"
12868 break;
12869
12870 case 168: /* op: "<<" */
12871#line 3800 "parse.y"
12872 { (yyval.id) = tLSHFT; }
12873#line 12874 "parse.c"
12874 break;
12875
12876 case 169: /* op: ">>" */
12877#line 3801 "parse.y"
12878 { (yyval.id) = tRSHFT; }
12879#line 12880 "parse.c"
12880 break;
12881
12882 case 170: /* op: '+' */
12883#line 3802 "parse.y"
12884 { (yyval.id) = '+'; }
12885#line 12886 "parse.c"
12886 break;
12887
12888 case 171: /* op: '-' */
12889#line 3803 "parse.y"
12890 { (yyval.id) = '-'; }
12891#line 12892 "parse.c"
12892 break;
12893
12894 case 172: /* op: '*' */
12895#line 3804 "parse.y"
12896 { (yyval.id) = '*'; }
12897#line 12898 "parse.c"
12898 break;
12899
12900 case 173: /* op: "*" */
12901#line 3805 "parse.y"
12902 { (yyval.id) = '*'; }
12903#line 12904 "parse.c"
12904 break;
12905
12906 case 174: /* op: '/' */
12907#line 3806 "parse.y"
12908 { (yyval.id) = '/'; }
12909#line 12910 "parse.c"
12910 break;
12911
12912 case 175: /* op: '%' */
12913#line 3807 "parse.y"
12914 { (yyval.id) = '%'; }
12915#line 12916 "parse.c"
12916 break;
12917
12918 case 176: /* op: "**" */
12919#line 3808 "parse.y"
12920 { (yyval.id) = tPOW; }
12921#line 12922 "parse.c"
12922 break;
12923
12924 case 177: /* op: "**arg" */
12925#line 3809 "parse.y"
12926 { (yyval.id) = tDSTAR; }
12927#line 12928 "parse.c"
12928 break;
12929
12930 case 178: /* op: '!' */
12931#line 3810 "parse.y"
12932 { (yyval.id) = '!'; }
12933#line 12934 "parse.c"
12934 break;
12935
12936 case 179: /* op: '~' */
12937#line 3811 "parse.y"
12938 { (yyval.id) = '~'; }
12939#line 12940 "parse.c"
12940 break;
12941
12942 case 180: /* op: "unary+" */
12943#line 3812 "parse.y"
12944 { (yyval.id) = tUPLUS; }
12945#line 12946 "parse.c"
12946 break;
12947
12948 case 181: /* op: "unary-" */
12949#line 3813 "parse.y"
12950 { (yyval.id) = tUMINUS; }
12951#line 12952 "parse.c"
12952 break;
12953
12954 case 182: /* op: "[]" */
12955#line 3814 "parse.y"
12956 { (yyval.id) = tAREF; }
12957#line 12958 "parse.c"
12958 break;
12959
12960 case 183: /* op: "[]=" */
12961#line 3815 "parse.y"
12962 { (yyval.id) = tASET; }
12963#line 12964 "parse.c"
12964 break;
12965
12966 case 184: /* op: '`' */
12967#line 3816 "parse.y"
12968 { (yyval.id) = '`'; }
12969#line 12970 "parse.c"
12970 break;
12971
12972 case 226: /* arg: lhs '=' lex_ctxt arg_rhs */
12973#line 3834 "parse.y"
12974 {
12975 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
12976 /*% ripper: assign!($:1, $:4) %*/
12977 }
12978#line 12979 "parse.c"
12979 break;
12980
12981 case 227: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
12982#line 3839 "parse.y"
12983 {
12984 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
12985 /*% ripper: opassign!($:1, $:2, $:4) %*/
12986 }
12987#line 12988 "parse.c"
12988 break;
12989
12990 case 228: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
12991#line 3844 "parse.y"
12992 {
12993 (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]));
12994 /*% ripper: opassign!(aref_field!($:1, $:3), $:5, $:7) %*/
12995 }
12996#line 12997 "parse.c"
12997 break;
12998
12999 case 229: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
13000#line 3849 "parse.y"
13001 {
13002 (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]));
13003 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
13004 }
13005#line 13006 "parse.c"
13006 break;
13007
13008 case 230: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
13009#line 3854 "parse.y"
13010 {
13011 (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]));
13012 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
13013 }
13014#line 13015 "parse.c"
13015 break;
13016
13017 case 231: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
13018#line 3859 "parse.y"
13019 {
13020 (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]));
13021 /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/
13022 }
13023#line 13024 "parse.c"
13024 break;
13025
13026 case 232: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
13027#line 3864 "parse.y"
13028 {
13029 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
13030 (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));
13031 /*% ripper: opassign!(const_path_field!($:1, $:3), $:4, $:6) %*/
13032 }
13033#line 13034 "parse.c"
13034 break;
13035
13036 case 233: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
13037#line 3870 "parse.y"
13038 {
13039 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-3]));
13040 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
13041 /*% ripper: opassign!(top_const_field!($:2), $:3, $:5) %*/
13042 }
13043#line 13044 "parse.c"
13044 break;
13045
13046 case 234: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
13047#line 3876 "parse.y"
13048 {
13049 VALUE MAYBE_UNUSED(e) = rb_backref_error(p, (yyvsp[-3].node));
13050 (yyval.node) = NEW_ERROR(&(yyloc));
13051 /*% ripper[error]: assign_error!(?e, opassign!(var_field!($:1), $:2, $:4)) %*/
13052 }
13053#line 13054 "parse.c"
13054 break;
13055
13056 case 235: /* arg: arg ".." arg */
13057#line 3882 "parse.y"
13058 {
13059 value_expr((yyvsp[-2].node));
13060 value_expr((yyvsp[0].node));
13061 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13062 /*% ripper: dot2!($:1, $:3) %*/
13063 }
13064#line 13065 "parse.c"
13065 break;
13066
13067 case 236: /* arg: arg "..." arg */
13068#line 3889 "parse.y"
13069 {
13070 value_expr((yyvsp[-2].node));
13071 value_expr((yyvsp[0].node));
13072 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13073 /*% ripper: dot3!($:1, $:3) %*/
13074 }
13075#line 13076 "parse.c"
13076 break;
13077
13078 case 237: /* arg: arg ".." */
13079#line 3896 "parse.y"
13080 {
13081 value_expr((yyvsp[-1].node));
13082 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
13083 /*% ripper: dot2!($:1, Qnil) %*/
13084 }
13085#line 13086 "parse.c"
13086 break;
13087
13088 case 238: /* arg: arg "..." */
13089#line 3902 "parse.y"
13090 {
13091 value_expr((yyvsp[-1].node));
13092 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
13093 /*% ripper: dot3!($:1, Qnil) %*/
13094 }
13095#line 13096 "parse.c"
13096 break;
13097
13098 case 239: /* arg: "(.." arg */
13099#line 3908 "parse.y"
13100 {
13101 value_expr((yyvsp[0].node));
13102 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
13103 /*% ripper: dot2!(Qnil, $:2) %*/
13104 }
13105#line 13106 "parse.c"
13106 break;
13107
13108 case 240: /* arg: "(..." arg */
13109#line 3914 "parse.y"
13110 {
13111 value_expr((yyvsp[0].node));
13112 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
13113 /*% ripper: dot3!(Qnil, $:2) %*/
13114 }
13115#line 13116 "parse.c"
13116 break;
13117
13118 case 241: /* arg: arg '+' arg */
13119#line 3920 "parse.y"
13120 {
13121 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13122 /*% ripper: binary!($:1, ID2VAL('\'+\''), $:3) %*/
13123 }
13124#line 13125 "parse.c"
13125 break;
13126
13127 case 242: /* arg: arg '-' arg */
13128#line 3925 "parse.y"
13129 {
13130 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13131 /*% ripper: binary!($:1, ID2VAL('\'-\''), $:3) %*/
13132 }
13133#line 13134 "parse.c"
13134 break;
13135
13136 case 243: /* arg: arg '*' arg */
13137#line 3930 "parse.y"
13138 {
13139 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13140 /*% ripper: binary!($:1, ID2VAL('\'*\''), $:3) %*/
13141 }
13142#line 13143 "parse.c"
13143 break;
13144
13145 case 244: /* arg: arg '/' arg */
13146#line 3935 "parse.y"
13147 {
13148 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13149 /*% ripper: binary!($:1, ID2VAL('\'/\''), $:3) %*/
13150 }
13151#line 13152 "parse.c"
13152 break;
13153
13154 case 245: /* arg: arg '%' arg */
13155#line 3940 "parse.y"
13156 {
13157 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13158 /*% ripper: binary!($:1, ID2VAL('\'%\''), $:3) %*/
13159 }
13160#line 13161 "parse.c"
13161 break;
13162
13163 case 246: /* arg: arg "**" arg */
13164#line 3945 "parse.y"
13165 {
13166 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13167 /*% ripper: binary!($:1, ID2VAL(idPow), $:3) %*/
13168 }
13169#line 13170 "parse.c"
13170 break;
13171
13172 case 247: /* arg: tUMINUS_NUM simple_numeric "**" arg */
13173#line 3950 "parse.y"
13174 {
13175 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
13176 /*% ripper: unary!(ID2VAL(idUMinus), binary!($:2, ID2VAL(idPow), $:4)) %*/
13177 }
13178#line 13179 "parse.c"
13179 break;
13180
13181 case 248: /* arg: "unary+" arg */
13182#line 3955 "parse.y"
13183 {
13184 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
13185 /*% ripper: unary!(ID2VAL(idUPlus), $:2) %*/
13186 }
13187#line 13188 "parse.c"
13188 break;
13189
13190 case 249: /* arg: "unary-" arg */
13191#line 3960 "parse.y"
13192 {
13193 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
13194 /*% ripper: unary!(ID2VAL(idUMinus), $:2) %*/
13195 }
13196#line 13197 "parse.c"
13197 break;
13198
13199 case 250: /* arg: arg '|' arg */
13200#line 3965 "parse.y"
13201 {
13202 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13203 /*% ripper: binary!($:1, ID2VAL('\'|\''), $:3) %*/
13204 }
13205#line 13206 "parse.c"
13206 break;
13207
13208 case 251: /* arg: arg '^' arg */
13209#line 3970 "parse.y"
13210 {
13211 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13212 /*% ripper: binary!($:1, ID2VAL('\'^\''), $:3) %*/
13213 }
13214#line 13215 "parse.c"
13215 break;
13216
13217 case 252: /* arg: arg '&' arg */
13218#line 3975 "parse.y"
13219 {
13220 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13221 /*% ripper: binary!($:1, ID2VAL('\'&\''), $:3) %*/
13222 }
13223#line 13224 "parse.c"
13224 break;
13225
13226 case 253: /* arg: arg "<=>" arg */
13227#line 3980 "parse.y"
13228 {
13229 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13230 /*% ripper: binary!($:1, ID2VAL(idCmp), $:3) %*/
13231 }
13232#line 13233 "parse.c"
13233 break;
13234
13235 case 255: /* arg: arg "==" arg */
13236#line 3986 "parse.y"
13237 {
13238 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13239 /*% ripper: binary!($:1, ID2VAL(idEq), $:3) %*/
13240 }
13241#line 13242 "parse.c"
13242 break;
13243
13244 case 256: /* arg: arg "===" arg */
13245#line 3991 "parse.y"
13246 {
13247 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13248 /*% ripper: binary!($:1, ID2VAL(idEqq), $:3) %*/
13249 }
13250#line 13251 "parse.c"
13251 break;
13252
13253 case 257: /* arg: arg "!=" arg */
13254#line 3996 "parse.y"
13255 {
13256 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13257 /*% ripper: binary!($:1, ID2VAL(idNeq), $:3) %*/
13258 }
13259#line 13260 "parse.c"
13260 break;
13261
13262 case 258: /* arg: arg "=~" arg */
13263#line 4001 "parse.y"
13264 {
13265 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13266 /*% ripper: binary!($:1, ID2VAL(idEqTilde), $:3) %*/
13267 }
13268#line 13269 "parse.c"
13269 break;
13270
13271 case 259: /* arg: arg "!~" arg */
13272#line 4006 "parse.y"
13273 {
13274 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13275 /*% ripper: binary!($:1, ID2VAL(idNeqTilde), $:3) %*/
13276 }
13277#line 13278 "parse.c"
13278 break;
13279
13280 case 260: /* arg: '!' arg */
13281#line 4011 "parse.y"
13282 {
13283 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
13284 /*% ripper: unary!(ID2VAL('\'!\''), $:2) %*/
13285 }
13286#line 13287 "parse.c"
13287 break;
13288
13289 case 261: /* arg: '~' arg */
13290#line 4016 "parse.y"
13291 {
13292 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
13293 /*% ripper: unary!(ID2VAL('\'~\''), $:2) %*/
13294 }
13295#line 13296 "parse.c"
13296 break;
13297
13298 case 262: /* arg: arg "<<" arg */
13299#line 4021 "parse.y"
13300 {
13301 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13302 /*% ripper: binary!($:1, ID2VAL(idLTLT), $:3) %*/
13303 }
13304#line 13305 "parse.c"
13305 break;
13306
13307 case 263: /* arg: arg ">>" arg */
13308#line 4026 "parse.y"
13309 {
13310 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13311 /*% ripper: binary!($:1, ID2VAL(idGTGT), $:3) %*/
13312 }
13313#line 13314 "parse.c"
13314 break;
13315
13316 case 264: /* arg: arg "&&" arg */
13317#line 4031 "parse.y"
13318 {
13319 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13320 /*% ripper: binary!($:1, ID2VAL(idANDOP), $:3) %*/
13321 }
13322#line 13323 "parse.c"
13323 break;
13324
13325 case 265: /* arg: arg "||" arg */
13326#line 4036 "parse.y"
13327 {
13328 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13329 /*% ripper: binary!($:1, ID2VAL(idOROP), $:3) %*/
13330 }
13331#line 13332 "parse.c"
13332 break;
13333
13334 case 266: /* arg: "'defined?'" option_'\n' begin_defined arg */
13335#line 4041 "parse.y"
13336 {
13337 p->ctxt.in_defined = (yyvsp[-1].ctxt).in_defined;
13338 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
13339 /*% ripper: defined!($:4) %*/
13340 }
13341#line 13342 "parse.c"
13342 break;
13343
13344 case 267: /* arg: arg '?' arg option_'\n' ':' arg */
13345#line 4047 "parse.y"
13346 {
13347 value_expr((yyvsp[-5].node));
13348 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
13349 fixpos((yyval.node), (yyvsp[-5].node));
13350 /*% ripper: ifop!($:1, $:3, $:6) %*/
13351 }
13352#line 13353 "parse.c"
13353 break;
13354
13355 case 268: /* arg: defn_head f_opt_paren_args '=' endless_arg */
13356#line 4054 "parse.y"
13357 {
13358 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
13359 restore_defun(p, (yyvsp[-3].node_def_temp));
13360 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
13361 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
13362 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
13363 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
13364 /*% ripper: def!($:head, $:args, $:$) %*/
13365 local_pop(p);
13366 }
13367#line 13368 "parse.c"
13368 break;
13369
13370 case 269: /* arg: defs_head f_opt_paren_args '=' endless_arg */
13371#line 4065 "parse.y"
13372 {
13373 endless_method_name(p, (yyvsp[-3].node_def_temp)->nd_mid, &(yylsp[-3]));
13374 restore_defun(p, (yyvsp[-3].node_def_temp));
13375 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
13376 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
13377 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
13378 /*% ripper: bodystmt!($:bodystmt, Qnil, Qnil, Qnil) %*/
13379 /*% ripper: defs!(*$:head[0..2], $:args, $:$) %*/
13380 local_pop(p);
13381 }
13382#line 13383 "parse.c"
13383 break;
13384
13385 case 270: /* arg: primary */
13386#line 4076 "parse.y"
13387 {
13388 (yyval.node) = (yyvsp[0].node);
13389 }
13390#line 13391 "parse.c"
13391 break;
13392
13393 case 272: /* endless_arg: endless_arg "'rescue' modifier" after_rescue arg */
13394#line 4083 "parse.y"
13395 {
13396 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
13397 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
13398 /*% ripper: rescue_mod!($:1, $:4) %*/
13399 }
13400#line 13401 "parse.c"
13401 break;
13402
13403 case 273: /* endless_arg: "'not'" option_'\n' endless_arg */
13404#line 4089 "parse.y"
13405 {
13406 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
13407 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
13408 }
13409#line 13410 "parse.c"
13410 break;
13411
13412 case 274: /* relop: '>' */
13413#line 4095 "parse.y"
13414 {(yyval.id) = '>';}
13415#line 13416 "parse.c"
13416 break;
13417
13418 case 275: /* relop: '<' */
13419#line 4096 "parse.y"
13420 {(yyval.id) = '<';}
13421#line 13422 "parse.c"
13422 break;
13423
13424 case 276: /* relop: ">=" */
13425#line 4097 "parse.y"
13426 {(yyval.id) = idGE;}
13427#line 13428 "parse.c"
13428 break;
13429
13430 case 277: /* relop: "<=" */
13431#line 4098 "parse.y"
13432 {(yyval.id) = idLE;}
13433#line 13434 "parse.c"
13434 break;
13435
13436 case 278: /* rel_expr: arg relop arg */
13437#line 4102 "parse.y"
13438 {
13439 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13440 /*% ripper: binary!($:1, ID2VAL($2), $:3) %*/
13441 }
13442#line 13443 "parse.c"
13443 break;
13444
13445 case 279: /* rel_expr: rel_expr relop arg */
13446#line 4107 "parse.y"
13447 {
13448 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
13449 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13450 /*% ripper: binary!($:1, ID2VAL($2), $:3) %*/
13451 }
13452#line 13453 "parse.c"
13453 break;
13454
13455 case 280: /* lex_ctxt: none */
13456#line 4115 "parse.y"
13457 {
13458 (yyval.ctxt) = p->ctxt;
13459 }
13460#line 13461 "parse.c"
13461 break;
13462
13463 case 281: /* begin_defined: lex_ctxt */
13464#line 4121 "parse.y"
13465 {
13466 p->ctxt.in_defined = 1;
13467 (yyval.ctxt) = (yyvsp[0].ctxt);
13468 }
13469#line 13470 "parse.c"
13470 break;
13471
13472 case 282: /* after_rescue: lex_ctxt */
13473#line 4128 "parse.y"
13474 {
13475 p->ctxt.in_rescue = after_rescue;
13476 (yyval.ctxt) = (yyvsp[0].ctxt);
13477 }
13478#line 13479 "parse.c"
13479 break;
13480
13481 case 283: /* arg_value: arg */
13482#line 4135 "parse.y"
13483 {
13484 value_expr((yyvsp[0].node));
13485 (yyval.node) = (yyvsp[0].node);
13486 }
13487#line 13488 "parse.c"
13488 break;
13489
13490 case 285: /* aref_args: args trailer */
13491#line 4143 "parse.y"
13492 {
13493 (yyval.node) = (yyvsp[-1].node);
13494 }
13495#line 13496 "parse.c"
13496 break;
13497
13498 case 286: /* aref_args: args ',' assocs trailer */
13499#line 4147 "parse.y"
13500 {
13501 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
13502 /*% ripper: args_add!($:1, bare_assoc_hash!($:3)) %*/
13503 }
13504#line 13505 "parse.c"
13505 break;
13506
13507 case 287: /* aref_args: assocs trailer */
13508#line 4152 "parse.y"
13509 {
13510 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
13511 /*% ripper: args_add!(args_new!, bare_assoc_hash!($:1)) %*/
13512 }
13513#line 13514 "parse.c"
13514 break;
13515
13516 case 288: /* arg_rhs: arg */
13517#line 4159 "parse.y"
13518 {
13519 value_expr((yyvsp[0].node));
13520 (yyval.node) = (yyvsp[0].node);
13521 }
13522#line 13523 "parse.c"
13523 break;
13524
13525 case 289: /* arg_rhs: arg "'rescue' modifier" after_rescue arg */
13526#line 4164 "parse.y"
13527 {
13528 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
13529 value_expr((yyvsp[-3].node));
13530 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
13531 /*% ripper: rescue_mod!($:1, $:4) %*/
13532 }
13533#line 13534 "parse.c"
13534 break;
13535
13536 case 290: /* paren_args: '(' opt_call_args rparen */
13537#line 4173 "parse.y"
13538 {
13539 (yyval.node) = (yyvsp[-1].node);
13540 /*% ripper: arg_paren!($:2) %*/
13541 }
13542#line 13543 "parse.c"
13543 break;
13544
13545 case 291: /* paren_args: '(' args ',' args_forward rparen */
13546#line 4178 "parse.y"
13547 {
13548 if (!check_forwarding_args(p)) {
13549 (yyval.node) = 0;
13550 }
13551 else {
13552 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
13553 /*% ripper: arg_paren!(args_add!($:2, $:4)) %*/
13554 }
13555 }
13556#line 13557 "parse.c"
13557 break;
13558
13559 case 292: /* paren_args: '(' args_forward rparen */
13560#line 4188 "parse.y"
13561 {
13562 if (!check_forwarding_args(p)) {
13563 (yyval.node) = 0;
13564 }
13565 else {
13566 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
13567 /*% ripper: arg_paren!($:2) %*/
13568 }
13569 }
13570#line 13571 "parse.c"
13571 break;
13572
13573 case 294: /* opt_paren_args: paren_args */
13574#line 4201 "parse.y"
13575 {
13576 (yyval.node) = (yyvsp[0].node) ? (yyvsp[0].node) : NODE_SPECIAL_EMPTY_ARGS;
13577 }
13578#line 13579 "parse.c"
13579 break;
13580
13581 case 297: /* opt_call_args: args ',' */
13582#line 4209 "parse.y"
13583 {
13584 (yyval.node) = (yyvsp[-1].node);
13585 }
13586#line 13587 "parse.c"
13587 break;
13588
13589 case 298: /* opt_call_args: args ',' assocs ',' */
13590#line 4213 "parse.y"
13591 {
13592 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
13593 /*% ripper: args_add!($:1, bare_assoc_hash!($:3)) %*/
13594 }
13595#line 13596 "parse.c"
13596 break;
13597
13598 case 299: /* opt_call_args: assocs ',' */
13599#line 4218 "parse.y"
13600 {
13601 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
13602 /*% ripper: args_add!(args_new!, bare_assoc_hash!($:1)) %*/
13603 }
13604#line 13605 "parse.c"
13605 break;
13606
13607 case 300: /* call_args: command */
13608#line 4225 "parse.y"
13609 {
13610 value_expr((yyvsp[0].node));
13611 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13612 /*% ripper: args_add!(args_new!, $:1) %*/
13613 }
13614#line 13615 "parse.c"
13615 break;
13616
13617 case 301: /* call_args: args opt_block_arg */
13618#line 4231 "parse.y"
13619 {
13620 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node_block_pass));
13621 /*% ripper: args_add_block!($:1, $:2) %*/
13622 }
13623#line 13624 "parse.c"
13624 break;
13625
13626 case 302: /* call_args: assocs opt_block_arg */
13627#line 4236 "parse.y"
13628 {
13629 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
13630 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
13631 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($:1)), $:2) %*/
13632 }
13633#line 13634 "parse.c"
13634 break;
13635
13636 case 303: /* call_args: args ',' assocs opt_block_arg */
13637#line 4242 "parse.y"
13638 {
13639 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
13640 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
13641 /*% ripper: args_add_block!(args_add!($:1, bare_assoc_hash!($:3)), $:4) %*/
13642 }
13643#line 13644 "parse.c"
13644 break;
13645
13646 case 305: /* $@13: %empty */
13647#line 4251 "parse.y"
13648 {
13649 /* If call_args starts with a open paren '(' or '[',
13650 * look-ahead reading of the letters calls CMDARG_PUSH(0),
13651 * but the push must be done after CMDARG_PUSH(1).
13652 * So this code makes them consistent by first cancelling
13653 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
13654 * and finally redoing CMDARG_PUSH(0).
13655 */
13656 int lookahead = 0;
13657 switch (yychar) {
13658 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
13659 lookahead = 1;
13660 }
13661 if (lookahead) CMDARG_POP();
13662 CMDARG_PUSH(1);
13663 if (lookahead) CMDARG_PUSH(0);
13664 }
13665#line 13666 "parse.c"
13666 break;
13667
13668 case 306: /* command_args: $@13 call_args */
13669#line 4269 "parse.y"
13670 {
13671 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
13672 * but the push must be done after CMDARG_POP() in the parser.
13673 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
13674 * CMDARG_POP() to pop 1 pushed by command_args,
13675 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
13676 */
13677 int lookahead = 0;
13678 switch (yychar) {
13679 case tLBRACE_ARG:
13680 lookahead = 1;
13681 }
13682 if (lookahead) CMDARG_POP();
13683 CMDARG_POP();
13684 if (lookahead) CMDARG_PUSH(0);
13685 (yyval.node) = (yyvsp[0].node);
13686 /*% ripper: $:2 %*/
13687 }
13688#line 13689 "parse.c"
13689 break;
13690
13691 case 307: /* block_arg: "&" arg_value */
13692#line 4290 "parse.y"
13693 {
13694 (yyval.node_block_pass) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
13695 /*% ripper: $:2 %*/
13696 }
13697#line 13698 "parse.c"
13698 break;
13699
13700 case 308: /* block_arg: "&" */
13701#line 4295 "parse.y"
13702 {
13703 forwarding_arg_check(p, idFWD_BLOCK, idFWD_ALL, "block");
13704 (yyval.node_block_pass) = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[0])), &(yyloc), &(yylsp[0]));
13705 /*% ripper: Qnil %*/
13706 }
13707#line 13708 "parse.c"
13708 break;
13709
13710 case 309: /* opt_block_arg: ',' block_arg */
13711#line 4303 "parse.y"
13712 {
13713 (yyval.node_block_pass) = (yyvsp[0].node_block_pass);
13714 /*% ripper: $:2 %*/
13715 }
13716#line 13717 "parse.c"
13717 break;
13718
13719 case 310: /* opt_block_arg: none */
13720#line 4308 "parse.y"
13721 {
13722 (yyval.node_block_pass) = 0;
13723 /*% ripper: Qfalse %*/
13724 }
13725#line 13726 "parse.c"
13726 break;
13727
13728 case 311: /* args: arg_value */
13729#line 4316 "parse.y"
13730 {
13731 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13732 /*% ripper: args_add!(args_new!, $:arg_value) %*/
13733 }
13734#line 13735 "parse.c"
13735 break;
13736
13737 case 312: /* args: arg_splat */
13738#line 4321 "parse.y"
13739 {
13740 (yyval.node) = (yyvsp[0].node);
13741 /*% ripper: args_add_star!(args_new!, $:arg_splat) %*/
13742 }
13743#line 13744 "parse.c"
13744 break;
13745
13746 case 313: /* args: args ',' arg_value */
13747#line 4326 "parse.y"
13748 {
13749 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13750 /*% ripper: args_add!($:non_last_args, $:arg_value) %*/
13751 }
13752#line 13753 "parse.c"
13753 break;
13754
13755 case 314: /* args: args ',' arg_splat */
13756#line 4331 "parse.y"
13757 {
13758 (yyval.node) = rest_arg_append(p, (yyvsp[-2].node), RNODE_SPLAT((yyvsp[0].node))->nd_head, &(yyloc));
13759 /*% ripper: args_add_star!($:non_last_args, $:arg_splat) %*/
13760 }
13761#line 13762 "parse.c"
13762 break;
13763
13764 case 315: /* arg_splat: "*" arg_value */
13765#line 4339 "parse.y"
13766 {
13767 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
13768 /*% ripper: $:arg_value %*/
13769 }
13770#line 13771 "parse.c"
13771 break;
13772
13773 case 316: /* arg_splat: "*" */
13774#line 4344 "parse.y"
13775 {
13776 forwarding_arg_check(p, idFWD_REST, idFWD_ALL, "rest");
13777 (yyval.node) = NEW_SPLAT(NEW_LVAR(idFWD_REST, &(yylsp[0])), &(yyloc), &(yylsp[0]));
13778 /*% ripper: Qnil %*/
13779 }
13780#line 13781 "parse.c"
13781 break;
13782
13783 case 319: /* mrhs: args ',' arg_value */
13784#line 4358 "parse.y"
13785 {
13786 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13787 /*% ripper: mrhs_add!(mrhs_new_from_args!($:args), $:arg_value) %*/
13788 }
13789#line 13790 "parse.c"
13790 break;
13791
13792 case 320: /* mrhs: args ',' "*" arg_value */
13793#line 4363 "parse.y"
13794 {
13795 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
13796 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($:args), $:arg_value) %*/
13797 }
13798#line 13799 "parse.c"
13799 break;
13800
13801 case 321: /* mrhs: "*" arg_value */
13802#line 4368 "parse.y"
13803 {
13804 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
13805 /*% ripper: mrhs_add_star!(mrhs_new!, $:arg_value) %*/
13806 }
13807#line 13808 "parse.c"
13808 break;
13809
13810 case 332: /* primary: "method" */
13811#line 4389 "parse.y"
13812 {
13813 (yyval.node) = (NODE *)NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
13814 /*% ripper: method_add_arg!(fcall!($:1), args_new!) %*/
13815 }
13816#line 13817 "parse.c"
13817 break;
13818
13819 case 333: /* $@14: %empty */
13820#line 4394 "parse.y"
13821 {
13822 CMDARG_PUSH(0);
13823 }
13824#line 13825 "parse.c"
13825 break;
13826
13827 case 334: /* primary: k_begin $@14 bodystmt k_end */
13828#line 4399 "parse.y"
13829 {
13830 CMDARG_POP();
13831 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
13832 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
13833 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
13834 /*% ripper: begin!($:3) %*/
13835 }
13836#line 13837 "parse.c"
13837 break;
13838
13839 case 335: /* $@15: %empty */
13840#line 4406 "parse.y"
13841 {SET_LEX_STATE(EXPR_ENDARG);}
13842#line 13843 "parse.c"
13843 break;
13844
13845 case 336: /* primary: "( arg" compstmt $@15 ')' */
13846#line 4407 "parse.y"
13847 {
13848 if (nd_type_p((yyvsp[-2].node), NODE_SELF)) RNODE_SELF((yyvsp[-2].node))->nd_state = 0;
13849 (yyval.node) = (yyvsp[-2].node);
13850 /*% ripper: paren!($:2) %*/
13851 }
13852#line 13853 "parse.c"
13853 break;
13854
13855 case 337: /* primary: "(" compstmt ')' */
13856#line 4413 "parse.y"
13857 {
13858 if (nd_type_p((yyvsp[-1].node), NODE_SELF)) RNODE_SELF((yyvsp[-1].node))->nd_state = 0;
13859 (yyval.node) = NEW_BLOCK((yyvsp[-1].node), &(yyloc));
13860 /*% ripper: paren!($:2) %*/
13861 }
13862#line 13863 "parse.c"
13863 break;
13864
13865 case 338: /* primary: primary_value "::" "constant" */
13866#line 4419 "parse.y"
13867 {
13868 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
13869 /*% ripper: const_path_ref!($:1, $:3) %*/
13870 }
13871#line 13872 "parse.c"
13872 break;
13873
13874 case 339: /* primary: ":: at EXPR_BEG" "constant" */
13875#line 4424 "parse.y"
13876 {
13877 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
13878 /*% ripper: top_const_ref!($:2) %*/
13879 }
13880#line 13881 "parse.c"
13881 break;
13882
13883 case 340: /* primary: "[" aref_args ']' */
13884#line 4429 "parse.y"
13885 {
13886 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
13887 /*% ripper: array!($:2) %*/
13888 }
13889#line 13890 "parse.c"
13890 break;
13891
13892 case 341: /* primary: "{" assoc_list '}' */
13893#line 4434 "parse.y"
13894 {
13895 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
13896 RNODE_HASH((yyval.node))->nd_brace = TRUE;
13897 /*% ripper: hash!($:2) %*/
13898 }
13899#line 13900 "parse.c"
13900 break;
13901
13902 case 342: /* primary: k_return */
13903#line 4440 "parse.y"
13904 {
13905 (yyval.node) = NEW_RETURN(0, &(yyloc), &(yylsp[0]));
13906 /*% ripper: return0! %*/
13907 }
13908#line 13909 "parse.c"
13909 break;
13910
13911 case 343: /* primary: k_yield '(' call_args rparen */
13912#line 4445 "parse.y"
13913 {
13914 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
13915 /*% ripper: yield!(paren!($:3)) %*/
13916 }
13917#line 13918 "parse.c"
13918 break;
13919
13920 case 344: /* primary: k_yield '(' rparen */
13921#line 4450 "parse.y"
13922 {
13923 (yyval.node) = NEW_YIELD(0, &(yyloc));
13924 /*% ripper: yield!(paren!(args_new!)) %*/
13925 }
13926#line 13927 "parse.c"
13927 break;
13928
13929 case 345: /* primary: k_yield */
13930#line 4455 "parse.y"
13931 {
13932 (yyval.node) = NEW_YIELD(0, &(yyloc));
13933 /*% ripper: yield0! %*/
13934 }
13935#line 13936 "parse.c"
13936 break;
13937
13938 case 346: /* primary: "'defined?'" option_'\n' '(' begin_defined expr rparen */
13939#line 4460 "parse.y"
13940 {
13941 p->ctxt.in_defined = (yyvsp[-2].ctxt).in_defined;
13942 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
13943 /*% ripper: defined!($:5) %*/
13944 }
13945#line 13946 "parse.c"
13946 break;
13947
13948 case 347: /* primary: "'not'" '(' expr rparen */
13949#line 4466 "parse.y"
13950 {
13951 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
13952 /*% ripper: unary!(ID2VAL(idNOT), $:3) %*/
13953 }
13954#line 13955 "parse.c"
13955 break;
13956
13957 case 348: /* primary: "'not'" '(' rparen */
13958#line 4471 "parse.y"
13959 {
13960 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
13961 /*% ripper: unary!(ID2VAL(idNOT), Qnil) %*/
13962 }
13963#line 13964 "parse.c"
13964 break;
13965
13966 case 349: /* primary: fcall brace_block */
13967#line 4476 "parse.y"
13968 {
13969 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-1].node_fcall), (yyvsp[0].node), &(yyloc));
13970 /*% ripper: method_add_block!(method_add_arg!(fcall!($:1), args_new!), $:2) %*/
13971 }
13972#line 13973 "parse.c"
13973 break;
13974
13975 case 351: /* primary: method_call brace_block */
13976#line 4482 "parse.y"
13977 {
13978 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
13979 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13980 /*% ripper: method_add_block!($:1, $:2) %*/
13981 }
13982#line 13983 "parse.c"
13983 break;
13984
13985 case 353: /* primary: k_if expr_value then compstmt if_tail k_end */
13986#line 4492 "parse.y"
13987 {
13988 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
13989 fixpos((yyval.node), (yyvsp[-4].node));
13990 /*% ripper: if!($:2, $:4, $:5) %*/
13991 }
13992#line 13993 "parse.c"
13993 break;
13994
13995 case 354: /* primary: k_unless expr_value then compstmt opt_else k_end */
13996#line 4501 "parse.y"
13997 {
13998 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc), &(yylsp[-5]), &(yylsp[-3]), &(yylsp[0]));
13999 fixpos((yyval.node), (yyvsp[-4].node));
14000 /*% ripper: unless!($:2, $:4, $:5) %*/
14001 }
14002#line 14003 "parse.c"
14003 break;
14004
14005 case 355: /* primary: k_while expr_value_do compstmt k_end */
14006#line 4509 "parse.y"
14007 {
14008 restore_block_exit(p, (yyvsp[-3].node_exits));
14009 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc), &(yylsp[-3]), &(yylsp[0]));
14010 fixpos((yyval.node), (yyvsp[-2].node));
14011 /*% ripper: while!($:2, $:3) %*/
14012 }
14013#line 14014 "parse.c"
14014 break;
14015
14016 case 356: /* primary: k_until expr_value_do compstmt k_end */
14017#line 4518 "parse.y"
14018 {
14019 restore_block_exit(p, (yyvsp[-3].node_exits));
14020 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc), &(yylsp[-3]), &(yylsp[0]));
14021 fixpos((yyval.node), (yyvsp[-2].node));
14022 /*% ripper: until!($:2, $:3) %*/
14023 }
14024#line 14025 "parse.c"
14025 break;
14026
14027 case 357: /* @16: %empty */
14028#line 4525 "parse.y"
14029 {
14030 (yyval.labels) = p->case_labels;
14031 p->case_labels = CHECK_LITERAL_WHEN;
14032 }
14033#line 14034 "parse.c"
14034 break;
14035
14036 case 358: /* primary: k_case expr_value option_terms @16 case_body k_end */
14037#line 4531 "parse.y"
14038 {
14039 if (CASE_LABELS_ENABLED_P(p->case_labels)) st_free_table(p->case_labels);
14040 p->case_labels = (yyvsp[-2].labels);
14041 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc), &(yylsp[-5]), &(yylsp[0]));
14042 fixpos((yyval.node), (yyvsp[-4].node));
14043 /*% ripper: case!($:2, $:5) %*/
14044 }
14045#line 14046 "parse.c"
14046 break;
14047
14048 case 359: /* @17: %empty */
14049#line 4539 "parse.y"
14050 {
14051 (yyval.labels) = p->case_labels;
14052 p->case_labels = 0;
14053 }
14054#line 14055 "parse.c"
14055 break;
14056
14057 case 360: /* primary: k_case option_terms @17 case_body k_end */
14058#line 4545 "parse.y"
14059 {
14060 if (p->case_labels) st_free_table(p->case_labels);
14061 p->case_labels = (yyvsp[-2].labels);
14062 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc), &(yylsp[-4]), &(yylsp[0]));
14063 /*% ripper: case!(Qnil, $:4) %*/
14064 }
14065#line 14066 "parse.c"
14066 break;
14067
14068 case 361: /* primary: k_case expr_value option_terms p_case_body k_end */
14069#line 4554 "parse.y"
14070 {
14071 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc), &(yylsp[-4]), &(yylsp[0]));
14072 /*% ripper: case!($:2, $:4) %*/
14073 }
14074#line 14075 "parse.c"
14075 break;
14076
14077 case 362: /* primary: k_for for_var "'in'" expr_value_do compstmt k_end */
14078#line 4561 "parse.y"
14079 {
14080 restore_block_exit(p, (yyvsp[-5].node_exits));
14081 /*
14082 * for a, b, c in e
14083 * #=>
14084 * e.each{|*x| a, b, c = x}
14085 *
14086 * for a in e
14087 * #=>
14088 * e.each{|x| a, = x}
14089 */
14090 ID id = internal_id(p);
14091 rb_node_args_aux_t *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
14092 rb_node_args_t *args;
14093 NODE *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
14094 rb_ast_id_table_t *tbl = rb_ast_new_local_table(p->ast, 1);
14095 tbl->ids[0] = id; /* internal id */
14096
14097 switch (nd_type((yyvsp[-4].node))) {
14098 case NODE_LASGN:
14099 case NODE_DASGN: /* e.each {|internal_var| a = internal_var; ... } */
14100 set_nd_value(p, (yyvsp[-4].node), internal_var);
14101 id = 0;
14102 m->nd_plen = 1;
14103 m->nd_next = (yyvsp[-4].node);
14104 break;
14105 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
14106 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
14107 break;
14108 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
14109 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]));
14110 }
14111 /* {|*internal_id| <m> = internal_id; ... } */
14112 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
14113 scope = NEW_SCOPE2(tbl, args, (yyvsp[-1].node), &(yyloc));
14114 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
14115 fixpos((yyval.node), (yyvsp[-4].node));
14116 /*% ripper: for!($:2, $:4, $:5) %*/
14117 }
14118#line 14119 "parse.c"
14119 break;
14120
14121 case 363: /* $@18: %empty */
14122#line 4601 "parse.y"
14123 {
14124 begin_definition("class", &(yylsp[-2]), &(yylsp[-1]));
14125 }
14126#line 14127 "parse.c"
14127 break;
14128
14129 case 364: /* primary: k_class cpath superclass $@18 bodystmt k_end */
14130#line 4606 "parse.y"
14131 {
14132 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
14133 nd_set_line(RNODE_CLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14134 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
14135 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
14136 /*% ripper: class!($:cpath, $:superclass, $:bodystmt) %*/
14137 local_pop(p);
14138 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
14139 p->ctxt.cant_return = (yyvsp[-5].ctxt).cant_return;
14140 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
14141 }
14142#line 14143 "parse.c"
14143 break;
14144
14145 case 365: /* $@19: %empty */
14146#line 4618 "parse.y"
14147 {
14148 begin_definition("", &(yylsp[-2]), &(yylsp[-1]));
14149 }
14150#line 14151 "parse.c"
14151 break;
14152
14153 case 366: /* primary: k_class "<<" expr_value $@19 term bodystmt k_end */
14154#line 4624 "parse.y"
14155 {
14156 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
14157 nd_set_line(RNODE_SCLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14158 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
14159 fixpos((yyval.node), (yyvsp[-4].node));
14160 /*% ripper: sclass!($:expr_value, $:bodystmt) %*/
14161 local_pop(p);
14162 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
14163 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
14164 p->ctxt.cant_return = (yyvsp[-6].ctxt).cant_return;
14165 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
14166 }
14167#line 14168 "parse.c"
14168 break;
14169
14170 case 367: /* $@20: %empty */
14171#line 4637 "parse.y"
14172 {
14173 begin_definition("module", &(yylsp[-1]), &(yylsp[0]));
14174 }
14175#line 14176 "parse.c"
14176 break;
14177
14178 case 368: /* primary: k_module cpath $@20 bodystmt k_end */
14179#line 4642 "parse.y"
14180 {
14181 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14182 nd_set_line(RNODE_MODULE((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14183 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
14184 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
14185 /*% ripper: module!($:cpath, $:bodystmt) %*/
14186 local_pop(p);
14187 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
14188 p->ctxt.cant_return = (yyvsp[-4].ctxt).cant_return;
14189 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
14190 }
14191#line 14192 "parse.c"
14192 break;
14193
14194 case 369: /* $@21: %empty */
14195#line 4655 "parse.y"
14196 {
14197 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14198 }
14199#line 14200 "parse.c"
14200 break;
14201
14202 case 370: /* primary: defn_head f_arglist $@21 bodystmt k_end */
14203#line 4660 "parse.y"
14204 {
14205 restore_defun(p, (yyvsp[-4].node_def_temp));
14206 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
14207 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
14208 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[-1].node);
14209 /*% ripper: def!($:head, $:args, $:bodystmt) %*/
14210 local_pop(p);
14211 }
14212#line 14213 "parse.c"
14213 break;
14214
14215 case 371: /* $@22: %empty */
14216#line 4670 "parse.y"
14217 {
14218 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14219 }
14220#line 14221 "parse.c"
14221 break;
14222
14223 case 372: /* primary: defs_head f_arglist $@22 bodystmt k_end */
14224#line 4675 "parse.y"
14225 {
14226 restore_defun(p, (yyvsp[-4].node_def_temp));
14227 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
14228 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
14229 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[-1].node);
14230 /*% ripper: defs!(*$:head[0..2], $:args, $:bodystmt) %*/
14231 local_pop(p);
14232 }
14233#line 14234 "parse.c"
14234 break;
14235
14236 case 373: /* primary: "'break'" */
14237#line 4684 "parse.y"
14238 {
14239 (yyval.node) = add_block_exit(p, NEW_BREAK(0, &(yyloc), &(yylsp[0])));
14240 /*% ripper: break!(args_new!) %*/
14241 }
14242#line 14243 "parse.c"
14243 break;
14244
14245 case 374: /* primary: "'next'" */
14246#line 4689 "parse.y"
14247 {
14248 (yyval.node) = add_block_exit(p, NEW_NEXT(0, &(yyloc), &(yylsp[0])));
14249 /*% ripper: next!(args_new!) %*/
14250 }
14251#line 14252 "parse.c"
14252 break;
14253
14254 case 375: /* primary: "'redo'" */
14255#line 4694 "parse.y"
14256 {
14257 (yyval.node) = add_block_exit(p, NEW_REDO(&(yyloc), &(yylsp[0])));
14258 /*% ripper: redo! %*/
14259 }
14260#line 14261 "parse.c"
14261 break;
14262
14263 case 376: /* primary: "'retry'" */
14264#line 4699 "parse.y"
14265 {
14266 if (!p->ctxt.in_defined) {
14267 switch (p->ctxt.in_rescue) {
14268 case before_rescue: yyerror1(&(yylsp[0]), "Invalid retry without rescue"); break;
14269 case after_rescue: /* ok */ break;
14270 case after_else: yyerror1(&(yylsp[0]), "Invalid retry after else"); break;
14271 case after_ensure: yyerror1(&(yylsp[0]), "Invalid retry after ensure"); break;
14272 }
14273 }
14274 (yyval.node) = NEW_RETRY(&(yyloc));
14275 /*% ripper: retry! %*/
14276 }
14277#line 14278 "parse.c"
14278 break;
14279
14280 case 377: /* primary_value: primary */
14281#line 4714 "parse.y"
14282 {
14283 value_expr((yyvsp[0].node));
14284 (yyval.node) = (yyvsp[0].node);
14285 }
14286#line 14287 "parse.c"
14287 break;
14288
14289 case 378: /* k_begin: "'begin'" */
14290#line 4721 "parse.y"
14291 {
14292 token_info_push(p, "begin", &(yyloc));
14293 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14294 }
14295#line 14296 "parse.c"
14296 break;
14297
14298 case 379: /* k_if: "'if'" */
14299#line 4728 "parse.y"
14300 {
14301 WARN_EOL("if");
14302 token_info_push(p, "if", &(yyloc));
14303 if (p->token_info && p->token_info->nonspc &&
14304 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
14305 const char *tok = p->lex.ptok - rb_strlen_lit("if");
14306 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
14307 beg += rb_strlen_lit("else");
14308 while (beg < tok && ISSPACE(*beg)) beg++;
14309 if (beg == tok) {
14310 p->token_info->nonspc = 0;
14311 }
14312 }
14313 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14314 }
14315#line 14316 "parse.c"
14316 break;
14317
14318 case 380: /* k_unless: "'unless'" */
14319#line 4746 "parse.y"
14320 {
14321 token_info_push(p, "unless", &(yyloc));
14322 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14323 }
14324#line 14325 "parse.c"
14325 break;
14326
14327 case 381: /* k_while: "'while'" allow_exits */
14328#line 4753 "parse.y"
14329 {
14330 (yyval.node_exits) = (yyvsp[0].node_exits);
14331 token_info_push(p, "while", &(yyloc));
14332 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14333 }
14334#line 14335 "parse.c"
14335 break;
14336
14337 case 382: /* k_until: "'until'" allow_exits */
14338#line 4761 "parse.y"
14339 {
14340 (yyval.node_exits) = (yyvsp[0].node_exits);
14341 token_info_push(p, "until", &(yyloc));
14342 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14343 }
14344#line 14345 "parse.c"
14345 break;
14346
14347 case 383: /* k_case: "'case'" */
14348#line 4769 "parse.y"
14349 {
14350 token_info_push(p, "case", &(yyloc));
14351 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14352 }
14353#line 14354 "parse.c"
14354 break;
14355
14356 case 384: /* k_for: "'for'" allow_exits */
14357#line 4776 "parse.y"
14358 {
14359 (yyval.node_exits) = (yyvsp[0].node_exits);
14360 token_info_push(p, "for", &(yyloc));
14361 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
14362 }
14363#line 14364 "parse.c"
14364 break;
14365
14366 case 385: /* k_class: "'class'" */
14367#line 4784 "parse.y"
14368 {
14369 token_info_push(p, "class", &(yyloc));
14370 (yyval.ctxt) = p->ctxt;
14371 p->ctxt.in_rescue = before_rescue;
14372 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14373 }
14374#line 14375 "parse.c"
14375 break;
14376
14377 case 386: /* k_module: "'module'" */
14378#line 4793 "parse.y"
14379 {
14380 token_info_push(p, "module", &(yyloc));
14381 (yyval.ctxt) = p->ctxt;
14382 p->ctxt.in_rescue = before_rescue;
14383 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14384 }
14385#line 14386 "parse.c"
14386 break;
14387
14388 case 387: /* k_def: "'def'" */
14389#line 4802 "parse.y"
14390 {
14391 token_info_push(p, "def", &(yyloc));
14392 (yyval.node_def_temp) = NEW_DEF_TEMP(&(yyloc));
14393 p->ctxt.in_argdef = 1;
14394 }
14395#line 14396 "parse.c"
14396 break;
14397
14398 case 388: /* k_do: "'do'" */
14399#line 4810 "parse.y"
14400 {
14401 token_info_push(p, "do", &(yyloc));
14402 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14403 }
14404#line 14405 "parse.c"
14405 break;
14406
14407 case 389: /* k_do_block: "'do' for block" */
14408#line 4817 "parse.y"
14409 {
14410 token_info_push(p, "do", &(yyloc));
14411 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14412 }
14413#line 14414 "parse.c"
14414 break;
14415
14416 case 390: /* k_rescue: "'rescue'" */
14417#line 4824 "parse.y"
14418 {
14419 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
14420 (yyval.ctxt) = p->ctxt;
14421 p->ctxt.in_rescue = after_rescue;
14422 }
14423#line 14424 "parse.c"
14424 break;
14425
14426 case 391: /* k_ensure: "'ensure'" */
14427#line 4832 "parse.y"
14428 {
14429 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
14430 (yyval.ctxt) = p->ctxt;
14431 }
14432#line 14433 "parse.c"
14433 break;
14434
14435 case 392: /* k_when: "'when'" */
14436#line 4839 "parse.y"
14437 {
14438 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
14439 }
14440#line 14441 "parse.c"
14441 break;
14442
14443 case 393: /* k_else: "'else'" */
14444#line 4845 "parse.y"
14445 {
14446 token_info *ptinfo_beg = p->token_info;
14447 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
14448 token_info_warn(p, "else", p->token_info, same, &(yyloc));
14449 if (same) {
14450 token_info e;
14451 e.next = ptinfo_beg->next;
14452 e.token = "else";
14453 token_info_setup(&e, p->lex.pbeg, &(yyloc));
14454 if (!e.nonspc) *ptinfo_beg = e;
14455 }
14456 }
14457#line 14458 "parse.c"
14458 break;
14459
14460 case 394: /* k_elsif: "'elsif'" */
14461#line 4860 "parse.y"
14462 {
14463 WARN_EOL("elsif");
14464 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
14465 }
14466#line 14467 "parse.c"
14467 break;
14468
14469 case 395: /* k_end: "'end'" */
14470#line 4867 "parse.y"
14471 {
14472 token_info_pop(p, "end", &(yyloc));
14473 pop_end_expect_token_locations(p);
14474 }
14475#line 14476 "parse.c"
14476 break;
14477
14478 case 396: /* k_end: "dummy end" */
14479#line 4872 "parse.y"
14480 {
14481 compile_error(p, "syntax error, unexpected end-of-input");
14482 }
14483#line 14484 "parse.c"
14484 break;
14485
14486 case 397: /* k_return: "'return'" */
14487#line 4878 "parse.y"
14488 {
14489 if (p->ctxt.cant_return && !dyna_in_block(p))
14490 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
14491 }
14492#line 14493 "parse.c"
14493 break;
14494
14495 case 398: /* k_yield: "'yield'" */
14496#line 4885 "parse.y"
14497 {
14498 if (!p->ctxt.in_defined && !p->ctxt.in_def && !compile_for_eval)
14499 yyerror1(&(yylsp[0]), "Invalid yield");
14500 }
14501#line 14502 "parse.c"
14502 break;
14503
14504 case 405: /* if_tail: k_elsif expr_value then compstmt if_tail */
14505#line 4904 "parse.y"
14506 {
14507 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14508 fixpos((yyval.node), (yyvsp[-3].node));
14509 /*% ripper: elsif!($:2, $:4, $:5) %*/
14510 }
14511#line 14512 "parse.c"
14512 break;
14513
14514 case 407: /* opt_else: k_else compstmt */
14515#line 4913 "parse.y"
14516 {
14517 (yyval.node) = (yyvsp[0].node);
14518 /*% ripper: else!($:2) %*/
14519 }
14520#line 14521 "parse.c"
14521 break;
14522
14523 case 410: /* f_marg: f_norm_arg */
14524#line 4924 "parse.y"
14525 {
14526 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14527 mark_lvar_used(p, (yyval.node));
14528 }
14529#line 14530 "parse.c"
14530 break;
14531
14532 case 411: /* f_marg: "(" f_margs rparen */
14533#line 4929 "parse.y"
14534 {
14535 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
14536 /*% ripper: mlhs_paren!($:2) %*/
14537 }
14538#line 14539 "parse.c"
14539 break;
14540
14541 case 412: /* f_marg_list: f_marg */
14542#line 4936 "parse.y"
14543 {
14544 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14545 /*% ripper: mlhs_add!(mlhs_new!, $:1) %*/
14546 }
14547#line 14548 "parse.c"
14548 break;
14549
14550 case 413: /* f_marg_list: f_marg_list ',' f_marg */
14551#line 4941 "parse.y"
14552 {
14553 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
14554 /*% ripper: mlhs_add!($:1, $:3) %*/
14555 }
14556#line 14557 "parse.c"
14557 break;
14558
14559 case 414: /* f_margs: f_marg_list */
14560#line 4948 "parse.y"
14561 {
14562 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
14563 /*% ripper: $:1 %*/
14564 }
14565#line 14566 "parse.c"
14566 break;
14567
14568 case 415: /* f_margs: f_marg_list ',' f_rest_marg */
14569#line 4953 "parse.y"
14570 {
14571 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14572 /*% ripper: mlhs_add_star!($:1, $:3) %*/
14573 }
14574#line 14575 "parse.c"
14575 break;
14576
14577 case 416: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
14578#line 4958 "parse.y"
14579 {
14580 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
14581 /*% ripper: mlhs_add_post!(mlhs_add_star!($:1, $:3), $:5) %*/
14582 }
14583#line 14584 "parse.c"
14584 break;
14585
14586 case 417: /* f_margs: f_rest_marg */
14587#line 4963 "parse.y"
14588 {
14589 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
14590 /*% ripper: mlhs_add_star!(mlhs_new!, $:1) %*/
14591 }
14592#line 14593 "parse.c"
14593 break;
14594
14595 case 418: /* f_margs: f_rest_marg ',' f_marg_list */
14596#line 4968 "parse.y"
14597 {
14598 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
14599 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $:1), $:3) %*/
14600 }
14601#line 14602 "parse.c"
14602 break;
14603
14604 case 419: /* f_rest_marg: "*" f_norm_arg */
14605#line 4975 "parse.y"
14606 {
14607 /*% ripper: $:2 %*/
14608 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14609 mark_lvar_used(p, (yyval.node));
14610 }
14611#line 14612 "parse.c"
14612 break;
14613
14614 case 420: /* f_rest_marg: "*" */
14615#line 4981 "parse.y"
14616 {
14617 (yyval.node) = NODE_SPECIAL_NO_NAME_REST;
14618 /*% ripper: Qnil %*/
14619 }
14620#line 14621 "parse.c"
14621 break;
14622
14623 case 422: /* f_any_kwrest: f_no_kwarg */
14624#line 4989 "parse.y"
14625 {
14626 (yyval.id) = idNil;
14627 /*% ripper: ID2VAL(idNil) %*/
14628 }
14629#line 14630 "parse.c"
14630 break;
14631
14632 case 423: /* $@23: %empty */
14633#line 4995 "parse.y"
14634 {p->ctxt.in_argdef = 0;}
14635#line 14636 "parse.c"
14636 break;
14637
14638 case 425: /* f_kwarg_f_block_kw: f_block_kw */
14639#line 2935 "parse.y"
14640 {
14641 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
14642 /*% ripper: rb_ary_new3(1, $:1) %*/
14643 }
14644#line 14645 "parse.c"
14645 break;
14646
14647 case 426: /* f_kwarg_f_block_kw: f_kwarg_f_block_kw ',' f_block_kw */
14648#line 2940 "parse.y"
14649 {
14650 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
14651 /*% ripper: rb_ary_push($:1, $:3) %*/
14652 }
14653#line 14654 "parse.c"
14654 break;
14655
14656 case 427: /* block_args_tail: f_kwarg_f_block_kw ',' f_kwrest opt_f_block_arg */
14657#line 4998 "parse.y"
14658 {
14659 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
14660 /*% ripper: [$:1, $:3, $:4] %*/
14661 }
14662#line 14663 "parse.c"
14663 break;
14664
14665 case 428: /* block_args_tail: f_kwarg_f_block_kw opt_f_block_arg */
14666#line 5003 "parse.y"
14667 {
14668 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), 0, (yyvsp[0].id), &(yylsp[-1]));
14669 /*% ripper: [$:1, Qnil, $:2] %*/
14670 }
14671#line 14672 "parse.c"
14672 break;
14673
14674 case 429: /* block_args_tail: f_any_kwrest opt_f_block_arg */
14675#line 5008 "parse.y"
14676 {
14677 (yyval.node_args) = new_args_tail(p, 0, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
14678 /*% ripper: [Qnil, $:1, $:2] %*/
14679 }
14680#line 14681 "parse.c"
14681 break;
14682
14683 case 430: /* block_args_tail: f_block_arg */
14684#line 5013 "parse.y"
14685 {
14686 (yyval.node_args) = new_args_tail(p, 0, 0, (yyvsp[0].id), &(yylsp[0]));
14687 /*% ripper: [Qnil, Qnil, $:1] %*/
14688 }
14689#line 14690 "parse.c"
14690 break;
14691
14692 case 431: /* excessed_comma: ',' */
14693#line 5020 "parse.y"
14694 {
14695 /* magic number for rest_id in iseq_set_arguments() */
14696 (yyval.id) = NODE_SPECIAL_EXCESSIVE_COMMA;
14697 /*% ripper: excessed_comma! %*/
14698 }
14699#line 14700 "parse.c"
14700 break;
14701
14702 case 432: /* f_opt_primary_value: f_arg_asgn f_eq primary_value */
14703#line 2913 "parse.y"
14704 {
14705 p->ctxt.in_argdef = 1;
14706 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
14707 /*% ripper: [$:$, $:3] %*/
14708 }
14709#line 14710 "parse.c"
14710 break;
14711
14712 case 433: /* f_optarg_primary_value: f_opt_primary_value */
14713#line 2922 "parse.y"
14714 {
14715 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
14716 /*% ripper: rb_ary_new3(1, $:1) %*/
14717 }
14718#line 14719 "parse.c"
14719 break;
14720
14721 case 434: /* f_optarg_primary_value: f_optarg_primary_value ',' f_opt_primary_value */
14722#line 2927 "parse.y"
14723 {
14724 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
14725 /*% ripper: rb_ary_push($:1, $:3) %*/
14726 }
14727#line 14728 "parse.c"
14728 break;
14729
14730 case 435: /* opt_args_tail_block_args_tail: ',' block_args_tail */
14731#line 2948 "parse.y"
14732 {
14733 (yyval.node_args) = (yyvsp[0].node_args);
14734 /*% ripper: $:2 %*/
14735 }
14736#line 14737 "parse.c"
14737 break;
14738
14739 case 436: /* opt_args_tail_block_args_tail: %empty */
14740#line 2953 "parse.y"
14741 {
14742 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
14743 /*% ripper: [Qnil, Qnil, Qnil] %*/
14744 }
14745#line 14746 "parse.c"
14746 break;
14747
14748 case 437: /* block_param: f_arg ',' f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail */
14749#line 5028 "parse.y"
14750 {
14751 (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));
14752 /*% ripper: params!($:1, $:3, $:5, Qnil, *$:6[0..2]) %*/
14753 }
14754#line 14755 "parse.c"
14755 break;
14756
14757 case 438: /* block_param: f_arg ',' f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14758#line 5033 "parse.y"
14759 {
14760 (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));
14761 /*% ripper: params!($:1, $:3, $:5, $:7, *$:8[0..2]) %*/
14762 }
14763#line 14764 "parse.c"
14764 break;
14765
14766 case 439: /* block_param: f_arg ',' f_optarg_primary_value opt_args_tail_block_args_tail */
14767#line 5038 "parse.y"
14768 {
14769 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
14770 /*% ripper: params!($:1, $:3, Qnil, Qnil, *$:4[0..2]) %*/
14771 }
14772#line 14773 "parse.c"
14773 break;
14774
14775 case 440: /* block_param: f_arg ',' f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail */
14776#line 5043 "parse.y"
14777 {
14778 (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));
14779 /*% ripper: params!($:1, $:3, Qnil, $:5, *$:6[0..2]) %*/
14780 }
14781#line 14782 "parse.c"
14782 break;
14783
14784 case 441: /* block_param: f_arg ',' f_rest_arg opt_args_tail_block_args_tail */
14785#line 5048 "parse.y"
14786 {
14787 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
14788 /*% ripper: params!($:1, Qnil, $:3, Qnil, *$:4[0..2]) %*/
14789 }
14790#line 14791 "parse.c"
14791 break;
14792
14793 case 442: /* block_param: f_arg excessed_comma */
14794#line 5053 "parse.y"
14795 {
14796 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
14797 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), 0, (yyvsp[0].id), 0, (yyval.node_args), &(yyloc));
14798 /*% ripper: params!($:1, Qnil, $:2, Qnil, Qnil, Qnil, Qnil) %*/
14799 }
14800#line 14801 "parse.c"
14801 break;
14802
14803 case 443: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14804#line 5059 "parse.y"
14805 {
14806 (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));
14807 /*% ripper: params!($:1, Qnil, $:3, $:5, *$:6[0..2]) %*/
14808 }
14809#line 14810 "parse.c"
14810 break;
14811
14812 case 444: /* block_param: f_arg opt_args_tail_block_args_tail */
14813#line 5064 "parse.y"
14814 {
14815 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
14816 /*% ripper: params!($:1, Qnil, Qnil, Qnil, *$:2[0..2]) %*/
14817 }
14818#line 14819 "parse.c"
14819 break;
14820
14821 case 445: /* block_param: f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail */
14822#line 5069 "parse.y"
14823 {
14824 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
14825 /*% ripper: params!(Qnil, $:1, $:3, Qnil, *$:4[0..2]) %*/
14826 }
14827#line 14828 "parse.c"
14828 break;
14829
14830 case 446: /* block_param: f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14831#line 5074 "parse.y"
14832 {
14833 (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));
14834 /*% ripper: params!(Qnil, $:1, $:3, $:5, *$:6[0..2]) %*/
14835 }
14836#line 14837 "parse.c"
14837 break;
14838
14839 case 447: /* block_param: f_optarg_primary_value opt_args_tail_block_args_tail */
14840#line 5079 "parse.y"
14841 {
14842 (yyval.node_args) = new_args(p, 0, (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
14843 /*% ripper: params!(Qnil, $:1, Qnil, Qnil, *$:2[0..2]) %*/
14844 }
14845#line 14846 "parse.c"
14846 break;
14847
14848 case 448: /* block_param: f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail */
14849#line 5084 "parse.y"
14850 {
14851 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), 0, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14852 /*% ripper: params!(Qnil, $:1, Qnil, $:3, *$:4[0..2]) %*/
14853 }
14854#line 14855 "parse.c"
14855 break;
14856
14857 case 449: /* block_param: f_rest_arg opt_args_tail_block_args_tail */
14858#line 5089 "parse.y"
14859 {
14860 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
14861 /*% ripper: params!(Qnil, Qnil, $:1, Qnil, *$:2[0..2]) %*/
14862 }
14863#line 14864 "parse.c"
14864 break;
14865
14866 case 450: /* block_param: f_rest_arg ',' f_arg opt_args_tail_block_args_tail */
14867#line 5094 "parse.y"
14868 {
14869 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
14870 /*% ripper: params!(Qnil, Qnil, $:1, $:3, *$:4[0..2]) %*/
14871 }
14872#line 14873 "parse.c"
14873 break;
14874
14875 case 451: /* block_param: block_args_tail */
14876#line 5099 "parse.y"
14877 {
14878 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
14879 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, *$:1[0..2]) %*/
14880 }
14881#line 14882 "parse.c"
14882 break;
14883
14884 case 453: /* opt_block_param: block_param_def */
14885#line 5107 "parse.y"
14886 {
14887 p->command_start = TRUE;
14888 }
14889#line 14890 "parse.c"
14890 break;
14891
14892 case 454: /* block_param_def: '|' opt_bv_decl '|' */
14893#line 5113 "parse.y"
14894 {
14895 p->max_numparam = ORDINAL_PARAM;
14896 p->ctxt.in_argdef = 0;
14897 (yyval.node_args) = 0;
14898 /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), $:2) %*/
14899 }
14900#line 14901 "parse.c"
14901 break;
14902
14903 case 455: /* block_param_def: '|' block_param opt_bv_decl '|' */
14904#line 5120 "parse.y"
14905 {
14906 p->max_numparam = ORDINAL_PARAM;
14907 p->ctxt.in_argdef = 0;
14908 (yyval.node_args) = (yyvsp[-2].node_args);
14909 /*% ripper: block_var!($:2, $:3) %*/
14910 }
14911#line 14912 "parse.c"
14912 break;
14913
14914 case 456: /* opt_bv_decl: option_'\n' */
14915#line 5130 "parse.y"
14916 {
14917 (yyval.id) = 0;
14918 /*% ripper: Qfalse %*/
14919 }
14920#line 14921 "parse.c"
14921 break;
14922
14923 case 457: /* opt_bv_decl: option_'\n' ';' bv_decls option_'\n' */
14924#line 5135 "parse.y"
14925 {
14926 (yyval.id) = 0;
14927 /*% ripper: $:3 %*/
14928 }
14929#line 14930 "parse.c"
14930 break;
14931
14932 case 460: /* bvar: "local variable or method" */
14933#line 5148 "parse.y"
14934 {
14935 new_bv(p, (yyvsp[0].id));
14936 /*% ripper: $:1 %*/
14937 }
14938#line 14939 "parse.c"
14939 break;
14940
14941 case 461: /* bvar: f_bad_arg */
14942#line 5153 "parse.y"
14943 {
14944 (yyval.id) = 0;
14945 }
14946#line 14947 "parse.c"
14947 break;
14948
14949 case 462: /* max_numparam: %empty */
14950#line 5158 "parse.y"
14951 {
14952 (yyval.num) = p->max_numparam;
14953 p->max_numparam = 0;
14954 }
14955#line 14956 "parse.c"
14956 break;
14957
14958 case 463: /* numparam: %empty */
14959#line 5164 "parse.y"
14960 {
14961 (yyval.node) = numparam_push(p);
14962 }
14963#line 14964 "parse.c"
14964 break;
14965
14966 case 464: /* it_id: %empty */
14967#line 5169 "parse.y"
14968 {
14969 (yyval.id) = p->it_id;
14970 p->it_id = 0;
14971 }
14972#line 14973 "parse.c"
14973 break;
14974
14975 case 465: /* @24: %empty */
14976#line 5176 "parse.y"
14977 {
14978 token_info_push(p, "->", &(yylsp[0]));
14979 (yyval.vars) = dyna_push(p);
14980 }
14981#line 14982 "parse.c"
14982 break;
14983
14984 case 466: /* $@25: %empty */
14985#line 5182 "parse.y"
14986 {
14987 CMDARG_PUSH(0);
14988 }
14989#line 14990 "parse.c"
14990 break;
14991
14992 case 467: /* lambda: "->" @24 max_numparam numparam it_id allow_exits f_larglist $@25 lambda_body */
14993#line 5186 "parse.y"
14994 {
14995 int max_numparam = p->max_numparam;
14996 ID it_id = p->it_id;
14997 p->lex.lpar_beg = (yyvsp[-8].num);
14998 p->max_numparam = (yyvsp[-6].num);
14999 p->it_id = (yyvsp[-4].id);
15000 restore_block_exit(p, (yyvsp[-3].node_exits));
15001 CMDARG_POP();
15002 (yyvsp[-2].node_args) = args_with_numbered(p, (yyvsp[-2].node_args), max_numparam, it_id);
15003 {
15004 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
15005 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node_args), (yyvsp[0].node), &loc);
15006 nd_set_line(RNODE_LAMBDA((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
15007 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
15008 nd_set_first_loc((yyval.node), (yylsp[-8]).beg_pos);
15009 }
15010 /*% ripper: lambda!($:args, $:body) %*/
15011 numparam_pop(p, (yyvsp[-5].node));
15012 dyna_pop(p, (yyvsp[-7].vars));
15013 }
15014#line 15015 "parse.c"
15015 break;
15016
15017 case 468: /* f_larglist: '(' f_args opt_bv_decl ')' */
15018#line 5209 "parse.y"
15019 {
15020 p->ctxt.in_argdef = 0;
15021 (yyval.node_args) = (yyvsp[-2].node_args);
15022 p->max_numparam = ORDINAL_PARAM;
15023 /*% ripper: paren!($:2) %*/
15024 }
15025#line 15026 "parse.c"
15026 break;
15027
15028 case 469: /* f_larglist: f_args */
15029#line 5216 "parse.y"
15030 {
15031 p->ctxt.in_argdef = 0;
15032 if (!args_info_empty_p(&(yyvsp[0].node_args)->nd_ainfo))
15033 p->max_numparam = ORDINAL_PARAM;
15034 (yyval.node_args) = (yyvsp[0].node_args);
15035 }
15036#line 15037 "parse.c"
15037 break;
15038
15039 case 470: /* lambda_body: tLAMBEG compstmt '}' */
15040#line 5225 "parse.y"
15041 {
15042 token_info_pop(p, "}", &(yylsp[0]));
15043 (yyval.node) = (yyvsp[-1].node);
15044 /*% ripper: $:2 %*/
15045 }
15046#line 15047 "parse.c"
15047 break;
15048
15049 case 471: /* $@26: %empty */
15050#line 5231 "parse.y"
15051 {
15052 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
15053 }
15054#line 15055 "parse.c"
15055 break;
15056
15057 case 472: /* lambda_body: "'do' for lambda" $@26 bodystmt k_end */
15058#line 5235 "parse.y"
15059 {
15060 (yyval.node) = (yyvsp[-1].node);
15061 /*% ripper: $:3 %*/
15062 }
15063#line 15064 "parse.c"
15064 break;
15065
15066 case 473: /* do_block: k_do_block do_body k_end */
15067#line 5242 "parse.y"
15068 {
15069 (yyval.node) = (yyvsp[-1].node);
15070 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
15071 /*% ripper: $:2 %*/
15072 }
15073#line 15074 "parse.c"
15074 break;
15075
15076 case 474: /* block_call: command do_block */
15077#line 5250 "parse.y"
15078 {
15079 if (nd_type_p((yyvsp[-1].node), NODE_YIELD)) {
15080 compile_error(p, "block given to yield");
15081 }
15082 else {
15083 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
15084 }
15085 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15086 fixpos((yyval.node), (yyvsp[-1].node));
15087 /*% ripper: method_add_block!($:1, $:2) %*/
15088 }
15089#line 15090 "parse.c"
15090 break;
15091
15092 case 475: /* block_call: block_call call_op2 operation2 opt_paren_args */
15093#line 5262 "parse.y"
15094 {
15095 bool has_args = (yyvsp[0].node) != 0;
15096 if (NODE_EMPTY_ARGS_P((yyvsp[0].node))) (yyvsp[0].node) = 0;
15097 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15098 /*% ripper: call!($:1, $:2, $:3) %*/
15099 if (has_args) {
15100 /*% ripper: method_add_arg!($:$, $:4) %*/
15101 }
15102 }
15103#line 15104 "parse.c"
15104 break;
15105
15106 case 476: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
15107#line 5272 "parse.y"
15108 {
15109 if (NODE_EMPTY_ARGS_P((yyvsp[-1].node))) (yyvsp[-1].node) = 0;
15110 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
15111 /*% ripper: command_call!($:1, $:2, $:3, $:4) %*/
15112 if ((yyvsp[0].node)) {
15113 /*% ripper: method_add_block!($:$, $:5) %*/
15114 }
15115 }
15116#line 15117 "parse.c"
15117 break;
15118
15119 case 477: /* block_call: block_call call_op2 operation2 command_args do_block */
15120#line 5281 "parse.y"
15121 {
15122 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
15123 /*% ripper: method_add_block!(command_call!($:1, $:2, $:3, $:4), $:5) %*/
15124 }
15125#line 15126 "parse.c"
15126 break;
15127
15128 case 478: /* method_call: fcall paren_args */
15129#line 5288 "parse.y"
15130 {
15131 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
15132 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
15133 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
15134 /*% ripper: method_add_arg!(fcall!($:1), $:2) %*/
15135 }
15136#line 15137 "parse.c"
15137 break;
15138
15139 case 479: /* method_call: primary_value call_op operation2 opt_paren_args */
15140#line 5295 "parse.y"
15141 {
15142 bool has_args = (yyvsp[0].node) != 0;
15143 if (NODE_EMPTY_ARGS_P((yyvsp[0].node))) (yyvsp[0].node) = 0;
15144 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15145 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15146 /*% ripper: call!($:1, $:2, $:3) %*/
15147 if (has_args) {
15148 /*% ripper: method_add_arg!($:$, $:4) %*/
15149 }
15150 }
15151#line 15152 "parse.c"
15152 break;
15153
15154 case 480: /* method_call: primary_value "::" operation2 paren_args */
15155#line 5306 "parse.y"
15156 {
15157 (yyval.node) = new_qcall(p, idCOLON2, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15158 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15159 /*% ripper: method_add_arg!(call!($:1, $:2, $:3), $:4) %*/
15160 }
15161#line 15162 "parse.c"
15162 break;
15163
15164 case 481: /* method_call: primary_value "::" operation3 */
15165#line 5312 "parse.y"
15166 {
15167 (yyval.node) = new_qcall(p, idCOLON2, (yyvsp[-2].node), (yyvsp[0].id), 0, &(yylsp[0]), &(yyloc));
15168 /*% ripper: call!($:1, $:2, $:3) %*/
15169 }
15170#line 15171 "parse.c"
15171 break;
15172
15173 case 482: /* method_call: primary_value call_op paren_args */
15174#line 5317 "parse.y"
15175 {
15176 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), idCall, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15177 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15178 /*% ripper: method_add_arg!(call!($:1, $:2, ID2VAL(idCall)), $:3) %*/
15179 }
15180#line 15181 "parse.c"
15181 break;
15182
15183 case 483: /* method_call: primary_value "::" paren_args */
15184#line 5323 "parse.y"
15185 {
15186 (yyval.node) = new_qcall(p, idCOLON2, (yyvsp[-2].node), idCall, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
15187 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
15188 /*% ripper: method_add_arg!(call!($:1, $:2, ID2VAL(idCall)), $:3) %*/
15189 }
15190#line 15191 "parse.c"
15191 break;
15192
15193 case 484: /* method_call: "'super'" paren_args */
15194#line 5329 "parse.y"
15195 {
15196 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
15197 /*% ripper: super!($:2) %*/
15198 }
15199#line 15200 "parse.c"
15200 break;
15201
15202 case 485: /* method_call: "'super'" */
15203#line 5334 "parse.y"
15204 {
15205 (yyval.node) = NEW_ZSUPER(&(yyloc));
15206 /*% ripper: zsuper! %*/
15207 }
15208#line 15209 "parse.c"
15209 break;
15210
15211 case 486: /* method_call: primary_value '[' opt_call_args rbracket */
15212#line 5339 "parse.y"
15213 {
15214 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
15215 fixpos((yyval.node), (yyvsp[-3].node));
15216 /*% ripper: aref!($:1, $:3) %*/
15217 }
15218#line 15219 "parse.c"
15219 break;
15220
15221 case 487: /* brace_block: '{' brace_body '}' */
15222#line 5347 "parse.y"
15223 {
15224 (yyval.node) = (yyvsp[-1].node);
15225 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
15226 /*% ripper: $:2 %*/
15227 }
15228#line 15229 "parse.c"
15229 break;
15230
15231 case 488: /* brace_block: k_do do_body k_end */
15232#line 5353 "parse.y"
15233 {
15234 (yyval.node) = (yyvsp[-1].node);
15235 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
15236 /*% ripper: $:2 %*/
15237 }
15238#line 15239 "parse.c"
15239 break;
15240
15241 case 489: /* @27: %empty */
15242#line 5360 "parse.y"
15243 {(yyval.vars) = dyna_push(p);}
15244#line 15245 "parse.c"
15245 break;
15246
15247 case 490: /* brace_body: @27 max_numparam numparam it_id allow_exits opt_block_param compstmt */
15248#line 5363 "parse.y"
15249 {
15250 int max_numparam = p->max_numparam;
15251 ID it_id = p->it_id;
15252 p->max_numparam = (yyvsp[-5].num);
15253 p->it_id = (yyvsp[-3].id);
15254 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam, it_id);
15255 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
15256 /*% ripper: brace_block!($:args, $:compstmt) %*/
15257 restore_block_exit(p, (yyvsp[-2].node_exits));
15258 numparam_pop(p, (yyvsp[-4].node));
15259 dyna_pop(p, (yyvsp[-6].vars));
15260 }
15261#line 15262 "parse.c"
15262 break;
15263
15264 case 491: /* @28: %empty */
15265#line 5377 "parse.y"
15266 {
15267 (yyval.vars) = dyna_push(p);
15268 CMDARG_PUSH(0);
15269 }
15270#line 15271 "parse.c"
15271 break;
15272
15273 case 492: /* do_body: @28 max_numparam numparam it_id allow_exits opt_block_param bodystmt */
15274#line 5383 "parse.y"
15275 {
15276 int max_numparam = p->max_numparam;
15277 ID it_id = p->it_id;
15278 p->max_numparam = (yyvsp[-5].num);
15279 p->it_id = (yyvsp[-3].id);
15280 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam, it_id);
15281 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
15282 /*% ripper: do_block!($:args, $:bodystmt) %*/
15283 CMDARG_POP();
15284 restore_block_exit(p, (yyvsp[-2].node_exits));
15285 numparam_pop(p, (yyvsp[-4].node));
15286 dyna_pop(p, (yyvsp[-6].vars));
15287 }
15288#line 15289 "parse.c"
15289 break;
15290
15291 case 493: /* case_args: arg_value */
15292#line 5399 "parse.y"
15293 {
15294 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
15295 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
15296 /*% ripper: args_add!(args_new!, $:arg_value) %*/
15297 }
15298#line 15299 "parse.c"
15299 break;
15300
15301 case 494: /* case_args: "*" arg_value */
15302#line 5405 "parse.y"
15303 {
15304 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc), &(yylsp[-1]));
15305 /*% ripper: args_add_star!(args_new!, $:arg_value) %*/
15306 }
15307#line 15308 "parse.c"
15308 break;
15309
15310 case 495: /* case_args: case_args ',' arg_value */
15311#line 5410 "parse.y"
15312 {
15313 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
15314 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15315 /*% ripper: args_add!($:non_last_args, $:arg_value) %*/
15316 }
15317#line 15318 "parse.c"
15318 break;
15319
15320 case 496: /* case_args: case_args ',' "*" arg_value */
15321#line 5416 "parse.y"
15322 {
15323 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
15324 /*% ripper: args_add_star!($:non_last_args, $:arg_value) %*/
15325 }
15326#line 15327 "parse.c"
15327 break;
15328
15329 case 497: /* case_body: k_when case_args then compstmt cases */
15330#line 5425 "parse.y"
15331 {
15332 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc), &(yylsp[-4]), &(yylsp[-2]));
15333 fixpos((yyval.node), (yyvsp[-3].node));
15334 /*% ripper: when!($:2, $:4, $:5) %*/
15335 }
15336#line 15337 "parse.c"
15337 break;
15338
15339 case 500: /* p_pvtbl: %empty */
15340#line 5436 "parse.y"
15341 {(yyval.tbl) = p->pvtbl; p->pvtbl = st_init_numtable();}
15342#line 15343 "parse.c"
15343 break;
15344
15345 case 501: /* p_pktbl: %empty */
15346#line 5437 "parse.y"
15347 {(yyval.tbl) = p->pktbl; p->pktbl = 0;}
15348#line 15349 "parse.c"
15349 break;
15350
15351 case 502: /* p_in_kwarg: %empty */
15352#line 5439 "parse.y"
15353 {
15354 (yyval.ctxt) = p->ctxt;
15355 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
15356 p->command_start = FALSE;
15357 p->ctxt.in_kwarg = 1;
15358 }
15359#line 15360 "parse.c"
15360 break;
15361
15362 case 503: /* $@29: %empty */
15363#line 5450 "parse.y"
15364 {
15365 pop_pktbl(p, (yyvsp[-2].tbl));
15366 pop_pvtbl(p, (yyvsp[-3].tbl));
15367 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
15368 }
15369#line 15370 "parse.c"
15370 break;
15371
15372 case 504: /* p_case_body: "'in'" p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@29 compstmt p_cases */
15373#line 5457 "parse.y"
15374 {
15375 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15376 /*% ripper: in!($:expr, $:compstmt, $:cases) %*/
15377 }
15378#line 15379 "parse.c"
15379 break;
15380
15381 case 508: /* p_top_expr: p_top_expr_body "'if' modifier" expr_value */
15382#line 5469 "parse.y"
15383 {
15384 (yyval.node) = new_if(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
15385 fixpos((yyval.node), (yyvsp[0].node));
15386 /*% ripper: if_mod!($:3, $:1) %*/
15387 }
15388#line 15389 "parse.c"
15389 break;
15390
15391 case 509: /* p_top_expr: p_top_expr_body "'unless' modifier" expr_value */
15392#line 5475 "parse.y"
15393 {
15394 (yyval.node) = new_unless(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc), &(yylsp[-1]), &NULL_LOC, &NULL_LOC);
15395 fixpos((yyval.node), (yyvsp[0].node));
15396 /*% ripper: unless_mod!($:3, $:1) %*/
15397 }
15398#line 15399 "parse.c"
15399 break;
15400
15401 case 511: /* p_top_expr_body: p_expr ',' */
15402#line 5484 "parse.y"
15403 {
15404 (yyval.node) = new_array_pattern_tail(p, 0, 1, 0, 0, &(yyloc));
15405 (yyval.node) = new_array_pattern(p, 0, (yyvsp[-1].node), (yyval.node), &(yyloc));
15406 /*% ripper: aryptn!(Qnil, [$:1], Qnil, Qnil) %*/
15407 }
15408#line 15409 "parse.c"
15409 break;
15410
15411 case 512: /* p_top_expr_body: p_expr ',' p_args */
15412#line 5490 "parse.y"
15413 {
15414 (yyval.node) = new_array_pattern(p, 0, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15415 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
15416 /*% ripper: aryptn!(Qnil, aryptn_pre_args(p, $:1, $:3[0]), *$:3[1..2]) %*/
15417 }
15418#line 15419 "parse.c"
15419 break;
15420
15421 case 513: /* p_top_expr_body: p_find */
15422#line 5496 "parse.y"
15423 {
15424 (yyval.node) = new_find_pattern(p, 0, (yyvsp[0].node), &(yyloc));
15425 /*% ripper: fndptn!(Qnil, *$:1[0..2]) %*/
15426 }
15427#line 15428 "parse.c"
15428 break;
15429
15430 case 514: /* p_top_expr_body: p_args_tail */
15431#line 5501 "parse.y"
15432 {
15433 (yyval.node) = new_array_pattern(p, 0, 0, (yyvsp[0].node), &(yyloc));
15434 /*% ripper: aryptn!(Qnil, *$:1[0..2]) %*/
15435 }
15436#line 15437 "parse.c"
15437 break;
15438
15439 case 515: /* p_top_expr_body: p_kwargs */
15440#line 5506 "parse.y"
15441 {
15442 (yyval.node) = new_hash_pattern(p, 0, (yyvsp[0].node), &(yyloc));
15443 /*% ripper: hshptn!(Qnil, *$:1[0..1]) %*/
15444 }
15445#line 15446 "parse.c"
15446 break;
15447
15448 case 517: /* p_as: p_expr "=>" p_variable */
15449#line 5516 "parse.y"
15450 {
15451 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
15452 n = list_append(p, n, (yyvsp[0].node));
15453 (yyval.node) = new_hash(p, n, &(yyloc));
15454 /*% ripper: binary!($:1, ID2VAL((id_assoc)), $:3) %*/
15455 }
15456#line 15457 "parse.c"
15457 break;
15458
15459 case 519: /* p_alt: p_alt '|' p_expr_basic */
15460#line 5526 "parse.y"
15461 {
15462 (yyval.node) = NEW_OR((yyvsp[-2].node), (yyvsp[0].node), &(yyloc), &(yylsp[-1]));
15463 /*% ripper: binary!($:1, ID2VAL(idOr), $:3) %*/
15464 }
15465#line 15466 "parse.c"
15466 break;
15467
15468 case 521: /* p_lparen: '(' p_pktbl */
15469#line 5534 "parse.y"
15470 {
15471 (yyval.tbl) = (yyvsp[0].tbl);
15472 /*% ripper: $:2 %*/
15473 }
15474#line 15475 "parse.c"
15475 break;
15476
15477 case 522: /* p_lbracket: '[' p_pktbl */
15478#line 5541 "parse.y"
15479 {
15480 (yyval.tbl) = (yyvsp[0].tbl);
15481 /*% ripper: $:2 %*/
15482 }
15483#line 15484 "parse.c"
15484 break;
15485
15486 case 525: /* p_expr_basic: p_const p_lparen p_args rparen */
15487#line 5550 "parse.y"
15488 {
15489 pop_pktbl(p, (yyvsp[-2].tbl));
15490 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), 0, (yyvsp[-1].node), &(yyloc));
15491 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15492 /*% ripper: aryptn!($:p_const, *$:p_args[0..2]) %*/
15493 }
15494#line 15495 "parse.c"
15495 break;
15496
15497 case 526: /* p_expr_basic: p_const p_lparen p_find rparen */
15498#line 5557 "parse.y"
15499 {
15500 pop_pktbl(p, (yyvsp[-2].tbl));
15501 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15502 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15503 /*% ripper: fndptn!($:p_const, *$:p_find[0..2]) %*/
15504 }
15505#line 15506 "parse.c"
15506 break;
15507
15508 case 527: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
15509#line 5564 "parse.y"
15510 {
15511 pop_pktbl(p, (yyvsp[-2].tbl));
15512 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15513 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15514 /*% ripper: hshptn!($:p_const, *$:p_kwargs[0..1]) %*/
15515 }
15516#line 15517 "parse.c"
15517 break;
15518
15519 case 528: /* p_expr_basic: p_const '(' rparen */
15520#line 5571 "parse.y"
15521 {
15522 (yyval.node) = new_array_pattern_tail(p, 0, 0, 0, 0, &(yyloc));
15523 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), 0, (yyval.node), &(yyloc));
15524 /*% ripper: aryptn!($:p_const, Qnil, Qnil, Qnil) %*/
15525 }
15526#line 15527 "parse.c"
15527 break;
15528
15529 case 529: /* p_expr_basic: p_const p_lbracket p_args rbracket */
15530#line 5577 "parse.y"
15531 {
15532 pop_pktbl(p, (yyvsp[-2].tbl));
15533 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), 0, (yyvsp[-1].node), &(yyloc));
15534 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15535 /*% ripper: aryptn!($:p_const, *$:p_args[0..2]) %*/
15536 }
15537#line 15538 "parse.c"
15538 break;
15539
15540 case 530: /* p_expr_basic: p_const p_lbracket p_find rbracket */
15541#line 5584 "parse.y"
15542 {
15543 pop_pktbl(p, (yyvsp[-2].tbl));
15544 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15545 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15546 /*% ripper: fndptn!($:p_const, *$:p_find[0..2]) %*/
15547 }
15548#line 15549 "parse.c"
15549 break;
15550
15551 case 531: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
15552#line 5591 "parse.y"
15553 {
15554 pop_pktbl(p, (yyvsp[-2].tbl));
15555 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
15556 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
15557 /*% ripper: hshptn!($:p_const, *$:p_kwargs[0..1]) %*/
15558 }
15559#line 15560 "parse.c"
15560 break;
15561
15562 case 532: /* p_expr_basic: p_const '[' rbracket */
15563#line 5598 "parse.y"
15564 {
15565 (yyval.node) = new_array_pattern_tail(p, 0, 0, 0, 0, &(yyloc));
15566 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), 0, (yyval.node), &(yyloc));
15567 /*% ripper: aryptn!($:1, Qnil, Qnil, Qnil) %*/
15568 }
15569#line 15570 "parse.c"
15570 break;
15571
15572 case 533: /* p_expr_basic: "[" p_args rbracket */
15573#line 5604 "parse.y"
15574 {
15575 (yyval.node) = new_array_pattern(p, 0, 0, (yyvsp[-1].node), &(yyloc));
15576 /*% ripper: aryptn!(Qnil, *$:p_args[0..2]) %*/
15577 }
15578#line 15579 "parse.c"
15579 break;
15580
15581 case 534: /* p_expr_basic: "[" p_find rbracket */
15582#line 5609 "parse.y"
15583 {
15584 (yyval.node) = new_find_pattern(p, 0, (yyvsp[-1].node), &(yyloc));
15585 /*% ripper: fndptn!(Qnil, *$:p_find[0..2]) %*/
15586 }
15587#line 15588 "parse.c"
15588 break;
15589
15590 case 535: /* p_expr_basic: "[" rbracket */
15591#line 5614 "parse.y"
15592 {
15593 (yyval.node) = new_array_pattern_tail(p, 0, 0, 0, 0, &(yyloc));
15594 (yyval.node) = new_array_pattern(p, 0, 0, (yyval.node), &(yyloc));
15595 /*% ripper: aryptn!(Qnil, Qnil, Qnil, Qnil) %*/
15596 }
15597#line 15598 "parse.c"
15598 break;
15599
15600 case 536: /* $@30: %empty */
15601#line 5620 "parse.y"
15602 {
15603 p->ctxt.in_kwarg = 0;
15604 }
15605#line 15606 "parse.c"
15606 break;
15607
15608 case 537: /* p_expr_basic: "{" p_pktbl lex_ctxt $@30 p_kwargs rbrace */
15609#line 5624 "parse.y"
15610 {
15611 pop_pktbl(p, (yyvsp[-4].tbl));
15612 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
15613 (yyval.node) = new_hash_pattern(p, 0, (yyvsp[-1].node), &(yyloc));
15614 /*% ripper: hshptn!(Qnil, *$:p_kwargs[0..1]) %*/
15615 }
15616#line 15617 "parse.c"
15617 break;
15618
15619 case 538: /* p_expr_basic: "{" rbrace */
15620#line 5631 "parse.y"
15621 {
15622 (yyval.node) = new_hash_pattern_tail(p, 0, 0, &(yyloc));
15623 (yyval.node) = new_hash_pattern(p, 0, (yyval.node), &(yyloc));
15624 /*% ripper: hshptn!(Qnil, Qnil, Qnil) %*/
15625 }
15626#line 15627 "parse.c"
15627 break;
15628
15629 case 539: /* p_expr_basic: "(" p_pktbl p_expr rparen */
15630#line 5637 "parse.y"
15631 {
15632 pop_pktbl(p, (yyvsp[-2].tbl));
15633 (yyval.node) = (yyvsp[-1].node);
15634 /*% ripper: $:p_expr %*/
15635 }
15636#line 15637 "parse.c"
15637 break;
15638
15639 case 540: /* p_args: p_expr */
15640#line 5645 "parse.y"
15641 {
15642 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
15643 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, 0, 0, &(yyloc));
15644 /*% ripper: [[$:1], Qnil, Qnil] %*/
15645 }
15646#line 15647 "parse.c"
15647 break;
15648
15649 case 541: /* p_args: p_args_head */
15650#line 5651 "parse.y"
15651 {
15652 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, 0, 0, &(yyloc));
15653 /*% ripper: [$:1, Qnil, Qnil] %*/
15654 }
15655#line 15656 "parse.c"
15656 break;
15657
15658 case 542: /* p_args: p_args_head p_arg */
15659#line 5656 "parse.y"
15660 {
15661 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, 0, 0, &(yyloc));
15662 /*% ripper: [rb_ary_concat($:1, $:2), Qnil, Qnil] %*/
15663 }
15664#line 15665 "parse.c"
15665 break;
15666
15667 case 543: /* p_args: p_args_head p_rest */
15668#line 5661 "parse.y"
15669 {
15670 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, (yyvsp[0].node), 0, &(yyloc));
15671 /*% ripper: [$:1, $:2, Qnil] %*/
15672 }
15673#line 15674 "parse.c"
15674 break;
15675
15676 case 544: /* p_args: p_args_head p_rest ',' p_args_post */
15677#line 5666 "parse.y"
15678 {
15679 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15680 /*% ripper: [$:1, $:2, $:4] %*/
15681 }
15682#line 15683 "parse.c"
15683 break;
15684
15685 case 546: /* p_args_head: p_arg ',' */
15686#line 5674 "parse.y"
15687 {
15688 (yyval.node) = (yyvsp[-1].node);
15689 }
15690#line 15691 "parse.c"
15691 break;
15692
15693 case 547: /* p_args_head: p_args_head p_arg ',' */
15694#line 5678 "parse.y"
15695 {
15696 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
15697 /*% ripper: rb_ary_concat($:1, $:2) %*/
15698 }
15699#line 15700 "parse.c"
15700 break;
15701
15702 case 548: /* p_args_tail: p_rest */
15703#line 5685 "parse.y"
15704 {
15705 (yyval.node) = new_array_pattern_tail(p, 0, 1, (yyvsp[0].node), 0, &(yyloc));
15706 /*% ripper: [Qnil, $:1, Qnil] %*/
15707 }
15708#line 15709 "parse.c"
15709 break;
15710
15711 case 549: /* p_args_tail: p_rest ',' p_args_post */
15712#line 5690 "parse.y"
15713 {
15714 (yyval.node) = new_array_pattern_tail(p, 0, 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15715 /*% ripper: [Qnil, $:1, $:3] %*/
15716 }
15717#line 15718 "parse.c"
15718 break;
15719
15720 case 550: /* p_find: p_rest ',' p_args_post ',' p_rest */
15721#line 5697 "parse.y"
15722 {
15723 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15724 /*% ripper: [$:1, $:3, $:5] %*/
15725 }
15726#line 15727 "parse.c"
15727 break;
15728
15729 case 551: /* p_rest: "*" "local variable or method" */
15730#line 5705 "parse.y"
15731 {
15732 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15733 /*% ripper: var_field!($:2) %*/
15734 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15735 }
15736#line 15737 "parse.c"
15737 break;
15738
15739 case 552: /* p_rest: "*" */
15740#line 5711 "parse.y"
15741 {
15742 (yyval.node) = 0;
15743 /*% ripper: var_field!(Qnil) %*/
15744 }
15745#line 15746 "parse.c"
15746 break;
15747
15748 case 554: /* p_args_post: p_args_post ',' p_arg */
15749#line 5719 "parse.y"
15750 {
15751 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
15752 /*% ripper: rb_ary_concat($:1, $:3) %*/
15753 }
15754#line 15755 "parse.c"
15755 break;
15756
15757 case 555: /* p_arg: p_expr */
15758#line 5726 "parse.y"
15759 {
15760 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
15761 /*% ripper: [$:1] %*/
15762 }
15763#line 15764 "parse.c"
15764 break;
15765
15766 case 556: /* p_kwargs: p_kwarg ',' p_any_kwrest */
15767#line 5733 "parse.y"
15768 {
15769 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
15770 /*% ripper: [$:1, $:3] %*/
15771 }
15772#line 15773 "parse.c"
15773 break;
15774
15775 case 557: /* p_kwargs: p_kwarg */
15776#line 5738 "parse.y"
15777 {
15778 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
15779 /*% ripper: [$:1, Qnil] %*/
15780 }
15781#line 15782 "parse.c"
15782 break;
15783
15784 case 558: /* p_kwargs: p_kwarg ',' */
15785#line 5743 "parse.y"
15786 {
15787 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
15788 /*% ripper: [$:1, Qnil] %*/
15789 }
15790#line 15791 "parse.c"
15791 break;
15792
15793 case 559: /* p_kwargs: p_any_kwrest */
15794#line 5748 "parse.y"
15795 {
15796 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, 0, &(yyloc)), (yyvsp[0].id), &(yyloc));
15797 /*% ripper: [[], $:1] %*/
15798 }
15799#line 15800 "parse.c"
15800 break;
15801
15802 case 561: /* p_kwarg: p_kwarg ',' p_kw */
15803#line 5757 "parse.y"
15804 {
15805 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
15806 /*% ripper: rb_ary_push($:1, $:3) %*/
15807 }
15808#line 15809 "parse.c"
15809 break;
15810
15811 case 562: /* p_kw: p_kw_label p_expr */
15812#line 5764 "parse.y"
15813 {
15814 error_duplicate_pattern_key(p, (yyvsp[-1].id), &(yylsp[-1]));
15815 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
15816 /*% ripper: [$:1, $:2] %*/
15817 }
15818#line 15819 "parse.c"
15819 break;
15820
15821 case 563: /* p_kw: p_kw_label */
15822#line 5770 "parse.y"
15823 {
15824 error_duplicate_pattern_key(p, (yyvsp[0].id), &(yylsp[0]));
15825 if ((yyvsp[0].id) && !is_local_id((yyvsp[0].id))) {
15826 yyerror1(&(yylsp[0]), "key must be valid as local variables");
15827 }
15828 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15829 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
15830 /*% ripper: [$:1, Qnil] %*/
15831 }
15832#line 15833 "parse.c"
15833 break;
15834
15835 case 565: /* p_kw_label: "string literal" string_contents tLABEL_END */
15836#line 5783 "parse.y"
15837 {
15838 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
15839 if (!(yyvsp[-1].node) || nd_type_p((yyvsp[-1].node), NODE_STR)) {
15840 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
15841 (yyval.id) = rb_sym2id(rb_node_sym_string_val(node));
15842 }
15843 else {
15844 yyerror1(&loc, "symbol literal with interpolation is not allowed");
15845 (yyval.id) = rb_intern_str(STR_NEW0());
15846 }
15847 /*% ripper: $:2 %*/
15848 }
15849#line 15850 "parse.c"
15850 break;
15851
15852 case 566: /* p_kwrest: kwrest_mark "local variable or method" */
15853#line 5798 "parse.y"
15854 {
15855 (yyval.id) = (yyvsp[0].id);
15856 /*% ripper: var_field!($:2) %*/
15857 }
15858#line 15859 "parse.c"
15859 break;
15860
15861 case 567: /* p_kwrest: kwrest_mark */
15862#line 5803 "parse.y"
15863 {
15864 (yyval.id) = 0;
15865 /*% ripper: Qnil %*/
15866 }
15867#line 15868 "parse.c"
15868 break;
15869
15870 case 568: /* p_kwnorest: kwrest_mark "'nil'" */
15871#line 5810 "parse.y"
15872 {
15873 (yyval.id) = 0;
15874 }
15875#line 15876 "parse.c"
15876 break;
15877
15878 case 570: /* p_any_kwrest: p_kwnorest */
15879#line 5817 "parse.y"
15880 {
15881 (yyval.id) = idNil;
15882 /*% ripper: var_field!(ID2VAL(idNil)) %*/
15883 }
15884#line 15885 "parse.c"
15885 break;
15886
15887 case 572: /* p_value: p_primitive ".." p_primitive */
15888#line 5825 "parse.y"
15889 {
15890 value_expr((yyvsp[-2].node));
15891 value_expr((yyvsp[0].node));
15892 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15893 /*% ripper: dot2!($:1, $:3) %*/
15894 }
15895#line 15896 "parse.c"
15896 break;
15897
15898 case 573: /* p_value: p_primitive "..." p_primitive */
15899#line 5832 "parse.y"
15900 {
15901 value_expr((yyvsp[-2].node));
15902 value_expr((yyvsp[0].node));
15903 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
15904 /*% ripper: dot3!($:1, $:3) %*/
15905 }
15906#line 15907 "parse.c"
15907 break;
15908
15909 case 574: /* p_value: p_primitive ".." */
15910#line 5839 "parse.y"
15911 {
15912 value_expr((yyvsp[-1].node));
15913 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15914 /*% ripper: dot2!($:1, Qnil) %*/
15915 }
15916#line 15917 "parse.c"
15917 break;
15918
15919 case 575: /* p_value: p_primitive "..." */
15920#line 5845 "parse.y"
15921 {
15922 value_expr((yyvsp[-1].node));
15923 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15924 /*% ripper: dot3!($:1, Qnil) %*/
15925 }
15926#line 15927 "parse.c"
15927 break;
15928
15929 case 579: /* p_value: "(.." p_primitive */
15930#line 5854 "parse.y"
15931 {
15932 value_expr((yyvsp[0].node));
15933 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15934 /*% ripper: dot2!(Qnil, $:2) %*/
15935 }
15936#line 15937 "parse.c"
15937 break;
15938
15939 case 580: /* p_value: "(..." p_primitive */
15940#line 5860 "parse.y"
15941 {
15942 value_expr((yyvsp[0].node));
15943 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15944 /*% ripper: dot3!(Qnil, $:2) %*/
15945 }
15946#line 15947 "parse.c"
15947 break;
15948
15949 case 589: /* p_primitive: keyword_variable */
15950#line 5869 "parse.y"
15951 {
15952 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
15953 /*% ripper: var_ref!($:1) %*/
15954 }
15955#line 15956 "parse.c"
15956 break;
15957
15958 case 591: /* p_variable: "local variable or method" */
15959#line 5877 "parse.y"
15960 {
15961 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15962 /*% ripper: var_field!($:1) %*/
15963 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15964 }
15965#line 15966 "parse.c"
15966 break;
15967
15968 case 592: /* p_var_ref: '^' "local variable or method" */
15969#line 5885 "parse.y"
15970 {
15971 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
15972 if (!n) {
15973 n = NEW_ERROR(&(yyloc));
15974 }
15975 else if (!(nd_type_p(n, NODE_LVAR) || nd_type_p(n, NODE_DVAR))) {
15976 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
15977 }
15978 (yyval.node) = n;
15979 /*% ripper: var_ref!($:2) %*/
15980 }
15981#line 15982 "parse.c"
15982 break;
15983
15984 case 593: /* p_var_ref: '^' nonlocal_var */
15985#line 5897 "parse.y"
15986 {
15987 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
15988 /*% ripper: var_ref!($:2) %*/
15989 }
15990#line 15991 "parse.c"
15991 break;
15992
15993 case 594: /* p_expr_ref: '^' "(" expr_value rparen */
15994#line 5904 "parse.y"
15995 {
15996 (yyval.node) = NEW_BLOCK((yyvsp[-1].node), &(yyloc));
15997 /*% ripper: begin!($:3) %*/
15998 }
15999#line 16000 "parse.c"
16000 break;
16001
16002 case 595: /* p_const: ":: at EXPR_BEG" cname */
16003#line 5911 "parse.y"
16004 {
16005 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
16006 /*% ripper: top_const_ref!($:2) %*/
16007 }
16008#line 16009 "parse.c"
16009 break;
16010
16011 case 596: /* p_const: p_const "::" cname */
16012#line 5916 "parse.y"
16013 {
16014 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
16015 /*% ripper: const_path_ref!($:1, $:3) %*/
16016 }
16017#line 16018 "parse.c"
16018 break;
16019
16020 case 597: /* p_const: "constant" */
16021#line 5921 "parse.y"
16022 {
16023 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
16024 /*% ripper: var_ref!($:1) %*/
16025 }
16026#line 16027 "parse.c"
16027 break;
16028
16029 case 598: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
16030#line 5930 "parse.y"
16031 {
16032 NODE *err = (yyvsp[-3].node);
16033 if ((yyvsp[-3].node)) {
16034 err = NEW_ERRINFO(&(yylsp[-3]));
16035 err = node_assign(p, (yyvsp[-3].node), err, NO_LEX_CTXT, &(yylsp[-3]));
16036 }
16037 (yyval.node) = NEW_RESBODY((yyvsp[-4].node), (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16038 if ((yyvsp[-4].node)) {
16039 fixpos((yyval.node), (yyvsp[-4].node));
16040 }
16041 else if ((yyvsp[-3].node)) {
16042 fixpos((yyval.node), (yyvsp[-3].node));
16043 }
16044 else {
16045 fixpos((yyval.node), (yyvsp[-1].node));
16046 }
16047 /*% ripper: rescue!($:2, $:3, $:5, $:6) %*/
16048 }
16049#line 16050 "parse.c"
16050 break;
16051
16052 case 600: /* exc_list: arg_value */
16053#line 5952 "parse.y"
16054 {
16055 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
16056 /*% ripper: rb_ary_new3(1, $:1) %*/
16057 }
16058#line 16059 "parse.c"
16059 break;
16060
16061 case 601: /* exc_list: mrhs */
16062#line 5957 "parse.y"
16063 {
16064 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
16065 }
16066#line 16067 "parse.c"
16067 break;
16068
16069 case 603: /* exc_var: "=>" lhs */
16070#line 5964 "parse.y"
16071 {
16072 (yyval.node) = (yyvsp[0].node);
16073 /*% ripper: $:2 %*/
16074 }
16075#line 16076 "parse.c"
16076 break;
16077
16078 case 605: /* opt_ensure: k_ensure stmts option_terms */
16079#line 5972 "parse.y"
16080 {
16081 p->ctxt.in_rescue = (yyvsp[-2].ctxt).in_rescue;
16082 (yyval.node) = (yyvsp[-1].node);
16083 void_expr(p, void_stmts(p, (yyval.node)));
16084 /*% ripper: ensure!($:2) %*/
16085 }
16086#line 16087 "parse.c"
16087 break;
16088
16089 case 609: /* strings: string */
16090#line 5986 "parse.y"
16091 {
16092 NODE *node = (yyvsp[0].node);
16093 if (!node) {
16094 node = NEW_STR(STRING_NEW0(), &(yyloc));
16095 }
16096 else {
16097 node = evstr2dstr(p, node);
16098 }
16099 (yyval.node) = node;
16100 /*% ripper: $:1 %*/
16101 }
16102#line 16103 "parse.c"
16103 break;
16104
16105 case 612: /* string: string string1 */
16106#line 6002 "parse.y"
16107 {
16108 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16109 /*% ripper: string_concat!($:1, $:2) %*/
16110 }
16111#line 16112 "parse.c"
16112 break;
16113
16114 case 613: /* string1: "string literal" string_contents "terminator" */
16115#line 6009 "parse.y"
16116 {
16117 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
16118 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
16119 /*% ripper: $:2 %*/
16120 if (p->heredoc_indent > 0) {
16121 /*% ripper: heredoc_dedent!($:$, INT2NUM(%{p->heredoc_indent})) %*/
16122 p->heredoc_indent = 0;
16123 }
16124 /*% ripper: string_literal!($:$) %*/
16125 }
16126#line 16127 "parse.c"
16127 break;
16128
16129 case 614: /* xstring: "backtick literal" xstring_contents "terminator" */
16130#line 6022 "parse.y"
16131 {
16132 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
16133 /*% ripper: $:2 %*/
16134 if (p->heredoc_indent > 0) {
16135 /*% ripper: heredoc_dedent!($:$, INT2NUM(%{p->heredoc_indent})) %*/
16136 p->heredoc_indent = 0;
16137 }
16138 /*% ripper: xstring_literal!($:$) %*/
16139 }
16140#line 16141 "parse.c"
16141 break;
16142
16143 case 615: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
16144#line 6034 "parse.y"
16145 {
16146 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
16147 /*% ripper: regexp_literal!($:2, $:3) %*/
16148 }
16149#line 16150 "parse.c"
16150 break;
16151
16152 case 618: /* words_tWORDS_BEG_word_list: "word list" nonempty_list_' ' word_list "terminator" */
16153#line 2961 "parse.y"
16154 {
16155 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16156 /*% ripper: array!($:3) %*/
16157 }
16158#line 16159 "parse.c"
16159 break;
16160
16161 case 620: /* word_list: %empty */
16162#line 6044 "parse.y"
16163 {
16164 (yyval.node) = 0;
16165 /*% ripper: words_new! %*/
16166 }
16167#line 16168 "parse.c"
16168 break;
16169
16170 case 621: /* word_list: word_list word nonempty_list_' ' */
16171#line 6049 "parse.y"
16172 {
16173 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
16174 /*% ripper: words_add!($:1, $:2) %*/
16175 }
16176#line 16177 "parse.c"
16177 break;
16178
16179 case 623: /* word: word string_content */
16180#line 6058 "parse.y"
16181 {
16182 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16183 /*% ripper: word_add!($:1, $:2) %*/
16184 }
16185#line 16186 "parse.c"
16186 break;
16187
16188 case 624: /* words_tSYMBOLS_BEG_symbol_list: "symbol list" nonempty_list_' ' symbol_list "terminator" */
16189#line 2961 "parse.y"
16190 {
16191 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16192 /*% ripper: array!($:3) %*/
16193 }
16194#line 16195 "parse.c"
16195 break;
16196
16197 case 626: /* symbol_list: %empty */
16198#line 6068 "parse.y"
16199 {
16200 (yyval.node) = 0;
16201 /*% ripper: symbols_new! %*/
16202 }
16203#line 16204 "parse.c"
16204 break;
16205
16206 case 627: /* symbol_list: symbol_list word nonempty_list_' ' */
16207#line 6073 "parse.y"
16208 {
16209 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
16210 /*% ripper: symbols_add!($:1, $:2) %*/
16211 }
16212#line 16213 "parse.c"
16213 break;
16214
16215 case 628: /* words_tQWORDS_BEG_qword_list: "verbatim word list" nonempty_list_' ' qword_list "terminator" */
16216#line 2961 "parse.y"
16217 {
16218 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16219 /*% ripper: array!($:3) %*/
16220 }
16221#line 16222 "parse.c"
16222 break;
16223
16224 case 630: /* words_tQSYMBOLS_BEG_qsym_list: "verbatim symbol list" nonempty_list_' ' qsym_list "terminator" */
16225#line 2961 "parse.y"
16226 {
16227 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
16228 /*% ripper: array!($:3) %*/
16229 }
16230#line 16231 "parse.c"
16231 break;
16232
16233 case 632: /* qword_list: %empty */
16234#line 6086 "parse.y"
16235 {
16236 (yyval.node) = 0;
16237 /*% ripper: qwords_new! %*/
16238 }
16239#line 16240 "parse.c"
16240 break;
16241
16242 case 633: /* qword_list: qword_list "literal content" nonempty_list_' ' */
16243#line 6091 "parse.y"
16244 {
16245 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
16246 /*% ripper: qwords_add!($:1, $:2) %*/
16247 }
16248#line 16249 "parse.c"
16249 break;
16250
16251 case 634: /* qsym_list: %empty */
16252#line 6098 "parse.y"
16253 {
16254 (yyval.node) = 0;
16255 /*% ripper: qsymbols_new! %*/
16256 }
16257#line 16258 "parse.c"
16258 break;
16259
16260 case 635: /* qsym_list: qsym_list "literal content" nonempty_list_' ' */
16261#line 6103 "parse.y"
16262 {
16263 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
16264 /*% ripper: qsymbols_add!($:1, $:2) %*/
16265 }
16266#line 16267 "parse.c"
16267 break;
16268
16269 case 636: /* string_contents: %empty */
16270#line 6110 "parse.y"
16271 {
16272 (yyval.node) = 0;
16273 /*% ripper: string_content! %*/
16274 }
16275#line 16276 "parse.c"
16276 break;
16277
16278 case 637: /* string_contents: string_contents string_content */
16279#line 6115 "parse.y"
16280 {
16281 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16282 /*% ripper: string_add!($:1, $:2) %*/
16283 }
16284#line 16285 "parse.c"
16285 break;
16286
16287 case 638: /* xstring_contents: %empty */
16288#line 6122 "parse.y"
16289 {
16290 (yyval.node) = 0;
16291 /*% ripper: xstring_new! %*/
16292 }
16293#line 16294 "parse.c"
16294 break;
16295
16296 case 639: /* xstring_contents: xstring_contents string_content */
16297#line 6127 "parse.y"
16298 {
16299 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
16300 /*% ripper: xstring_add!($:1, $:2) %*/
16301 }
16302#line 16303 "parse.c"
16303 break;
16304
16305 case 640: /* regexp_contents: %empty */
16306#line 6134 "parse.y"
16307 {
16308 (yyval.node) = 0;
16309 /*% ripper: regexp_new! %*/
16310 }
16311#line 16312 "parse.c"
16312 break;
16313
16314 case 641: /* regexp_contents: regexp_contents string_content */
16315#line 6139 "parse.y"
16316 {
16317 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
16318 if (!head) {
16319 (yyval.node) = tail;
16320 }
16321 else if (!tail) {
16322 (yyval.node) = head;
16323 }
16324 else {
16325 switch (nd_type(head)) {
16326 case NODE_STR:
16327 head = str2dstr(p, head);
16328 break;
16329 case NODE_DSTR:
16330 break;
16331 default:
16332 head = list_append(p, NEW_DSTR(0, &(yyloc)), head);
16333 break;
16334 }
16335 (yyval.node) = list_append(p, head, tail);
16336 }
16337 /*% ripper: regexp_add!($:1, $:2) %*/
16338 }
16339#line 16340 "parse.c"
16340 break;
16341
16342 case 643: /* @31: %empty */
16343#line 6167 "parse.y"
16344 {
16345 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
16346 (yyval.strterm) = p->lex.strterm;
16347 p->lex.strterm = 0;
16348 SET_LEX_STATE(EXPR_BEG);
16349 }
16350#line 16351 "parse.c"
16351 break;
16352
16353 case 644: /* string_content: tSTRING_DVAR @31 string_dvar */
16354#line 6174 "parse.y"
16355 {
16356 p->lex.strterm = (yyvsp[-1].strterm);
16357 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
16358 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
16359 /*% ripper: string_dvar!($:3) %*/
16360 }
16361#line 16362 "parse.c"
16362 break;
16363
16364 case 645: /* @32: %empty */
16365#line 6181 "parse.y"
16366 {
16367 CMDARG_PUSH(0);
16368 COND_PUSH(0);
16369 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
16370 (yyval.strterm) = p->lex.strterm;
16371 p->lex.strterm = 0;
16372 SET_LEX_STATE(EXPR_BEG);
16373 }
16374#line 16375 "parse.c"
16375 break;
16376
16377 case 646: /* @33: %empty */
16378#line 6189 "parse.y"
16379 {
16380 (yyval.num) = p->lex.brace_nest;
16381 p->lex.brace_nest = 0;
16382 }
16383#line 16384 "parse.c"
16384 break;
16385
16386 case 647: /* @34: %empty */
16387#line 6193 "parse.y"
16388 {
16389 (yyval.num) = p->heredoc_indent;
16390 p->heredoc_indent = 0;
16391 }
16392#line 16393 "parse.c"
16393 break;
16394
16395 case 648: /* string_content: "'#{'" @32 @33 @34 compstmt string_dend */
16396#line 6198 "parse.y"
16397 {
16398 COND_POP();
16399 CMDARG_POP();
16400 p->lex.strterm = (yyvsp[-4].strterm);
16401 SET_LEX_STATE((yyvsp[-5].state));
16402 p->lex.brace_nest = (yyvsp[-3].num);
16403 p->heredoc_indent = (yyvsp[-2].num);
16404 p->heredoc_line_indent = -1;
16405 if ((yyvsp[-1].node)) nd_unset_fl_newline((yyvsp[-1].node));
16406 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
16407 /*% ripper: string_embexpr!($:compstmt) %*/
16408 }
16409#line 16410 "parse.c"
16410 break;
16411
16412 case 651: /* string_dvar: nonlocal_var */
16413#line 6217 "parse.y"
16414 {
16415 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
16416 /*% ripper: var_ref!($:1) %*/
16417 }
16418#line 16419 "parse.c"
16419 break;
16420
16421 case 655: /* ssym: "symbol literal" sym */
16422#line 6229 "parse.y"
16423 {
16424 SET_LEX_STATE(EXPR_END);
16425 VALUE str = rb_id2str((yyvsp[0].id));
16426 /*
16427 * TODO:
16428 * set_yylval_noname sets invalid id to yylval.
16429 * This branch can be removed once yylval is changed to
16430 * hold lexed string.
16431 */
16432 if (!str) str = STR_NEW0();
16433 (yyval.node) = NEW_SYM(str, &(yyloc));
16434 /*% ripper: symbol_literal!(symbol!($:2)) %*/
16435 }
16436#line 16437 "parse.c"
16437 break;
16438
16439 case 658: /* dsym: "symbol literal" string_contents "terminator" */
16440#line 6249 "parse.y"
16441 {
16442 SET_LEX_STATE(EXPR_END);
16443 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
16444 /*% ripper: dyna_symbol!($:2) %*/
16445 }
16446#line 16447 "parse.c"
16447 break;
16448
16449 case 660: /* numeric: tUMINUS_NUM simple_numeric */
16450#line 6258 "parse.y"
16451 {
16452 (yyval.node) = (yyvsp[0].node);
16453 negate_lit(p, (yyval.node));
16454 /*% ripper: unary!(ID2VAL(idUMinus), $:2) %*/
16455 }
16456#line 16457 "parse.c"
16457 break;
16458
16459 case 671: /* keyword_variable: "'nil'" */
16460#line 6280 "parse.y"
16461 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
16462#line 16463 "parse.c"
16463 break;
16464
16465 case 672: /* keyword_variable: "'self'" */
16466#line 6281 "parse.y"
16467 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
16468#line 16469 "parse.c"
16469 break;
16470
16471 case 673: /* keyword_variable: "'true'" */
16472#line 6282 "parse.y"
16473 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
16474#line 16475 "parse.c"
16475 break;
16476
16477 case 674: /* keyword_variable: "'false'" */
16478#line 6283 "parse.y"
16479 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
16480#line 16481 "parse.c"
16481 break;
16482
16483 case 675: /* keyword_variable: "'__FILE__'" */
16484#line 6284 "parse.y"
16485 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
16486#line 16487 "parse.c"
16487 break;
16488
16489 case 676: /* keyword_variable: "'__LINE__'" */
16490#line 6285 "parse.y"
16491 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
16492#line 16493 "parse.c"
16493 break;
16494
16495 case 677: /* keyword_variable: "'__ENCODING__'" */
16496#line 6286 "parse.y"
16497 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
16498#line 16499 "parse.c"
16499 break;
16500
16501 case 678: /* var_ref: user_variable */
16502#line 6290 "parse.y"
16503 {
16504 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
16505 if (ifdef_ripper(id_is_var(p, (yyvsp[0].id)), false)) {
16506 /*% ripper: var_ref!($:1) %*/
16507 }
16508 else {
16509 /*% ripper: vcall!($:1) %*/
16510 }
16511 }
16512#line 16513 "parse.c"
16513 break;
16514
16515 case 679: /* var_ref: keyword_variable */
16516#line 6300 "parse.y"
16517 {
16518 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
16519 /*% ripper: var_ref!($:1) %*/
16520 }
16521#line 16522 "parse.c"
16522 break;
16523
16524 case 680: /* var_lhs: user_variable */
16525#line 6307 "parse.y"
16526 {
16527 /*% ripper: var_field!($:1) %*/
16528 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
16529 }
16530#line 16531 "parse.c"
16531 break;
16532
16533 case 681: /* var_lhs: keyword_variable */
16534#line 6307 "parse.y"
16535 {
16536 /*% ripper: var_field!($:1) %*/
16537 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
16538 }
16539#line 16540 "parse.c"
16540 break;
16541
16542 case 684: /* $@35: %empty */
16543#line 6318 "parse.y"
16544 {
16545 SET_LEX_STATE(EXPR_BEG);
16546 p->command_start = TRUE;
16547 }
16548#line 16549 "parse.c"
16549 break;
16550
16551 case 685: /* superclass: '<' $@35 expr_value term */
16552#line 6323 "parse.y"
16553 {
16554 (yyval.node) = (yyvsp[-1].node);
16555 /*% ripper: $:3 %*/
16556 }
16557#line 16558 "parse.c"
16558 break;
16559
16560 case 686: /* superclass: %empty */
16561#line 6328 "parse.y"
16562 {
16563 (yyval.node) = 0;
16564 /*% ripper: Qnil %*/
16565 }
16566#line 16567 "parse.c"
16567 break;
16568
16569 case 688: /* f_opt_paren_args: none */
16570#line 6336 "parse.y"
16571 {
16572 p->ctxt.in_argdef = 0;
16573 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[-1]));
16574 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyval.node_args), &(yylsp[-1]));
16575 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, Qnil) %*/
16576 }
16577#line 16578 "parse.c"
16578 break;
16579
16580 case 689: /* f_paren_args: '(' f_args rparen */
16581#line 6345 "parse.y"
16582 {
16583 (yyval.node_args) = (yyvsp[-1].node_args);
16584 /*% ripper: paren!($:2) %*/
16585 SET_LEX_STATE(EXPR_BEG);
16586 p->command_start = TRUE;
16587 p->ctxt.in_argdef = 0;
16588 }
16589#line 16590 "parse.c"
16590 break;
16591
16592 case 691: /* @36: %empty */
16593#line 6355 "parse.y"
16594 {
16595 (yyval.ctxt) = p->ctxt;
16596 p->ctxt.in_kwarg = 1;
16597 p->ctxt.in_argdef = 1;
16598 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
16599 }
16600#line 16601 "parse.c"
16601 break;
16602
16603 case 692: /* f_arglist: @36 f_args term */
16604#line 6362 "parse.y"
16605 {
16606 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
16607 p->ctxt.in_argdef = 0;
16608 (yyval.node_args) = (yyvsp[-1].node_args);
16609 SET_LEX_STATE(EXPR_BEG);
16610 p->command_start = TRUE;
16611 /*% ripper: $:2 %*/
16612 }
16613#line 16614 "parse.c"
16614 break;
16615
16616 case 693: /* f_kwarg_f_kw: f_kw */
16617#line 2935 "parse.y"
16618 {
16619 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
16620 /*% ripper: rb_ary_new3(1, $:1) %*/
16621 }
16622#line 16623 "parse.c"
16623 break;
16624
16625 case 694: /* f_kwarg_f_kw: f_kwarg_f_kw ',' f_kw */
16626#line 2940 "parse.y"
16627 {
16628 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
16629 /*% ripper: rb_ary_push($:1, $:3) %*/
16630 }
16631#line 16632 "parse.c"
16632 break;
16633
16634 case 695: /* args_tail: f_kwarg_f_kw ',' f_kwrest opt_f_block_arg */
16635#line 6373 "parse.y"
16636 {
16637 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
16638 /*% ripper: [$:1, $:3, $:4] %*/
16639 }
16640#line 16641 "parse.c"
16641 break;
16642
16643 case 696: /* args_tail: f_kwarg_f_kw opt_f_block_arg */
16644#line 6378 "parse.y"
16645 {
16646 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), 0, (yyvsp[0].id), &(yylsp[-1]));
16647 /*% ripper: [$:1, Qnil, $:2] %*/
16648 }
16649#line 16650 "parse.c"
16650 break;
16651
16652 case 697: /* args_tail: f_any_kwrest opt_f_block_arg */
16653#line 6383 "parse.y"
16654 {
16655 (yyval.node_args) = new_args_tail(p, 0, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
16656 /*% ripper: [Qnil, $:1, $:2] %*/
16657 }
16658#line 16659 "parse.c"
16659 break;
16660
16661 case 698: /* args_tail: f_block_arg */
16662#line 6388 "parse.y"
16663 {
16664 (yyval.node_args) = new_args_tail(p, 0, 0, (yyvsp[0].id), &(yylsp[0]));
16665 /*% ripper: [Qnil, Qnil, $:1] %*/
16666 }
16667#line 16668 "parse.c"
16668 break;
16669
16670 case 699: /* args_tail: args_forward */
16671#line 6393 "parse.y"
16672 {
16673 ID fwd = (yyvsp[0].id);
16674 if (lambda_beginning_p() ||
16675 (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest)) {
16676 yyerror0("unexpected ... in lambda argument");
16677 fwd = 0;
16678 }
16679 else {
16680 add_forwarding_args(p);
16681 }
16682 (yyval.node_args) = new_args_tail(p, 0, fwd, arg_FWD_BLOCK, &(yylsp[0]));
16683 (yyval.node_args)->nd_ainfo.forwarding = 1;
16684 /*% ripper: [Qnil, $:1, Qnil] %*/
16685 }
16686#line 16687 "parse.c"
16687 break;
16688
16689 case 700: /* f_opt_arg_value: f_arg_asgn f_eq arg_value */
16690#line 2913 "parse.y"
16691 {
16692 p->ctxt.in_argdef = 1;
16693 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16694 /*% ripper: [$:$, $:3] %*/
16695 }
16696#line 16697 "parse.c"
16697 break;
16698
16699 case 701: /* f_optarg_arg_value: f_opt_arg_value */
16700#line 2922 "parse.y"
16701 {
16702 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
16703 /*% ripper: rb_ary_new3(1, $:1) %*/
16704 }
16705#line 16706 "parse.c"
16706 break;
16707
16708 case 702: /* f_optarg_arg_value: f_optarg_arg_value ',' f_opt_arg_value */
16709#line 2927 "parse.y"
16710 {
16711 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
16712 /*% ripper: rb_ary_push($:1, $:3) %*/
16713 }
16714#line 16715 "parse.c"
16715 break;
16716
16717 case 703: /* opt_args_tail_args_tail: ',' args_tail */
16718#line 2948 "parse.y"
16719 {
16720 (yyval.node_args) = (yyvsp[0].node_args);
16721 /*% ripper: $:2 %*/
16722 }
16723#line 16724 "parse.c"
16724 break;
16725
16726 case 704: /* opt_args_tail_args_tail: %empty */
16727#line 2953 "parse.y"
16728 {
16729 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
16730 /*% ripper: [Qnil, Qnil, Qnil] %*/
16731 }
16732#line 16733 "parse.c"
16733 break;
16734
16735 case 705: /* f_args: f_arg ',' f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail */
16736#line 6410 "parse.y"
16737 {
16738 (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));
16739 /*% ripper: params!($:1, $:3, $:5, Qnil, *$:6[0..2]) %*/
16740 }
16741#line 16742 "parse.c"
16742 break;
16743
16744 case 706: /* f_args: f_arg ',' f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail */
16745#line 6415 "parse.y"
16746 {
16747 (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));
16748 /*% ripper: params!($:1, $:3, $:5, $:7, *$:8[0..2]) %*/
16749 }
16750#line 16751 "parse.c"
16751 break;
16752
16753 case 707: /* f_args: f_arg ',' f_optarg_arg_value opt_args_tail_args_tail */
16754#line 6420 "parse.y"
16755 {
16756 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
16757 /*% ripper: params!($:1, $:3, Qnil, Qnil, *$:4[0..2]) %*/
16758 }
16759#line 16760 "parse.c"
16760 break;
16761
16762 case 708: /* f_args: f_arg ',' f_optarg_arg_value ',' f_arg opt_args_tail_args_tail */
16763#line 6425 "parse.y"
16764 {
16765 (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));
16766 /*% ripper: params!($:1, $:3, Qnil, $:5, *$:6[0..2]) %*/
16767 }
16768#line 16769 "parse.c"
16769 break;
16770
16771 case 709: /* f_args: f_arg ',' f_rest_arg opt_args_tail_args_tail */
16772#line 6430 "parse.y"
16773 {
16774 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
16775 /*% ripper: params!($:1, Qnil, $:3, Qnil, *$:4[0..2]) %*/
16776 }
16777#line 16778 "parse.c"
16778 break;
16779
16780 case 710: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail_args_tail */
16781#line 6435 "parse.y"
16782 {
16783 (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));
16784 /*% ripper: params!($:1, Qnil, $:3, $:5, *$:6[0..2]) %*/
16785 }
16786#line 16787 "parse.c"
16787 break;
16788
16789 case 711: /* f_args: f_arg opt_args_tail_args_tail */
16790#line 6440 "parse.y"
16791 {
16792 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
16793 /*% ripper: params!($:1, Qnil, Qnil, Qnil, *$:2[0..2]) %*/
16794 }
16795#line 16796 "parse.c"
16796 break;
16797
16798 case 712: /* f_args: f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail */
16799#line 6445 "parse.y"
16800 {
16801 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
16802 /*% ripper: params!(Qnil, $:1, $:3, Qnil, *$:4[0..2]) %*/
16803 }
16804#line 16805 "parse.c"
16805 break;
16806
16807 case 713: /* f_args: f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail */
16808#line 6450 "parse.y"
16809 {
16810 (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));
16811 /*% ripper: params!(Qnil, $:1, $:3, $:5, *$:6[0..2]) %*/
16812 }
16813#line 16814 "parse.c"
16814 break;
16815
16816 case 714: /* f_args: f_optarg_arg_value opt_args_tail_args_tail */
16817#line 6455 "parse.y"
16818 {
16819 (yyval.node_args) = new_args(p, 0, (yyvsp[-1].node_opt_arg), 0, 0, (yyvsp[0].node_args), &(yyloc));
16820 /*% ripper: params!(Qnil, $:1, Qnil, Qnil, *$:2[0..2]) %*/
16821 }
16822#line 16823 "parse.c"
16823 break;
16824
16825 case 715: /* f_args: f_optarg_arg_value ',' f_arg opt_args_tail_args_tail */
16826#line 6460 "parse.y"
16827 {
16828 (yyval.node_args) = new_args(p, 0, (yyvsp[-3].node_opt_arg), 0, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16829 /*% ripper: params!(Qnil, $:1, Qnil, $:3, *$:4[0..2]) %*/
16830 }
16831#line 16832 "parse.c"
16832 break;
16833
16834 case 716: /* f_args: f_rest_arg opt_args_tail_args_tail */
16835#line 6465 "parse.y"
16836 {
16837 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-1].id), 0, (yyvsp[0].node_args), &(yyloc));
16838 /*% ripper: params!(Qnil, Qnil, $:1, Qnil, *$:2[0..2]) %*/
16839 }
16840#line 16841 "parse.c"
16841 break;
16842
16843 case 717: /* f_args: f_rest_arg ',' f_arg opt_args_tail_args_tail */
16844#line 6470 "parse.y"
16845 {
16846 (yyval.node_args) = new_args(p, 0, 0, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
16847 /*% ripper: params!(Qnil, Qnil, $:1, $:3, *$:4[0..2]) %*/
16848 }
16849#line 16850 "parse.c"
16850 break;
16851
16852 case 718: /* f_args: args_tail */
16853#line 6475 "parse.y"
16854 {
16855 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyvsp[0].node_args), &(yyloc));
16856 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, *$:1[0..2]) %*/
16857 }
16858#line 16859 "parse.c"
16859 break;
16860
16861 case 719: /* f_args: %empty */
16862#line 6480 "parse.y"
16863 {
16864 (yyval.node_args) = new_args_tail(p, 0, 0, 0, &(yylsp[0]));
16865 (yyval.node_args) = new_args(p, 0, 0, 0, 0, (yyval.node_args), &(yylsp[0]));
16866 /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, Qnil) %*/
16867 }
16868#line 16869 "parse.c"
16869 break;
16870
16871 case 720: /* args_forward: "(..." */
16872#line 6488 "parse.y"
16873 {
16874#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
16875 (yyval.id) = 0;
16876#else
16877 (yyval.id) = idFWD_KWREST;
16878#endif
16879 /*% ripper: args_forward! %*/
16880 }
16881#line 16882 "parse.c"
16882 break;
16883
16884 case 721: /* f_bad_arg: "constant" */
16885#line 6499 "parse.y"
16886 {
16887 static const char mesg[] = "formal argument cannot be a constant";
16888 /*%%%*/
16889 yyerror1(&(yylsp[0]), mesg);
16890 /*% %*/
16891 (yyval.id) = 0;
16892 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16893 }
16894#line 16895 "parse.c"
16895 break;
16896
16897 case 722: /* f_bad_arg: "instance variable" */
16898#line 6508 "parse.y"
16899 {
16900 static const char mesg[] = "formal argument cannot be an instance variable";
16901 /*%%%*/
16902 yyerror1(&(yylsp[0]), mesg);
16903 /*% %*/
16904 (yyval.id) = 0;
16905 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16906 }
16907#line 16908 "parse.c"
16908 break;
16909
16910 case 723: /* f_bad_arg: "global variable" */
16911#line 6517 "parse.y"
16912 {
16913 static const char mesg[] = "formal argument cannot be a global variable";
16914 /*%%%*/
16915 yyerror1(&(yylsp[0]), mesg);
16916 /*% %*/
16917 (yyval.id) = 0;
16918 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16919 }
16920#line 16921 "parse.c"
16921 break;
16922
16923 case 724: /* f_bad_arg: "class variable" */
16924#line 6526 "parse.y"
16925 {
16926 static const char mesg[] = "formal argument cannot be a class variable";
16927 /*%%%*/
16928 yyerror1(&(yylsp[0]), mesg);
16929 /*% %*/
16930 (yyval.id) = 0;
16931 /*% ripper[error]: param_error!(ERR_MESG(), $:1) %*/
16932 }
16933#line 16934 "parse.c"
16934 break;
16935
16936 case 726: /* f_norm_arg: "local variable or method" */
16937#line 6538 "parse.y"
16938 {
16939 VALUE e = formal_argument_error(p, (yyval.id) = (yyvsp[0].id));
16940 if (e) {
16941 /*% ripper[error]: param_error!(?e, $:1) %*/
16942 }
16943 p->max_numparam = ORDINAL_PARAM;
16944 }
16945#line 16946 "parse.c"
16946 break;
16947
16948 case 727: /* f_arg_asgn: f_norm_arg */
16949#line 6548 "parse.y"
16950 {
16951 ID id = (yyvsp[0].id);
16952 arg_var(p, id);
16953 (yyval.id) = (yyvsp[0].id);
16954 }
16955#line 16956 "parse.c"
16956 break;
16957
16958 case 728: /* f_arg_item: f_arg_asgn */
16959#line 6556 "parse.y"
16960 {
16961 (yyval.node_args_aux) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
16962 /*% ripper: $:1 %*/
16963 }
16964#line 16965 "parse.c"
16965 break;
16966
16967 case 729: /* f_arg_item: "(" f_margs rparen */
16968#line 6561 "parse.y"
16969 {
16970 ID tid = internal_id(p);
16971 YYLTYPE loc;
16972 loc.beg_pos = (yylsp[-1]).beg_pos;
16973 loc.end_pos = (yylsp[-1]).beg_pos;
16974 arg_var(p, tid);
16975 if (dyna_in_block(p)) {
16976 (yyvsp[-1].node_masgn)->nd_value = NEW_DVAR(tid, &loc);
16977 }
16978 else {
16979 (yyvsp[-1].node_masgn)->nd_value = NEW_LVAR(tid, &loc);
16980 }
16981 (yyval.node_args_aux) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
16982 (yyval.node_args_aux)->nd_next = (NODE *)(yyvsp[-1].node_masgn);
16983 /*% ripper: mlhs_paren!($:2) %*/
16984 }
16985#line 16986 "parse.c"
16986 break;
16987
16988 case 731: /* f_arg: f_arg ',' f_arg_item */
16989#line 6582 "parse.y"
16990 {
16991 (yyval.node_args_aux) = (yyvsp[-2].node_args_aux);
16992 (yyval.node_args_aux)->nd_plen++;
16993 (yyval.node_args_aux)->nd_next = block_append(p, (yyval.node_args_aux)->nd_next, (yyvsp[0].node_args_aux)->nd_next);
16994 rb_discard_node(p, (NODE *)(yyvsp[0].node_args_aux));
16995 /*% ripper: rb_ary_push($:1, $:3) %*/
16996 }
16997#line 16998 "parse.c"
16998 break;
16999
17000 case 732: /* f_label: "label" */
17001#line 6593 "parse.y"
17002 {
17003 VALUE e = formal_argument_error(p, (yyval.id) = (yyvsp[0].id));
17004 if (e) {
17005 (yyval.id) = 0;
17006 /*% ripper[error]: param_error!(?e, $:1) %*/
17007 }
17008 /*
17009 * Workaround for Prism::ParseTest#test_filepath for
17010 * "unparser/corpus/literal/def.txt"
17011 *
17012 * See the discussion on https://github.com/ruby/ruby/pull/9923
17013 */
17014 arg_var(p, ifdef_ripper(0, (yyvsp[0].id)));
17015 /*% ripper: $:1 %*/
17016 p->max_numparam = ORDINAL_PARAM;
17017 p->ctxt.in_argdef = 0;
17018 }
17019#line 17020 "parse.c"
17020 break;
17021
17022 case 733: /* f_kw: f_label arg_value */
17023#line 6613 "parse.y"
17024 {
17025 p->ctxt.in_argdef = 1;
17026 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
17027 /*% ripper: [$:$, $:2] %*/
17028 }
17029#line 17030 "parse.c"
17030 break;
17031
17032 case 734: /* f_kw: f_label */
17033#line 6619 "parse.y"
17034 {
17035 p->ctxt.in_argdef = 1;
17036 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
17037 /*% ripper: [$:$, 0] %*/
17038 }
17039#line 17040 "parse.c"
17040 break;
17041
17042 case 735: /* f_block_kw: f_label primary_value */
17043#line 6627 "parse.y"
17044 {
17045 p->ctxt.in_argdef = 1;
17046 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
17047 /*% ripper: [$:$, $:2] %*/
17048 }
17049#line 17050 "parse.c"
17050 break;
17051
17052 case 736: /* f_block_kw: f_label */
17053#line 6633 "parse.y"
17054 {
17055 p->ctxt.in_argdef = 1;
17056 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
17057 /*% ripper: [$:$, 0] %*/
17058 }
17059#line 17060 "parse.c"
17060 break;
17061
17062 case 739: /* f_no_kwarg: p_kwnorest */
17063#line 6645 "parse.y"
17064 {
17065 /*% ripper: nokw_param!(Qnil) %*/
17066 }
17067#line 17068 "parse.c"
17068 break;
17069
17070 case 740: /* f_kwrest: kwrest_mark "local variable or method" */
17071#line 6651 "parse.y"
17072 {
17073 arg_var(p, shadowing_lvar(p, (yyvsp[0].id)));
17074 (yyval.id) = (yyvsp[0].id);
17075 /*% ripper: kwrest_param!($:2) %*/
17076 }
17077#line 17078 "parse.c"
17078 break;
17079
17080 case 741: /* f_kwrest: kwrest_mark */
17081#line 6657 "parse.y"
17082 {
17083 arg_var(p, idFWD_KWREST);
17084 (yyval.id) = idFWD_KWREST;
17085 /*% ripper: kwrest_param!(Qnil) %*/
17086 }
17087#line 17088 "parse.c"
17088 break;
17089
17090 case 744: /* f_rest_arg: restarg_mark "local variable or method" */
17091#line 6669 "parse.y"
17092 {
17093 arg_var(p, shadowing_lvar(p, (yyvsp[0].id)));
17094 (yyval.id) = (yyvsp[0].id);
17095 /*% ripper: rest_param!($:2) %*/
17096 }
17097#line 17098 "parse.c"
17098 break;
17099
17100 case 745: /* f_rest_arg: restarg_mark */
17101#line 6675 "parse.y"
17102 {
17103 arg_var(p, idFWD_REST);
17104 (yyval.id) = idFWD_REST;
17105 /*% ripper: rest_param!(Qnil) %*/
17106 }
17107#line 17108 "parse.c"
17108 break;
17109
17110 case 748: /* f_block_arg: blkarg_mark "local variable or method" */
17111#line 6687 "parse.y"
17112 {
17113 arg_var(p, shadowing_lvar(p, (yyvsp[0].id)));
17114 (yyval.id) = (yyvsp[0].id);
17115 /*% ripper: blockarg!($:2) %*/
17116 }
17117#line 17118 "parse.c"
17118 break;
17119
17120 case 749: /* f_block_arg: blkarg_mark */
17121#line 6693 "parse.y"
17122 {
17123 arg_var(p, idFWD_BLOCK);
17124 (yyval.id) = idFWD_BLOCK;
17125 /*% ripper: blockarg!(Qnil) %*/
17126 }
17127#line 17128 "parse.c"
17128 break;
17129
17130 case 750: /* opt_f_block_arg: ',' f_block_arg */
17131#line 6701 "parse.y"
17132 {
17133 (yyval.id) = (yyvsp[0].id);
17134 /*% ripper: $:2 %*/
17135 }
17136#line 17137 "parse.c"
17137 break;
17138
17139 case 751: /* opt_f_block_arg: none */
17140#line 6706 "parse.y"
17141 {
17142 (yyval.id) = 0;
17143 /*% ripper: Qnil %*/
17144 }
17145#line 17146 "parse.c"
17146 break;
17147
17148 case 752: /* singleton: var_ref */
17149#line 6713 "parse.y"
17150 {
17151 value_expr((yyvsp[0].node));
17152 (yyval.node) = (yyvsp[0].node);
17153 }
17154#line 17155 "parse.c"
17155 break;
17156
17157 case 753: /* $@37: %empty */
17158#line 6718 "parse.y"
17159 {
17160 SET_LEX_STATE(EXPR_BEG);
17161 p->ctxt.in_argdef = 0;
17162 }
17163#line 17164 "parse.c"
17164 break;
17165
17166 case 754: /* singleton: '(' $@37 expr rparen */
17167#line 6723 "parse.y"
17168 {
17169 p->ctxt.in_argdef = 1;
17170 NODE *expr = last_expr_node((yyvsp[-1].node));
17171 switch (nd_type(expr)) {
17172 case NODE_STR:
17173 case NODE_DSTR:
17174 case NODE_XSTR:
17175 case NODE_DXSTR:
17176 case NODE_REGX:
17177 case NODE_DREGX:
17178 case NODE_SYM:
17179 case NODE_LINE:
17180 case NODE_FILE:
17181 case NODE_ENCODING:
17182 case NODE_INTEGER:
17183 case NODE_FLOAT:
17184 case NODE_RATIONAL:
17185 case NODE_IMAGINARY:
17186 case NODE_DSYM:
17187 case NODE_LIST:
17188 case NODE_ZLIST:
17189 yyerror1(&expr->nd_loc, "can't define singleton method for literals");
17190 break;
17191 default:
17192 value_expr((yyvsp[-1].node));
17193 break;
17194 }
17195 (yyval.node) = (yyvsp[-1].node);
17196 /*% ripper: paren!($:3) %*/
17197 }
17198#line 17199 "parse.c"
17199 break;
17200
17201 case 756: /* assoc_list: assocs trailer */
17202#line 6757 "parse.y"
17203 {
17204 (yyval.node) = (yyvsp[-1].node);
17205 /*% ripper: assoclist_from_args!($:1) %*/
17206 }
17207#line 17208 "parse.c"
17208 break;
17209
17210 case 758: /* assocs: assocs ',' assoc */
17211#line 6766 "parse.y"
17212 {
17213 NODE *assocs = (yyvsp[-2].node);
17214 NODE *tail = (yyvsp[0].node);
17215 if (!assocs) {
17216 assocs = tail;
17217 }
17218 else if (tail) {
17219 if (RNODE_LIST(assocs)->nd_head) {
17220 NODE *n = RNODE_LIST(tail)->nd_next;
17221 if (!RNODE_LIST(tail)->nd_head && nd_type_p(n, NODE_LIST) &&
17222 nd_type_p((n = RNODE_LIST(n)->nd_head), NODE_HASH)) {
17223 /* DSTAR */
17224 tail = RNODE_HASH(n)->nd_head;
17225 }
17226 }
17227 if (tail) {
17228 assocs = list_concat(assocs, tail);
17229 }
17230 }
17231 (yyval.node) = assocs;
17232 /*% ripper: rb_ary_push($:1, $:3) %*/
17233 }
17234#line 17235 "parse.c"
17235 break;
17236
17237 case 759: /* assoc: arg_value "=>" arg_value */
17238#line 6791 "parse.y"
17239 {
17240 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
17241 /*% ripper: assoc_new!($:1, $:3) %*/
17242 }
17243#line 17244 "parse.c"
17244 break;
17245
17246 case 760: /* assoc: "label" arg_value */
17247#line 6796 "parse.y"
17248 {
17249 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
17250 /*% ripper: assoc_new!($:1, $:2) %*/
17251 }
17252#line 17253 "parse.c"
17253 break;
17254
17255 case 761: /* assoc: "label" */
17256#line 6801 "parse.y"
17257 {
17258 NODE *val = gettable(p, (yyvsp[0].id), &(yyloc));
17259 if (!val) val = NEW_ERROR(&(yyloc));
17260 (yyval.node) = list_append(p, NEW_LIST(NEW_SYM(rb_id2str((yyvsp[0].id)), &(yylsp[0])), &(yyloc)), val);
17261 /*% ripper: assoc_new!($:1, Qnil) %*/
17262 }
17263#line 17264 "parse.c"
17264 break;
17265
17266 case 762: /* assoc: "string literal" string_contents tLABEL_END arg_value */
17267#line 6808 "parse.y"
17268 {
17269 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
17270 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
17271 /*% ripper: assoc_new!(dyna_symbol!($:2), $:4) %*/
17272 }
17273#line 17274 "parse.c"
17274 break;
17275
17276 case 763: /* assoc: "**arg" arg_value */
17277#line 6814 "parse.y"
17278 {
17279 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
17280 /*% ripper: assoc_splat!($:2) %*/
17281 }
17282#line 17283 "parse.c"
17283 break;
17284
17285 case 764: /* assoc: "**arg" */
17286#line 6819 "parse.y"
17287 {
17288 forwarding_arg_check(p, idFWD_KWREST, idFWD_ALL, "keyword rest");
17289 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)),
17290 NEW_LVAR(idFWD_KWREST, &(yyloc)));
17291 /*% ripper: assoc_splat!(Qnil) %*/
17292 }
17293#line 17294 "parse.c"
17294 break;
17295
17296 case 784: /* term: ';' */
17297#line 6865 "parse.y"
17298 {yyerrok;token_flush(p);}
17299#line 17300 "parse.c"
17300 break;
17301
17302 case 785: /* term: '\n' */
17303#line 6867 "parse.y"
17304 {
17305 (yyloc).end_pos = (yyloc).beg_pos;
17306 token_flush(p);
17307 }
17308#line 17309 "parse.c"
17309 break;
17310
17311 case 787: /* terms: terms ';' */
17312#line 6874 "parse.y"
17313 {yyerrok;}
17314#line 17315 "parse.c"
17315 break;
17316
17317 case 788: /* none: %empty */
17318#line 6878 "parse.y"
17319 {
17320 (yyval.node) = 0;
17321 }
17322#line 17323 "parse.c"
17323 break;
17324
17325
17326#line 17327 "parse.c"
17327
17328 default: break;
17329 }
17330 /* User semantic actions sometimes alter yychar, and that requires
17331 that yytoken be updated with the new translation. We take the
17332 approach of translating immediately before every use of yytoken.
17333 One alternative is translating here after every semantic action,
17334 but that translation would be missed if the semantic action invokes
17335 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
17336 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
17337 incorrect destructor might then be invoked immediately. In the
17338 case of YYERROR or YYBACKUP, subsequent parser actions might lead
17339 to an incorrect destructor call or verbose syntax error message
17340 before the lookahead is translated. */
17341 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc, p);
17342
17343 YYPOPSTACK (yylen);
17344 /* %after-reduce function. */
17345#line 2661 "parse.y"
17346 {after_reduce(yylen, p);}
17347#line 17348 "parse.c"
17348
17349 yylen = 0;
17350
17351 *++yyvsp = yyval;
17352 *++yylsp = yyloc;
17353
17354 /* Now 'shift' the result of the reduction. Determine what state
17355 that goes to, based on the state we popped back to and the rule
17356 number reduced by. */
17357 {
17358 const int yylhs = yyr1[yyn] - YYNTOKENS;
17359 const int yyi = yypgoto[yylhs] + *yyssp;
17360 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
17361 ? yytable[yyi]
17362 : yydefgoto[yylhs]);
17363 }
17364
17365 goto yynewstate;
17366
17367
17368/*--------------------------------------.
17369| yyerrlab -- here on detecting error. |
17370`--------------------------------------*/
17371yyerrlab:
17372 /* Make sure we have latest lookahead translation. See comments at
17373 user semantic actions for why this is necessary. */
17374 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
17375 /* If not already recovering from an error, report this error. */
17376 if (!yyerrstatus)
17377 {
17378 ++yynerrs;
17379 {
17380 yypcontext_t yyctx
17381 = {yyssp, yytoken, &yylloc};
17382 char const *yymsgp = YY_("syntax error");
17383 int yysyntax_error_status;
17384 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
17385 if (yysyntax_error_status == 0)
17386 yymsgp = yymsg;
17387 else if (yysyntax_error_status == -1)
17388 {
17389 if (yymsg != yymsgbuf)
17390 YYSTACK_FREE (yymsg);
17391 yymsg = YY_CAST (char *,
17392 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
17393 if (yymsg)
17394 {
17395 yysyntax_error_status
17396 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
17397 yymsgp = yymsg;
17398 }
17399 else
17400 {
17401 yymsg = yymsgbuf;
17402 yymsg_alloc = sizeof yymsgbuf;
17403 yysyntax_error_status = YYENOMEM;
17404 }
17405 }
17406 yyerror (&yylloc, p, yymsgp);
17407 if (yysyntax_error_status == YYENOMEM)
17408 YYNOMEM;
17409 }
17410 }
17411
17412 yyerror_range[1] = yylloc;
17413 if (yyerrstatus == 3)
17414 {
17415 /* If just tried and failed to reuse lookahead token after an
17416 error, discard it. */
17417
17418 if (yychar <= END_OF_INPUT)
17419 {
17420 /* Return failure if at end of input. */
17421 if (yychar == END_OF_INPUT)
17422 YYABORT;
17423 }
17424 else
17425 {
17426 yydestruct ("Error: discarding",
17427 yytoken, &yylval, &yylloc, p);
17428 yychar = YYEMPTY;
17429 }
17430 }
17431
17432 /* Else will try to reuse lookahead token after shifting the error
17433 token. */
17434 goto yyerrlab1;
17435
17436
17437/*---------------------------------------------------.
17438| yyerrorlab -- error raised explicitly by YYERROR. |
17439`---------------------------------------------------*/
17440yyerrorlab:
17441 /* Pacify compilers when the user code never invokes YYERROR and the
17442 label yyerrorlab therefore never appears in user code. */
17443 if (0)
17444 YYERROR;
17445 ++yynerrs;
17446
17447 /* Do not reclaim the symbols of the rule whose action triggered
17448 this YYERROR. */
17449 YYPOPSTACK (yylen);
17450 /* %after-pop-stack function. */
17451#line 2663 "parse.y"
17452 {after_pop_stack(yylen, p);}
17453#line 17454 "parse.c"
17454
17455 yylen = 0;
17456 YY_STACK_PRINT (yyss, yyssp, p);
17457 yystate = *yyssp;
17458 goto yyerrlab1;
17459
17460
17461/*-------------------------------------------------------------.
17462| yyerrlab1 -- common code for both syntax error and YYERROR. |
17463`-------------------------------------------------------------*/
17464yyerrlab1:
17465 yyerrstatus = 3; /* Each real token shifted decrements this. */
17466
17467 /* Pop stack until we find a state that shifts the error token. */
17468 for (;;)
17469 {
17470 yyn = yypact[yystate];
17471 if (!yypact_value_is_default (yyn))
17472 {
17473 yyn += YYSYMBOL_YYerror;
17474 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
17475 {
17476 yyn = yytable[yyn];
17477 if (0 < yyn)
17478 break;
17479 }
17480 }
17481
17482 /* Pop the current state because it cannot handle the error token. */
17483 if (yyssp == yyss)
17484 YYABORT;
17485
17486 yyerror_range[1] = *yylsp;
17487 yydestruct ("Error: popping",
17488 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
17489 YYPOPSTACK (1);
17490 /* %after-pop-stack function. */
17491#line 2663 "parse.y"
17492 {after_pop_stack(1, p);}
17493#line 17494 "parse.c"
17494
17495 yystate = *yyssp;
17496 YY_STACK_PRINT (yyss, yyssp, p);
17497 }
17498
17499 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
17500 *++yyvsp = yylval;
17501 YY_IGNORE_MAYBE_UNINITIALIZED_END
17502
17503 yyerror_range[2] = yylloc;
17504 ++yylsp;
17505 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
17506
17507 /* Shift the error token. */
17508 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp, p);
17509 /* %after-shift-error-token code. */
17510#line 2662 "parse.y"
17511 {after_shift_error_token(p);}
17512#line 17513 "parse.c"
17513
17514
17515 yystate = yyn;
17516 goto yynewstate;
17517
17518
17519/*-------------------------------------.
17520| yyacceptlab -- YYACCEPT comes here. |
17521`-------------------------------------*/
17522yyacceptlab:
17523 yyresult = 0;
17524 goto yyreturnlab;
17525
17526
17527/*-----------------------------------.
17528| yyabortlab -- YYABORT comes here. |
17529`-----------------------------------*/
17530yyabortlab:
17531 yyresult = 1;
17532 goto yyreturnlab;
17533
17534
17535/*-----------------------------------------------------------.
17536| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
17537`-----------------------------------------------------------*/
17538yyexhaustedlab:
17539 yyerror (&yylloc, p, YY_("memory exhausted"));
17540 yyresult = 2;
17541 goto yyreturnlab;
17542
17543
17544/*----------------------------------------------------------.
17545| yyreturnlab -- parsing is finished, clean up and return. |
17546`----------------------------------------------------------*/
17547yyreturnlab:
17548 if (yychar != YYEMPTY)
17549 {
17550 /* Make sure we have latest lookahead translation. See comments at
17551 user semantic actions for why this is necessary. */
17552 yytoken = YYTRANSLATE (yychar);
17553 yydestruct ("Cleanup: discarding lookahead",
17554 yytoken, &yylval, &yylloc, p);
17555 }
17556 /* Do not reclaim the symbols of the rule whose action triggered
17557 this YYABORT or YYACCEPT. */
17558 YYPOPSTACK (yylen);
17559 YY_STACK_PRINT (yyss, yyssp, p);
17560 while (yyssp != yyss)
17561 {
17562 yydestruct ("Cleanup: popping",
17563 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
17564 YYPOPSTACK (1);
17565 }
17566#ifndef yyoverflow
17567 if (yyss != yyssa)
17568 YYSTACK_FREE (yyss);
17569#endif
17570 if (yymsg != yymsgbuf)
17571 YYSTACK_FREE (yymsg);
17572 return yyresult;
17573}
17574
17575#line 6882 "parse.y"
17576
17577# undef p
17578# undef yylex
17579# undef yylval
17580# define yylval (*p->lval)
17581
17582static int regx_options(struct parser_params*);
17583static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
17584static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
17585static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
17586static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
17587
17588#define set_parser_s_value(x) (ifdef_ripper(p->s_value = (x), (void)0))
17589
17590# define set_yylval_node(x) { \
17591 YYLTYPE _cur_loc; \
17592 rb_parser_set_location(p, &_cur_loc); \
17593 yylval.node = (x); \
17594 set_parser_s_value(STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)); \
17595}
17596# define set_yylval_str(x) \
17597do { \
17598 set_yylval_node(NEW_STR(x, &_cur_loc)); \
17599 set_parser_s_value(rb_str_new_mutable_parser_string(x)); \
17600} while(0)
17601# define set_yylval_num(x) { \
17602 yylval.num = (x); \
17603 set_parser_s_value(x); \
17604}
17605# define set_yylval_id(x) (yylval.id = (x))
17606# define set_yylval_name(x) { \
17607 (yylval.id = (x)); \
17608 set_parser_s_value(ID2SYM(x)); \
17609}
17610# define yylval_id() (yylval.id)
17611
17612#define set_yylval_noname() set_yylval_id(keyword_nil)
17613#define has_delayed_token(p) (p->delayed.token != NULL)
17614
17615#ifndef RIPPER
17616#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
17617#define dispatch_scan_event(p, t) parser_dispatch_scan_event(p, t, __LINE__)
17618
17619static bool
17620parser_has_token(struct parser_params *p)
17621{
17622 const char *const pcur = p->lex.pcur;
17623 const char *const ptok = p->lex.ptok;
17624 if (p->keep_tokens && (pcur < ptok)) {
17625 rb_bug("lex.pcur < lex.ptok. (line: %d) %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF"",
17626 p->ruby_sourceline, ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur);
17627 }
17628 return pcur > ptok;
17629}
17630
17631static const char *
17632escaped_char(int c)
17633{
17634 switch (c) {
17635 case '"': return "\\\"";
17636 case '\\': return "\\\\";
17637 case '\0': return "\\0";
17638 case '\n': return "\\n";
17639 case '\r': return "\\r";
17640 case '\t': return "\\t";
17641 case '\f': return "\\f";
17642 case '\013': return "\\v";
17643 case '\010': return "\\b";
17644 case '\007': return "\\a";
17645 case '\033': return "\\e";
17646 case '\x7f': return "\\c?";
17647 }
17648 return NULL;
17649}
17650
17651static rb_parser_string_t *
17652rb_parser_str_escape(struct parser_params *p, rb_parser_string_t *str)
17653{
17654 rb_encoding *enc = p->enc;
17655 const char *ptr = str->ptr;
17656 const char *pend = ptr + str->len;
17657 const char *prev = ptr;
17658 char charbuf[5] = {'\\', 'x', 0, 0, 0};
17659 rb_parser_string_t * result = rb_parser_string_new(p, 0, 0);
17660
17661 while (ptr < pend) {
17662 unsigned int c;
17663 const char *cc;
17664 int n = rb_enc_precise_mbclen(ptr, pend, enc);
17665 if (!MBCLEN_CHARFOUND_P(n)) {
17666 if (ptr > prev) parser_str_cat(result, prev, ptr - prev);
17667 n = rb_enc_mbminlen(enc);
17668 if (pend < ptr + n)
17669 n = (int)(pend - ptr);
17670 while (n--) {
17671 c = *ptr & 0xf0 >> 4;
17672 charbuf[2] = (c < 10) ? '0' + c : 'A' + c - 10;
17673 c = *ptr & 0x0f;
17674 charbuf[3] = (c < 10) ? '0' + c : 'A' + c - 10;
17675 parser_str_cat(result, charbuf, 4);
17676 prev = ++ptr;
17677 }
17678 continue;
17679 }
17680 n = MBCLEN_CHARFOUND_LEN(n);
17681 c = rb_enc_mbc_to_codepoint(ptr, pend, enc);
17682 ptr += n;
17683 cc = escaped_char(c);
17684 if (cc) {
17685 if (ptr - n > prev) parser_str_cat(result, prev, ptr - n - prev);
17686 parser_str_cat_cstr(result, cc);
17687 prev = ptr;
17688 }
17689 else if (rb_enc_isascii(c, enc) && ISPRINT(c)) {
17690 }
17691 else {
17692 if (ptr - n > prev) {
17693 parser_str_cat(result, prev, ptr - n - prev);
17694 prev = ptr - n;
17695 }
17696 parser_str_cat(result, prev, ptr - prev);
17697 prev = ptr;
17698 }
17699 }
17700 if (ptr > prev) parser_str_cat(result, prev, ptr - prev);
17701
17702 return result;
17703}
17704
17705static void
17706parser_append_tokens(struct parser_params *p, rb_parser_string_t *str, enum yytokentype t, int line)
17707{
17708 rb_parser_ast_token_t *token = xcalloc(1, sizeof(rb_parser_ast_token_t));
17709 token->id = p->token_id;
17710 token->type_name = parser_token2char(p, t);
17711 token->str = str;
17712 token->loc.beg_pos = p->yylloc->beg_pos;
17713 token->loc.end_pos = p->yylloc->end_pos;
17714 rb_parser_ary_push_ast_token(p, p->tokens, token);
17715 p->token_id++;
17716
17717 if (p->debug) {
17718 rb_parser_string_t *str_escaped = rb_parser_str_escape(p, str);
17719 rb_parser_printf(p, "Append tokens (line: %d) [%d, :%s, \"%s\", [%d, %d, %d, %d]]\n",
17720 line, token->id, token->type_name, str_escaped->ptr,
17721 token->loc.beg_pos.lineno, token->loc.beg_pos.column,
17722 token->loc.end_pos.lineno, token->loc.end_pos.column);
17723 rb_parser_string_free(p, str_escaped);
17724 }
17725}
17726
17727static void
17728parser_dispatch_scan_event(struct parser_params *p, enum yytokentype t, int line)
17729{
17730 debug_token_line(p, "parser_dispatch_scan_event", line);
17731
17732 if (!parser_has_token(p)) return;
17733
17734 RUBY_SET_YYLLOC(*p->yylloc);
17735
17736 if (p->keep_tokens) {
17737 rb_parser_string_t *str = rb_parser_encoding_string_new(p, p->lex.ptok, p->lex.pcur - p->lex.ptok, p->enc);
17738 parser_append_tokens(p, str, t, line);
17739 }
17740
17741 token_flush(p);
17742}
17743
17744#define dispatch_delayed_token(p, t) parser_dispatch_delayed_token(p, t, __LINE__)
17745static void
17746parser_dispatch_delayed_token(struct parser_params *p, enum yytokentype t, int line)
17747{
17748 debug_token_line(p, "parser_dispatch_delayed_token", line);
17749
17750 if (!has_delayed_token(p)) return;
17751
17752 RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(*p->yylloc);
17753
17754 if (p->keep_tokens) {
17755 /* p->delayed.token is freed by rb_parser_tokens_free */
17756 parser_append_tokens(p, p->delayed.token, t, line);
17757 } else {
17758 rb_parser_string_free(p, p->delayed.token);
17759 }
17760
17761 p->delayed.token = NULL;
17762}
17763#else
17764#define literal_flush(p, ptr) ((void)(ptr))
17765
17766static int
17767ripper_has_scan_event(struct parser_params *p)
17768{
17769 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
17770 return p->lex.pcur > p->lex.ptok;
17771}
17772
17773static VALUE
17774ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
17775{
17776 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
17777 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
17778 RUBY_SET_YYLLOC(*p->yylloc);
17779 token_flush(p);
17780 return rval;
17781}
17782
17783static void
17784ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
17785{
17786 if (!ripper_has_scan_event(p)) return;
17787
17788 set_parser_s_value(ripper_scan_event_val(p, t));
17789}
17790#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
17791
17792static void
17793ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
17794{
17795 /* save and adjust the location to delayed token for callbacks */
17796 int saved_line = p->ruby_sourceline;
17797 const char *saved_tokp = p->lex.ptok;
17798 VALUE s_value, str;
17799
17800 if (!has_delayed_token(p)) return;
17801 p->ruby_sourceline = p->delayed.beg_line;
17802 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
17803 str = rb_str_new_mutable_parser_string(p->delayed.token);
17804 rb_parser_string_free(p, p->delayed.token);
17805 s_value = ripper_dispatch1(p, ripper_token2eventid(t), str);
17806 set_parser_s_value(s_value);
17807 p->delayed.token = NULL;
17808 p->ruby_sourceline = saved_line;
17809 p->lex.ptok = saved_tokp;
17810}
17811#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
17812#endif /* RIPPER */
17813
17814static inline int
17815is_identchar(struct parser_params *p, const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
17816{
17817 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
17818}
17819
17820static inline int
17821parser_is_identchar(struct parser_params *p)
17822{
17823 return !(p)->eofp && is_identchar(p, p->lex.pcur-1, p->lex.pend, p->enc);
17824}
17825
17826static inline int
17827parser_isascii(struct parser_params *p)
17828{
17829 return ISASCII(*(p->lex.pcur-1));
17830}
17831
17832static void
17833token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
17834{
17835 int column = 1, nonspc = 0, i;
17836 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
17837 if (*ptr == '\t') {
17838 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
17839 }
17840 column++;
17841 if (*ptr != ' ' && *ptr != '\t') {
17842 nonspc = 1;
17843 }
17844 }
17845
17846 ptinfo->beg = loc->beg_pos;
17847 ptinfo->indent = column;
17848 ptinfo->nonspc = nonspc;
17849}
17850
17851static void
17852token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17853{
17854 token_info *ptinfo;
17855
17856 if (!p->token_info_enabled) return;
17857 ptinfo = ALLOC(token_info);
17858 ptinfo->token = token;
17859 ptinfo->next = p->token_info;
17860 token_info_setup(ptinfo, p->lex.pbeg, loc);
17861
17862 p->token_info = ptinfo;
17863}
17864
17865static void
17866token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17867{
17868 token_info *ptinfo_beg = p->token_info;
17869
17870 if (!ptinfo_beg) return;
17871
17872 /* indentation check of matched keywords (begin..end, if..end, etc.) */
17873 token_info_warn(p, token, ptinfo_beg, 1, loc);
17874
17875 p->token_info = ptinfo_beg->next;
17876 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17877}
17878
17879static void
17880token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
17881{
17882 token_info *ptinfo_beg = p->token_info;
17883
17884 if (!ptinfo_beg) return;
17885 p->token_info = ptinfo_beg->next;
17886
17887 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
17888 ptinfo_beg->beg.column != beg_pos.column ||
17889 strcmp(ptinfo_beg->token, token)) {
17890 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
17891 beg_pos.lineno, beg_pos.column, token,
17892 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
17893 ptinfo_beg->token);
17894 }
17895
17896 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17897}
17898
17899static void
17900token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
17901{
17902 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
17903 if (!p->token_info_enabled) return;
17904 if (!ptinfo_beg) return;
17905 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
17906 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
17907 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
17908 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
17909 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
17910 rb_warn3L(ptinfo_end->beg.lineno,
17911 "mismatched indentations at '%s' with '%s' at %d",
17912 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
17913}
17914
17915static int
17916parser_precise_mbclen(struct parser_params *p, const char *ptr)
17917{
17918 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
17919 if (!MBCLEN_CHARFOUND_P(len)) {
17920 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
17921 return -1;
17922 }
17923 return len;
17924}
17925
17926#ifndef RIPPER
17927static inline void
17928parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
17929{
17930 rb_parser_string_t *str;
17931 int lineno = p->ruby_sourceline;
17932 if (!yylloc) {
17933 return;
17934 }
17935 else if (yylloc->beg_pos.lineno == lineno) {
17936 str = p->lex.lastline;
17937 }
17938 else {
17939 return;
17940 }
17941 ruby_show_error_line(p, p->error_buffer, yylloc, lineno, str);
17942}
17943
17944static int
17945parser_yyerror(struct parser_params *p, const rb_code_location_t *yylloc, const char *msg)
17946{
17947#if 0
17948 YYLTYPE current;
17949
17950 if (!yylloc) {
17951 yylloc = RUBY_SET_YYLLOC(current);
17952 }
17953 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
17954 p->ruby_sourceline != yylloc->end_pos.lineno)) {
17955 yylloc = 0;
17956 }
17957#endif
17958 parser_compile_error(p, yylloc, "%s", msg);
17959 parser_show_error_line(p, yylloc);
17960 return 0;
17961}
17962
17963static int
17964parser_yyerror0(struct parser_params *p, const char *msg)
17965{
17966 YYLTYPE current;
17967 return parser_yyerror(p, RUBY_SET_YYLLOC(current), msg);
17968}
17969
17970void
17971ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, rb_parser_string_t *str)
17972{
17973 VALUE mesg;
17974 const int max_line_margin = 30;
17975 const char *ptr, *ptr_end, *pt, *pb;
17976 const char *pre = "", *post = "", *pend;
17977 const char *code = "", *caret = "";
17978 const char *lim;
17979 const char *const pbeg = PARSER_STRING_PTR(str);
17980 char *buf;
17981 long len;
17982 int i;
17983
17984 if (!yylloc) return;
17985 pend = rb_parser_string_end(str);
17986 if (pend > pbeg && pend[-1] == '\n') {
17987 if (--pend > pbeg && pend[-1] == '\r') --pend;
17988 }
17989
17990 pt = pend;
17991 if (lineno == yylloc->end_pos.lineno &&
17992 (pend - pbeg) > yylloc->end_pos.column) {
17993 pt = pbeg + yylloc->end_pos.column;
17994 }
17995
17996 ptr = ptr_end = pt;
17997 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
17998 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
17999
18000 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
18001 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
18002
18003 len = ptr_end - ptr;
18004 if (len > 4) {
18005 if (ptr > pbeg) {
18006 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_parser_str_get_encoding(str));
18007 if (ptr > pbeg) pre = "...";
18008 }
18009 if (ptr_end < pend) {
18010 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_parser_str_get_encoding(str));
18011 if (ptr_end < pend) post = "...";
18012 }
18013 }
18014 pb = pbeg;
18015 if (lineno == yylloc->beg_pos.lineno) {
18016 pb += yylloc->beg_pos.column;
18017 if (pb > pt) pb = pt;
18018 }
18019 if (pb < ptr) pb = ptr;
18020 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
18021 return;
18022 }
18023 if (RTEST(errbuf)) {
18024 mesg = rb_attr_get(errbuf, idMesg);
18025 if (char_at_end(p, mesg, '\n') != '\n')
18026 rb_str_cat_cstr(mesg, "\n");
18027 }
18028 else {
18029 mesg = rb_enc_str_new(0, 0, rb_parser_str_get_encoding(str));
18030 }
18031 if (!errbuf && rb_stderr_tty_p()) {
18032#define CSI_BEGIN "\033["
18033#define CSI_SGR "m"
18034 rb_str_catf(mesg,
18035 CSI_BEGIN""CSI_SGR"%s" /* pre */
18036 CSI_BEGIN"1"CSI_SGR"%.*s"
18037 CSI_BEGIN"1;4"CSI_SGR"%.*s"
18038 CSI_BEGIN";1"CSI_SGR"%.*s"
18039 CSI_BEGIN""CSI_SGR"%s" /* post */
18040 "\n",
18041 pre,
18042 (int)(pb - ptr), ptr,
18043 (int)(pt - pb), pb,
18044 (int)(ptr_end - pt), pt,
18045 post);
18046 }
18047 else {
18048 char *p2;
18049
18050 len = ptr_end - ptr;
18051 lim = pt < pend ? pt : pend;
18052 i = (int)(lim - ptr);
18053 buf = ALLOCA_N(char, i+2);
18054 code = ptr;
18055 caret = p2 = buf;
18056 if (ptr <= pb) {
18057 while (ptr < pb) {
18058 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
18059 }
18060 *p2++ = '^';
18061 ptr++;
18062 }
18063 if (lim > ptr) {
18064 memset(p2, '~', (lim - ptr));
18065 p2 += (lim - ptr);
18066 }
18067 *p2 = '\0';
18068 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
18069 pre, (int)len, code, post,
18070 pre, caret);
18071 }
18072 if (!errbuf) rb_write_error_str(mesg);
18073}
18074#else
18075
18076static int
18077parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
18078{
18079 const char *pcur = 0, *ptok = 0;
18080 if (p->ruby_sourceline == yylloc->beg_pos.lineno &&
18081 p->ruby_sourceline == yylloc->end_pos.lineno) {
18082 pcur = p->lex.pcur;
18083 ptok = p->lex.ptok;
18084 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
18085 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
18086 }
18087 parser_yyerror0(p, msg);
18088 if (pcur) {
18089 p->lex.ptok = ptok;
18090 p->lex.pcur = pcur;
18091 }
18092 return 0;
18093}
18094
18095static int
18096parser_yyerror0(struct parser_params *p, const char *msg)
18097{
18098 dispatch1(parse_error, STR_NEW2(msg));
18099 ripper_error(p);
18100 return 0;
18101}
18102
18103static inline void
18104parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
18105{
18106}
18107#endif /* !RIPPER */
18108
18109static int
18110vtable_size(const struct vtable *tbl)
18111{
18112 if (!DVARS_TERMINAL_P(tbl)) {
18113 return tbl->pos;
18114 }
18115 else {
18116 return 0;
18117 }
18118}
18119
18120static struct vtable *
18121vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
18122{
18123 struct vtable *tbl = ALLOC(struct vtable);
18124 tbl->pos = 0;
18125 tbl->capa = 8;
18126 tbl->tbl = ALLOC_N(ID, tbl->capa);
18127 tbl->prev = prev;
18128#ifndef RIPPER
18129 if (p->debug) {
18130 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
18131 }
18132#endif
18133 return tbl;
18134}
18135#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
18136
18137static void
18138vtable_free_gen(struct parser_params *p, int line, const char *name,
18139 struct vtable *tbl)
18140{
18141#ifndef RIPPER
18142 if (p->debug) {
18143 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
18144 }
18145#endif
18146 if (!DVARS_TERMINAL_P(tbl)) {
18147 if (tbl->tbl) {
18148 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
18149 }
18150 ruby_sized_xfree(tbl, sizeof(*tbl));
18151 }
18152}
18153#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
18154
18155static void
18156vtable_add_gen(struct parser_params *p, int line, const char *name,
18157 struct vtable *tbl, ID id)
18158{
18159#ifndef RIPPER
18160 if (p->debug) {
18161 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
18162 line, name, (void *)tbl, rb_id2name(id));
18163 }
18164#endif
18165 if (DVARS_TERMINAL_P(tbl)) {
18166 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
18167 return;
18168 }
18169 if (tbl->pos == tbl->capa) {
18170 tbl->capa = tbl->capa * 2;
18171 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
18172 }
18173 tbl->tbl[tbl->pos++] = id;
18174}
18175#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
18176
18177static void
18178vtable_pop_gen(struct parser_params *p, int line, const char *name,
18179 struct vtable *tbl, int n)
18180{
18181 if (p->debug) {
18182 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
18183 line, name, (void *)tbl, n);
18184 }
18185 if (tbl->pos < n) {
18186 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
18187 return;
18188 }
18189 tbl->pos -= n;
18190}
18191#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
18192
18193static int
18194vtable_included(const struct vtable * tbl, ID id)
18195{
18196 int i;
18197
18198 if (!DVARS_TERMINAL_P(tbl)) {
18199 for (i = 0; i < tbl->pos; i++) {
18200 if (tbl->tbl[i] == id) {
18201 return i+1;
18202 }
18203 }
18204 }
18205 return 0;
18206}
18207
18208static void parser_prepare(struct parser_params *p);
18209
18210static int
18211e_option_supplied(struct parser_params *p)
18212{
18213 return strcmp(p->ruby_sourcefile, "-e") == 0;
18214}
18215
18216#ifndef RIPPER
18217static NODE *parser_append_options(struct parser_params *p, NODE *node);
18218
18219static VALUE
18220yycompile0(VALUE arg)
18221{
18222 int n;
18223 NODE *tree;
18224 struct parser_params *p = (struct parser_params *)arg;
18225 int cov = FALSE;
18226
18227 if (!compile_for_eval && !NIL_P(p->ruby_sourcefile_string) && !e_option_supplied(p)) {
18228 cov = TRUE;
18229 }
18230
18231 if (p->debug_lines) {
18232 p->ast->body.script_lines = p->debug_lines;
18233 }
18234
18235 parser_prepare(p);
18236#define RUBY_DTRACE_PARSE_HOOK(name) \
18237 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
18238 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
18239 }
18240 RUBY_DTRACE_PARSE_HOOK(BEGIN);
18241 n = yyparse(p);
18242 RUBY_DTRACE_PARSE_HOOK(END);
18243
18244 p->debug_lines = 0;
18245
18246 xfree(p->lex.strterm);
18247 p->lex.strterm = 0;
18248 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
18249 if (n || p->error_p) {
18250 VALUE mesg = p->error_buffer;
18251 if (!mesg) {
18252 mesg = syntax_error_new();
18253 }
18254 if (!p->error_tolerant) {
18255 rb_set_errinfo(mesg);
18256 return FALSE;
18257 }
18258 }
18259 tree = p->eval_tree;
18260 if (!tree) {
18261 tree = NEW_NIL(&NULL_LOC);
18262 }
18263 else {
18264 rb_parser_ary_t *tokens = p->tokens;
18265 NODE *prelude;
18266 NODE *body = parser_append_options(p, RNODE_SCOPE(tree)->nd_body);
18267 prelude = block_append(p, p->eval_tree_begin, body);
18268 RNODE_SCOPE(tree)->nd_body = prelude;
18269 p->ast->body.frozen_string_literal = p->frozen_string_literal;
18270 p->ast->body.coverage_enabled = cov;
18271 if (p->keep_tokens) {
18272 p->ast->node_buffer->tokens = tokens;
18273 p->tokens = NULL;
18274 }
18275 }
18276 p->ast->body.root = tree;
18277 p->ast->body.line_count = p->line_count;
18278 return TRUE;
18279}
18280
18281static rb_ast_t *
18282yycompile(struct parser_params *p, VALUE fname, int line)
18283{
18284 rb_ast_t *ast;
18285 if (NIL_P(fname)) {
18286 p->ruby_sourcefile_string = Qnil;
18287 p->ruby_sourcefile = "(none)";
18288 }
18289 else {
18290 p->ruby_sourcefile_string = rb_str_to_interned_str(fname);
18291 p->ruby_sourcefile = StringValueCStr(fname);
18292 }
18293 p->ruby_sourceline = line - 1;
18294
18295 p->lvtbl = NULL;
18296
18297 p->ast = ast = rb_ast_new();
18298 compile_callback(yycompile0, (VALUE)p);
18299 p->ast = 0;
18300
18301 while (p->lvtbl) {
18302 local_pop(p);
18303 }
18304
18305 return ast;
18306}
18307#endif /* !RIPPER */
18308
18309static rb_encoding *
18310must_be_ascii_compatible(struct parser_params *p, rb_parser_string_t *s)
18311{
18312 rb_encoding *enc = rb_parser_str_get_encoding(s);
18313 if (!rb_enc_asciicompat(enc)) {
18314 rb_raise(rb_eArgError, "invalid source encoding");
18315 }
18316 return enc;
18317}
18318
18319static rb_parser_string_t *
18320lex_getline(struct parser_params *p)
18321{
18322 rb_parser_string_t *line = (*p->lex.gets)(p, p->lex.input, p->line_count);
18323 if (!line) return 0;
18324 p->line_count++;
18325 string_buffer_append(p, line);
18326 must_be_ascii_compatible(p, line);
18327 return line;
18328}
18329
18330#ifndef RIPPER
18331rb_ast_t*
18332rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, VALUE fname, rb_parser_input_data input, int line)
18333{
18334 p->lex.gets = gets;
18335 p->lex.input = input;
18336 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
18337
18338 return yycompile(p, fname, line);
18339}
18340#endif /* !RIPPER */
18341
18342#define STR_FUNC_ESCAPE 0x01
18343#define STR_FUNC_EXPAND 0x02
18344#define STR_FUNC_REGEXP 0x04
18345#define STR_FUNC_QWORDS 0x08
18346#define STR_FUNC_SYMBOL 0x10
18347#define STR_FUNC_INDENT 0x20
18348#define STR_FUNC_LABEL 0x40
18349#define STR_FUNC_LIST 0x4000
18350#define STR_FUNC_TERM 0x8000
18351
18352enum string_type {
18353 str_label = STR_FUNC_LABEL,
18354 str_squote = (0),
18355 str_dquote = (STR_FUNC_EXPAND),
18356 str_xquote = (STR_FUNC_EXPAND),
18357 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
18358 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
18359 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
18360 str_ssym = (STR_FUNC_SYMBOL),
18361 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
18362};
18363
18364static rb_parser_string_t *
18365parser_str_new(struct parser_params *p, const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
18366{
18367 rb_parser_string_t *pstr;
18368
18369 pstr = rb_parser_encoding_string_new(p, ptr, len, enc);
18370
18371 if (!(func & STR_FUNC_REGEXP)) {
18372 if (rb_parser_is_ascii_string(p, pstr)) {
18373 }
18374 else if (rb_is_usascii_enc((void *)enc0) && enc != rb_utf8_encoding()) {
18375 /* everything is valid in ASCII-8BIT */
18376 enc = rb_ascii8bit_encoding();
18377 PARSER_ENCODING_CODERANGE_SET(pstr, enc, RB_PARSER_ENC_CODERANGE_VALID);
18378 }
18379 }
18380
18381 return pstr;
18382}
18383
18384static int
18385strterm_is_heredoc(rb_strterm_t *strterm)
18386{
18387 return strterm->heredoc;
18388}
18389
18390static rb_strterm_t *
18391new_strterm(struct parser_params *p, int func, int term, int paren)
18392{
18393 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
18394 strterm->u.literal.func = func;
18395 strterm->u.literal.term = term;
18396 strterm->u.literal.paren = paren;
18397 return strterm;
18398}
18399
18400static rb_strterm_t *
18401new_heredoc(struct parser_params *p)
18402{
18403 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
18404 strterm->heredoc = true;
18405 return strterm;
18406}
18407
18408#define peek(p,c) peek_n(p, (c), 0)
18409#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
18410#define peekc(p) peekc_n(p, 0)
18411#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
18412
18413#define add_delayed_token(p, tok, end) parser_add_delayed_token(p, tok, end, __LINE__)
18414static void
18415parser_add_delayed_token(struct parser_params *p, const char *tok, const char *end, int line)
18416{
18417 debug_token_line(p, "add_delayed_token", line);
18418
18419 if (tok < end) {
18420 if (has_delayed_token(p)) {
18421 bool next_line = parser_string_char_at_end(p, p->delayed.token, 0) == '\n';
18422 int end_line = (next_line ? 1 : 0) + p->delayed.end_line;
18423 int end_col = (next_line ? 0 : p->delayed.end_col);
18424 if (end_line != p->ruby_sourceline || end_col != tok - p->lex.pbeg) {
18425 dispatch_delayed_token(p, tSTRING_CONTENT);
18426 }
18427 }
18428 if (!has_delayed_token(p)) {
18429 p->delayed.token = rb_parser_string_new(p, 0, 0);
18430 rb_parser_enc_associate(p, p->delayed.token, p->enc);
18431 p->delayed.beg_line = p->ruby_sourceline;
18432 p->delayed.beg_col = rb_long2int(tok - p->lex.pbeg);
18433 }
18434 parser_str_cat(p->delayed.token, tok, end - tok);
18435 p->delayed.end_line = p->ruby_sourceline;
18436 p->delayed.end_col = rb_long2int(end - p->lex.pbeg);
18437 p->lex.ptok = end;
18438 }
18439}
18440
18441static void
18442set_lastline(struct parser_params *p, rb_parser_string_t *str)
18443{
18444 p->lex.pbeg = p->lex.pcur = PARSER_STRING_PTR(str);
18445 p->lex.pend = p->lex.pcur + PARSER_STRING_LEN(str);
18446 p->lex.lastline = str;
18447}
18448
18449static int
18450nextline(struct parser_params *p, int set_encoding)
18451{
18452 rb_parser_string_t *str = p->lex.nextline;
18453 p->lex.nextline = 0;
18454 if (!str) {
18455 if (p->eofp)
18456 return -1;
18457
18458 if (!lex_eol_ptr_p(p, p->lex.pbeg) && *(p->lex.pend-1) != '\n') {
18459 goto end_of_input;
18460 }
18461
18462 if (!p->lex.input || !(str = lex_getline(p))) {
18463 end_of_input:
18464 p->eofp = 1;
18465 lex_goto_eol(p);
18466 return -1;
18467 }
18468#ifndef RIPPER
18469 if (p->debug_lines) {
18470 if (set_encoding) rb_parser_enc_associate(p, str, p->enc);
18471 rb_parser_string_t *copy = rb_parser_string_deep_copy(p, str);
18472 rb_parser_ary_push_script_line(p, p->debug_lines, copy);
18473 }
18474#endif
18475 p->cr_seen = FALSE;
18476 }
18477 else if (str == AFTER_HEREDOC_WITHOUT_TERMINTOR) {
18478 /* after here-document without terminator */
18479 goto end_of_input;
18480 }
18481 add_delayed_token(p, p->lex.ptok, p->lex.pend);
18482 if (p->heredoc_end > 0) {
18483 p->ruby_sourceline = p->heredoc_end;
18484 p->heredoc_end = 0;
18485 }
18486 p->ruby_sourceline++;
18487 set_lastline(p, str);
18488 token_flush(p);
18489 return 0;
18490}
18491
18492static int
18493parser_cr(struct parser_params *p, int c)
18494{
18495 if (peek(p, '\n')) {
18496 p->lex.pcur++;
18497 c = '\n';
18498 }
18499 return c;
18500}
18501
18502static inline int
18503nextc0(struct parser_params *p, int set_encoding)
18504{
18505 int c;
18506
18507 if (UNLIKELY(lex_eol_p(p) || p->eofp || p->lex.nextline > AFTER_HEREDOC_WITHOUT_TERMINTOR)) {
18508 if (nextline(p, set_encoding)) return -1;
18509 }
18510 c = (unsigned char)*p->lex.pcur++;
18511 if (UNLIKELY(c == '\r')) {
18512 c = parser_cr(p, c);
18513 }
18514
18515 return c;
18516}
18517#define nextc(p) nextc0(p, TRUE)
18518
18519static void
18520pushback(struct parser_params *p, int c)
18521{
18522 if (c == -1) return;
18523 p->eofp = 0;
18524 p->lex.pcur--;
18525 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
18526 p->lex.pcur--;
18527 }
18528}
18529
18530#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
18531
18532#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
18533#define tok(p) (p)->tokenbuf
18534#define toklen(p) (p)->tokidx
18535
18536static int
18537looking_at_eol_p(struct parser_params *p)
18538{
18539 const char *ptr = p->lex.pcur;
18540 while (!lex_eol_ptr_p(p, ptr)) {
18541 int c = (unsigned char)*ptr++;
18542 int eol = (c == '\n' || c == '#');
18543 if (eol || !ISSPACE(c)) {
18544 return eol;
18545 }
18546 }
18547 return TRUE;
18548}
18549
18550static char*
18551newtok(struct parser_params *p)
18552{
18553 p->tokidx = 0;
18554 if (!p->tokenbuf) {
18555 p->toksiz = 60;
18556 p->tokenbuf = ALLOC_N(char, 60);
18557 }
18558 if (p->toksiz > 4096) {
18559 p->toksiz = 60;
18560 REALLOC_N(p->tokenbuf, char, 60);
18561 }
18562 return p->tokenbuf;
18563}
18564
18565static char *
18566tokspace(struct parser_params *p, int n)
18567{
18568 p->tokidx += n;
18569
18570 if (p->tokidx >= p->toksiz) {
18571 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
18572 REALLOC_N(p->tokenbuf, char, p->toksiz);
18573 }
18574 return &p->tokenbuf[p->tokidx-n];
18575}
18576
18577static void
18578tokadd(struct parser_params *p, int c)
18579{
18580 p->tokenbuf[p->tokidx++] = (char)c;
18581 if (p->tokidx >= p->toksiz) {
18582 p->toksiz *= 2;
18583 REALLOC_N(p->tokenbuf, char, p->toksiz);
18584 }
18585}
18586
18587static int
18588tok_hex(struct parser_params *p, size_t *numlen)
18589{
18590 int c;
18591
18592 c = (int)ruby_scan_hex(p->lex.pcur, 2, numlen);
18593 if (!*numlen) {
18594 flush_string_content(p, p->enc, rb_strlen_lit("\\x"));
18595 yyerror0("invalid hex escape");
18596 dispatch_scan_event(p, tSTRING_CONTENT);
18597 return 0;
18598 }
18599 p->lex.pcur += *numlen;
18600 return c;
18601}
18602
18603#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
18604
18605static int
18606escaped_control_code(int c)
18607{
18608 int c2 = 0;
18609 switch (c) {
18610 case ' ':
18611 c2 = 's';
18612 break;
18613 case '\n':
18614 c2 = 'n';
18615 break;
18616 case '\t':
18617 c2 = 't';
18618 break;
18619 case '\v':
18620 c2 = 'v';
18621 break;
18622 case '\r':
18623 c2 = 'r';
18624 break;
18625 case '\f':
18626 c2 = 'f';
18627 break;
18628 }
18629 return c2;
18630}
18631
18632#define WARN_SPACE_CHAR(c, prefix) \
18633 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c))
18634
18635static int
18636tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
18637 int regexp_literal, const char *begin)
18638{
18639 const int wide = !begin;
18640 size_t numlen;
18641 int codepoint = (int)ruby_scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
18642
18643 p->lex.pcur += numlen;
18644 if (p->lex.strterm == NULL ||
18645 strterm_is_heredoc(p->lex.strterm) ||
18646 (p->lex.strterm->u.literal.func != str_regexp)) {
18647 if (!begin) begin = p->lex.pcur;
18648 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
18649 flush_string_content(p, rb_utf8_encoding(), p->lex.pcur - begin);
18650 yyerror0("invalid Unicode escape");
18651 dispatch_scan_event(p, tSTRING_CONTENT);
18652 return wide && numlen > 0;
18653 }
18654 if (codepoint > 0x10ffff) {
18655 flush_string_content(p, rb_utf8_encoding(), p->lex.pcur - begin);
18656 yyerror0("invalid Unicode codepoint (too large)");
18657 dispatch_scan_event(p, tSTRING_CONTENT);
18658 return wide;
18659 }
18660 if ((codepoint & 0xfffff800) == 0xd800) {
18661 flush_string_content(p, rb_utf8_encoding(), p->lex.pcur - begin);
18662 yyerror0("invalid Unicode codepoint");
18663 dispatch_scan_event(p, tSTRING_CONTENT);
18664 return wide;
18665 }
18666 }
18667 if (regexp_literal) {
18668 tokcopy(p, (int)numlen);
18669 }
18670 else if (codepoint >= 0x80) {
18671 rb_encoding *utf8 = rb_utf8_encoding();
18672 if (*encp && utf8 != *encp) {
18673 YYLTYPE loc = RUBY_INIT_YYLLOC();
18674 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
18675 parser_show_error_line(p, &loc);
18676 return wide;
18677 }
18678 *encp = utf8;
18679 tokaddmbc(p, codepoint, *encp);
18680 }
18681 else {
18682 tokadd(p, codepoint);
18683 }
18684 return TRUE;
18685}
18686
18687static int tokadd_mbchar(struct parser_params *p, int c);
18688
18689static int
18690tokskip_mbchar(struct parser_params *p)
18691{
18692 int len = parser_precise_mbclen(p, p->lex.pcur-1);
18693 if (len > 0) {
18694 p->lex.pcur += len - 1;
18695 }
18696 return len;
18697}
18698
18699/* return value is for ?\u3042 */
18700static void
18701tokadd_utf8(struct parser_params *p, rb_encoding **encp,
18702 int term, int symbol_literal, int regexp_literal)
18703{
18704 /*
18705 * If `term` is not -1, then we allow multiple codepoints in \u{}
18706 * upto `term` byte, otherwise we're parsing a character literal.
18707 * And then add the codepoints to the current token.
18708 */
18709 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
18710
18711 const int open_brace = '{', close_brace = '}';
18712
18713 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
18714
18715 if (peek(p, open_brace)) { /* handle \u{...} form */
18716 if (regexp_literal && p->lex.strterm->u.literal.func == str_regexp) {
18717 /*
18718 * Skip parsing validation code and copy bytes as-is until term or
18719 * closing brace, in order to correctly handle extended regexps where
18720 * invalid unicode escapes are allowed in comments. The regexp parser
18721 * does its own validation and will catch any issues.
18722 */
18723 tokadd(p, open_brace);
18724 while (!lex_eol_ptr_p(p, ++p->lex.pcur)) {
18725 int c = peekc(p);
18726 if (c == close_brace) {
18727 tokadd(p, c);
18728 ++p->lex.pcur;
18729 break;
18730 }
18731 else if (c == term) {
18732 break;
18733 }
18734 if (c == '\\' && !lex_eol_n_p(p, 1)) {
18735 tokadd(p, c);
18736 c = *++p->lex.pcur;
18737 }
18738 tokadd_mbchar(p, c);
18739 }
18740 }
18741 else {
18742 const char *second = NULL;
18743 int c, last = nextc(p);
18744 if (lex_eol_p(p)) goto unterminated;
18745 while (ISSPACE(c = peekc(p)) && !lex_eol_ptr_p(p, ++p->lex.pcur));
18746 while (c != close_brace) {
18747 if (c == term) goto unterminated;
18748 if (second == multiple_codepoints)
18749 second = p->lex.pcur;
18750 if (regexp_literal) tokadd(p, last);
18751 if (!tokadd_codepoint(p, encp, regexp_literal, NULL)) {
18752 break;
18753 }
18754 while (ISSPACE(c = peekc(p))) {
18755 if (lex_eol_ptr_p(p, ++p->lex.pcur)) goto unterminated;
18756 last = c;
18757 }
18758 if (term == -1 && !second)
18759 second = multiple_codepoints;
18760 }
18761
18762 if (c != close_brace) {
18763 unterminated:
18764 flush_string_content(p, rb_utf8_encoding(), 0);
18765 yyerror0("unterminated Unicode escape");
18766 dispatch_scan_event(p, tSTRING_CONTENT);
18767 return;
18768 }
18769 if (second && second != multiple_codepoints) {
18770 const char *pcur = p->lex.pcur;
18771 p->lex.pcur = second;
18772 dispatch_scan_event(p, tSTRING_CONTENT);
18773 token_flush(p);
18774 p->lex.pcur = pcur;
18775 yyerror0(multiple_codepoints);
18776 token_flush(p);
18777 }
18778
18779 if (regexp_literal) tokadd(p, close_brace);
18780 nextc(p);
18781 }
18782 }
18783 else { /* handle \uxxxx form */
18784 if (!tokadd_codepoint(p, encp, regexp_literal, p->lex.pcur - rb_strlen_lit("\\u"))) {
18785 token_flush(p);
18786 return;
18787 }
18788 }
18789}
18790
18791#define ESCAPE_CONTROL 1
18792#define ESCAPE_META 2
18793
18794static int
18795read_escape(struct parser_params *p, int flags, const char *begin)
18796{
18797 int c;
18798 size_t numlen;
18799
18800 switch (c = nextc(p)) {
18801 case '\\': /* Backslash */
18802 return c;
18803
18804 case 'n': /* newline */
18805 return '\n';
18806
18807 case 't': /* horizontal tab */
18808 return '\t';
18809
18810 case 'r': /* carriage-return */
18811 return '\r';
18812
18813 case 'f': /* form-feed */
18814 return '\f';
18815
18816 case 'v': /* vertical tab */
18817 return '\13';
18818
18819 case 'a': /* alarm(bell) */
18820 return '\007';
18821
18822 case 'e': /* escape */
18823 return 033;
18824
18825 case '0': case '1': case '2': case '3': /* octal constant */
18826 case '4': case '5': case '6': case '7':
18827 pushback(p, c);
18828 c = (int)ruby_scan_oct(p->lex.pcur, 3, &numlen);
18829 p->lex.pcur += numlen;
18830 return c;
18831
18832 case 'x': /* hex constant */
18833 c = tok_hex(p, &numlen);
18834 if (numlen == 0) return 0;
18835 return c;
18836
18837 case 'b': /* backspace */
18838 return '\010';
18839
18840 case 's': /* space */
18841 return ' ';
18842
18843 case 'M':
18844 if (flags & ESCAPE_META) goto eof;
18845 if ((c = nextc(p)) != '-') {
18846 goto eof;
18847 }
18848 if ((c = nextc(p)) == '\\') {
18849 switch (peekc(p)) {
18850 case 'u': case 'U':
18851 nextc(p);
18852 goto eof;
18853 }
18854 return read_escape(p, flags|ESCAPE_META, begin) | 0x80;
18855 }
18856 else if (c == -1) goto eof;
18857 else if (!ISASCII(c)) {
18858 tokskip_mbchar(p);
18859 goto eof;
18860 }
18861 else {
18862 int c2 = escaped_control_code(c);
18863 if (c2) {
18864 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
18865 WARN_SPACE_CHAR(c2, "\\M-");
18866 }
18867 else {
18868 WARN_SPACE_CHAR(c2, "\\C-\\M-");
18869 }
18870 }
18871 else if (ISCNTRL(c)) goto eof;
18872 return ((c & 0xff) | 0x80);
18873 }
18874
18875 case 'C':
18876 if ((c = nextc(p)) != '-') {
18877 goto eof;
18878 }
18879 case 'c':
18880 if (flags & ESCAPE_CONTROL) goto eof;
18881 if ((c = nextc(p))== '\\') {
18882 switch (peekc(p)) {
18883 case 'u': case 'U':
18884 nextc(p);
18885 goto eof;
18886 }
18887 c = read_escape(p, flags|ESCAPE_CONTROL, begin);
18888 }
18889 else if (c == '?')
18890 return 0177;
18891 else if (c == -1) goto eof;
18892 else if (!ISASCII(c)) {
18893 tokskip_mbchar(p);
18894 goto eof;
18895 }
18896 else {
18897 int c2 = escaped_control_code(c);
18898 if (c2) {
18899 if (ISCNTRL(c)) {
18900 if (flags & ESCAPE_META) {
18901 WARN_SPACE_CHAR(c2, "\\M-");
18902 }
18903 else {
18904 WARN_SPACE_CHAR(c2, "");
18905 }
18906 }
18907 else {
18908 if (flags & ESCAPE_META) {
18909 WARN_SPACE_CHAR(c2, "\\M-\\C-");
18910 }
18911 else {
18912 WARN_SPACE_CHAR(c2, "\\C-");
18913 }
18914 }
18915 }
18916 else if (ISCNTRL(c)) goto eof;
18917 }
18918 return c & 0x9f;
18919
18920 eof:
18921 case -1:
18922 flush_string_content(p, p->enc, p->lex.pcur - begin);
18923 yyerror0("Invalid escape character syntax");
18924 dispatch_scan_event(p, tSTRING_CONTENT);
18925 return '\0';
18926
18927 default:
18928 return c;
18929 }
18930}
18931
18932static void
18933tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
18934{
18935 int len = rb_enc_codelen(c, enc);
18936 rb_enc_mbcput(c, tokspace(p, len), enc);
18937}
18938
18939static int
18940tokadd_escape(struct parser_params *p)
18941{
18942 int c;
18943 size_t numlen;
18944 const char *begin = p->lex.pcur;
18945
18946 switch (c = nextc(p)) {
18947 case '\n':
18948 return 0; /* just ignore */
18949
18950 case '0': case '1': case '2': case '3': /* octal constant */
18951 case '4': case '5': case '6': case '7':
18952 {
18953 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
18954 if (numlen == 0) goto eof;
18955 p->lex.pcur += numlen;
18956 tokcopy(p, (int)numlen + 1);
18957 }
18958 return 0;
18959
18960 case 'x': /* hex constant */
18961 {
18962 tok_hex(p, &numlen);
18963 if (numlen == 0) return -1;
18964 tokcopy(p, (int)numlen + 2);
18965 }
18966 return 0;
18967
18968 eof:
18969 case -1:
18970 flush_string_content(p, p->enc, p->lex.pcur - begin);
18971 yyerror0("Invalid escape character syntax");
18972 token_flush(p);
18973 return -1;
18974
18975 default:
18976 tokadd(p, '\\');
18977 tokadd(p, c);
18978 }
18979 return 0;
18980}
18981
18982static int
18983char_to_option(int c)
18984{
18985 int val;
18986
18987 switch (c) {
18988 case 'i':
18989 val = RE_ONIG_OPTION_IGNORECASE;
18990 break;
18991 case 'x':
18992 val = RE_ONIG_OPTION_EXTEND;
18993 break;
18994 case 'm':
18995 val = RE_ONIG_OPTION_MULTILINE;
18996 break;
18997 default:
18998 val = 0;
18999 break;
19000 }
19001 return val;
19002}
19003
19004#define ARG_ENCODING_FIXED 16
19005#define ARG_ENCODING_NONE 32
19006#define ENC_ASCII8BIT 1
19007#define ENC_EUC_JP 2
19008#define ENC_Windows_31J 3
19009#define ENC_UTF8 4
19010
19011static int
19012char_to_option_kcode(int c, int *option, int *kcode)
19013{
19014 *option = 0;
19015
19016 switch (c) {
19017 case 'n':
19018 *kcode = ENC_ASCII8BIT;
19019 return (*option = ARG_ENCODING_NONE);
19020 case 'e':
19021 *kcode = ENC_EUC_JP;
19022 break;
19023 case 's':
19024 *kcode = ENC_Windows_31J;
19025 break;
19026 case 'u':
19027 *kcode = ENC_UTF8;
19028 break;
19029 default:
19030 *kcode = -1;
19031 return (*option = char_to_option(c));
19032 }
19033 *option = ARG_ENCODING_FIXED;
19034 return 1;
19035}
19036
19037static int
19038regx_options(struct parser_params *p)
19039{
19040 int kcode = 0;
19041 int kopt = 0;
19042 int options = 0;
19043 int c, opt, kc;
19044
19045 newtok(p);
19046 while (c = nextc(p), ISALPHA(c)) {
19047 if (c == 'o') {
19048 options |= RE_OPTION_ONCE;
19049 }
19050 else if (char_to_option_kcode(c, &opt, &kc)) {
19051 if (kc >= 0) {
19052 if (kc != ENC_ASCII8BIT) kcode = c;
19053 kopt = opt;
19054 }
19055 else {
19056 options |= opt;
19057 }
19058 }
19059 else {
19060 tokadd(p, c);
19061 }
19062 }
19063 options |= kopt;
19064 pushback(p, c);
19065 if (toklen(p)) {
19066 YYLTYPE loc = RUBY_INIT_YYLLOC();
19067 tokfix(p);
19068 compile_error(p, "unknown regexp option%s - %*s",
19069 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
19070 parser_show_error_line(p, &loc);
19071 }
19072 return options | RE_OPTION_ENCODING(kcode);
19073}
19074
19075static int
19076tokadd_mbchar(struct parser_params *p, int c)
19077{
19078 int len = parser_precise_mbclen(p, p->lex.pcur-1);
19079 if (len < 0) return -1;
19080 tokadd(p, c);
19081 p->lex.pcur += --len;
19082 if (len > 0) tokcopy(p, len);
19083 return c;
19084}
19085
19086static inline int
19087simple_re_meta(int c)
19088{
19089 switch (c) {
19090 case '$': case '*': case '+': case '.':
19091 case '?': case '^': case '|':
19092 case ')': case ']': case '}': case '>':
19093 return TRUE;
19094 default:
19095 return FALSE;
19096 }
19097}
19098
19099static int
19100parser_update_heredoc_indent(struct parser_params *p, int c)
19101{
19102 if (p->heredoc_line_indent == -1) {
19103 if (c == '\n') p->heredoc_line_indent = 0;
19104 }
19105 else {
19106 if (c == ' ') {
19107 p->heredoc_line_indent++;
19108 return TRUE;
19109 }
19110 else if (c == '\t') {
19111 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
19112 p->heredoc_line_indent = w * TAB_WIDTH;
19113 return TRUE;
19114 }
19115 else if (c != '\n') {
19116 if (p->heredoc_indent > p->heredoc_line_indent) {
19117 p->heredoc_indent = p->heredoc_line_indent;
19118 }
19119 p->heredoc_line_indent = -1;
19120 }
19121 else {
19122 /* Whitespace only line has no indentation */
19123 p->heredoc_line_indent = 0;
19124 }
19125 }
19126 return FALSE;
19127}
19128
19129static void
19130parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
19131{
19132 YYLTYPE loc = RUBY_INIT_YYLLOC();
19133 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
19134 compile_error(p, "%s mixed within %s source", n1, n2);
19135 parser_show_error_line(p, &loc);
19136}
19137
19138static void
19139parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
19140{
19141 const char *pos = p->lex.pcur;
19142 p->lex.pcur = beg;
19143 parser_mixed_error(p, enc1, enc2);
19144 p->lex.pcur = pos;
19145}
19146
19147static inline char
19148nibble_char_upper(unsigned int c)
19149{
19150 c &= 0xf;
19151 return c + (c < 10 ? '0' : 'A' - 10);
19152}
19153
19154static int
19155tokadd_string(struct parser_params *p,
19156 int func, int term, int paren, long *nest,
19157 rb_encoding **encp, rb_encoding **enc)
19158{
19159 int c;
19160 bool erred = false;
19161#ifdef RIPPER
19162 const int heredoc_end = (p->heredoc_end ? p->heredoc_end + 1 : 0);
19163 int top_of_line = FALSE;
19164#endif
19165
19166#define mixed_error(enc1, enc2) \
19167 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
19168#define mixed_escape(beg, enc1, enc2) \
19169 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
19170
19171 while ((c = nextc(p)) != -1) {
19172 if (p->heredoc_indent > 0) {
19173 parser_update_heredoc_indent(p, c);
19174 }
19175#ifdef RIPPER
19176 if (top_of_line && heredoc_end == p->ruby_sourceline) {
19177 pushback(p, c);
19178 break;
19179 }
19180#endif
19181
19182 if (paren && c == paren) {
19183 ++*nest;
19184 }
19185 else if (c == term) {
19186 if (!nest || !*nest) {
19187 pushback(p, c);
19188 break;
19189 }
19190 --*nest;
19191 }
19192 else if ((func & STR_FUNC_EXPAND) && c == '#' && !lex_eol_p(p)) {
19193 unsigned char c2 = *p->lex.pcur;
19194 if (c2 == '$' || c2 == '@' || c2 == '{') {
19195 pushback(p, c);
19196 break;
19197 }
19198 }
19199 else if (c == '\\') {
19200 c = nextc(p);
19201 switch (c) {
19202 case '\n':
19203 if (func & STR_FUNC_QWORDS) break;
19204 if (func & STR_FUNC_EXPAND) {
19205 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
19206 continue;
19207 if (c == term) {
19208 c = '\\';
19209 goto terminate;
19210 }
19211 }
19212 tokadd(p, '\\');
19213 break;
19214
19215 case '\\':
19216 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
19217 break;
19218
19219 case 'u':
19220 if ((func & STR_FUNC_EXPAND) == 0) {
19221 tokadd(p, '\\');
19222 break;
19223 }
19224 tokadd_utf8(p, enc, term,
19225 func & STR_FUNC_SYMBOL,
19226 func & STR_FUNC_REGEXP);
19227 continue;
19228
19229 default:
19230 if (c == -1) return -1;
19231 if (!ISASCII(c)) {
19232 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
19233 goto non_ascii;
19234 }
19235 if (func & STR_FUNC_REGEXP) {
19236 switch (c) {
19237 case 'c':
19238 case 'C':
19239 case 'M': {
19240 pushback(p, c);
19241 c = read_escape(p, 0, p->lex.pcur - 1);
19242
19243 char *t = tokspace(p, rb_strlen_lit("\\x00"));
19244 *t++ = '\\';
19245 *t++ = 'x';
19246 *t++ = nibble_char_upper(c >> 4);
19247 *t++ = nibble_char_upper(c);
19248 continue;
19249 }
19250 }
19251
19252 if (c == term && !simple_re_meta(c)) {
19253 tokadd(p, c);
19254 continue;
19255 }
19256 pushback(p, c);
19257 if ((c = tokadd_escape(p)) < 0)
19258 return -1;
19259 if (*enc && *enc != *encp) {
19260 mixed_escape(p->lex.ptok+2, *enc, *encp);
19261 }
19262 continue;
19263 }
19264 else if (func & STR_FUNC_EXPAND) {
19265 pushback(p, c);
19266 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
19267 c = read_escape(p, 0, p->lex.pcur - 1);
19268 }
19269 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
19270 /* ignore backslashed spaces in %w */
19271 }
19272 else if (c != term && !(paren && c == paren)) {
19273 tokadd(p, '\\');
19274 pushback(p, c);
19275 continue;
19276 }
19277 }
19278 }
19279 else if (!parser_isascii(p)) {
19280 non_ascii:
19281 if (!*enc) {
19282 *enc = *encp;
19283 }
19284 else if (*enc != *encp) {
19285 mixed_error(*enc, *encp);
19286 continue;
19287 }
19288 if (tokadd_mbchar(p, c) == -1) return -1;
19289 continue;
19290 }
19291 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
19292 pushback(p, c);
19293 break;
19294 }
19295 if (c & 0x80) {
19296 if (!*enc) {
19297 *enc = *encp;
19298 }
19299 else if (*enc != *encp) {
19300 mixed_error(*enc, *encp);
19301 continue;
19302 }
19303 }
19304 tokadd(p, c);
19305#ifdef RIPPER
19306 top_of_line = (c == '\n');
19307#endif
19308 }
19309 terminate:
19310 if (*enc) *encp = *enc;
19311 return c;
19312}
19313
19314#define NEW_STRTERM(func, term, paren) new_strterm(p, func, term, paren)
19315
19316static void
19317flush_string_content(struct parser_params *p, rb_encoding *enc, size_t back)
19318{
19319 p->lex.pcur -= back;
19320 if (has_delayed_token(p)) {
19321 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
19322 if (len > 0) {
19323 rb_parser_enc_str_buf_cat(p, p->delayed.token, p->lex.ptok, len, enc);
19324 p->delayed.end_line = p->ruby_sourceline;
19325 p->delayed.end_col = rb_long2int(p->lex.pcur - p->lex.pbeg);
19326 }
19327 dispatch_delayed_token(p, tSTRING_CONTENT);
19328 p->lex.ptok = p->lex.pcur;
19329 }
19330 dispatch_scan_event(p, tSTRING_CONTENT);
19331 p->lex.pcur += back;
19332}
19333
19334/* this can be shared with ripper, since it's independent from struct
19335 * parser_params. */
19336#ifndef RIPPER
19337#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
19338#define SPECIAL_PUNCT(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('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
19344 BIT('0', idx))
19345const uint_least32_t ruby_global_name_punct_bits[] = {
19346 SPECIAL_PUNCT(0),
19347 SPECIAL_PUNCT(1),
19348 SPECIAL_PUNCT(2),
19349};
19350#undef BIT
19351#undef SPECIAL_PUNCT
19352#endif
19353
19354static enum yytokentype
19355parser_peek_variable_name(struct parser_params *p)
19356{
19357 int c;
19358 const char *ptr = p->lex.pcur;
19359
19360 if (lex_eol_ptr_n_p(p, ptr, 1)) return 0;
19361 c = *ptr++;
19362 switch (c) {
19363 case '$':
19364 if ((c = *ptr) == '-') {
19365 if (lex_eol_ptr_p(p, ++ptr)) return 0;
19366 c = *ptr;
19367 }
19368 else if (is_global_name_punct(c) || ISDIGIT(c)) {
19369 return tSTRING_DVAR;
19370 }
19371 break;
19372 case '@':
19373 if ((c = *ptr) == '@') {
19374 if (lex_eol_ptr_p(p, ++ptr)) return 0;
19375 c = *ptr;
19376 }
19377 break;
19378 case '{':
19379 p->lex.pcur = ptr;
19380 p->command_start = TRUE;
19381 yylval.state = p->lex.state;
19382 return tSTRING_DBEG;
19383 default:
19384 return 0;
19385 }
19386 if (!ISASCII(c) || c == '_' || ISALPHA(c))
19387 return tSTRING_DVAR;
19388 return 0;
19389}
19390
19391#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
19392#define IS_END() IS_lex_state(EXPR_END_ANY)
19393#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
19394#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
19395#define IS_LABEL_POSSIBLE() (\
19396 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
19397 IS_ARG())
19398#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
19399#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
19400
19401static inline enum yytokentype
19402parser_string_term(struct parser_params *p, int func)
19403{
19404 xfree(p->lex.strterm);
19405 p->lex.strterm = 0;
19406 if (func & STR_FUNC_REGEXP) {
19407 set_yylval_num(regx_options(p));
19408 dispatch_scan_event(p, tREGEXP_END);
19409 SET_LEX_STATE(EXPR_END);
19410 return tREGEXP_END;
19411 }
19412 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
19413 nextc(p);
19414 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
19415 return tLABEL_END;
19416 }
19417 SET_LEX_STATE(EXPR_END);
19418 return tSTRING_END;
19419}
19420
19421static enum yytokentype
19422parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
19423{
19424 int func = quote->func;
19425 int term = quote->term;
19426 int paren = quote->paren;
19427 int c, space = 0;
19428 rb_encoding *enc = p->enc;
19429 rb_encoding *base_enc = 0;
19430 rb_parser_string_t *lit;
19431
19432 if (func & STR_FUNC_TERM) {
19433 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
19434 SET_LEX_STATE(EXPR_END);
19435 xfree(p->lex.strterm);
19436 p->lex.strterm = 0;
19437 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
19438 }
19439 c = nextc(p);
19440 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
19441 while (c != '\n' && ISSPACE(c = nextc(p)));
19442 space = 1;
19443 }
19444 if (func & STR_FUNC_LIST) {
19445 quote->func &= ~STR_FUNC_LIST;
19446 space = 1;
19447 }
19448 if (c == term && !quote->nest) {
19449 if (func & STR_FUNC_QWORDS) {
19450 quote->func |= STR_FUNC_TERM;
19451 pushback(p, c); /* dispatch the term at tSTRING_END */
19452 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
19453 return ' ';
19454 }
19455 return parser_string_term(p, func);
19456 }
19457 if (space) {
19458 if (!ISSPACE(c)) pushback(p, c);
19459 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
19460 return ' ';
19461 }
19462 newtok(p);
19463 if ((func & STR_FUNC_EXPAND) && c == '#') {
19464 enum yytokentype t = parser_peek_variable_name(p);
19465 if (t) return t;
19466 tokadd(p, '#');
19467 c = nextc(p);
19468 }
19469 pushback(p, c);
19470 if (tokadd_string(p, func, term, paren, &quote->nest,
19471 &enc, &base_enc) == -1) {
19472 if (p->eofp) {
19473#ifndef RIPPER
19474# define unterminated_literal(mesg) yyerror0(mesg)
19475#else
19476# define unterminated_literal(mesg) compile_error(p, mesg)
19477#endif
19478 literal_flush(p, p->lex.pcur);
19479 if (func & STR_FUNC_QWORDS) {
19480 /* no content to add, bailing out here */
19481 unterminated_literal("unterminated list meets end of file");
19482 xfree(p->lex.strterm);
19483 p->lex.strterm = 0;
19484 return tSTRING_END;
19485 }
19486 if (func & STR_FUNC_REGEXP) {
19487 unterminated_literal("unterminated regexp meets end of file");
19488 }
19489 else {
19490 unterminated_literal("unterminated string meets end of file");
19491 }
19492 quote->func |= STR_FUNC_TERM;
19493 }
19494 }
19495
19496 tokfix(p);
19497 lit = STR_NEW3(tok(p), toklen(p), enc, func);
19498 set_yylval_str(lit);
19499 flush_string_content(p, enc, 0);
19500
19501 return tSTRING_CONTENT;
19502}
19503
19504static enum yytokentype
19505heredoc_identifier(struct parser_params *p)
19506{
19507 /*
19508 * term_len is length of `<<"END"` except `END`,
19509 * in this case term_len is 4 (<, <, " and ").
19510 */
19511 long len, offset = p->lex.pcur - p->lex.pbeg;
19512 int c = nextc(p), term, func = 0, quote = 0;
19513 enum yytokentype token = tSTRING_BEG;
19514 int indent = 0;
19515
19516 if (c == '-') {
19517 c = nextc(p);
19518 func = STR_FUNC_INDENT;
19519 offset++;
19520 }
19521 else if (c == '~') {
19522 c = nextc(p);
19523 func = STR_FUNC_INDENT;
19524 offset++;
19525 indent = INT_MAX;
19526 }
19527 switch (c) {
19528 case '\'':
19529 func |= str_squote; goto quoted;
19530 case '"':
19531 func |= str_dquote; goto quoted;
19532 case '`':
19533 token = tXSTRING_BEG;
19534 func |= str_xquote; goto quoted;
19535
19536 quoted:
19537 quote++;
19538 offset++;
19539 term = c;
19540 len = 0;
19541 while ((c = nextc(p)) != term) {
19542 if (c == -1 || c == '\r' || c == '\n') {
19543 yyerror0("unterminated here document identifier");
19544 return -1;
19545 }
19546 }
19547 break;
19548
19549 default:
19550 if (!parser_is_identchar(p)) {
19551 pushback(p, c);
19552 if (func & STR_FUNC_INDENT) {
19553 pushback(p, indent > 0 ? '~' : '-');
19554 }
19555 return 0;
19556 }
19557 func |= str_dquote;
19558 do {
19559 int n = parser_precise_mbclen(p, p->lex.pcur-1);
19560 if (n < 0) return 0;
19561 p->lex.pcur += --n;
19562 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
19563 pushback(p, c);
19564 break;
19565 }
19566
19567 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
19568 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
19569 yyerror0("too long here document identifier");
19570 dispatch_scan_event(p, tHEREDOC_BEG);
19571 lex_goto_eol(p);
19572
19573 p->lex.strterm = new_heredoc(p);
19574 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
19575 here->offset = offset;
19576 here->sourceline = p->ruby_sourceline;
19577 here->length = (unsigned)len;
19578 here->quote = quote;
19579 here->func = func;
19580 here->lastline = p->lex.lastline;
19581
19582 token_flush(p);
19583 p->heredoc_indent = indent;
19584 p->heredoc_line_indent = 0;
19585 return token;
19586}
19587
19588static void
19589heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
19590{
19591 rb_parser_string_t *line;
19592 rb_strterm_t *term = p->lex.strterm;
19593
19594 p->lex.strterm = 0;
19595 line = here->lastline;
19596 p->lex.lastline = line;
19597 p->lex.pbeg = PARSER_STRING_PTR(line);
19598 p->lex.pend = p->lex.pbeg + PARSER_STRING_LEN(line);
19599 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
19600 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
19601 p->heredoc_end = p->ruby_sourceline;
19602 p->ruby_sourceline = (int)here->sourceline;
19603 if (p->eofp) p->lex.nextline = AFTER_HEREDOC_WITHOUT_TERMINTOR;
19604 p->eofp = 0;
19605 xfree(term);
19606}
19607
19608static int
19609dedent_string_column(const char *str, long len, int width)
19610{
19611 int i, col = 0;
19612
19613 for (i = 0; i < len && col < width; i++) {
19614 if (str[i] == ' ') {
19615 col++;
19616 }
19617 else if (str[i] == '\t') {
19618 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
19619 if (n > width) break;
19620 col = n;
19621 }
19622 else {
19623 break;
19624 }
19625 }
19626
19627 return i;
19628}
19629
19630static int
19631dedent_string(struct parser_params *p, rb_parser_string_t *string, int width)
19632{
19633 char *str;
19634 long len;
19635 int i;
19636
19637 len = PARSER_STRING_LEN(string);
19638 str = PARSER_STRING_PTR(string);
19639
19640 i = dedent_string_column(str, len, width);
19641 if (!i) return 0;
19642
19643 rb_parser_str_modify(string);
19644 str = PARSER_STRING_PTR(string);
19645 if (PARSER_STRING_LEN(string) != len)
19646 rb_fatal("literal string changed: %s", PARSER_STRING_PTR(string));
19647 MEMMOVE(str, str + i, char, len - i);
19648 rb_parser_str_set_len(p, string, len - i);
19649 return i;
19650}
19651
19652static NODE *
19653heredoc_dedent(struct parser_params *p, NODE *root)
19654{
19655 NODE *node, *str_node, *prev_node;
19656 int indent = p->heredoc_indent;
19657 rb_parser_string_t *prev_lit = 0;
19658
19659 if (indent <= 0) return root;
19660 if (!root) return root;
19661
19662 prev_node = node = str_node = root;
19663 if (nd_type_p(root, NODE_LIST)) str_node = RNODE_LIST(root)->nd_head;
19664
19665 while (str_node) {
19666 rb_parser_string_t *lit = RNODE_STR(str_node)->string;
19667 if (nd_fl_newline(str_node)) {
19668 dedent_string(p, lit, indent);
19669 }
19670 if (!prev_lit) {
19671 prev_lit = lit;
19672 }
19673 else if (!literal_concat0(p, prev_lit, lit)) {
19674 return 0;
19675 }
19676 else {
19677 NODE *end = RNODE_LIST(node)->as.nd_end;
19678 node = RNODE_LIST(prev_node)->nd_next = RNODE_LIST(node)->nd_next;
19679 if (!node) {
19680 if (nd_type_p(prev_node, NODE_DSTR))
19681 nd_set_type(prev_node, NODE_STR);
19682 break;
19683 }
19684 RNODE_LIST(node)->as.nd_end = end;
19685 goto next_str;
19686 }
19687
19688 str_node = 0;
19689 while ((nd_type_p(node, NODE_LIST) || nd_type_p(node, NODE_DSTR)) && (node = RNODE_LIST(prev_node = node)->nd_next) != 0) {
19690 next_str:
19691 if (!nd_type_p(node, NODE_LIST)) break;
19692 if ((str_node = RNODE_LIST(node)->nd_head) != 0) {
19693 enum node_type type = nd_type(str_node);
19694 if (type == NODE_STR || type == NODE_DSTR) break;
19695 prev_lit = 0;
19696 str_node = 0;
19697 }
19698 }
19699 }
19700 return root;
19701}
19702
19703static int
19704whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
19705{
19706 const char *beg = p->lex.pbeg;
19707 const char *ptr = p->lex.pend;
19708
19709 if (ptr - beg < len) return FALSE;
19710 if (ptr > beg && ptr[-1] == '\n') {
19711 if (--ptr > beg && ptr[-1] == '\r') --ptr;
19712 if (ptr - beg < len) return FALSE;
19713 }
19714 if (strncmp(eos, ptr -= len, len)) return FALSE;
19715 if (indent) {
19716 while (beg < ptr && ISSPACE(*beg)) beg++;
19717 }
19718 return beg == ptr;
19719}
19720
19721static int
19722word_match_p(struct parser_params *p, const char *word, long len)
19723{
19724 if (strncmp(p->lex.pcur, word, len)) return 0;
19725 if (lex_eol_n_p(p, len)) return 1;
19726 int c = (unsigned char)p->lex.pcur[len];
19727 if (ISSPACE(c)) return 1;
19728 switch (c) {
19729 case '\0': case '\004': case '\032': return 1;
19730 }
19731 return 0;
19732}
19733
19734#define NUM_SUFFIX_R (1<<0)
19735#define NUM_SUFFIX_I (1<<1)
19736#define NUM_SUFFIX_ALL 3
19737
19738static int
19739number_literal_suffix(struct parser_params *p, int mask)
19740{
19741 int c, result = 0;
19742 const char *lastp = p->lex.pcur;
19743
19744 while ((c = nextc(p)) != -1) {
19745 if ((mask & NUM_SUFFIX_I) && c == 'i') {
19746 result |= (mask & NUM_SUFFIX_I);
19747 mask &= ~NUM_SUFFIX_I;
19748 /* r after i, rational of complex is disallowed */
19749 mask &= ~NUM_SUFFIX_R;
19750 continue;
19751 }
19752 if ((mask & NUM_SUFFIX_R) && c == 'r') {
19753 result |= (mask & NUM_SUFFIX_R);
19754 mask &= ~NUM_SUFFIX_R;
19755 continue;
19756 }
19757 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
19758 p->lex.pcur = lastp;
19759 literal_flush(p, p->lex.pcur);
19760 return 0;
19761 }
19762 pushback(p, c);
19763 break;
19764 }
19765 return result;
19766}
19767
19768static enum yytokentype
19769set_number_literal(struct parser_params *p, enum yytokentype type, int suffix, int base, int seen_point)
19770{
19771 enum rb_numeric_type numeric_type = integer_literal;
19772
19773 if (type == tFLOAT) {
19774 numeric_type = float_literal;
19775 }
19776
19777 if (suffix & NUM_SUFFIX_R) {
19778 type = tRATIONAL;
19779 numeric_type = rational_literal;
19780 }
19781 if (suffix & NUM_SUFFIX_I) {
19782 type = tIMAGINARY;
19783 }
19784
19785 switch (type) {
19786 case tINTEGER:
19787 set_yylval_node(NEW_INTEGER(strdup(tok(p)), base, &_cur_loc));
19788 break;
19789 case tFLOAT:
19790 set_yylval_node(NEW_FLOAT(strdup(tok(p)), &_cur_loc));
19791 break;
19792 case tRATIONAL:
19793 set_yylval_node(NEW_RATIONAL(strdup(tok(p)), base, seen_point, &_cur_loc));
19794 break;
19795 case tIMAGINARY:
19796 set_yylval_node(NEW_IMAGINARY(strdup(tok(p)), base, seen_point, numeric_type, &_cur_loc));
19797 (void)numeric_type; /* for ripper */
19798 break;
19799 default:
19800 rb_bug("unexpected token: %d", type);
19801 }
19802 SET_LEX_STATE(EXPR_END);
19803 return type;
19804}
19805
19806#define dispatch_heredoc_end(p) parser_dispatch_heredoc_end(p, __LINE__)
19807static void
19808parser_dispatch_heredoc_end(struct parser_params *p, int line)
19809{
19810 if (has_delayed_token(p))
19811 dispatch_delayed_token(p, tSTRING_CONTENT);
19812
19813#ifdef RIPPER
19814 VALUE str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
19815 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
19816#else
19817 if (p->keep_tokens) {
19818 rb_parser_string_t *str = rb_parser_encoding_string_new(p, p->lex.ptok, p->lex.pend - p->lex.ptok, p->enc);
19819 RUBY_SET_YYLLOC_OF_HEREDOC_END(*p->yylloc);
19820 parser_append_tokens(p, str, tHEREDOC_END, line);
19821 }
19822#endif
19823
19824 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
19825 lex_goto_eol(p);
19826 token_flush(p);
19827}
19828
19829static enum yytokentype
19830here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
19831{
19832 int c, func, indent = 0;
19833 const char *eos, *ptr, *ptr_end;
19834 long len;
19835 rb_parser_string_t *str = 0;
19836 rb_encoding *enc = p->enc;
19837 rb_encoding *base_enc = 0;
19838 int bol;
19839#ifdef RIPPER
19840 VALUE s_value;
19841#endif
19842
19843 eos = PARSER_STRING_PTR(here->lastline) + here->offset;
19844 len = here->length;
19845 indent = (func = here->func) & STR_FUNC_INDENT;
19846
19847 if ((c = nextc(p)) == -1) {
19848 error:
19849#ifdef RIPPER
19850 if (!has_delayed_token(p)) {
19851 dispatch_scan_event(p, tSTRING_CONTENT);
19852 }
19853 else {
19854 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
19855 if (!(func & STR_FUNC_REGEXP)) {
19856 int cr = ENC_CODERANGE_UNKNOWN;
19857 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
19858 if (cr != ENC_CODERANGE_7BIT &&
19859 rb_is_usascii_enc(p->enc) &&
19860 enc != rb_utf8_encoding()) {
19861 enc = rb_ascii8bit_encoding();
19862 }
19863 }
19864 rb_parser_enc_str_buf_cat(p, p->delayed.token, p->lex.ptok, len, enc);
19865 }
19866 dispatch_delayed_token(p, tSTRING_CONTENT);
19867 }
19868 lex_goto_eol(p);
19869#endif
19870 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19871 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
19872 (int)len, eos);
19873 token_flush(p);
19874 SET_LEX_STATE(EXPR_END);
19875 return tSTRING_END;
19876 }
19877 bol = was_bol(p);
19878 if (!bol) {
19879 /* not beginning of line, cannot be the terminator */
19880 }
19881 else if (p->heredoc_line_indent == -1) {
19882 /* `heredoc_line_indent == -1` means
19883 * - "after an interpolation in the same line", or
19884 * - "in a continuing line"
19885 */
19886 p->heredoc_line_indent = 0;
19887 }
19888 else if (whole_match_p(p, eos, len, indent)) {
19889 dispatch_heredoc_end(p);
19890 restore:
19891 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19892 token_flush(p);
19893 SET_LEX_STATE(EXPR_END);
19894 return tSTRING_END;
19895 }
19896
19897 if (!(func & STR_FUNC_EXPAND)) {
19898 do {
19899 ptr = PARSER_STRING_PTR(p->lex.lastline);
19900 ptr_end = p->lex.pend;
19901 if (ptr_end > ptr) {
19902 switch (ptr_end[-1]) {
19903 case '\n':
19904 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
19905 ptr_end++;
19906 break;
19907 }
19908 case '\r':
19909 --ptr_end;
19910 }
19911 }
19912
19913 if (p->heredoc_indent > 0) {
19914 long i = 0;
19915 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
19916 i++;
19917 p->heredoc_line_indent = 0;
19918 }
19919
19920 if (str)
19921 parser_str_cat(str, ptr, ptr_end - ptr);
19922 else
19923 str = rb_parser_encoding_string_new(p, ptr, ptr_end - ptr, enc);
19924 if (!lex_eol_ptr_p(p, ptr_end)) parser_str_cat_cstr(str, "\n");
19925 lex_goto_eol(p);
19926 if (p->heredoc_indent > 0) {
19927 goto flush_str;
19928 }
19929 if (nextc(p) == -1) {
19930 if (str) {
19931 rb_parser_string_free(p, str);
19932 str = 0;
19933 }
19934 goto error;
19935 }
19936 } while (!whole_match_p(p, eos, len, indent));
19937 }
19938 else {
19939 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
19940 newtok(p);
19941 if (c == '#') {
19942 enum yytokentype t = parser_peek_variable_name(p);
19943 if (p->heredoc_line_indent != -1) {
19944 if (p->heredoc_indent > p->heredoc_line_indent) {
19945 p->heredoc_indent = p->heredoc_line_indent;
19946 }
19947 p->heredoc_line_indent = -1;
19948 }
19949 if (t) return t;
19950 tokadd(p, '#');
19951 c = nextc(p);
19952 }
19953 do {
19954 pushback(p, c);
19955 enc = p->enc;
19956 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
19957 if (p->eofp) goto error;
19958 goto restore;
19959 }
19960 if (c != '\n') {
19961 if (c == '\\') p->heredoc_line_indent = -1;
19962 flush:
19963 str = STR_NEW3(tok(p), toklen(p), enc, func);
19964 flush_str:
19965 set_yylval_str(str);
19966#ifndef RIPPER
19967 if (bol) nd_set_fl_newline(yylval.node);
19968#endif
19969 flush_string_content(p, enc, 0);
19970 return tSTRING_CONTENT;
19971 }
19972 tokadd(p, nextc(p));
19973 if (p->heredoc_indent > 0) {
19974 lex_goto_eol(p);
19975 goto flush;
19976 }
19977 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
19978 if ((c = nextc(p)) == -1) goto error;
19979 } while (!whole_match_p(p, eos, len, indent));
19980 str = STR_NEW3(tok(p), toklen(p), enc, func);
19981 }
19982 dispatch_heredoc_end(p);
19983 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19984 token_flush(p);
19985 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
19986#ifdef RIPPER
19987 /* Preserve s_value for set_yylval_str */
19988 s_value = p->s_value;
19989#endif
19990 set_yylval_str(str);
19991#ifdef RIPPER
19992 set_parser_s_value(s_value);
19993#endif
19994
19995#ifndef RIPPER
19996 if (bol) nd_set_fl_newline(yylval.node);
19997#endif
19998 return tSTRING_CONTENT;
19999}
20000
20001#include "lex.c"
20002
20003static int
20004arg_ambiguous(struct parser_params *p, char c)
20005{
20006#ifndef RIPPER
20007 if (c == '/') {
20008 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after '%c' operator", WARN_I(c));
20009 }
20010 else {
20011 rb_warning1("ambiguous first argument; put parentheses or a space even after '%c' operator", WARN_I(c));
20012 }
20013#else
20014 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
20015#endif
20016 return TRUE;
20017}
20018
20019/* returns true value if formal argument error;
20020 * Qtrue, or error message if ripper */
20021static VALUE
20022formal_argument_error(struct parser_params *p, ID id)
20023{
20024 switch (id_type(id)) {
20025 case ID_LOCAL:
20026 break;
20027#ifndef RIPPER
20028# define ERR(mesg) (yyerror0(mesg), Qtrue)
20029#else
20030# define ERR(mesg) WARN_S(mesg)
20031#endif
20032 case ID_CONST:
20033 return ERR("formal argument cannot be a constant");
20034 case ID_INSTANCE:
20035 return ERR("formal argument cannot be an instance variable");
20036 case ID_GLOBAL:
20037 return ERR("formal argument cannot be a global variable");
20038 case ID_CLASS:
20039 return ERR("formal argument cannot be a class variable");
20040 default:
20041 return ERR("formal argument must be local variable");
20042#undef ERR
20043 }
20044 shadowing_lvar(p, id);
20045
20046 return Qfalse;
20047}
20048
20049static int
20050lvar_defined(struct parser_params *p, ID id)
20051{
20052 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
20053}
20054
20055/* emacsen -*- hack */
20056static long
20057parser_encode_length(struct parser_params *p, const char *name, long len)
20058{
20059 long nlen;
20060
20061 if (len > 5 && name[nlen = len - 5] == '-') {
20062 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
20063 return nlen;
20064 }
20065 if (len > 4 && name[nlen = len - 4] == '-') {
20066 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
20067 return nlen;
20068 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
20069 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
20070 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
20071 return nlen;
20072 }
20073 return len;
20074}
20075
20076static void
20077parser_set_encode(struct parser_params *p, const char *name)
20078{
20079 rb_encoding *enc;
20080 VALUE excargs[3];
20081 int idx = 0;
20082
20083 const char *wrong = 0;
20084 switch (*name) {
20085 case 'e': case 'E': wrong = "external"; break;
20086 case 'i': case 'I': wrong = "internal"; break;
20087 case 'f': case 'F': wrong = "filesystem"; break;
20088 case 'l': case 'L': wrong = "locale"; break;
20089 }
20090 if (wrong && STRCASECMP(name, wrong) == 0) goto unknown;
20091 idx = rb_enc_find_index(name);
20092 if (idx < 0) {
20093 unknown:
20094 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
20095 error:
20096 excargs[0] = rb_eArgError;
20097 excargs[2] = rb_make_backtrace();
20098 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
20099 VALUE exc = rb_make_exception(3, excargs);
20100 ruby_show_error_line(p, exc, &(YYLTYPE)RUBY_INIT_YYLLOC(), p->ruby_sourceline, p->lex.lastline);
20101
20102 rb_ast_free(p->ast);
20103 p->ast = NULL;
20104
20105 rb_exc_raise(exc);
20106 }
20107 enc = rb_enc_from_index(idx);
20108 if (!rb_enc_asciicompat(enc)) {
20109 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
20110 goto error;
20111 }
20112 p->enc = enc;
20113#ifndef RIPPER
20114 if (p->debug_lines) {
20115 long i;
20116 for (i = 0; i < p->debug_lines->len; i++) {
20117 rb_parser_enc_associate(p, p->debug_lines->data[i], enc);
20118 }
20119 }
20120#endif
20121}
20122
20123static bool
20124comment_at_top(struct parser_params *p)
20125{
20126 if (p->token_seen) return false;
20127 return (p->line_count == (p->has_shebang ? 2 : 1));
20128}
20129
20130typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
20131typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
20132
20133static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
20134
20135static void
20136magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
20137{
20138 if (!comment_at_top(p)) {
20139 return;
20140 }
20141 parser_set_encode(p, val);
20142}
20143
20144static int
20145parser_get_bool(struct parser_params *p, const char *name, const char *val)
20146{
20147 switch (*val) {
20148 case 't': case 'T':
20149 if (STRCASECMP(val, "true") == 0) {
20150 return TRUE;
20151 }
20152 break;
20153 case 'f': case 'F':
20154 if (STRCASECMP(val, "false") == 0) {
20155 return FALSE;
20156 }
20157 break;
20158 }
20159 return parser_invalid_pragma_value(p, name, val);
20160}
20161
20162static int
20163parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
20164{
20165 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
20166 return -1;
20167}
20168
20169static void
20170parser_set_token_info(struct parser_params *p, const char *name, const char *val)
20171{
20172 int b = parser_get_bool(p, name, val);
20173 if (b >= 0) p->token_info_enabled = b;
20174}
20175
20176static void
20177parser_set_frozen_string_literal(struct parser_params *p, const char *name, const char *val)
20178{
20179 int b;
20180
20181 if (p->token_seen) {
20182 rb_warning1("'%s' is ignored after any tokens", WARN_S(name));
20183 return;
20184 }
20185
20186 b = parser_get_bool(p, name, val);
20187 if (b < 0) return;
20188
20189 p->frozen_string_literal = b;
20190}
20191
20192static void
20193parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
20194{
20195 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
20196 if (*s == ' ' || *s == '\t') continue;
20197 if (*s == '#') break;
20198 rb_warning1("'%s' is ignored unless in comment-only line", WARN_S(name));
20199 return;
20200 }
20201
20202 switch (*val) {
20203 case 'n': case 'N':
20204 if (STRCASECMP(val, "none") == 0) {
20205 p->ctxt.shareable_constant_value = rb_parser_shareable_none;
20206 return;
20207 }
20208 break;
20209 case 'l': case 'L':
20210 if (STRCASECMP(val, "literal") == 0) {
20211 p->ctxt.shareable_constant_value = rb_parser_shareable_literal;
20212 return;
20213 }
20214 break;
20215 case 'e': case 'E':
20216 if (STRCASECMP(val, "experimental_copy") == 0) {
20217 p->ctxt.shareable_constant_value = rb_parser_shareable_copy;
20218 return;
20219 }
20220 if (STRCASECMP(val, "experimental_everything") == 0) {
20221 p->ctxt.shareable_constant_value = rb_parser_shareable_everything;
20222 return;
20223 }
20224 break;
20225 }
20226 parser_invalid_pragma_value(p, name, val);
20227}
20228
20229# if WARN_PAST_SCOPE
20230static void
20231parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
20232{
20233 int b = parser_get_bool(p, name, val);
20234 if (b >= 0) p->past_scope_enabled = b;
20235}
20236# endif
20237
20239 const char *name;
20240 rb_magic_comment_setter_t func;
20241 rb_magic_comment_length_t length;
20242};
20243
20244static const struct magic_comment magic_comments[] = {
20245 {"coding", magic_comment_encoding, parser_encode_length},
20246 {"encoding", magic_comment_encoding, parser_encode_length},
20247 {"frozen_string_literal", parser_set_frozen_string_literal},
20248 {"shareable_constant_value", parser_set_shareable_constant_value},
20249 {"warn_indent", parser_set_token_info},
20250# if WARN_PAST_SCOPE
20251 {"warn_past_scope", parser_set_past_scope},
20252# endif
20253};
20254
20255static const char *
20256magic_comment_marker(const char *str, long len)
20257{
20258 long i = 2;
20259
20260 while (i < len) {
20261 switch (str[i]) {
20262 case '-':
20263 if (str[i-1] == '*' && str[i-2] == '-') {
20264 return str + i + 1;
20265 }
20266 i += 2;
20267 break;
20268 case '*':
20269 if (i + 1 >= len) return 0;
20270 if (str[i+1] != '-') {
20271 i += 4;
20272 }
20273 else if (str[i-1] != '-') {
20274 i += 2;
20275 }
20276 else {
20277 return str + i + 2;
20278 }
20279 break;
20280 default:
20281 i += 3;
20282 break;
20283 }
20284 }
20285 return 0;
20286}
20287
20288static int
20289parser_magic_comment(struct parser_params *p, const char *str, long len)
20290{
20291 int indicator = 0;
20292 VALUE name = 0, val = 0;
20293 const char *beg, *end, *vbeg, *vend;
20294#define str_copy(_s, _p, _n) ((_s) \
20295 ? (void)(rb_str_resize((_s), (_n)), \
20296 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
20297 : (void)((_s) = STR_NEW((_p), (_n))))
20298
20299 if (len <= 7) return FALSE;
20300 if (!!(beg = magic_comment_marker(str, len))) {
20301 if (!(end = magic_comment_marker(beg, str + len - beg)))
20302 return FALSE;
20303 indicator = TRUE;
20304 str = beg;
20305 len = end - beg - 3;
20306 }
20307
20308 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
20309 while (len > 0) {
20310 const struct magic_comment *mc = magic_comments;
20311 char *s;
20312 int i;
20313 long n = 0;
20314
20315 for (; len > 0 && *str; str++, --len) {
20316 switch (*str) {
20317 case '\'': case '"': case ':': case ';':
20318 continue;
20319 }
20320 if (!ISSPACE(*str)) break;
20321 }
20322 for (beg = str; len > 0; str++, --len) {
20323 switch (*str) {
20324 case '\'': case '"': case ':': case ';':
20325 break;
20326 default:
20327 if (ISSPACE(*str)) break;
20328 continue;
20329 }
20330 break;
20331 }
20332 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
20333 if (!len) break;
20334 if (*str != ':') {
20335 if (!indicator) return FALSE;
20336 continue;
20337 }
20338
20339 do str++; while (--len > 0 && ISSPACE(*str));
20340 if (!len) break;
20341 const char *tok_beg = str;
20342 if (*str == '"') {
20343 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
20344 if (*str == '\\') {
20345 --len;
20346 ++str;
20347 }
20348 }
20349 vend = str;
20350 if (len) {
20351 --len;
20352 ++str;
20353 }
20354 }
20355 else {
20356 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
20357 vend = str;
20358 }
20359 const char *tok_end = str;
20360 if (indicator) {
20361 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
20362 }
20363 else {
20364 while (len > 0 && (ISSPACE(*str))) --len, str++;
20365 if (len) return FALSE;
20366 }
20367
20368 n = end - beg;
20369 str_copy(name, beg, n);
20370 s = RSTRING_PTR(name);
20371 for (i = 0; i < n; ++i) {
20372 if (s[i] == '-') s[i] = '_';
20373 }
20374 do {
20375 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
20376 n = vend - vbeg;
20377 if (mc->length) {
20378 n = (*mc->length)(p, vbeg, n);
20379 }
20380 str_copy(val, vbeg, n);
20381 p->lex.ptok = tok_beg;
20382 p->lex.pcur = tok_end;
20383 (*mc->func)(p, mc->name, RSTRING_PTR(val));
20384 break;
20385 }
20386 } while (++mc < magic_comments + numberof(magic_comments));
20387#ifdef RIPPER
20388 str_copy(val, vbeg, vend - vbeg);
20389 dispatch2(magic_comment, name, val);
20390#endif
20391 }
20392
20393 return TRUE;
20394}
20395
20396static void
20397set_file_encoding(struct parser_params *p, const char *str, const char *send)
20398{
20399 int sep = 0;
20400 const char *beg = str;
20401 VALUE s;
20402
20403 for (;;) {
20404 if (send - str <= 6) return;
20405 switch (str[6]) {
20406 case 'C': case 'c': str += 6; continue;
20407 case 'O': case 'o': str += 5; continue;
20408 case 'D': case 'd': str += 4; continue;
20409 case 'I': case 'i': str += 3; continue;
20410 case 'N': case 'n': str += 2; continue;
20411 case 'G': case 'g': str += 1; continue;
20412 case '=': case ':':
20413 sep = 1;
20414 str += 6;
20415 break;
20416 default:
20417 str += 6;
20418 if (ISSPACE(*str)) break;
20419 continue;
20420 }
20421 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
20422 sep = 0;
20423 }
20424 for (;;) {
20425 do {
20426 if (++str >= send) return;
20427 } while (ISSPACE(*str));
20428 if (sep) break;
20429 if (*str != '=' && *str != ':') return;
20430 sep = 1;
20431 str++;
20432 }
20433 beg = str;
20434 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
20435 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
20436 p->lex.ptok = beg;
20437 p->lex.pcur = str;
20438 parser_set_encode(p, RSTRING_PTR(s));
20439 rb_str_resize(s, 0);
20440}
20441
20442static void
20443parser_prepare(struct parser_params *p)
20444{
20445 int c = nextc0(p, FALSE);
20446 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
20447 switch (c) {
20448 case '#':
20449 if (peek(p, '!')) p->has_shebang = 1;
20450 break;
20451 case 0xef: /* UTF-8 BOM marker */
20452 if (!lex_eol_n_p(p, 2) &&
20453 (unsigned char)p->lex.pcur[0] == 0xbb &&
20454 (unsigned char)p->lex.pcur[1] == 0xbf) {
20455 p->enc = rb_utf8_encoding();
20456 p->lex.pcur += 2;
20457#ifndef RIPPER
20458 if (p->debug_lines) {
20459 rb_parser_string_set_encoding(p->lex.lastline, p->enc);
20460 }
20461#endif
20462 p->lex.pbeg = p->lex.pcur;
20463 token_flush(p);
20464 return;
20465 }
20466 break;
20467 case -1: /* end of script. */
20468 return;
20469 }
20470 pushback(p, c);
20471 p->enc = rb_parser_str_get_encoding(p->lex.lastline);
20472}
20473
20474#ifndef RIPPER
20475#define ambiguous_operator(tok, op, syn) ( \
20476 rb_warning0("'"op"' after local variable or literal is interpreted as binary operator"), \
20477 rb_warning0("even though it seems like "syn""))
20478#else
20479#define ambiguous_operator(tok, op, syn) \
20480 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
20481#endif
20482#define warn_balanced(tok, op, syn) ((void) \
20483 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
20484 space_seen && !ISSPACE(c) && \
20485 (ambiguous_operator(tok, op, syn), 0)), \
20486 (enum yytokentype)(tok))
20487
20488static enum yytokentype
20489no_digits(struct parser_params *p)
20490{
20491 yyerror0("numeric literal without digits");
20492 if (peek(p, '_')) nextc(p);
20493 /* dummy 0, for tUMINUS_NUM at numeric */
20494 return set_number_literal(p, tINTEGER, 0, 10, 0);
20495}
20496
20497static enum yytokentype
20498parse_numeric(struct parser_params *p, int c)
20499{
20500 int is_float, seen_point, seen_e, nondigit;
20501 int suffix;
20502
20503 is_float = seen_point = seen_e = nondigit = 0;
20504 SET_LEX_STATE(EXPR_END);
20505 newtok(p);
20506 if (c == '-' || c == '+') {
20507 tokadd(p, c);
20508 c = nextc(p);
20509 }
20510 if (c == '0') {
20511 int start = toklen(p);
20512 c = nextc(p);
20513 if (c == 'x' || c == 'X') {
20514 /* hexadecimal */
20515 c = nextc(p);
20516 if (c != -1 && ISXDIGIT(c)) {
20517 do {
20518 if (c == '_') {
20519 if (nondigit) break;
20520 nondigit = c;
20521 continue;
20522 }
20523 if (!ISXDIGIT(c)) break;
20524 nondigit = 0;
20525 tokadd(p, c);
20526 } while ((c = nextc(p)) != -1);
20527 }
20528 pushback(p, c);
20529 tokfix(p);
20530 if (toklen(p) == start) {
20531 return no_digits(p);
20532 }
20533 else if (nondigit) goto trailing_uc;
20534 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20535 return set_number_literal(p, tINTEGER, suffix, 16, 0);
20536 }
20537 if (c == 'b' || c == 'B') {
20538 /* binary */
20539 c = nextc(p);
20540 if (c == '0' || c == '1') {
20541 do {
20542 if (c == '_') {
20543 if (nondigit) break;
20544 nondigit = c;
20545 continue;
20546 }
20547 if (c != '0' && c != '1') break;
20548 nondigit = 0;
20549 tokadd(p, c);
20550 } while ((c = nextc(p)) != -1);
20551 }
20552 pushback(p, c);
20553 tokfix(p);
20554 if (toklen(p) == start) {
20555 return no_digits(p);
20556 }
20557 else if (nondigit) goto trailing_uc;
20558 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20559 return set_number_literal(p, tINTEGER, suffix, 2, 0);
20560 }
20561 if (c == 'd' || c == 'D') {
20562 /* decimal */
20563 c = nextc(p);
20564 if (c != -1 && ISDIGIT(c)) {
20565 do {
20566 if (c == '_') {
20567 if (nondigit) break;
20568 nondigit = c;
20569 continue;
20570 }
20571 if (!ISDIGIT(c)) break;
20572 nondigit = 0;
20573 tokadd(p, c);
20574 } while ((c = nextc(p)) != -1);
20575 }
20576 pushback(p, c);
20577 tokfix(p);
20578 if (toklen(p) == start) {
20579 return no_digits(p);
20580 }
20581 else if (nondigit) goto trailing_uc;
20582 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20583 return set_number_literal(p, tINTEGER, suffix, 10, 0);
20584 }
20585 if (c == '_') {
20586 /* 0_0 */
20587 goto octal_number;
20588 }
20589 if (c == 'o' || c == 'O') {
20590 /* prefixed octal */
20591 c = nextc(p);
20592 if (c == -1 || c == '_' || !ISDIGIT(c)) {
20593 tokfix(p);
20594 return no_digits(p);
20595 }
20596 }
20597 if (c >= '0' && c <= '7') {
20598 /* octal */
20599 octal_number:
20600 do {
20601 if (c == '_') {
20602 if (nondigit) break;
20603 nondigit = c;
20604 continue;
20605 }
20606 if (c < '0' || c > '9') break;
20607 if (c > '7') goto invalid_octal;
20608 nondigit = 0;
20609 tokadd(p, c);
20610 } while ((c = nextc(p)) != -1);
20611 if (toklen(p) > start) {
20612 pushback(p, c);
20613 tokfix(p);
20614 if (nondigit) goto trailing_uc;
20615 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20616 return set_number_literal(p, tINTEGER, suffix, 8, 0);
20617 }
20618 if (nondigit) {
20619 pushback(p, c);
20620 goto trailing_uc;
20621 }
20622 }
20623 if (c > '7' && c <= '9') {
20624 invalid_octal:
20625 yyerror0("Invalid octal digit");
20626 }
20627 else if (c == '.' || c == 'e' || c == 'E') {
20628 tokadd(p, '0');
20629 }
20630 else {
20631 pushback(p, c);
20632 tokfix(p);
20633 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20634 return set_number_literal(p, tINTEGER, suffix, 10, 0);
20635 }
20636 }
20637
20638 for (;;) {
20639 switch (c) {
20640 case '0': case '1': case '2': case '3': case '4':
20641 case '5': case '6': case '7': case '8': case '9':
20642 nondigit = 0;
20643 tokadd(p, c);
20644 break;
20645
20646 case '.':
20647 if (nondigit) goto trailing_uc;
20648 if (seen_point || seen_e) {
20649 goto decode_num;
20650 }
20651 else {
20652 int c0 = nextc(p);
20653 if (c0 == -1 || !ISDIGIT(c0)) {
20654 pushback(p, c0);
20655 goto decode_num;
20656 }
20657 c = c0;
20658 }
20659 seen_point = toklen(p);
20660 tokadd(p, '.');
20661 tokadd(p, c);
20662 is_float++;
20663 nondigit = 0;
20664 break;
20665
20666 case 'e':
20667 case 'E':
20668 if (nondigit) {
20669 pushback(p, c);
20670 c = nondigit;
20671 goto decode_num;
20672 }
20673 if (seen_e) {
20674 goto decode_num;
20675 }
20676 nondigit = c;
20677 c = nextc(p);
20678 if (c != '-' && c != '+' && !ISDIGIT(c)) {
20679 pushback(p, c);
20680 c = nondigit;
20681 nondigit = 0;
20682 goto decode_num;
20683 }
20684 tokadd(p, nondigit);
20685 seen_e++;
20686 is_float++;
20687 tokadd(p, c);
20688 nondigit = (c == '-' || c == '+') ? c : 0;
20689 break;
20690
20691 case '_': /* `_' in number just ignored */
20692 if (nondigit) goto decode_num;
20693 nondigit = c;
20694 break;
20695
20696 default:
20697 goto decode_num;
20698 }
20699 c = nextc(p);
20700 }
20701
20702 decode_num:
20703 pushback(p, c);
20704 if (nondigit) {
20705 trailing_uc:
20706 literal_flush(p, p->lex.pcur - 1);
20707 YYLTYPE loc = RUBY_INIT_YYLLOC();
20708 compile_error(p, "trailing '%c' in number", nondigit);
20709 parser_show_error_line(p, &loc);
20710 }
20711 tokfix(p);
20712 if (is_float) {
20713 enum yytokentype type = tFLOAT;
20714
20715 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
20716 if (suffix & NUM_SUFFIX_R) {
20717 type = tRATIONAL;
20718 }
20719 else {
20720 strtod(tok(p), 0);
20721 if (errno == ERANGE) {
20722 rb_warning1("Float %s out of range", WARN_S(tok(p)));
20723 errno = 0;
20724 }
20725 }
20726 return set_number_literal(p, type, suffix, 0, seen_point);
20727 }
20728 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
20729 return set_number_literal(p, tINTEGER, suffix, 10, 0);
20730}
20731
20732static enum yytokentype
20733parse_qmark(struct parser_params *p, int space_seen)
20734{
20735 rb_encoding *enc;
20736 register int c;
20737 rb_parser_string_t *lit;
20738
20739 if (IS_END()) {
20740 SET_LEX_STATE(EXPR_VALUE);
20741 return '?';
20742 }
20743 c = nextc(p);
20744 if (c == -1) {
20745 compile_error(p, "incomplete character syntax");
20746 return 0;
20747 }
20748 if (rb_enc_isspace(c, p->enc)) {
20749 if (!IS_ARG()) {
20750 int c2 = escaped_control_code(c);
20751 if (c2) {
20752 WARN_SPACE_CHAR(c2, "?");
20753 }
20754 }
20755 ternary:
20756 pushback(p, c);
20757 SET_LEX_STATE(EXPR_VALUE);
20758 return '?';
20759 }
20760 newtok(p);
20761 enc = p->enc;
20762 if (!parser_isascii(p)) {
20763 if (tokadd_mbchar(p, c) == -1) return 0;
20764 }
20765 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
20766 !lex_eol_p(p) && is_identchar(p, p->lex.pcur, p->lex.pend, p->enc)) {
20767 if (space_seen) {
20768 const char *start = p->lex.pcur - 1, *ptr = start;
20769 do {
20770 int n = parser_precise_mbclen(p, ptr);
20771 if (n < 0) return -1;
20772 ptr += n;
20773 } while (!lex_eol_ptr_p(p, ptr) && is_identchar(p, ptr, p->lex.pend, p->enc));
20774 rb_warn2("'?' just followed by '%.*s' is interpreted as" \
20775 " a conditional operator, put a space after '?'",
20776 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
20777 }
20778 goto ternary;
20779 }
20780 else if (c == '\\') {
20781 if (peek(p, 'u')) {
20782 nextc(p);
20783 enc = rb_utf8_encoding();
20784 tokadd_utf8(p, &enc, -1, 0, 0);
20785 }
20786 else if (!ISASCII(c = peekc(p)) && c != -1) {
20787 nextc(p);
20788 if (tokadd_mbchar(p, c) == -1) return 0;
20789 }
20790 else {
20791 c = read_escape(p, 0, p->lex.pcur - rb_strlen_lit("?\\"));
20792 tokadd(p, c);
20793 }
20794 }
20795 else {
20796 tokadd(p, c);
20797 }
20798 tokfix(p);
20799 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
20800 set_yylval_str(lit);
20801 SET_LEX_STATE(EXPR_END);
20802 return tCHAR;
20803}
20804
20805static enum yytokentype
20806parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
20807{
20808 register int c;
20809 const char *ptok = p->lex.pcur;
20810
20811 if (IS_BEG()) {
20812 int term;
20813 int paren;
20814
20815 c = nextc(p);
20816 quotation:
20817 if (c == -1) goto unterminated;
20818 if (!ISALNUM(c)) {
20819 term = c;
20820 if (!ISASCII(c)) goto unknown;
20821 c = 'Q';
20822 }
20823 else {
20824 term = nextc(p);
20825 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
20826 unknown:
20827 pushback(p, term);
20828 c = parser_precise_mbclen(p, p->lex.pcur);
20829 if (c < 0) return 0;
20830 p->lex.pcur += c;
20831 yyerror0("unknown type of %string");
20832 return 0;
20833 }
20834 }
20835 if (term == -1) {
20836 unterminated:
20837 compile_error(p, "unterminated quoted string meets end of file");
20838 return 0;
20839 }
20840 paren = term;
20841 if (term == '(') term = ')';
20842 else if (term == '[') term = ']';
20843 else if (term == '{') term = '}';
20844 else if (term == '<') term = '>';
20845 else paren = 0;
20846
20847 p->lex.ptok = ptok-1;
20848 switch (c) {
20849 case 'Q':
20850 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
20851 return tSTRING_BEG;
20852
20853 case 'q':
20854 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
20855 return tSTRING_BEG;
20856
20857 case 'W':
20858 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20859 return tWORDS_BEG;
20860
20861 case 'w':
20862 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20863 return tQWORDS_BEG;
20864
20865 case 'I':
20866 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20867 return tSYMBOLS_BEG;
20868
20869 case 'i':
20870 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20871 return tQSYMBOLS_BEG;
20872
20873 case 'x':
20874 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
20875 return tXSTRING_BEG;
20876
20877 case 'r':
20878 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
20879 return tREGEXP_BEG;
20880
20881 case 's':
20882 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
20883 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
20884 return tSYMBEG;
20885
20886 default:
20887 yyerror0("unknown type of %string");
20888 return 0;
20889 }
20890 }
20891 if ((c = nextc(p)) == '=') {
20892 set_yylval_id('%');
20893 SET_LEX_STATE(EXPR_BEG);
20894 return tOP_ASGN;
20895 }
20896 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
20897 goto quotation;
20898 }
20899 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20900 pushback(p, c);
20901 return warn_balanced('%', "%%", "string literal");
20902}
20903
20904static int
20905tokadd_ident(struct parser_params *p, int c)
20906{
20907 do {
20908 if (tokadd_mbchar(p, c) == -1) return -1;
20909 c = nextc(p);
20910 } while (parser_is_identchar(p));
20911 pushback(p, c);
20912 return 0;
20913}
20914
20915static ID
20916tokenize_ident(struct parser_params *p)
20917{
20918 ID ident = TOK_INTERN();
20919
20920 set_yylval_name(ident);
20921
20922 return ident;
20923}
20924
20925static int
20926parse_numvar(struct parser_params *p)
20927{
20928 size_t len;
20929 int overflow;
20930 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
20931 const unsigned long nth_ref_max =
20933 /* NTH_REF is left-shifted to be ORed with back-ref flag and
20934 * turned into a Fixnum, in compile.c */
20935
20936 if (overflow || n > nth_ref_max) {
20937 /* compile_error()? */
20938 rb_warn1("'%s' is too big for a number variable, always nil", WARN_S(tok(p)));
20939 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
20940 }
20941 else {
20942 return (int)n;
20943 }
20944}
20945
20946static enum yytokentype
20947parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
20948{
20949 const char *ptr = p->lex.pcur;
20950 register int c;
20951
20952 SET_LEX_STATE(EXPR_END);
20953 p->lex.ptok = ptr - 1; /* from '$' */
20954 newtok(p);
20955 c = nextc(p);
20956 switch (c) {
20957 case '_': /* $_: last read line string */
20958 c = nextc(p);
20959 if (parser_is_identchar(p)) {
20960 tokadd(p, '$');
20961 tokadd(p, '_');
20962 break;
20963 }
20964 pushback(p, c);
20965 c = '_';
20966 /* fall through */
20967 case '~': /* $~: match-data */
20968 case '*': /* $*: argv */
20969 case '$': /* $$: pid */
20970 case '?': /* $?: last status */
20971 case '!': /* $!: error string */
20972 case '@': /* $@: error position */
20973 case '/': /* $/: input record separator */
20974 case '\\': /* $\: output record separator */
20975 case ';': /* $;: field separator */
20976 case ',': /* $,: output field separator */
20977 case '.': /* $.: last read line number */
20978 case '=': /* $=: ignorecase */
20979 case ':': /* $:: load path */
20980 case '<': /* $<: default input handle */
20981 case '>': /* $>: default output handle */
20982 case '\"': /* $": already loaded files */
20983 tokadd(p, '$');
20984 tokadd(p, c);
20985 goto gvar;
20986
20987 case '-':
20988 tokadd(p, '$');
20989 tokadd(p, c);
20990 c = nextc(p);
20991 if (parser_is_identchar(p)) {
20992 if (tokadd_mbchar(p, c) == -1) return 0;
20993 }
20994 else {
20995 pushback(p, c);
20996 pushback(p, '-');
20997 return '$';
20998 }
20999 gvar:
21000 tokenize_ident(p);
21001 return tGVAR;
21002
21003 case '&': /* $&: last match */
21004 case '`': /* $`: string before last match */
21005 case '\'': /* $': string after last match */
21006 case '+': /* $+: string matches last paren. */
21007 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
21008 tokadd(p, '$');
21009 tokadd(p, c);
21010 goto gvar;
21011 }
21012 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
21013 return tBACK_REF;
21014
21015 case '1': case '2': case '3':
21016 case '4': case '5': case '6':
21017 case '7': case '8': case '9':
21018 tokadd(p, '$');
21019 do {
21020 tokadd(p, c);
21021 c = nextc(p);
21022 } while (c != -1 && ISDIGIT(c));
21023 pushback(p, c);
21024 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
21025 tokfix(p);
21026 c = parse_numvar(p);
21027 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
21028 return tNTH_REF;
21029
21030 default:
21031 if (!parser_is_identchar(p)) {
21032 YYLTYPE loc = RUBY_INIT_YYLLOC();
21033 if (c == -1 || ISSPACE(c)) {
21034 compile_error(p, "'$' without identifiers is not allowed as a global variable name");
21035 }
21036 else {
21037 pushback(p, c);
21038 compile_error(p, "'$%c' is not allowed as a global variable name", c);
21039 }
21040 parser_show_error_line(p, &loc);
21041 set_yylval_noname();
21042 return tGVAR;
21043 }
21044 /* fall through */
21045 case '0':
21046 tokadd(p, '$');
21047 }
21048
21049 if (tokadd_ident(p, c)) return 0;
21050 SET_LEX_STATE(EXPR_END);
21051 if (VALID_SYMNAME_P(tok(p), toklen(p), p->enc, ID_GLOBAL)) {
21052 tokenize_ident(p);
21053 }
21054 else {
21055 compile_error(p, "'%.*s' is not allowed as a global variable name", toklen(p), tok(p));
21056 set_yylval_noname();
21057 }
21058 return tGVAR;
21059}
21060
21061static bool
21062parser_numbered_param(struct parser_params *p, int n)
21063{
21064 if (n < 0) return false;
21065
21066 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
21067 return false;
21068 }
21069 if (p->max_numparam == ORDINAL_PARAM) {
21070 compile_error(p, "ordinary parameter is defined");
21071 return false;
21072 }
21073 struct vtable *args = p->lvtbl->args;
21074 if (p->max_numparam < n) {
21075 p->max_numparam = n;
21076 }
21077 while (n > args->pos) {
21078 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
21079 }
21080 return true;
21081}
21082
21083static enum yytokentype
21084parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
21085{
21086 const char *ptr = p->lex.pcur;
21087 enum yytokentype result = tIVAR;
21088 register int c = nextc(p);
21089 YYLTYPE loc;
21090
21091 p->lex.ptok = ptr - 1; /* from '@' */
21092 newtok(p);
21093 tokadd(p, '@');
21094 if (c == '@') {
21095 result = tCVAR;
21096 tokadd(p, '@');
21097 c = nextc(p);
21098 }
21099 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
21100 if (c == -1 || !parser_is_identchar(p)) {
21101 pushback(p, c);
21102 RUBY_SET_YYLLOC(loc);
21103 if (result == tIVAR) {
21104 compile_error(p, "'@' without identifiers is not allowed as an instance variable name");
21105 }
21106 else {
21107 compile_error(p, "'@@' without identifiers is not allowed as a class variable name");
21108 }
21109 parser_show_error_line(p, &loc);
21110 set_yylval_noname();
21111 SET_LEX_STATE(EXPR_END);
21112 return result;
21113 }
21114 else if (ISDIGIT(c)) {
21115 pushback(p, c);
21116 RUBY_SET_YYLLOC(loc);
21117 if (result == tIVAR) {
21118 compile_error(p, "'@%c' is not allowed as an instance variable name", c);
21119 }
21120 else {
21121 compile_error(p, "'@@%c' is not allowed as a class variable name", c);
21122 }
21123 parser_show_error_line(p, &loc);
21124 set_yylval_noname();
21125 SET_LEX_STATE(EXPR_END);
21126 return result;
21127 }
21128
21129 if (tokadd_ident(p, c)) return 0;
21130 tokenize_ident(p);
21131 return result;
21132}
21133
21134static enum yytokentype
21135parse_ident(struct parser_params *p, int c, int cmd_state)
21136{
21137 enum yytokentype result;
21138 bool is_ascii = true;
21139 const enum lex_state_e last_state = p->lex.state;
21140 ID ident;
21141 int enforce_keyword_end = 0;
21142
21143 do {
21144 if (!ISASCII(c)) is_ascii = false;
21145 if (tokadd_mbchar(p, c) == -1) return 0;
21146 c = nextc(p);
21147 } while (parser_is_identchar(p));
21148 if ((c == '!' || c == '?') && !peek(p, '=')) {
21149 result = tFID;
21150 tokadd(p, c);
21151 }
21152 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
21153 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
21154 result = tIDENTIFIER;
21155 tokadd(p, c);
21156 }
21157 else {
21158 result = tCONSTANT; /* assume provisionally */
21159 pushback(p, c);
21160 }
21161 tokfix(p);
21162
21163 if (IS_LABEL_POSSIBLE()) {
21164 if (IS_LABEL_SUFFIX(0)) {
21165 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
21166 nextc(p);
21167 tokenize_ident(p);
21168 return tLABEL;
21169 }
21170 }
21171
21172#ifndef RIPPER
21173 if (peek_end_expect_token_locations(p)) {
21174 const rb_code_position_t *end_pos;
21175 int lineno, column;
21176 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21177
21178 end_pos = peek_end_expect_token_locations(p)->pos;
21179 lineno = end_pos->lineno;
21180 column = end_pos->column;
21181
21182 if (p->debug) {
21183 rb_parser_printf(p, "enforce_keyword_end check. current: (%d, %d), peek: (%d, %d)\n",
21184 p->ruby_sourceline, beg_pos, lineno, column);
21185 }
21186
21187 if ((p->ruby_sourceline > lineno) && (beg_pos <= column)) {
21188 const struct kwtable *kw;
21189
21190 if ((IS_lex_state(EXPR_DOT)) && (kw = rb_reserved_word(tok(p), toklen(p))) && (kw && kw->id[0] == keyword_end)) {
21191 if (p->debug) rb_parser_printf(p, "enforce_keyword_end is enabled\n");
21192 enforce_keyword_end = 1;
21193 }
21194 }
21195 }
21196#endif
21197
21198 if (is_ascii && (!IS_lex_state(EXPR_DOT) || enforce_keyword_end)) {
21199 const struct kwtable *kw;
21200
21201 /* See if it is a reserved word. */
21202 kw = rb_reserved_word(tok(p), toklen(p));
21203 if (kw) {
21204 enum lex_state_e state = p->lex.state;
21205 if (IS_lex_state_for(state, EXPR_FNAME)) {
21206 SET_LEX_STATE(EXPR_ENDFN);
21207 set_yylval_name(rb_intern2(tok(p), toklen(p)));
21208 return kw->id[0];
21209 }
21210 SET_LEX_STATE(kw->state);
21211 if (IS_lex_state(EXPR_BEG)) {
21212 p->command_start = TRUE;
21213 }
21214 if (kw->id[0] == keyword_do) {
21215 if (lambda_beginning_p()) {
21216 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
21217 return keyword_do_LAMBDA;
21218 }
21219 if (COND_P()) return keyword_do_cond;
21220 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
21221 return keyword_do_block;
21222 return keyword_do;
21223 }
21224 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED | EXPR_CLASS)))
21225 return kw->id[0];
21226 else {
21227 if (kw->id[0] != kw->id[1])
21228 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
21229 return kw->id[1];
21230 }
21231 }
21232 }
21233
21234 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
21235 if (cmd_state) {
21236 SET_LEX_STATE(EXPR_CMDARG);
21237 }
21238 else {
21239 SET_LEX_STATE(EXPR_ARG);
21240 }
21241 }
21242 else if (p->lex.state == EXPR_FNAME) {
21243 SET_LEX_STATE(EXPR_ENDFN);
21244 }
21245 else {
21246 SET_LEX_STATE(EXPR_END);
21247 }
21248
21249 ident = tokenize_ident(p);
21250 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
21251 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
21252 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
21253 (lvar_defined(p, ident) || NUMPARAM_ID_P(ident))) {
21254 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
21255 }
21256 return result;
21257}
21258
21259static void
21260warn_cr(struct parser_params *p)
21261{
21262 if (!p->cr_seen) {
21263 p->cr_seen = TRUE;
21264 /* carried over with p->lex.nextline for nextc() */
21265 rb_warn0("encountered \\r in middle of line, treated as a mere space");
21266 }
21267}
21268
21269static enum yytokentype
21270parser_yylex(struct parser_params *p)
21271{
21272 register int c;
21273 int space_seen = 0;
21274 int cmd_state;
21275 int label;
21276 enum lex_state_e last_state;
21277 int fallthru = FALSE;
21278 int token_seen = p->token_seen;
21279
21280 if (p->lex.strterm) {
21281 if (strterm_is_heredoc(p->lex.strterm)) {
21282 token_flush(p);
21283 return here_document(p, &p->lex.strterm->u.heredoc);
21284 }
21285 else {
21286 token_flush(p);
21287 return parse_string(p, &p->lex.strterm->u.literal);
21288 }
21289 }
21290 cmd_state = p->command_start;
21291 p->command_start = FALSE;
21292 p->token_seen = TRUE;
21293#ifndef RIPPER
21294 token_flush(p);
21295#endif
21296 retry:
21297 last_state = p->lex.state;
21298 switch (c = nextc(p)) {
21299 case '\0': /* NUL */
21300 case '\004': /* ^D */
21301 case '\032': /* ^Z */
21302 case -1: /* end of script. */
21303 p->eofp = 1;
21304#ifndef RIPPER
21305 if (p->end_expect_token_locations) {
21306 pop_end_expect_token_locations(p);
21307 RUBY_SET_YYLLOC_OF_DUMMY_END(*p->yylloc);
21308 return tDUMNY_END;
21309 }
21310#endif
21311 /* Set location for end-of-input because dispatch_scan_event is not called. */
21312 RUBY_SET_YYLLOC(*p->yylloc);
21313 return END_OF_INPUT;
21314
21315 /* white spaces */
21316 case '\r':
21317 warn_cr(p);
21318 /* fall through */
21319 case ' ': case '\t': case '\f':
21320 case '\13': /* '\v' */
21321 space_seen = 1;
21322 while ((c = nextc(p))) {
21323 switch (c) {
21324 case '\r':
21325 warn_cr(p);
21326 /* fall through */
21327 case ' ': case '\t': case '\f':
21328 case '\13': /* '\v' */
21329 break;
21330 default:
21331 goto outofloop;
21332 }
21333 }
21334 outofloop:
21335 pushback(p, c);
21336 dispatch_scan_event(p, tSP);
21337#ifndef RIPPER
21338 token_flush(p);
21339#endif
21340 goto retry;
21341
21342 case '#': /* it's a comment */
21343 p->token_seen = token_seen;
21344 const char *const pcur = p->lex.pcur, *const ptok = p->lex.ptok;
21345 /* no magic_comment in shebang line */
21346 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
21347 if (comment_at_top(p)) {
21348 set_file_encoding(p, p->lex.pcur, p->lex.pend);
21349 }
21350 }
21351 p->lex.pcur = pcur, p->lex.ptok = ptok;
21352 lex_goto_eol(p);
21353 dispatch_scan_event(p, tCOMMENT);
21354 fallthru = TRUE;
21355 /* fall through */
21356 case '\n':
21357 p->token_seen = token_seen;
21358 rb_parser_string_t *prevline = p->lex.lastline;
21359 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
21360 !IS_lex_state(EXPR_LABELED));
21361 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
21362 if (!fallthru) {
21363 dispatch_scan_event(p, tIGNORED_NL);
21364 }
21365 fallthru = FALSE;
21366 if (!c && p->ctxt.in_kwarg) {
21367 goto normal_newline;
21368 }
21369 goto retry;
21370 }
21371 while (1) {
21372 switch (c = nextc(p)) {
21373 case ' ': case '\t': case '\f': case '\r':
21374 case '\13': /* '\v' */
21375 space_seen = 1;
21376 break;
21377 case '#':
21378 pushback(p, c);
21379 if (space_seen) {
21380 dispatch_scan_event(p, tSP);
21381 token_flush(p);
21382 }
21383 goto retry;
21384 case '&':
21385 case '.': {
21386 dispatch_delayed_token(p, tIGNORED_NL);
21387 if (peek(p, '.') == (c == '&')) {
21388 pushback(p, c);
21389 dispatch_scan_event(p, tSP);
21390 goto retry;
21391 }
21392 }
21393 default:
21394 p->ruby_sourceline--;
21395 p->lex.nextline = p->lex.lastline;
21396 set_lastline(p, prevline);
21397 case -1: /* EOF no decrement*/
21398 if (c == -1 && space_seen) {
21399 dispatch_scan_event(p, tSP);
21400 }
21401 lex_goto_eol(p);
21402 if (c != -1) {
21403 token_flush(p);
21404 RUBY_SET_YYLLOC(*p->yylloc);
21405 }
21406 goto normal_newline;
21407 }
21408 }
21409 normal_newline:
21410 p->command_start = TRUE;
21411 SET_LEX_STATE(EXPR_BEG);
21412 return '\n';
21413
21414 case '*':
21415 if ((c = nextc(p)) == '*') {
21416 if ((c = nextc(p)) == '=') {
21417 set_yylval_id(idPow);
21418 SET_LEX_STATE(EXPR_BEG);
21419 return tOP_ASGN;
21420 }
21421 pushback(p, c);
21422 if (IS_SPCARG(c)) {
21423 rb_warning0("'**' interpreted as argument prefix");
21424 c = tDSTAR;
21425 }
21426 else if (IS_BEG()) {
21427 c = tDSTAR;
21428 }
21429 else {
21430 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
21431 }
21432 }
21433 else {
21434 if (c == '=') {
21435 set_yylval_id('*');
21436 SET_LEX_STATE(EXPR_BEG);
21437 return tOP_ASGN;
21438 }
21439 pushback(p, c);
21440 if (IS_SPCARG(c)) {
21441 rb_warning0("'*' interpreted as argument prefix");
21442 c = tSTAR;
21443 }
21444 else if (IS_BEG()) {
21445 c = tSTAR;
21446 }
21447 else {
21448 c = warn_balanced('*', "*", "argument prefix");
21449 }
21450 }
21451 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21452 return c;
21453
21454 case '!':
21455 c = nextc(p);
21456 if (IS_AFTER_OPERATOR()) {
21457 SET_LEX_STATE(EXPR_ARG);
21458 if (c == '@') {
21459 return '!';
21460 }
21461 }
21462 else {
21463 SET_LEX_STATE(EXPR_BEG);
21464 }
21465 if (c == '=') {
21466 return tNEQ;
21467 }
21468 if (c == '~') {
21469 return tNMATCH;
21470 }
21471 pushback(p, c);
21472 return '!';
21473
21474 case '=':
21475 if (was_bol(p)) {
21476 /* skip embedded rd document */
21477 if (word_match_p(p, "begin", 5)) {
21478 int first_p = TRUE;
21479
21480 lex_goto_eol(p);
21481 dispatch_scan_event(p, tEMBDOC_BEG);
21482 for (;;) {
21483 lex_goto_eol(p);
21484 if (!first_p) {
21485 dispatch_scan_event(p, tEMBDOC);
21486 }
21487 first_p = FALSE;
21488 c = nextc(p);
21489 if (c == -1) {
21490 compile_error(p, "embedded document meets end of file");
21491 return END_OF_INPUT;
21492 }
21493 if (c == '=' && word_match_p(p, "end", 3)) {
21494 break;
21495 }
21496 pushback(p, c);
21497 }
21498 lex_goto_eol(p);
21499 dispatch_scan_event(p, tEMBDOC_END);
21500 goto retry;
21501 }
21502 }
21503
21504 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21505 if ((c = nextc(p)) == '=') {
21506 if ((c = nextc(p)) == '=') {
21507 return tEQQ;
21508 }
21509 pushback(p, c);
21510 return tEQ;
21511 }
21512 if (c == '~') {
21513 return tMATCH;
21514 }
21515 else if (c == '>') {
21516 return tASSOC;
21517 }
21518 pushback(p, c);
21519 return '=';
21520
21521 case '<':
21522 c = nextc(p);
21523 if (c == '<' &&
21524 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
21525 !IS_END() &&
21526 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
21527 enum yytokentype token = heredoc_identifier(p);
21528 if (token) return token < 0 ? 0 : token;
21529 }
21530 if (IS_AFTER_OPERATOR()) {
21531 SET_LEX_STATE(EXPR_ARG);
21532 }
21533 else {
21534 if (IS_lex_state(EXPR_CLASS))
21535 p->command_start = TRUE;
21536 SET_LEX_STATE(EXPR_BEG);
21537 }
21538 if (c == '=') {
21539 if ((c = nextc(p)) == '>') {
21540 return tCMP;
21541 }
21542 pushback(p, c);
21543 return tLEQ;
21544 }
21545 if (c == '<') {
21546 if ((c = nextc(p)) == '=') {
21547 set_yylval_id(idLTLT);
21548 SET_LEX_STATE(EXPR_BEG);
21549 return tOP_ASGN;
21550 }
21551 pushback(p, c);
21552 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
21553 }
21554 pushback(p, c);
21555 return '<';
21556
21557 case '>':
21558 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21559 if ((c = nextc(p)) == '=') {
21560 return tGEQ;
21561 }
21562 if (c == '>') {
21563 if ((c = nextc(p)) == '=') {
21564 set_yylval_id(idGTGT);
21565 SET_LEX_STATE(EXPR_BEG);
21566 return tOP_ASGN;
21567 }
21568 pushback(p, c);
21569 return tRSHFT;
21570 }
21571 pushback(p, c);
21572 return '>';
21573
21574 case '"':
21575 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
21576 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
21577 p->lex.ptok = p->lex.pcur-1;
21578 return tSTRING_BEG;
21579
21580 case '`':
21581 if (IS_lex_state(EXPR_FNAME)) {
21582 SET_LEX_STATE(EXPR_ENDFN);
21583 return c;
21584 }
21585 if (IS_lex_state(EXPR_DOT)) {
21586 if (cmd_state)
21587 SET_LEX_STATE(EXPR_CMDARG);
21588 else
21589 SET_LEX_STATE(EXPR_ARG);
21590 return c;
21591 }
21592 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
21593 return tXSTRING_BEG;
21594
21595 case '\'':
21596 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
21597 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
21598 p->lex.ptok = p->lex.pcur-1;
21599 return tSTRING_BEG;
21600
21601 case '?':
21602 return parse_qmark(p, space_seen);
21603
21604 case '&':
21605 if ((c = nextc(p)) == '&') {
21606 SET_LEX_STATE(EXPR_BEG);
21607 if ((c = nextc(p)) == '=') {
21608 set_yylval_id(idANDOP);
21609 SET_LEX_STATE(EXPR_BEG);
21610 return tOP_ASGN;
21611 }
21612 pushback(p, c);
21613 return tANDOP;
21614 }
21615 else if (c == '=') {
21616 set_yylval_id('&');
21617 SET_LEX_STATE(EXPR_BEG);
21618 return tOP_ASGN;
21619 }
21620 else if (c == '.') {
21621 set_yylval_id(idANDDOT);
21622 SET_LEX_STATE(EXPR_DOT);
21623 return tANDDOT;
21624 }
21625 pushback(p, c);
21626 if (IS_SPCARG(c)) {
21627 if ((c != ':') ||
21628 (c = peekc_n(p, 1)) == -1 ||
21629 !(c == '\'' || c == '"' ||
21630 is_identchar(p, (p->lex.pcur+1), p->lex.pend, p->enc))) {
21631 rb_warning0("'&' interpreted as argument prefix");
21632 }
21633 c = tAMPER;
21634 }
21635 else if (IS_BEG()) {
21636 c = tAMPER;
21637 }
21638 else {
21639 c = warn_balanced('&', "&", "argument prefix");
21640 }
21641 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21642 return c;
21643
21644 case '|':
21645 if ((c = nextc(p)) == '|') {
21646 SET_LEX_STATE(EXPR_BEG);
21647 if ((c = nextc(p)) == '=') {
21648 set_yylval_id(idOROP);
21649 SET_LEX_STATE(EXPR_BEG);
21650 return tOP_ASGN;
21651 }
21652 pushback(p, c);
21653 if (IS_lex_state_for(last_state, EXPR_BEG)) {
21654 c = '|';
21655 pushback(p, '|');
21656 return c;
21657 }
21658 return tOROP;
21659 }
21660 if (c == '=') {
21661 set_yylval_id('|');
21662 SET_LEX_STATE(EXPR_BEG);
21663 return tOP_ASGN;
21664 }
21665 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
21666 pushback(p, c);
21667 return '|';
21668
21669 case '+':
21670 c = nextc(p);
21671 if (IS_AFTER_OPERATOR()) {
21672 SET_LEX_STATE(EXPR_ARG);
21673 if (c == '@') {
21674 return tUPLUS;
21675 }
21676 pushback(p, c);
21677 return '+';
21678 }
21679 if (c == '=') {
21680 set_yylval_id('+');
21681 SET_LEX_STATE(EXPR_BEG);
21682 return tOP_ASGN;
21683 }
21684 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
21685 SET_LEX_STATE(EXPR_BEG);
21686 pushback(p, c);
21687 if (c != -1 && ISDIGIT(c)) {
21688 return parse_numeric(p, '+');
21689 }
21690 return tUPLUS;
21691 }
21692 SET_LEX_STATE(EXPR_BEG);
21693 pushback(p, c);
21694 return warn_balanced('+', "+", "unary operator");
21695
21696 case '-':
21697 c = nextc(p);
21698 if (IS_AFTER_OPERATOR()) {
21699 SET_LEX_STATE(EXPR_ARG);
21700 if (c == '@') {
21701 return tUMINUS;
21702 }
21703 pushback(p, c);
21704 return '-';
21705 }
21706 if (c == '=') {
21707 set_yylval_id('-');
21708 SET_LEX_STATE(EXPR_BEG);
21709 return tOP_ASGN;
21710 }
21711 if (c == '>') {
21712 SET_LEX_STATE(EXPR_ENDFN);
21713 yylval.num = p->lex.lpar_beg;
21714 p->lex.lpar_beg = p->lex.paren_nest;
21715 return tLAMBDA;
21716 }
21717 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
21718 SET_LEX_STATE(EXPR_BEG);
21719 pushback(p, c);
21720 if (c != -1 && ISDIGIT(c)) {
21721 return tUMINUS_NUM;
21722 }
21723 return tUMINUS;
21724 }
21725 SET_LEX_STATE(EXPR_BEG);
21726 pushback(p, c);
21727 return warn_balanced('-', "-", "unary operator");
21728
21729 case '.': {
21730 int is_beg = IS_BEG();
21731 SET_LEX_STATE(EXPR_BEG);
21732 if ((c = nextc(p)) == '.') {
21733 if ((c = nextc(p)) == '.') {
21734 if (p->ctxt.in_argdef || IS_LABEL_POSSIBLE()) {
21735 SET_LEX_STATE(EXPR_ENDARG);
21736 return tBDOT3;
21737 }
21738 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
21739 rb_warn0("... at EOL, should be parenthesized?");
21740 }
21741 return is_beg ? tBDOT3 : tDOT3;
21742 }
21743 pushback(p, c);
21744 return is_beg ? tBDOT2 : tDOT2;
21745 }
21746 pushback(p, c);
21747 if (c != -1 && ISDIGIT(c)) {
21748 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
21749 parse_numeric(p, '.');
21750 if (ISDIGIT(prev)) {
21751 yyerror0("unexpected fraction part after numeric literal");
21752 }
21753 else {
21754 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
21755 }
21756 SET_LEX_STATE(EXPR_END);
21757 p->lex.ptok = p->lex.pcur;
21758 goto retry;
21759 }
21760 set_yylval_id('.');
21761 SET_LEX_STATE(EXPR_DOT);
21762 return '.';
21763 }
21764
21765 case '0': case '1': case '2': case '3': case '4':
21766 case '5': case '6': case '7': case '8': case '9':
21767 return parse_numeric(p, c);
21768
21769 case ')':
21770 COND_POP();
21771 CMDARG_POP();
21772 SET_LEX_STATE(EXPR_ENDFN);
21773 p->lex.paren_nest--;
21774 return c;
21775
21776 case ']':
21777 COND_POP();
21778 CMDARG_POP();
21779 SET_LEX_STATE(EXPR_END);
21780 p->lex.paren_nest--;
21781 return c;
21782
21783 case '}':
21784 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
21785 if (!p->lex.brace_nest--) return tSTRING_DEND;
21786 COND_POP();
21787 CMDARG_POP();
21788 SET_LEX_STATE(EXPR_END);
21789 p->lex.paren_nest--;
21790 return c;
21791
21792 case ':':
21793 c = nextc(p);
21794 if (c == ':') {
21795 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
21796 SET_LEX_STATE(EXPR_BEG);
21797 return tCOLON3;
21798 }
21799 set_yylval_id(idCOLON2);
21800 SET_LEX_STATE(EXPR_DOT);
21801 return tCOLON2;
21802 }
21803 if (IS_END() || ISSPACE(c) || c == '#') {
21804 pushback(p, c);
21805 c = warn_balanced(':', ":", "symbol literal");
21806 SET_LEX_STATE(EXPR_BEG);
21807 return c;
21808 }
21809 switch (c) {
21810 case '\'':
21811 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
21812 break;
21813 case '"':
21814 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
21815 break;
21816 default:
21817 pushback(p, c);
21818 break;
21819 }
21820 SET_LEX_STATE(EXPR_FNAME);
21821 return tSYMBEG;
21822
21823 case '/':
21824 if (IS_BEG()) {
21825 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21826 return tREGEXP_BEG;
21827 }
21828 if ((c = nextc(p)) == '=') {
21829 set_yylval_id('/');
21830 SET_LEX_STATE(EXPR_BEG);
21831 return tOP_ASGN;
21832 }
21833 pushback(p, c);
21834 if (IS_SPCARG(c)) {
21835 arg_ambiguous(p, '/');
21836 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21837 return tREGEXP_BEG;
21838 }
21839 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21840 return warn_balanced('/', "/", "regexp literal");
21841
21842 case '^':
21843 if ((c = nextc(p)) == '=') {
21844 set_yylval_id('^');
21845 SET_LEX_STATE(EXPR_BEG);
21846 return tOP_ASGN;
21847 }
21848 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21849 pushback(p, c);
21850 return '^';
21851
21852 case ';':
21853 SET_LEX_STATE(EXPR_BEG);
21854 p->command_start = TRUE;
21855 return ';';
21856
21857 case ',':
21858 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21859 return ',';
21860
21861 case '~':
21862 if (IS_AFTER_OPERATOR()) {
21863 if ((c = nextc(p)) != '@') {
21864 pushback(p, c);
21865 }
21866 SET_LEX_STATE(EXPR_ARG);
21867 }
21868 else {
21869 SET_LEX_STATE(EXPR_BEG);
21870 }
21871 return '~';
21872
21873 case '(':
21874 if (IS_BEG()) {
21875 c = tLPAREN;
21876 }
21877 else if (!space_seen) {
21878 /* foo( ... ) => method call, no ambiguity */
21879 }
21880 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
21881 c = tLPAREN_ARG;
21882 }
21883 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
21884 rb_warning0("parentheses after method name is interpreted as "
21885 "an argument list, not a decomposed argument");
21886 }
21887 p->lex.paren_nest++;
21888 COND_PUSH(0);
21889 CMDARG_PUSH(0);
21890 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21891 return c;
21892
21893 case '[':
21894 p->lex.paren_nest++;
21895 if (IS_AFTER_OPERATOR()) {
21896 if ((c = nextc(p)) == ']') {
21897 p->lex.paren_nest--;
21898 SET_LEX_STATE(EXPR_ARG);
21899 if ((c = nextc(p)) == '=') {
21900 return tASET;
21901 }
21902 pushback(p, c);
21903 return tAREF;
21904 }
21905 pushback(p, c);
21906 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
21907 return '[';
21908 }
21909 else if (IS_BEG()) {
21910 c = tLBRACK;
21911 }
21912 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
21913 c = tLBRACK;
21914 }
21915 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21916 COND_PUSH(0);
21917 CMDARG_PUSH(0);
21918 return c;
21919
21920 case '{':
21921 ++p->lex.brace_nest;
21922 if (lambda_beginning_p())
21923 c = tLAMBEG;
21924 else if (IS_lex_state(EXPR_LABELED))
21925 c = tLBRACE; /* hash */
21926 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
21927 c = '{'; /* block (primary) */
21928 else if (IS_lex_state(EXPR_ENDARG))
21929 c = tLBRACE_ARG; /* block (expr) */
21930 else
21931 c = tLBRACE; /* hash */
21932 if (c != tLBRACE) {
21933 p->command_start = TRUE;
21934 SET_LEX_STATE(EXPR_BEG);
21935 }
21936 else {
21937 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21938 }
21939 ++p->lex.paren_nest; /* after lambda_beginning_p() */
21940 COND_PUSH(0);
21941 CMDARG_PUSH(0);
21942 return c;
21943
21944 case '\\':
21945 c = nextc(p);
21946 if (c == '\n') {
21947 space_seen = 1;
21948 dispatch_scan_event(p, tSP);
21949 goto retry; /* skip \\n */
21950 }
21951 if (c == ' ') return tSP;
21952 if (ISSPACE(c)) return c;
21953 pushback(p, c);
21954 return '\\';
21955
21956 case '%':
21957 return parse_percent(p, space_seen, last_state);
21958
21959 case '$':
21960 return parse_gvar(p, last_state);
21961
21962 case '@':
21963 return parse_atmark(p, last_state);
21964
21965 case '_':
21966 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
21967 p->ruby__end__seen = 1;
21968 p->eofp = 1;
21969#ifdef RIPPER
21970 lex_goto_eol(p);
21971 dispatch_scan_event(p, k__END__);
21972#endif
21973 return END_OF_INPUT;
21974 }
21975 newtok(p);
21976 break;
21977
21978 default:
21979 if (!parser_is_identchar(p)) {
21980 compile_error(p, "Invalid char '\\x%02X' in expression", c);
21981 token_flush(p);
21982 goto retry;
21983 }
21984
21985 newtok(p);
21986 break;
21987 }
21988
21989 return parse_ident(p, c, cmd_state);
21990}
21991
21992static enum yytokentype
21993yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
21994{
21995 enum yytokentype t;
21996
21997 p->lval = lval;
21998 lval->node = 0;
21999 p->yylloc = yylloc;
22000
22001 t = parser_yylex(p);
22002
22003 if (has_delayed_token(p))
22004 dispatch_delayed_token(p, t);
22005 else if (t != END_OF_INPUT)
22006 dispatch_scan_event(p, t);
22007
22008 return t;
22009}
22010
22011#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
22012
22013static NODE*
22014node_new_internal(struct parser_params *p, enum node_type type, size_t size, size_t alignment)
22015{
22016 NODE *n = rb_ast_newnode(p->ast, type, size, alignment);
22017
22018 rb_node_init(n, type);
22019 return n;
22020}
22021
22022static NODE *
22023nd_set_loc(NODE *nd, const YYLTYPE *loc)
22024{
22025 nd->nd_loc = *loc;
22026 nd_set_line(nd, loc->beg_pos.lineno);
22027 return nd;
22028}
22029
22030static NODE*
22031node_newnode(struct parser_params *p, enum node_type type, size_t size, size_t alignment, const rb_code_location_t *loc)
22032{
22033 NODE *n = node_new_internal(p, type, size, alignment);
22034
22035 nd_set_loc(n, loc);
22036 nd_set_node_id(n, parser_get_node_id(p));
22037 return n;
22038}
22039
22040#define NODE_NEWNODE(node_type, type, loc) (type *)(node_newnode(p, node_type, sizeof(type), RUBY_ALIGNOF(type), loc))
22041
22042static rb_node_scope_t *
22043rb_node_scope_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
22044{
22045 rb_ast_id_table_t *nd_tbl;
22046 nd_tbl = local_tbl(p);
22047 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
22048 n->nd_tbl = nd_tbl;
22049 n->nd_body = nd_body;
22050 n->nd_args = nd_args;
22051
22052 return n;
22053}
22054
22055static rb_node_scope_t *
22056rb_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)
22057{
22058 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
22059 n->nd_tbl = nd_tbl;
22060 n->nd_body = nd_body;
22061 n->nd_args = nd_args;
22062
22063 return n;
22064}
22065
22066static rb_node_defn_t *
22067rb_node_defn_new(struct parser_params *p, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
22068{
22069 rb_node_defn_t *n = NODE_NEWNODE(NODE_DEFN, rb_node_defn_t, loc);
22070 n->nd_mid = nd_mid;
22071 n->nd_defn = nd_defn;
22072
22073 return n;
22074}
22075
22076static rb_node_defs_t *
22077rb_node_defs_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
22078{
22079 rb_node_defs_t *n = NODE_NEWNODE(NODE_DEFS, rb_node_defs_t, loc);
22080 n->nd_recv = nd_recv;
22081 n->nd_mid = nd_mid;
22082 n->nd_defn = nd_defn;
22083
22084 return n;
22085}
22086
22087static rb_node_block_t *
22088rb_node_block_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22089{
22090 rb_node_block_t *n = NODE_NEWNODE(NODE_BLOCK, rb_node_block_t, loc);
22091 n->nd_head = nd_head;
22092 n->nd_end = (NODE *)n;
22093 n->nd_next = 0;
22094
22095 return n;
22096}
22097
22098static rb_node_for_t *
22099rb_node_for_new(struct parser_params *p, NODE *nd_iter, NODE *nd_body, const YYLTYPE *loc)
22100{
22101 rb_node_for_t *n = NODE_NEWNODE(NODE_FOR, rb_node_for_t, loc);
22102 n->nd_body = nd_body;
22103 n->nd_iter = nd_iter;
22104
22105 return n;
22106}
22107
22108static rb_node_for_masgn_t *
22109rb_node_for_masgn_new(struct parser_params *p, NODE *nd_var, const YYLTYPE *loc)
22110{
22111 rb_node_for_masgn_t *n = NODE_NEWNODE(NODE_FOR_MASGN, rb_node_for_masgn_t, loc);
22112 n->nd_var = nd_var;
22113
22114 return n;
22115}
22116
22117static rb_node_retry_t *
22118rb_node_retry_new(struct parser_params *p, const YYLTYPE *loc)
22119{
22120 rb_node_retry_t *n = NODE_NEWNODE(NODE_RETRY, rb_node_retry_t, loc);
22121
22122 return n;
22123}
22124
22125static rb_node_begin_t *
22126rb_node_begin_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22127{
22128 rb_node_begin_t *n = NODE_NEWNODE(NODE_BEGIN, rb_node_begin_t, loc);
22129 n->nd_body = nd_body;
22130
22131 return n;
22132}
22133
22134static rb_node_rescue_t *
22135rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *nd_else, const YYLTYPE *loc)
22136{
22137 rb_node_rescue_t *n = NODE_NEWNODE(NODE_RESCUE, rb_node_rescue_t, loc);
22138 n->nd_head = nd_head;
22139 n->nd_resq = nd_resq;
22140 n->nd_else = nd_else;
22141
22142 return n;
22143}
22144
22145static rb_node_resbody_t *
22146rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_exc_var, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
22147{
22148 rb_node_resbody_t *n = NODE_NEWNODE(NODE_RESBODY, rb_node_resbody_t, loc);
22149 n->nd_args = nd_args;
22150 n->nd_exc_var = nd_exc_var;
22151 n->nd_body = nd_body;
22152 n->nd_next = nd_next;
22153
22154 return n;
22155}
22156
22157static rb_node_ensure_t *
22158rb_node_ensure_new(struct parser_params *p, NODE *nd_head, NODE *nd_ensr, const YYLTYPE *loc)
22159{
22160 rb_node_ensure_t *n = NODE_NEWNODE(NODE_ENSURE, rb_node_ensure_t, loc);
22161 n->nd_head = nd_head;
22162 n->nd_ensr = nd_ensr;
22163
22164 return n;
22165}
22166
22167static rb_node_and_t *
22168rb_node_and_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22169{
22170 rb_node_and_t *n = NODE_NEWNODE(NODE_AND, rb_node_and_t, loc);
22171 n->nd_1st = nd_1st;
22172 n->nd_2nd = nd_2nd;
22173 n->operator_loc = *operator_loc;
22174
22175 return n;
22176}
22177
22178static rb_node_or_t *
22179rb_node_or_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22180{
22181 rb_node_or_t *n = NODE_NEWNODE(NODE_OR, rb_node_or_t, loc);
22182 n->nd_1st = nd_1st;
22183 n->nd_2nd = nd_2nd;
22184 n->operator_loc = *operator_loc;
22185
22186 return n;
22187}
22188
22189static rb_node_return_t *
22190rb_node_return_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
22191{
22192 rb_node_return_t *n = NODE_NEWNODE(NODE_RETURN, rb_node_return_t, loc);
22193 n->nd_stts = nd_stts;
22194 n->keyword_loc = *keyword_loc;
22195 return n;
22196}
22197
22198static rb_node_yield_t *
22199rb_node_yield_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22200{
22201 rb_node_yield_t *n = NODE_NEWNODE(NODE_YIELD, rb_node_yield_t, loc);
22202 n->nd_head = nd_head;
22203
22204 return n;
22205}
22206
22207static rb_node_if_t *
22208rb_node_if_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc)
22209{
22210 rb_node_if_t *n = NODE_NEWNODE(NODE_IF, rb_node_if_t, loc);
22211 n->nd_cond = nd_cond;
22212 n->nd_body = nd_body;
22213 n->nd_else = nd_else;
22214
22215 return n;
22216}
22217
22218static rb_node_unless_t *
22219rb_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)
22220{
22221 rb_node_unless_t *n = NODE_NEWNODE(NODE_UNLESS, rb_node_unless_t, loc);
22222 n->nd_cond = nd_cond;
22223 n->nd_body = nd_body;
22224 n->nd_else = nd_else;
22225 n->keyword_loc = *keyword_loc;
22226 n->then_keyword_loc = *then_keyword_loc;
22227 n->end_keyword_loc = *end_keyword_loc;
22228
22229 return n;
22230}
22231
22232static rb_node_class_t *
22233rb_node_class_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, NODE *nd_super, const YYLTYPE *loc)
22234{
22235 /* Keep the order of node creation */
22236 NODE *scope = NEW_SCOPE(0, nd_body, loc);
22237 rb_node_class_t *n = NODE_NEWNODE(NODE_CLASS, rb_node_class_t, loc);
22238 n->nd_cpath = nd_cpath;
22239 n->nd_body = scope;
22240 n->nd_super = nd_super;
22241
22242 return n;
22243}
22244
22245static rb_node_sclass_t *
22246rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const YYLTYPE *loc)
22247{
22248 /* Keep the order of node creation */
22249 NODE *scope = NEW_SCOPE(0, nd_body, loc);
22250 rb_node_sclass_t *n = NODE_NEWNODE(NODE_SCLASS, rb_node_sclass_t, loc);
22251 n->nd_recv = nd_recv;
22252 n->nd_body = scope;
22253
22254 return n;
22255}
22256
22257static rb_node_module_t *
22258rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc)
22259{
22260 /* Keep the order of node creation */
22261 NODE *scope = NEW_SCOPE(0, nd_body, loc);
22262 rb_node_module_t *n = NODE_NEWNODE(NODE_MODULE, rb_node_module_t, loc);
22263 n->nd_cpath = nd_cpath;
22264 n->nd_body = scope;
22265
22266 return n;
22267}
22268
22269static rb_node_iter_t *
22270rb_node_iter_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
22271{
22272 /* Keep the order of node creation */
22273 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
22274 rb_node_iter_t *n = NODE_NEWNODE(NODE_ITER, rb_node_iter_t, loc);
22275 n->nd_body = scope;
22276 n->nd_iter = 0;
22277
22278 return n;
22279}
22280
22281static rb_node_lambda_t *
22282rb_node_lambda_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
22283{
22284 /* Keep the order of node creation */
22285 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
22286 rb_node_lambda_t *n = NODE_NEWNODE(NODE_LAMBDA, rb_node_lambda_t, loc);
22287 n->nd_body = scope;
22288
22289 return n;
22290}
22291
22292static rb_node_case_t *
22293rb_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)
22294{
22295 rb_node_case_t *n = NODE_NEWNODE(NODE_CASE, rb_node_case_t, loc);
22296 n->nd_head = nd_head;
22297 n->nd_body = nd_body;
22298 n->case_keyword_loc = *case_keyword_loc;
22299 n->end_keyword_loc = *end_keyword_loc;
22300
22301 return n;
22302}
22303
22304static rb_node_case2_t *
22305rb_node_case2_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc)
22306{
22307 rb_node_case2_t *n = NODE_NEWNODE(NODE_CASE2, rb_node_case2_t, loc);
22308 n->nd_head = 0;
22309 n->nd_body = nd_body;
22310 n->case_keyword_loc = *case_keyword_loc;
22311 n->end_keyword_loc = *end_keyword_loc;
22312
22313 return n;
22314}
22315
22316static rb_node_case3_t *
22317rb_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)
22318{
22319 rb_node_case3_t *n = NODE_NEWNODE(NODE_CASE3, rb_node_case3_t, loc);
22320 n->nd_head = nd_head;
22321 n->nd_body = nd_body;
22322 n->case_keyword_loc = *case_keyword_loc;
22323 n->end_keyword_loc = *end_keyword_loc;
22324
22325 return n;
22326}
22327
22328static rb_node_when_t *
22329rb_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)
22330{
22331 rb_node_when_t *n = NODE_NEWNODE(NODE_WHEN, rb_node_when_t, loc);
22332 n->nd_head = nd_head;
22333 n->nd_body = nd_body;
22334 n->nd_next = nd_next;
22335 n->keyword_loc = *keyword_loc;
22336 n->then_keyword_loc = *then_keyword_loc;
22337
22338 return n;
22339}
22340
22341static rb_node_in_t *
22342rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
22343{
22344 rb_node_in_t *n = NODE_NEWNODE(NODE_IN, rb_node_in_t, loc);
22345 n->nd_head = nd_head;
22346 n->nd_body = nd_body;
22347 n->nd_next = nd_next;
22348
22349 return n;
22350}
22351
22352static rb_node_while_t *
22353rb_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)
22354{
22355 rb_node_while_t *n = NODE_NEWNODE(NODE_WHILE, rb_node_while_t, loc);
22356 n->nd_cond = nd_cond;
22357 n->nd_body = nd_body;
22358 n->nd_state = nd_state;
22359 n->keyword_loc = *keyword_loc;
22360 n->closing_loc = *closing_loc;
22361
22362 return n;
22363}
22364
22365static rb_node_until_t *
22366rb_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)
22367{
22368 rb_node_until_t *n = NODE_NEWNODE(NODE_UNTIL, rb_node_until_t, loc);
22369 n->nd_cond = nd_cond;
22370 n->nd_body = nd_body;
22371 n->nd_state = nd_state;
22372 n->keyword_loc = *keyword_loc;
22373 n->closing_loc = *closing_loc;
22374
22375 return n;
22376}
22377
22378static rb_node_colon2_t *
22379rb_node_colon2_new(struct parser_params *p, NODE *nd_head, ID nd_mid, const YYLTYPE *loc)
22380{
22381 rb_node_colon2_t *n = NODE_NEWNODE(NODE_COLON2, rb_node_colon2_t, loc);
22382 n->nd_head = nd_head;
22383 n->nd_mid = nd_mid;
22384
22385 return n;
22386}
22387
22388static rb_node_colon3_t *
22389rb_node_colon3_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
22390{
22391 rb_node_colon3_t *n = NODE_NEWNODE(NODE_COLON3, rb_node_colon3_t, loc);
22392 n->nd_mid = nd_mid;
22393
22394 return n;
22395}
22396
22397static rb_node_dot2_t *
22398rb_node_dot2_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
22399{
22400 rb_node_dot2_t *n = NODE_NEWNODE(NODE_DOT2, rb_node_dot2_t, loc);
22401 n->nd_beg = nd_beg;
22402 n->nd_end = nd_end;
22403
22404 return n;
22405}
22406
22407static rb_node_dot3_t *
22408rb_node_dot3_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
22409{
22410 rb_node_dot3_t *n = NODE_NEWNODE(NODE_DOT3, rb_node_dot3_t, loc);
22411 n->nd_beg = nd_beg;
22412 n->nd_end = nd_end;
22413
22414 return n;
22415}
22416
22417static rb_node_self_t *
22418rb_node_self_new(struct parser_params *p, const YYLTYPE *loc)
22419{
22420 rb_node_self_t *n = NODE_NEWNODE(NODE_SELF, rb_node_self_t, loc);
22421 n->nd_state = 1;
22422
22423 return n;
22424}
22425
22426static rb_node_nil_t *
22427rb_node_nil_new(struct parser_params *p, const YYLTYPE *loc)
22428{
22429 rb_node_nil_t *n = NODE_NEWNODE(NODE_NIL, rb_node_nil_t, loc);
22430
22431 return n;
22432}
22433
22434static rb_node_true_t *
22435rb_node_true_new(struct parser_params *p, const YYLTYPE *loc)
22436{
22437 rb_node_true_t *n = NODE_NEWNODE(NODE_TRUE, rb_node_true_t, loc);
22438
22439 return n;
22440}
22441
22442static rb_node_false_t *
22443rb_node_false_new(struct parser_params *p, const YYLTYPE *loc)
22444{
22445 rb_node_false_t *n = NODE_NEWNODE(NODE_FALSE, rb_node_false_t, loc);
22446
22447 return n;
22448}
22449
22450static rb_node_super_t *
22451rb_node_super_new(struct parser_params *p, NODE *nd_args, const YYLTYPE *loc)
22452{
22453 rb_node_super_t *n = NODE_NEWNODE(NODE_SUPER, rb_node_super_t, loc);
22454 n->nd_args = nd_args;
22455
22456 return n;
22457}
22458
22459static rb_node_zsuper_t *
22460rb_node_zsuper_new(struct parser_params *p, const YYLTYPE *loc)
22461{
22462 rb_node_zsuper_t *n = NODE_NEWNODE(NODE_ZSUPER, rb_node_zsuper_t, loc);
22463
22464 return n;
22465}
22466
22467static rb_node_match2_t *
22468rb_node_match2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
22469{
22470 rb_node_match2_t *n = NODE_NEWNODE(NODE_MATCH2, rb_node_match2_t, loc);
22471 n->nd_recv = nd_recv;
22472 n->nd_value = nd_value;
22473 n->nd_args = 0;
22474
22475 return n;
22476}
22477
22478static rb_node_match3_t *
22479rb_node_match3_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
22480{
22481 rb_node_match3_t *n = NODE_NEWNODE(NODE_MATCH3, rb_node_match3_t, loc);
22482 n->nd_recv = nd_recv;
22483 n->nd_value = nd_value;
22484
22485 return n;
22486}
22487
22488/* TODO: Use union for NODE_LIST2 */
22489static rb_node_list_t *
22490rb_node_list_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22491{
22492 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
22493 n->nd_head = nd_head;
22494 n->as.nd_alen = 1;
22495 n->nd_next = 0;
22496
22497 return n;
22498}
22499
22500static rb_node_list_t *
22501rb_node_list_new2(struct parser_params *p, NODE *nd_head, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22502{
22503 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
22504 n->nd_head = nd_head;
22505 n->as.nd_alen = nd_alen;
22506 n->nd_next = nd_next;
22507
22508 return n;
22509}
22510
22511static rb_node_zlist_t *
22512rb_node_zlist_new(struct parser_params *p, const YYLTYPE *loc)
22513{
22514 rb_node_zlist_t *n = NODE_NEWNODE(NODE_ZLIST, rb_node_zlist_t, loc);
22515
22516 return n;
22517}
22518
22519static rb_node_hash_t *
22520rb_node_hash_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22521{
22522 rb_node_hash_t *n = NODE_NEWNODE(NODE_HASH, rb_node_hash_t, loc);
22523 n->nd_head = nd_head;
22524 n->nd_brace = 0;
22525
22526 return n;
22527}
22528
22529static rb_node_masgn_t *
22530rb_node_masgn_new(struct parser_params *p, NODE *nd_head, NODE *nd_args, const YYLTYPE *loc)
22531{
22532 rb_node_masgn_t *n = NODE_NEWNODE(NODE_MASGN, rb_node_masgn_t, loc);
22533 n->nd_head = nd_head;
22534 n->nd_value = 0;
22535 n->nd_args = nd_args;
22536
22537 return n;
22538}
22539
22540static rb_node_gasgn_t *
22541rb_node_gasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22542{
22543 rb_node_gasgn_t *n = NODE_NEWNODE(NODE_GASGN, rb_node_gasgn_t, loc);
22544 n->nd_vid = nd_vid;
22545 n->nd_value = nd_value;
22546
22547 return n;
22548}
22549
22550static rb_node_lasgn_t *
22551rb_node_lasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22552{
22553 rb_node_lasgn_t *n = NODE_NEWNODE(NODE_LASGN, rb_node_lasgn_t, loc);
22554 n->nd_vid = nd_vid;
22555 n->nd_value = nd_value;
22556
22557 return n;
22558}
22559
22560static rb_node_dasgn_t *
22561rb_node_dasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22562{
22563 rb_node_dasgn_t *n = NODE_NEWNODE(NODE_DASGN, rb_node_dasgn_t, loc);
22564 n->nd_vid = nd_vid;
22565 n->nd_value = nd_value;
22566
22567 return n;
22568}
22569
22570static rb_node_iasgn_t *
22571rb_node_iasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22572{
22573 rb_node_iasgn_t *n = NODE_NEWNODE(NODE_IASGN, rb_node_iasgn_t, loc);
22574 n->nd_vid = nd_vid;
22575 n->nd_value = nd_value;
22576
22577 return n;
22578}
22579
22580static rb_node_cvasgn_t *
22581rb_node_cvasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
22582{
22583 rb_node_cvasgn_t *n = NODE_NEWNODE(NODE_CVASGN, rb_node_cvasgn_t, loc);
22584 n->nd_vid = nd_vid;
22585 n->nd_value = nd_value;
22586
22587 return n;
22588}
22589
22590static rb_node_op_asgn1_t *
22591rb_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)
22592{
22593 rb_node_op_asgn1_t *n = NODE_NEWNODE(NODE_OP_ASGN1, rb_node_op_asgn1_t, loc);
22594 n->nd_recv = nd_recv;
22595 n->nd_mid = nd_mid;
22596 n->nd_index = index;
22597 n->nd_rvalue = rvalue;
22598 n->call_operator_loc = *call_operator_loc;
22599 n->opening_loc = *opening_loc;
22600 n->closing_loc = *closing_loc;
22601 n->binary_operator_loc = *binary_operator_loc;
22602
22603 return n;
22604}
22605
22606static rb_node_op_asgn2_t *
22607rb_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)
22608{
22609 rb_node_op_asgn2_t *n = NODE_NEWNODE(NODE_OP_ASGN2, rb_node_op_asgn2_t, loc);
22610 n->nd_recv = nd_recv;
22611 n->nd_value = nd_value;
22612 n->nd_vid = nd_vid;
22613 n->nd_mid = nd_mid;
22614 n->nd_aid = nd_aid;
22615 n->call_operator_loc = *call_operator_loc;
22616 n->message_loc = *message_loc;
22617 n->binary_operator_loc = *binary_operator_loc;
22618
22619 return n;
22620}
22621
22622static rb_node_op_asgn_or_t *
22623rb_node_op_asgn_or_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
22624{
22625 rb_node_op_asgn_or_t *n = NODE_NEWNODE(NODE_OP_ASGN_OR, rb_node_op_asgn_or_t, loc);
22626 n->nd_head = nd_head;
22627 n->nd_value = nd_value;
22628
22629 return n;
22630}
22631
22632static rb_node_op_asgn_and_t *
22633rb_node_op_asgn_and_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
22634{
22635 rb_node_op_asgn_and_t *n = NODE_NEWNODE(NODE_OP_ASGN_AND, rb_node_op_asgn_and_t, loc);
22636 n->nd_head = nd_head;
22637 n->nd_value = nd_value;
22638
22639 return n;
22640}
22641
22642static rb_node_gvar_t *
22643rb_node_gvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22644{
22645 rb_node_gvar_t *n = NODE_NEWNODE(NODE_GVAR, rb_node_gvar_t, loc);
22646 n->nd_vid = nd_vid;
22647
22648 return n;
22649}
22650
22651static rb_node_lvar_t *
22652rb_node_lvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22653{
22654 rb_node_lvar_t *n = NODE_NEWNODE(NODE_LVAR, rb_node_lvar_t, loc);
22655 n->nd_vid = nd_vid;
22656
22657 return n;
22658}
22659
22660static rb_node_dvar_t *
22661rb_node_dvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22662{
22663 rb_node_dvar_t *n = NODE_NEWNODE(NODE_DVAR, rb_node_dvar_t, loc);
22664 n->nd_vid = nd_vid;
22665
22666 return n;
22667}
22668
22669static rb_node_ivar_t *
22670rb_node_ivar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22671{
22672 rb_node_ivar_t *n = NODE_NEWNODE(NODE_IVAR, rb_node_ivar_t, loc);
22673 n->nd_vid = nd_vid;
22674
22675 return n;
22676}
22677
22678static rb_node_const_t *
22679rb_node_const_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22680{
22681 rb_node_const_t *n = NODE_NEWNODE(NODE_CONST, rb_node_const_t, loc);
22682 n->nd_vid = nd_vid;
22683
22684 return n;
22685}
22686
22687static rb_node_cvar_t *
22688rb_node_cvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
22689{
22690 rb_node_cvar_t *n = NODE_NEWNODE(NODE_CVAR, rb_node_cvar_t, loc);
22691 n->nd_vid = nd_vid;
22692
22693 return n;
22694}
22695
22696static rb_node_nth_ref_t *
22697rb_node_nth_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
22698{
22699 rb_node_nth_ref_t *n = NODE_NEWNODE(NODE_NTH_REF, rb_node_nth_ref_t, loc);
22700 n->nd_nth = nd_nth;
22701
22702 return n;
22703}
22704
22705static rb_node_back_ref_t *
22706rb_node_back_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
22707{
22708 rb_node_back_ref_t *n = NODE_NEWNODE(NODE_BACK_REF, rb_node_back_ref_t, loc);
22709 n->nd_nth = nd_nth;
22710
22711 return n;
22712}
22713
22714static rb_node_integer_t *
22715rb_node_integer_new(struct parser_params *p, char* val, int base, const YYLTYPE *loc)
22716{
22717 rb_node_integer_t *n = NODE_NEWNODE(NODE_INTEGER, rb_node_integer_t, loc);
22718 n->val = val;
22719 n->minus = FALSE;
22720 n->base = base;
22721
22722 return n;
22723}
22724
22725static rb_node_float_t *
22726rb_node_float_new(struct parser_params *p, char* val, const YYLTYPE *loc)
22727{
22728 rb_node_float_t *n = NODE_NEWNODE(NODE_FLOAT, rb_node_float_t, loc);
22729 n->val = val;
22730 n->minus = FALSE;
22731
22732 return n;
22733}
22734
22735static rb_node_rational_t *
22736rb_node_rational_new(struct parser_params *p, char* val, int base, int seen_point, const YYLTYPE *loc)
22737{
22738 rb_node_rational_t *n = NODE_NEWNODE(NODE_RATIONAL, rb_node_rational_t, loc);
22739 n->val = val;
22740 n->minus = FALSE;
22741 n->base = base;
22742 n->seen_point = seen_point;
22743
22744 return n;
22745}
22746
22747static rb_node_imaginary_t *
22748rb_node_imaginary_new(struct parser_params *p, char* val, int base, int seen_point, enum rb_numeric_type numeric_type, const YYLTYPE *loc)
22749{
22750 rb_node_imaginary_t *n = NODE_NEWNODE(NODE_IMAGINARY, rb_node_imaginary_t, loc);
22751 n->val = val;
22752 n->minus = FALSE;
22753 n->base = base;
22754 n->seen_point = seen_point;
22755 n->type = numeric_type;
22756
22757 return n;
22758}
22759
22760static rb_node_str_t *
22761rb_node_str_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc)
22762{
22763 rb_node_str_t *n = NODE_NEWNODE(NODE_STR, rb_node_str_t, loc);
22764 n->string = string;
22765
22766 return n;
22767}
22768
22769/* TODO; Use union for NODE_DSTR2 */
22770static rb_node_dstr_t *
22771rb_node_dstr_new0(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22772{
22773 rb_node_dstr_t *n = NODE_NEWNODE(NODE_DSTR, rb_node_dstr_t, loc);
22774 n->string = string;
22775 n->as.nd_alen = nd_alen;
22776 n->nd_next = (rb_node_list_t *)nd_next;
22777
22778 return n;
22779}
22780
22781static rb_node_dstr_t *
22782rb_node_dstr_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc)
22783{
22784 return rb_node_dstr_new0(p, string, 1, 0, loc);
22785}
22786
22787static rb_node_xstr_t *
22788rb_node_xstr_new(struct parser_params *p, rb_parser_string_t *string, const YYLTYPE *loc)
22789{
22790 rb_node_xstr_t *n = NODE_NEWNODE(NODE_XSTR, rb_node_xstr_t, loc);
22791 n->string = string;
22792
22793 return n;
22794}
22795
22796static rb_node_dxstr_t *
22797rb_node_dxstr_new(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22798{
22799 rb_node_dxstr_t *n = NODE_NEWNODE(NODE_DXSTR, rb_node_dxstr_t, loc);
22800 n->string = string;
22801 n->as.nd_alen = nd_alen;
22802 n->nd_next = (rb_node_list_t *)nd_next;
22803
22804 return n;
22805}
22806
22807static rb_node_sym_t *
22808rb_node_sym_new(struct parser_params *p, VALUE str, const YYLTYPE *loc)
22809{
22810 rb_node_sym_t *n = NODE_NEWNODE(NODE_SYM, rb_node_sym_t, loc);
22811 n->string = rb_str_to_parser_string(p, str);
22812
22813 return n;
22814}
22815
22816static rb_node_dsym_t *
22817rb_node_dsym_new(struct parser_params *p, rb_parser_string_t *string, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
22818{
22819 rb_node_dsym_t *n = NODE_NEWNODE(NODE_DSYM, rb_node_dsym_t, loc);
22820 n->string = string;
22821 n->as.nd_alen = nd_alen;
22822 n->nd_next = (rb_node_list_t *)nd_next;
22823
22824 return n;
22825}
22826
22827static rb_node_evstr_t *
22828rb_node_evstr_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22829{
22830 rb_node_evstr_t *n = NODE_NEWNODE(NODE_EVSTR, rb_node_evstr_t, loc);
22831 n->nd_body = nd_body;
22832
22833 return n;
22834}
22835
22836static rb_node_regx_t *
22837rb_node_regx_new(struct parser_params *p, rb_parser_string_t *string, int options, const YYLTYPE *loc)
22838{
22839 rb_node_regx_t *n = NODE_NEWNODE(NODE_REGX, rb_node_regx_t, loc);
22840 n->string = string;
22841 n->options = options & RE_OPTION_MASK;
22842
22843 return n;
22844}
22845
22846static rb_node_call_t *
22847rb_node_call_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22848{
22849 rb_node_call_t *n = NODE_NEWNODE(NODE_CALL, rb_node_call_t, loc);
22850 n->nd_recv = nd_recv;
22851 n->nd_mid = nd_mid;
22852 n->nd_args = nd_args;
22853
22854 return n;
22855}
22856
22857static rb_node_opcall_t *
22858rb_node_opcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22859{
22860 rb_node_opcall_t *n = NODE_NEWNODE(NODE_OPCALL, rb_node_opcall_t, loc);
22861 n->nd_recv = nd_recv;
22862 n->nd_mid = nd_mid;
22863 n->nd_args = nd_args;
22864
22865 return n;
22866}
22867
22868static rb_node_fcall_t *
22869rb_node_fcall_new(struct parser_params *p, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22870{
22871 rb_node_fcall_t *n = NODE_NEWNODE(NODE_FCALL, rb_node_fcall_t, loc);
22872 n->nd_mid = nd_mid;
22873 n->nd_args = nd_args;
22874
22875 return n;
22876}
22877
22878static rb_node_qcall_t *
22879rb_node_qcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22880{
22881 rb_node_qcall_t *n = NODE_NEWNODE(NODE_QCALL, rb_node_qcall_t, loc);
22882 n->nd_recv = nd_recv;
22883 n->nd_mid = nd_mid;
22884 n->nd_args = nd_args;
22885
22886 return n;
22887}
22888
22889static rb_node_vcall_t *
22890rb_node_vcall_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
22891{
22892 rb_node_vcall_t *n = NODE_NEWNODE(NODE_VCALL, rb_node_vcall_t, loc);
22893 n->nd_mid = nd_mid;
22894
22895 return n;
22896}
22897
22898static rb_node_once_t *
22899rb_node_once_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22900{
22901 rb_node_once_t *n = NODE_NEWNODE(NODE_ONCE, rb_node_once_t, loc);
22902 n->nd_body = nd_body;
22903
22904 return n;
22905}
22906
22907static rb_node_args_t *
22908rb_node_args_new(struct parser_params *p, const YYLTYPE *loc)
22909{
22910 rb_node_args_t *n = NODE_NEWNODE(NODE_ARGS, rb_node_args_t, loc);
22911 MEMZERO(&n->nd_ainfo, struct rb_args_info, 1);
22912
22913 return n;
22914}
22915
22916static rb_node_args_aux_t *
22917rb_node_args_aux_new(struct parser_params *p, ID nd_pid, int nd_plen, const YYLTYPE *loc)
22918{
22919 rb_node_args_aux_t *n = NODE_NEWNODE(NODE_ARGS_AUX, rb_node_args_aux_t, loc);
22920 n->nd_pid = nd_pid;
22921 n->nd_plen = nd_plen;
22922 n->nd_next = 0;
22923
22924 return n;
22925}
22926
22927static rb_node_opt_arg_t *
22928rb_node_opt_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22929{
22930 rb_node_opt_arg_t *n = NODE_NEWNODE(NODE_OPT_ARG, rb_node_opt_arg_t, loc);
22931 n->nd_body = nd_body;
22932 n->nd_next = 0;
22933
22934 return n;
22935}
22936
22937static rb_node_kw_arg_t *
22938rb_node_kw_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22939{
22940 rb_node_kw_arg_t *n = NODE_NEWNODE(NODE_KW_ARG, rb_node_kw_arg_t, loc);
22941 n->nd_body = nd_body;
22942 n->nd_next = 0;
22943
22944 return n;
22945}
22946
22947static rb_node_postarg_t *
22948rb_node_postarg_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
22949{
22950 rb_node_postarg_t *n = NODE_NEWNODE(NODE_POSTARG, rb_node_postarg_t, loc);
22951 n->nd_1st = nd_1st;
22952 n->nd_2nd = nd_2nd;
22953
22954 return n;
22955}
22956
22957static rb_node_argscat_t *
22958rb_node_argscat_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22959{
22960 rb_node_argscat_t *n = NODE_NEWNODE(NODE_ARGSCAT, rb_node_argscat_t, loc);
22961 n->nd_head = nd_head;
22962 n->nd_body = nd_body;
22963
22964 return n;
22965}
22966
22967static rb_node_argspush_t *
22968rb_node_argspush_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22969{
22970 rb_node_argspush_t *n = NODE_NEWNODE(NODE_ARGSPUSH, rb_node_argspush_t, loc);
22971 n->nd_head = nd_head;
22972 n->nd_body = nd_body;
22973
22974 return n;
22975}
22976
22977static rb_node_splat_t *
22978rb_node_splat_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22979{
22980 rb_node_splat_t *n = NODE_NEWNODE(NODE_SPLAT, rb_node_splat_t, loc);
22981 n->nd_head = nd_head;
22982 n->operator_loc = *operator_loc;
22983
22984 return n;
22985}
22986
22987static rb_node_block_pass_t *
22988rb_node_block_pass_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *operator_loc)
22989{
22990 rb_node_block_pass_t *n = NODE_NEWNODE(NODE_BLOCK_PASS, rb_node_block_pass_t, loc);
22991 n->forwarding = 0;
22992 n->nd_head = 0;
22993 n->nd_body = nd_body;
22994 n->operator_loc = *operator_loc;
22995
22996 return n;
22997}
22998
22999static rb_node_alias_t *
23000rb_node_alias_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23001{
23002 rb_node_alias_t *n = NODE_NEWNODE(NODE_ALIAS, rb_node_alias_t, loc);
23003 n->nd_1st = nd_1st;
23004 n->nd_2nd = nd_2nd;
23005 n->keyword_loc = *keyword_loc;
23006
23007 return n;
23008}
23009
23010static rb_node_valias_t *
23011rb_node_valias_new(struct parser_params *p, ID nd_alias, ID nd_orig, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23012{
23013 rb_node_valias_t *n = NODE_NEWNODE(NODE_VALIAS, rb_node_valias_t, loc);
23014 n->nd_alias = nd_alias;
23015 n->nd_orig = nd_orig;
23016 n->keyword_loc = *keyword_loc;
23017
23018 return n;
23019}
23020
23021static rb_node_undef_t *
23022rb_node_undef_new(struct parser_params *p, NODE *nd_undef, const YYLTYPE *loc)
23023{
23024 rb_node_undef_t *n = NODE_NEWNODE(NODE_UNDEF, rb_node_undef_t, loc);
23025 n->nd_undefs = rb_parser_ary_new_capa_for_node(p, 1);
23026 n->keyword_loc = NULL_LOC;
23027 rb_parser_ary_push_node(p, n->nd_undefs, nd_undef);
23028
23029 return n;
23030}
23031
23032static rb_node_errinfo_t *
23033rb_node_errinfo_new(struct parser_params *p, const YYLTYPE *loc)
23034{
23035 rb_node_errinfo_t *n = NODE_NEWNODE(NODE_ERRINFO, rb_node_errinfo_t, loc);
23036
23037 return n;
23038}
23039
23040static rb_node_defined_t *
23041rb_node_defined_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
23042{
23043 rb_node_defined_t *n = NODE_NEWNODE(NODE_DEFINED, rb_node_defined_t, loc);
23044 n->nd_head = nd_head;
23045
23046 return n;
23047}
23048
23049static rb_node_postexe_t *
23050rb_node_postexe_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
23051{
23052 rb_node_postexe_t *n = NODE_NEWNODE(NODE_POSTEXE, rb_node_postexe_t, loc);
23053 n->nd_body = nd_body;
23054
23055 return n;
23056}
23057
23058static rb_node_attrasgn_t *
23059rb_node_attrasgn_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
23060{
23061 rb_node_attrasgn_t *n = NODE_NEWNODE(NODE_ATTRASGN, rb_node_attrasgn_t, loc);
23062 n->nd_recv = nd_recv;
23063 n->nd_mid = nd_mid;
23064 n->nd_args = nd_args;
23065
23066 return n;
23067}
23068
23069static rb_node_aryptn_t *
23070rb_node_aryptn_new(struct parser_params *p, NODE *pre_args, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
23071{
23072 rb_node_aryptn_t *n = NODE_NEWNODE(NODE_ARYPTN, rb_node_aryptn_t, loc);
23073 n->nd_pconst = 0;
23074 n->pre_args = pre_args;
23075 n->rest_arg = rest_arg;
23076 n->post_args = post_args;
23077
23078 return n;
23079}
23080
23081static rb_node_hshptn_t *
23082rb_node_hshptn_new(struct parser_params *p, NODE *nd_pconst, NODE *nd_pkwargs, NODE *nd_pkwrestarg, const YYLTYPE *loc)
23083{
23084 rb_node_hshptn_t *n = NODE_NEWNODE(NODE_HSHPTN, rb_node_hshptn_t, loc);
23085 n->nd_pconst = nd_pconst;
23086 n->nd_pkwargs = nd_pkwargs;
23087 n->nd_pkwrestarg = nd_pkwrestarg;
23088
23089 return n;
23090}
23091
23092static rb_node_fndptn_t *
23093rb_node_fndptn_new(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
23094{
23095 rb_node_fndptn_t *n = NODE_NEWNODE(NODE_FNDPTN, rb_node_fndptn_t, loc);
23096 n->nd_pconst = 0;
23097 n->pre_rest_arg = pre_rest_arg;
23098 n->args = args;
23099 n->post_rest_arg = post_rest_arg;
23100
23101 return n;
23102}
23103
23104static rb_node_line_t *
23105rb_node_line_new(struct parser_params *p, const YYLTYPE *loc)
23106{
23107 rb_node_line_t *n = NODE_NEWNODE(NODE_LINE, rb_node_line_t, loc);
23108
23109 return n;
23110}
23111
23112static rb_node_file_t *
23113rb_node_file_new(struct parser_params *p, VALUE str, const YYLTYPE *loc)
23114{
23115 rb_node_file_t *n = NODE_NEWNODE(NODE_FILE, rb_node_file_t, loc);
23116 n->path = rb_str_to_parser_string(p, str);
23117
23118 return n;
23119}
23120
23121static rb_node_encoding_t *
23122rb_node_encoding_new(struct parser_params *p, const YYLTYPE *loc)
23123{
23124 rb_node_encoding_t *n = NODE_NEWNODE(NODE_ENCODING, rb_node_encoding_t, loc);
23125 n->enc = p->enc;
23126
23127 return n;
23128}
23129
23130static rb_node_cdecl_t *
23131rb_node_cdecl_new(struct parser_params *p, ID nd_vid, NODE *nd_value, NODE *nd_else, enum rb_parser_shareability shareability, const YYLTYPE *loc)
23132{
23133 rb_node_cdecl_t *n = NODE_NEWNODE(NODE_CDECL, rb_node_cdecl_t, loc);
23134 n->nd_vid = nd_vid;
23135 n->nd_value = nd_value;
23136 n->nd_else = nd_else;
23137 n->shareability = shareability;
23138
23139 return n;
23140}
23141
23142static rb_node_op_cdecl_t *
23143rb_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)
23144{
23145 rb_node_op_cdecl_t *n = NODE_NEWNODE(NODE_OP_CDECL, rb_node_op_cdecl_t, loc);
23146 n->nd_head = nd_head;
23147 n->nd_value = nd_value;
23148 n->nd_aid = nd_aid;
23149 n->shareability = shareability;
23150
23151 return n;
23152}
23153
23154static rb_node_error_t *
23155rb_node_error_new(struct parser_params *p, const YYLTYPE *loc)
23156{
23157 rb_node_error_t *n = NODE_NEWNODE(NODE_ERROR, rb_node_error_t, loc);
23158
23159 return n;
23160}
23161
23162static rb_node_break_t *
23163rb_node_break_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23164{
23165 rb_node_break_t *n = NODE_NEWNODE(NODE_BREAK, rb_node_break_t, loc);
23166 n->nd_stts = nd_stts;
23167 n->nd_chain = 0;
23168 n->keyword_loc = *keyword_loc;
23169
23170 return n;
23171}
23172
23173static rb_node_next_t *
23174rb_node_next_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23175{
23176 rb_node_next_t *n = NODE_NEWNODE(NODE_NEXT, rb_node_next_t, loc);
23177 n->nd_stts = nd_stts;
23178 n->nd_chain = 0;
23179 n->keyword_loc = *keyword_loc;
23180
23181 return n;
23182}
23183
23184static rb_node_redo_t *
23185rb_node_redo_new(struct parser_params *p, const YYLTYPE *loc, const YYLTYPE *keyword_loc)
23186{
23187 rb_node_redo_t *n = NODE_NEWNODE(NODE_REDO, rb_node_redo_t, loc);
23188 n->nd_chain = 0;
23189 n->keyword_loc = *keyword_loc;
23190
23191 return n;
23192}
23193
23194static rb_node_def_temp_t *
23195rb_node_def_temp_new(struct parser_params *p, const YYLTYPE *loc)
23196{
23197 rb_node_def_temp_t *n = NODE_NEWNODE((enum node_type)NODE_DEF_TEMP, rb_node_def_temp_t, loc);
23198 n->save.numparam_save = 0;
23199 n->save.max_numparam = 0;
23200 n->save.ctxt = p->ctxt;
23201 n->nd_def = 0;
23202 n->nd_mid = 0;
23203
23204 return n;
23205}
23206
23207static rb_node_def_temp_t *
23208def_head_save(struct parser_params *p, rb_node_def_temp_t *n)
23209{
23210 n->save.numparam_save = numparam_push(p);
23211 n->save.max_numparam = p->max_numparam;
23212 return n;
23213}
23214
23215#ifndef RIPPER
23216static enum node_type
23217nodetype(NODE *node) /* for debug */
23218{
23219 return (enum node_type)nd_type(node);
23220}
23221
23222static int
23223nodeline(NODE *node)
23224{
23225 return nd_line(node);
23226}
23227#endif
23228
23229static NODE*
23230newline_node(NODE *node)
23231{
23232 if (node) {
23233 node = remove_begin(node);
23234 nd_set_fl_newline(node);
23235 }
23236 return node;
23237}
23238
23239static void
23240fixpos(NODE *node, NODE *orig)
23241{
23242 if (!node) return;
23243 if (!orig) return;
23244 nd_set_line(node, nd_line(orig));
23245}
23246
23247static NODE*
23248block_append(struct parser_params *p, NODE *head, NODE *tail)
23249{
23250 NODE *end, *h = head, *nd;
23251
23252 if (tail == 0) return head;
23253
23254 if (h == 0) return tail;
23255 switch (nd_type(h)) {
23256 default:
23257 h = end = NEW_BLOCK(head, &head->nd_loc);
23258 head = end;
23259 break;
23260 case NODE_BLOCK:
23261 end = RNODE_BLOCK(h)->nd_end;
23262 break;
23263 }
23264
23265 nd = RNODE_BLOCK(end)->nd_head;
23266 switch (nd_type(nd)) {
23267 case NODE_RETURN:
23268 case NODE_BREAK:
23269 case NODE_NEXT:
23270 case NODE_REDO:
23271 case NODE_RETRY:
23272 rb_warning0L(nd_line(tail), "statement not reached");
23273 break;
23274
23275 default:
23276 break;
23277 }
23278
23279 if (!nd_type_p(tail, NODE_BLOCK)) {
23280 tail = NEW_BLOCK(tail, &tail->nd_loc);
23281 }
23282 RNODE_BLOCK(end)->nd_next = tail;
23283 RNODE_BLOCK(h)->nd_end = RNODE_BLOCK(tail)->nd_end;
23284 nd_set_last_loc(head, nd_last_loc(tail));
23285 return head;
23286}
23287
23288/* append item to the list */
23289static NODE*
23290list_append(struct parser_params *p, NODE *list, NODE *item)
23291{
23292 NODE *last;
23293
23294 if (list == 0) return NEW_LIST(item, &item->nd_loc);
23295 if (RNODE_LIST(list)->nd_next) {
23296 last = RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end;
23297 }
23298 else {
23299 last = list;
23300 }
23301
23302 RNODE_LIST(list)->as.nd_alen += 1;
23303 RNODE_LIST(last)->nd_next = NEW_LIST(item, &item->nd_loc);
23304 RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end = RNODE_LIST(last)->nd_next;
23305
23306 nd_set_last_loc(list, nd_last_loc(item));
23307
23308 return list;
23309}
23310
23311/* concat two lists */
23312static NODE*
23313list_concat(NODE *head, NODE *tail)
23314{
23315 NODE *last;
23316
23317 if (RNODE_LIST(head)->nd_next) {
23318 last = RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end;
23319 }
23320 else {
23321 last = head;
23322 }
23323
23324 RNODE_LIST(head)->as.nd_alen += RNODE_LIST(tail)->as.nd_alen;
23325 RNODE_LIST(last)->nd_next = tail;
23326 if (RNODE_LIST(tail)->nd_next) {
23327 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = RNODE_LIST(RNODE_LIST(tail)->nd_next)->as.nd_end;
23328 }
23329 else {
23330 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = tail;
23331 }
23332
23333 nd_set_last_loc(head, nd_last_loc(tail));
23334
23335 return head;
23336}
23337
23338static int
23339literal_concat0(struct parser_params *p, rb_parser_string_t *head, rb_parser_string_t *tail)
23340{
23341 if (!tail) return 1;
23342 if (!rb_parser_enc_compatible(p, head, tail)) {
23343 compile_error(p, "string literal encodings differ (%s / %s)",
23344 rb_enc_name(rb_parser_str_get_encoding(head)),
23345 rb_enc_name(rb_parser_str_get_encoding(tail)));
23346 rb_parser_str_resize(p, head, 0);
23347 rb_parser_str_resize(p, tail, 0);
23348 return 0;
23349 }
23350 rb_parser_str_buf_append(p, head, tail);
23351 return 1;
23352}
23353
23354static rb_parser_string_t *
23355string_literal_head(struct parser_params *p, enum node_type htype, NODE *head)
23356{
23357 if (htype != NODE_DSTR) return NULL;
23358 if (RNODE_DSTR(head)->nd_next) {
23359 head = RNODE_LIST(RNODE_LIST(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_head;
23360 if (!head || !nd_type_p(head, NODE_STR)) return NULL;
23361 }
23362 rb_parser_string_t *lit = RNODE_DSTR(head)->string;
23363 ASSUME(lit);
23364 return lit;
23365}
23366
23367#ifndef RIPPER
23368static rb_parser_string_t *
23369rb_parser_string_deep_copy(struct parser_params *p, const rb_parser_string_t *orig)
23370{
23371 rb_parser_string_t *copy;
23372 if (!orig) return NULL;
23373 copy = rb_parser_string_new(p, PARSER_STRING_PTR(orig), PARSER_STRING_LEN(orig));
23374 copy->coderange = orig->coderange;
23375 copy->enc = orig->enc;
23376 return copy;
23377}
23378#endif
23379
23380/* concat two string literals */
23381static NODE *
23382literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
23383{
23384 enum node_type htype;
23385 rb_parser_string_t *lit;
23386
23387 if (!head) return tail;
23388 if (!tail) return head;
23389
23390 htype = nd_type(head);
23391 if (htype == NODE_EVSTR) {
23392 head = new_dstr(p, head, loc);
23393 htype = NODE_DSTR;
23394 }
23395 if (p->heredoc_indent > 0) {
23396 switch (htype) {
23397 case NODE_STR:
23398 head = str2dstr(p, head);
23399 case NODE_DSTR:
23400 return list_append(p, head, tail);
23401 default:
23402 break;
23403 }
23404 }
23405 switch (nd_type(tail)) {
23406 case NODE_STR:
23407 if ((lit = string_literal_head(p, htype, head)) != false) {
23408 htype = NODE_STR;
23409 }
23410 else {
23411 lit = RNODE_DSTR(head)->string;
23412 }
23413 if (htype == NODE_STR) {
23414 if (!literal_concat0(p, lit, RNODE_STR(tail)->string)) {
23415 error:
23416 rb_discard_node(p, head);
23417 rb_discard_node(p, tail);
23418 return 0;
23419 }
23420 rb_discard_node(p, tail);
23421 }
23422 else {
23423 list_append(p, head, tail);
23424 }
23425 break;
23426
23427 case NODE_DSTR:
23428 if (htype == NODE_STR) {
23429 if (!literal_concat0(p, RNODE_STR(head)->string, RNODE_DSTR(tail)->string))
23430 goto error;
23431 rb_parser_string_free(p, RNODE_DSTR(tail)->string);
23432 RNODE_DSTR(tail)->string = RNODE_STR(head)->string;
23433 RNODE_STR(head)->string = NULL;
23434 rb_discard_node(p, head);
23435 head = tail;
23436 }
23437 else if (!RNODE_DSTR(tail)->string) {
23438 append:
23439 RNODE_DSTR(head)->as.nd_alen += RNODE_DSTR(tail)->as.nd_alen - 1;
23440 if (!RNODE_DSTR(head)->nd_next) {
23441 RNODE_DSTR(head)->nd_next = RNODE_DSTR(tail)->nd_next;
23442 }
23443 else if (RNODE_DSTR(tail)->nd_next) {
23444 RNODE_DSTR(RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_next = RNODE_DSTR(tail)->nd_next;
23445 RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end = RNODE_DSTR(RNODE_DSTR(tail)->nd_next)->as.nd_end;
23446 }
23447 rb_discard_node(p, tail);
23448 }
23449 else if ((lit = string_literal_head(p, htype, head)) != false) {
23450 if (!literal_concat0(p, lit, RNODE_DSTR(tail)->string))
23451 goto error;
23452 rb_parser_string_free(p, RNODE_DSTR(tail)->string);
23453 RNODE_DSTR(tail)->string = 0;
23454 goto append;
23455 }
23456 else {
23457 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));
23458 RNODE_DSTR(tail)->string = 0;
23459 }
23460 break;
23461
23462 case NODE_EVSTR:
23463 if (htype == NODE_STR) {
23464 head = str2dstr(p, head);
23465 RNODE_DSTR(head)->as.nd_alen = 1;
23466 }
23467 list_append(p, head, tail);
23468 break;
23469 }
23470 return head;
23471}
23472
23473static void
23474nd_copy_flag(NODE *new_node, NODE *old_node)
23475{
23476 if (nd_fl_newline(old_node)) nd_set_fl_newline(new_node);
23477 nd_set_line(new_node, nd_line(old_node));
23478 new_node->nd_loc = old_node->nd_loc;
23479 new_node->node_id = old_node->node_id;
23480}
23481
23482static NODE *
23483str2dstr(struct parser_params *p, NODE *node)
23484{
23485 NODE *new_node = (NODE *)NODE_NEW_INTERNAL(NODE_DSTR, rb_node_dstr_t);
23486 nd_copy_flag(new_node, node);
23487 RNODE_DSTR(new_node)->string = RNODE_STR(node)->string;
23488 RNODE_DSTR(new_node)->as.nd_alen = 0;
23489 RNODE_DSTR(new_node)->nd_next = 0;
23490 RNODE_STR(node)->string = 0;
23491
23492 return new_node;
23493}
23494
23495static NODE *
23496str2regx(struct parser_params *p, NODE *node, int options)
23497{
23498 NODE *new_node = (NODE *)NODE_NEW_INTERNAL(NODE_REGX, rb_node_regx_t);
23499 nd_copy_flag(new_node, node);
23500 RNODE_REGX(new_node)->string = RNODE_STR(node)->string;
23501 RNODE_REGX(new_node)->options = options;
23502 RNODE_STR(node)->string = 0;
23503
23504 return new_node;
23505}
23506
23507static NODE *
23508evstr2dstr(struct parser_params *p, NODE *node)
23509{
23510 if (nd_type_p(node, NODE_EVSTR)) {
23511 node = new_dstr(p, node, &node->nd_loc);
23512 }
23513 return node;
23514}
23515
23516static NODE *
23517new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23518{
23519 NODE *head = node;
23520
23521 if (node) {
23522 switch (nd_type(node)) {
23523 case NODE_STR:
23524 return str2dstr(p, node);
23525 case NODE_DSTR:
23526 break;
23527 case NODE_EVSTR:
23528 return node;
23529 }
23530 }
23531 return NEW_EVSTR(head, loc);
23532}
23533
23534static NODE *
23535new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23536{
23537 NODE *dstr = NEW_DSTR(STRING_NEW0(), loc);
23538 return list_append(p, dstr, node);
23539}
23540
23541static NODE *
23542call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
23543 const YYLTYPE *op_loc, const YYLTYPE *loc)
23544{
23545 NODE *expr;
23546 value_expr(recv);
23547 value_expr(arg1);
23548 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
23549 nd_set_line(expr, op_loc->beg_pos.lineno);
23550 return expr;
23551}
23552
23553static NODE *
23554call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
23555{
23556 NODE *opcall;
23557 value_expr(recv);
23558 opcall = NEW_OPCALL(recv, id, 0, loc);
23559 nd_set_line(opcall, op_loc->beg_pos.lineno);
23560 return opcall;
23561}
23562
23563static NODE *
23564new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
23565{
23566 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
23567 nd_set_line(qcall, op_loc->beg_pos.lineno);
23568 return qcall;
23569}
23570
23571static NODE*
23572new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
23573{
23574 NODE *ret;
23575 if (block) block_dup_check(p, args, block);
23576 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
23577 if (block) ret = method_add_block(p, ret, block, loc);
23578 fixpos(ret, recv);
23579 return ret;
23580}
23581
23582#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? RNODE_ONCE(node)->nd_body : node)
23583
23584static NODE*
23585last_expr_once_body(NODE *node)
23586{
23587 if (!node) return 0;
23588 return nd_once_body(node);
23589}
23590
23591static NODE*
23592match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
23593{
23594 NODE *n;
23595 int line = op_loc->beg_pos.lineno;
23596
23597 value_expr(node1);
23598 value_expr(node2);
23599
23600 if ((n = last_expr_once_body(node1)) != 0) {
23601 switch (nd_type(n)) {
23602 case NODE_DREGX:
23603 {
23604 NODE *match = NEW_MATCH2(node1, node2, loc);
23605 nd_set_line(match, line);
23606 return match;
23607 }
23608
23609 case NODE_REGX:
23610 {
23611 const VALUE lit = rb_node_regx_string_val(n);
23612 if (!NIL_P(lit)) {
23613 NODE *match = NEW_MATCH2(node1, node2, loc);
23614 RNODE_MATCH2(match)->nd_args = reg_named_capture_assign(p, lit, loc, assignable);
23615 nd_set_line(match, line);
23616 return match;
23617 }
23618 }
23619 }
23620 }
23621
23622 if ((n = last_expr_once_body(node2)) != 0) {
23623 NODE *match3;
23624
23625 switch (nd_type(n)) {
23626 case NODE_DREGX:
23627 match3 = NEW_MATCH3(node2, node1, loc);
23628 return match3;
23629 }
23630 }
23631
23632 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
23633 nd_set_line(n, line);
23634 return n;
23635}
23636
23637# if WARN_PAST_SCOPE
23638static int
23639past_dvar_p(struct parser_params *p, ID id)
23640{
23641 struct vtable *past = p->lvtbl->past;
23642 while (past) {
23643 if (vtable_included(past, id)) return 1;
23644 past = past->prev;
23645 }
23646 return 0;
23647}
23648# endif
23649
23650static int
23651numparam_nested_p(struct parser_params *p)
23652{
23653 struct local_vars *local = p->lvtbl;
23654 NODE *outer = local->numparam.outer;
23655 NODE *inner = local->numparam.inner;
23656 if (outer || inner) {
23657 NODE *used = outer ? outer : inner;
23658 compile_error(p, "numbered parameter is already used in\n"
23659 "%s:%d: %s block here",
23660 p->ruby_sourcefile, nd_line(used),
23661 outer ? "outer" : "inner");
23662 parser_show_error_line(p, &used->nd_loc);
23663 return 1;
23664 }
23665 return 0;
23666}
23667
23668static int
23669numparam_used_p(struct parser_params *p)
23670{
23671 NODE *numparam = p->lvtbl->numparam.current;
23672 if (numparam) {
23673 compile_error(p, "numbered parameter is already used in\n"
23674 "%s:%d: current block here",
23675 p->ruby_sourcefile, nd_line(numparam));
23676 parser_show_error_line(p, &numparam->nd_loc);
23677 return 1;
23678 }
23679 return 0;
23680}
23681
23682static int
23683it_used_p(struct parser_params *p)
23684{
23685 NODE *it = p->lvtbl->it;
23686 if (it) {
23687 compile_error(p, "'it' is already used in\n"
23688 "%s:%d: current block here",
23689 p->ruby_sourcefile, nd_line(it));
23690 parser_show_error_line(p, &it->nd_loc);
23691 return 1;
23692 }
23693 return 0;
23694}
23695
23696static NODE*
23697gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
23698{
23699 ID *vidp = NULL;
23700 NODE *node;
23701 switch (id) {
23702 case keyword_self:
23703 return NEW_SELF(loc);
23704 case keyword_nil:
23705 return NEW_NIL(loc);
23706 case keyword_true:
23707 return NEW_TRUE(loc);
23708 case keyword_false:
23709 return NEW_FALSE(loc);
23710 case keyword__FILE__:
23711 {
23712 VALUE file = p->ruby_sourcefile_string;
23713 if (NIL_P(file))
23714 file = rb_str_new(0, 0);
23715 node = NEW_FILE(file, loc);
23716 }
23717 return node;
23718 case keyword__LINE__:
23719 return NEW_LINE(loc);
23720 case keyword__ENCODING__:
23721 return NEW_ENCODING(loc);
23722
23723 }
23724 switch (id_type(id)) {
23725 case ID_LOCAL:
23726 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
23727 if (NUMPARAM_ID_P(id) && (numparam_nested_p(p) || it_used_p(p))) return 0;
23728 if (vidp) *vidp |= LVAR_USED;
23729 node = NEW_DVAR(id, loc);
23730 return node;
23731 }
23732 if (local_id_ref(p, id, &vidp)) {
23733 if (vidp) *vidp |= LVAR_USED;
23734 node = NEW_LVAR(id, loc);
23735 return node;
23736 }
23737 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
23738 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
23739 if (numparam_nested_p(p) || it_used_p(p)) return 0;
23740 node = NEW_DVAR(id, loc);
23741 struct local_vars *local = p->lvtbl;
23742 if (!local->numparam.current) local->numparam.current = node;
23743 return node;
23744 }
23745# if WARN_PAST_SCOPE
23746 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
23747 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
23748 }
23749# endif
23750 /* method call without arguments */
23751 if (dyna_in_block(p) && id == rb_intern("it") && !(DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev))) {
23752 if (numparam_used_p(p)) return 0;
23753 if (p->max_numparam == ORDINAL_PARAM) {
23754 compile_error(p, "ordinary parameter is defined");
23755 return 0;
23756 }
23757 if (!p->it_id) {
23758 p->it_id = internal_id(p);
23759 vtable_add(p->lvtbl->args, p->it_id);
23760 }
23761 NODE *node = NEW_DVAR(p->it_id, loc);
23762 if (!p->lvtbl->it) p->lvtbl->it = node;
23763 return node;
23764 }
23765 return NEW_VCALL(id, loc);
23766 case ID_GLOBAL:
23767 return NEW_GVAR(id, loc);
23768 case ID_INSTANCE:
23769 return NEW_IVAR(id, loc);
23770 case ID_CONST:
23771 return NEW_CONST(id, loc);
23772 case ID_CLASS:
23773 return NEW_CVAR(id, loc);
23774 }
23775 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
23776 return 0;
23777}
23778
23779static rb_node_opt_arg_t *
23780opt_arg_append(rb_node_opt_arg_t *opt_list, rb_node_opt_arg_t *opt)
23781{
23782 rb_node_opt_arg_t *opts = opt_list;
23783 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
23784
23785 while (opts->nd_next) {
23786 opts = opts->nd_next;
23787 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
23788 }
23789 opts->nd_next = opt;
23790
23791 return opt_list;
23792}
23793
23794static rb_node_kw_arg_t *
23795kwd_append(rb_node_kw_arg_t *kwlist, rb_node_kw_arg_t *kw)
23796{
23797 if (kwlist) {
23798 /* Assume rb_node_kw_arg_t and rb_node_opt_arg_t has same structure */
23799 opt_arg_append(RNODE_OPT_ARG(kwlist), RNODE_OPT_ARG(kw));
23800 }
23801 return kwlist;
23802}
23803
23804static NODE *
23805new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
23806{
23807 NODE *n = expr;
23808 while (n) {
23809 if (nd_type_p(n, NODE_BEGIN)) {
23810 n = RNODE_BEGIN(n)->nd_body;
23811 }
23812 else if (nd_type_p(n, NODE_BLOCK) && RNODE_BLOCK(n)->nd_end == n) {
23813 n = RNODE_BLOCK(n)->nd_head;
23814 }
23815 else {
23816 break;
23817 }
23818 }
23819 return NEW_DEFINED(n, loc);
23820}
23821
23822static NODE*
23823str_to_sym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23824{
23825 VALUE lit;
23826 rb_parser_string_t *str = RNODE_STR(node)->string;
23827 if (rb_parser_enc_str_coderange(p, str) == RB_PARSER_ENC_CODERANGE_BROKEN) {
23828 yyerror1(loc, "invalid symbol");
23829 lit = STR_NEW0();
23830 }
23831 else {
23832 lit = rb_str_new_parser_string(str);
23833 }
23834 return NEW_SYM(lit, loc);
23835}
23836
23837static NODE*
23838symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
23839{
23840 enum node_type type = nd_type(symbol);
23841 switch (type) {
23842 case NODE_DSTR:
23843 nd_set_type(symbol, NODE_DSYM);
23844 break;
23845 case NODE_STR:
23846 symbol = str_to_sym_node(p, symbol, &RNODE(symbol)->nd_loc);
23847 break;
23848 default:
23849 compile_error(p, "unexpected node as symbol: %s", parser_node_name(type));
23850 }
23851 return list_append(p, symbols, symbol);
23852}
23853
23854static NODE *
23855new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
23856{
23857 struct RNode_LIST *list;
23858 NODE *prev;
23859
23860 if (!node) {
23861 /* Check string is valid regex */
23862 rb_parser_string_t *str = STRING_NEW0();
23863 reg_compile(p, str, options);
23864 node = NEW_REGX(str, options, loc);
23865 return node;
23866 }
23867 switch (nd_type(node)) {
23868 case NODE_STR:
23869 {
23870 /* Check string is valid regex */
23871 reg_compile(p, RNODE_STR(node)->string, options);
23872 node = str2regx(p, node, options);
23873 }
23874 break;
23875 default:
23876 node = NEW_DSTR0(STRING_NEW0(), 1, NEW_LIST(node, loc), loc);
23877 /* fall through */
23878 case NODE_DSTR:
23879 nd_set_type(node, NODE_DREGX);
23880 nd_set_loc(node, loc);
23881 rb_node_dregx_t *const dreg = RNODE_DREGX(node);
23882 dreg->as.nd_cflag = options & RE_OPTION_MASK;
23883 if (dreg->string) reg_fragment_check(p, dreg->string, options);
23884 prev = node;
23885 for (list = dreg->nd_next; list; list = RNODE_LIST(list->nd_next)) {
23886 NODE *frag = list->nd_head;
23887 enum node_type type = nd_type(frag);
23888 if (type == NODE_STR || (type == NODE_DSTR && !RNODE_DSTR(frag)->nd_next)) {
23889 rb_parser_string_t *tail = RNODE_STR(frag)->string;
23890 if (reg_fragment_check(p, tail, options) && prev && RNODE_DREGX(prev)->string) {
23891 rb_parser_string_t *lit = prev == node ? dreg->string : RNODE_STR(RNODE_LIST(prev)->nd_head)->string;
23892 if (!literal_concat0(p, lit, tail)) {
23893 return NEW_NIL(loc); /* dummy node on error */
23894 }
23895 rb_parser_str_resize(p, tail, 0);
23896 RNODE_LIST(prev)->nd_next = list->nd_next;
23897 rb_discard_node(p, list->nd_head);
23898 rb_discard_node(p, (NODE *)list);
23899 list = RNODE_LIST(prev);
23900 }
23901 else {
23902 prev = (NODE *)list;
23903 }
23904 }
23905 else {
23906 prev = 0;
23907 }
23908 }
23909 if (!dreg->nd_next) {
23910 /* Check string is valid regex */
23911 reg_compile(p, dreg->string, options);
23912 }
23913 if (options & RE_OPTION_ONCE) {
23914 node = NEW_ONCE(node, loc);
23915 }
23916 break;
23917 }
23918 return node;
23919}
23920
23921static rb_node_kw_arg_t *
23922new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
23923{
23924 if (!k) return 0;
23925 return NEW_KW_ARG((k), loc);
23926}
23927
23928static NODE *
23929new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23930{
23931 if (!node) {
23932 NODE *xstr = NEW_XSTR(STRING_NEW0(), loc);
23933 return xstr;
23934 }
23935 switch (nd_type(node)) {
23936 case NODE_STR:
23937 nd_set_type(node, NODE_XSTR);
23938 nd_set_loc(node, loc);
23939 break;
23940 case NODE_DSTR:
23941 nd_set_type(node, NODE_DXSTR);
23942 nd_set_loc(node, loc);
23943 break;
23944 default:
23945 node = NEW_DXSTR(0, 1, NEW_LIST(node, loc), loc);
23946 break;
23947 }
23948 return node;
23949}
23950
23951static const
23952struct st_hash_type literal_type = {
23953 literal_cmp,
23954 literal_hash,
23955};
23956
23957static int nd_type_st_key_enable_p(NODE *node);
23958
23959static void
23960check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
23961{
23962 /* See https://bugs.ruby-lang.org/issues/20331 for discussion about what is warned. */
23963 if (!arg || !p->case_labels) return;
23964 if (!nd_type_st_key_enable_p(arg)) return;
23965
23966 if (p->case_labels == CHECK_LITERAL_WHEN) {
23967 p->case_labels = st_init_table(&literal_type);
23968 }
23969 else {
23970 st_data_t line;
23971 if (st_lookup(p->case_labels, (st_data_t)arg, &line)) {
23972 rb_warning2("'when' clause on line %d duplicates 'when' clause on line %d and is ignored",
23973 WARN_I((int)nd_line(arg)), WARN_I((int)line));
23974 return;
23975 }
23976 }
23977 st_insert(p->case_labels, (st_data_t)arg, (st_data_t)p->ruby_sourceline);
23978}
23979
23980#ifdef RIPPER
23981static int
23982id_is_var(struct parser_params *p, ID id)
23983{
23984 if (is_notop_id(id)) {
23985 switch (id & ID_SCOPE_MASK) {
23986 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
23987 return 1;
23988 case ID_LOCAL:
23989 if (dyna_in_block(p)) {
23990 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
23991 }
23992 if (local_id(p, id)) return 1;
23993 /* method call without arguments */
23994 return 0;
23995 }
23996 }
23997 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
23998 return 0;
23999}
24000#endif
24001
24002static inline enum lex_state_e
24003parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
24004{
24005 if (p->debug) {
24006 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
24007 }
24008 return p->lex.state = ls;
24009}
24010
24011#ifndef RIPPER
24012static void
24013flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
24014{
24015 VALUE mesg = p->debug_buffer;
24016
24017 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
24018 p->debug_buffer = Qnil;
24019 rb_io_puts(1, &mesg, out);
24020 }
24021 if (!NIL_P(str) && RSTRING_LEN(str)) {
24022 rb_io_write(p->debug_output, str);
24023 }
24024}
24025
24026static const char rb_parser_lex_state_names[][8] = {
24027 "BEG", "END", "ENDARG", "ENDFN", "ARG",
24028 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
24029 "LABEL", "LABELED","FITEM",
24030};
24031
24032static VALUE
24033append_lex_state_name(struct parser_params *p, enum lex_state_e state, VALUE buf)
24034{
24035 int i, sep = 0;
24036 unsigned int mask = 1;
24037 static const char none[] = "NONE";
24038
24039 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
24040 if ((unsigned)state & mask) {
24041 if (sep) {
24042 rb_str_cat(buf, "|", 1);
24043 }
24044 sep = 1;
24045 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
24046 }
24047 }
24048 if (!sep) {
24049 rb_str_cat(buf, none, sizeof(none)-1);
24050 }
24051 return buf;
24052}
24053
24054enum lex_state_e
24055rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
24056 enum lex_state_e to, int line)
24057{
24058 VALUE mesg;
24059 mesg = rb_str_new_cstr("lex_state: ");
24060 append_lex_state_name(p, from, mesg);
24061 rb_str_cat_cstr(mesg, " -> ");
24062 append_lex_state_name(p, to, mesg);
24063 rb_str_catf(mesg, " at line %d\n", line);
24064 flush_debug_buffer(p, p->debug_output, mesg);
24065 return to;
24066}
24067
24068VALUE
24069rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state)
24070{
24071 return rb_str_to_interned_str(append_lex_state_name(p, state, rb_str_new(0, 0)));
24072}
24073
24074static void
24075append_bitstack_value(struct parser_params *p, stack_type stack, VALUE mesg)
24076{
24077 if (stack == 0) {
24078 rb_str_cat_cstr(mesg, "0");
24079 }
24080 else {
24081 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
24082 for (; mask && !(stack & mask); mask >>= 1) continue;
24083 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
24084 }
24085}
24086
24087void
24088rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
24089 const char *name, int line)
24090{
24091 VALUE mesg = rb_sprintf("%s: ", name);
24092 append_bitstack_value(p, stack, mesg);
24093 rb_str_catf(mesg, " at line %d\n", line);
24094 flush_debug_buffer(p, p->debug_output, mesg);
24095}
24096
24097void
24098rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
24099{
24100 va_list ap;
24101 VALUE mesg = rb_str_new_cstr("internal parser error: ");
24102
24103 va_start(ap, fmt);
24104 rb_str_vcatf(mesg, fmt, ap);
24105 va_end(ap);
24106 yyerror0(RSTRING_PTR(mesg));
24107 RB_GC_GUARD(mesg);
24108
24109 mesg = rb_str_new(0, 0);
24110 append_lex_state_name(p, p->lex.state, mesg);
24111 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
24112 rb_str_resize(mesg, 0);
24113 append_bitstack_value(p, p->cond_stack, mesg);
24114 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
24115 rb_str_resize(mesg, 0);
24116 append_bitstack_value(p, p->cmdarg_stack, mesg);
24117 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
24118 if (p->debug_output == rb_ractor_stdout())
24119 p->debug_output = rb_ractor_stderr();
24120 p->debug = TRUE;
24121}
24122
24123static YYLTYPE *
24124rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
24125{
24126 yylloc->beg_pos.lineno = sourceline;
24127 yylloc->beg_pos.column = beg_pos;
24128 yylloc->end_pos.lineno = sourceline;
24129 yylloc->end_pos.column = end_pos;
24130 return yylloc;
24131}
24132
24133YYLTYPE *
24134rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
24135{
24136 int sourceline = here->sourceline;
24137 int beg_pos = (int)here->offset - here->quote
24138 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
24139 int end_pos = (int)here->offset + here->length + here->quote;
24140
24141 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24142}
24143
24144YYLTYPE *
24145rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc)
24146{
24147 yylloc->beg_pos.lineno = p->delayed.beg_line;
24148 yylloc->beg_pos.column = p->delayed.beg_col;
24149 yylloc->end_pos.lineno = p->delayed.end_line;
24150 yylloc->end_pos.column = p->delayed.end_col;
24151
24152 return yylloc;
24153}
24154
24155YYLTYPE *
24156rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc)
24157{
24158 int sourceline = p->ruby_sourceline;
24159 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
24160 int end_pos = (int)(p->lex.pend - p->lex.pbeg);
24161 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24162}
24163
24164YYLTYPE *
24165rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc)
24166{
24167 yylloc->end_pos = yylloc->beg_pos;
24168
24169 return yylloc;
24170}
24171
24172YYLTYPE *
24173rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
24174{
24175 int sourceline = p->ruby_sourceline;
24176 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
24177 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
24178 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24179}
24180
24181YYLTYPE *
24182rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
24183{
24184 int sourceline = p->ruby_sourceline;
24185 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
24186 int end_pos = (int)(p->lex.pcur - p->lex.pbeg);
24187 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
24188}
24189#endif /* !RIPPER */
24190
24191static int
24192assignable0(struct parser_params *p, ID id, const char **err)
24193{
24194 if (!id) return -1;
24195 switch (id) {
24196 case keyword_self:
24197 *err = "Can't change the value of self";
24198 return -1;
24199 case keyword_nil:
24200 *err = "Can't assign to nil";
24201 return -1;
24202 case keyword_true:
24203 *err = "Can't assign to true";
24204 return -1;
24205 case keyword_false:
24206 *err = "Can't assign to false";
24207 return -1;
24208 case keyword__FILE__:
24209 *err = "Can't assign to __FILE__";
24210 return -1;
24211 case keyword__LINE__:
24212 *err = "Can't assign to __LINE__";
24213 return -1;
24214 case keyword__ENCODING__:
24215 *err = "Can't assign to __ENCODING__";
24216 return -1;
24217 }
24218 switch (id_type(id)) {
24219 case ID_LOCAL:
24220 if (dyna_in_block(p)) {
24221 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
24222 compile_error(p, "Can't assign to numbered parameter _%d",
24223 NUMPARAM_ID_TO_IDX(id));
24224 return -1;
24225 }
24226 if (dvar_curr(p, id)) return NODE_DASGN;
24227 if (dvar_defined(p, id)) return NODE_DASGN;
24228 if (local_id(p, id)) return NODE_LASGN;
24229 dyna_var(p, id);
24230 return NODE_DASGN;
24231 }
24232 else {
24233 if (!local_id(p, id)) local_var(p, id);
24234 return NODE_LASGN;
24235 }
24236 break;
24237 case ID_GLOBAL: return NODE_GASGN;
24238 case ID_INSTANCE: return NODE_IASGN;
24239 case ID_CONST:
24240 if (!p->ctxt.in_def) return NODE_CDECL;
24241 *err = "dynamic constant assignment";
24242 return -1;
24243 case ID_CLASS: return NODE_CVASGN;
24244 default:
24245 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
24246 }
24247 return -1;
24248}
24249
24250static NODE*
24251assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
24252{
24253 const char *err = 0;
24254 int node_type = assignable0(p, id, &err);
24255 switch (node_type) {
24256 case NODE_DASGN: return NEW_DASGN(id, val, loc);
24257 case NODE_LASGN: return NEW_LASGN(id, val, loc);
24258 case NODE_GASGN: return NEW_GASGN(id, val, loc);
24259 case NODE_IASGN: return NEW_IASGN(id, val, loc);
24260 case NODE_CDECL: return NEW_CDECL(id, val, 0, p->ctxt.shareable_constant_value, loc);
24261 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
24262 }
24263/* TODO: FIXME */
24264#ifndef RIPPER
24265 if (err) yyerror1(loc, err);
24266#else
24267 if (err) set_value(assign_error(p, err, p->s_lvalue));
24268#endif
24269 return NEW_ERROR(loc);
24270}
24271
24272static int
24273is_private_local_id(struct parser_params *p, ID name)
24274{
24275 VALUE s;
24276 if (name == idUScore) return 1;
24277 if (!is_local_id(name)) return 0;
24278 s = rb_id2str(name);
24279 if (!s) return 0;
24280 return RSTRING_PTR(s)[0] == '_';
24281}
24282
24283static int
24284shadowing_lvar_0(struct parser_params *p, ID name)
24285{
24286 if (dyna_in_block(p)) {
24287 if (dvar_curr(p, name)) {
24288 if (is_private_local_id(p, name)) return 1;
24289 yyerror0("duplicated argument name");
24290 }
24291 else if (dvar_defined(p, name) || local_id(p, name)) {
24292 vtable_add(p->lvtbl->vars, name);
24293 if (p->lvtbl->used) {
24294 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
24295 }
24296 return 0;
24297 }
24298 }
24299 else {
24300 if (local_id(p, name)) {
24301 if (is_private_local_id(p, name)) return 1;
24302 yyerror0("duplicated argument name");
24303 }
24304 }
24305 return 1;
24306}
24307
24308static ID
24309shadowing_lvar(struct parser_params *p, ID name)
24310{
24311 shadowing_lvar_0(p, name);
24312 return name;
24313}
24314
24315static void
24316new_bv(struct parser_params *p, ID name)
24317{
24318 if (!name) return;
24319 if (!is_local_id(name)) {
24320 compile_error(p, "invalid local variable - %"PRIsVALUE,
24321 rb_id2str(name));
24322 return;
24323 }
24324 if (!shadowing_lvar_0(p, name)) return;
24325 dyna_var(p, name);
24326 ID *vidp = 0;
24327 if (dvar_defined_ref(p, name, &vidp)) {
24328 if (vidp) *vidp |= LVAR_USED;
24329 }
24330}
24331
24332static void
24333aryset_check(struct parser_params *p, NODE *args)
24334{
24335 NODE *block = 0, *kwds = 0;
24336 if (args && nd_type_p(args, NODE_BLOCK_PASS)) {
24337 block = RNODE_BLOCK_PASS(args)->nd_body;
24338 args = RNODE_BLOCK_PASS(args)->nd_head;
24339 }
24340 if (args && nd_type_p(args, NODE_ARGSCAT)) {
24341 args = RNODE_ARGSCAT(args)->nd_body;
24342 }
24343 if (args && nd_type_p(args, NODE_ARGSPUSH)) {
24344 kwds = RNODE_ARGSPUSH(args)->nd_body;
24345 }
24346 else {
24347 for (NODE *next = args; next && nd_type_p(next, NODE_LIST);
24348 next = RNODE_LIST(next)->nd_next) {
24349 kwds = RNODE_LIST(next)->nd_head;
24350 }
24351 }
24352 if (kwds && nd_type_p(kwds, NODE_HASH) && !RNODE_HASH(kwds)->nd_brace) {
24353 yyerror1(&kwds->nd_loc, "keyword arg given in index assignment");
24354 }
24355 if (block) {
24356 yyerror1(&block->nd_loc, "block arg given in index assignment");
24357 }
24358}
24359
24360static NODE *
24361aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
24362{
24363 aryset_check(p, idx);
24364 return NEW_ATTRASGN(recv, tASET, idx, loc);
24365}
24366
24367static void
24368block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
24369{
24370 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
24371 compile_error(p, "both block arg and actual block given");
24372 }
24373}
24374
24375static NODE *
24376attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
24377{
24378 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
24379 return NEW_ATTRASGN(recv, id, 0, loc);
24380}
24381
24382static VALUE
24383rb_backref_error(struct parser_params *p, NODE *node)
24384{
24385#ifndef RIPPER
24386# define ERR(...) (compile_error(p, __VA_ARGS__), Qtrue)
24387#else
24388# define ERR(...) rb_sprintf(__VA_ARGS__)
24389#endif
24390 switch (nd_type(node)) {
24391 case NODE_NTH_REF:
24392 return ERR("Can't set variable $%ld", RNODE_NTH_REF(node)->nd_nth);
24393 case NODE_BACK_REF:
24394 return ERR("Can't set variable $%c", (int)RNODE_BACK_REF(node)->nd_nth);
24395 }
24396#undef ERR
24397 UNREACHABLE_RETURN(Qfalse); /* only called on syntax error */
24398}
24399
24400static NODE *
24401arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
24402{
24403 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
24404 switch (nd_type(node1)) {
24405 case NODE_LIST:
24406 return list_append(p, node1, node2);
24407 case NODE_BLOCK_PASS:
24408 RNODE_BLOCK_PASS(node1)->nd_head = arg_append(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
24409 node1->nd_loc.end_pos = RNODE_BLOCK_PASS(node1)->nd_head->nd_loc.end_pos;
24410 return node1;
24411 case NODE_ARGSPUSH:
24412 RNODE_ARGSPUSH(node1)->nd_body = list_append(p, NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, &RNODE_ARGSPUSH(node1)->nd_body->nd_loc), node2);
24413 node1->nd_loc.end_pos = RNODE_ARGSPUSH(node1)->nd_body->nd_loc.end_pos;
24414 nd_set_type(node1, NODE_ARGSCAT);
24415 return node1;
24416 case NODE_ARGSCAT:
24417 if (!nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
24418 RNODE_ARGSCAT(node1)->nd_body = list_append(p, RNODE_ARGSCAT(node1)->nd_body, node2);
24419 node1->nd_loc.end_pos = RNODE_ARGSCAT(node1)->nd_body->nd_loc.end_pos;
24420 return node1;
24421 }
24422 return NEW_ARGSPUSH(node1, node2, loc);
24423}
24424
24425static NODE *
24426arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
24427{
24428 if (!node2) return node1;
24429 switch (nd_type(node1)) {
24430 case NODE_BLOCK_PASS:
24431 if (RNODE_BLOCK_PASS(node1)->nd_head)
24432 RNODE_BLOCK_PASS(node1)->nd_head = arg_concat(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
24433 else
24434 RNODE_LIST(node1)->nd_head = NEW_LIST(node2, loc);
24435 return node1;
24436 case NODE_ARGSPUSH:
24437 if (!nd_type_p(node2, NODE_LIST)) break;
24438 RNODE_ARGSPUSH(node1)->nd_body = list_concat(NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, loc), node2);
24439 nd_set_type(node1, NODE_ARGSCAT);
24440 return node1;
24441 case NODE_ARGSCAT:
24442 if (!nd_type_p(node2, NODE_LIST) ||
24443 !nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
24444 RNODE_ARGSCAT(node1)->nd_body = list_concat(RNODE_ARGSCAT(node1)->nd_body, node2);
24445 return node1;
24446 }
24447 return NEW_ARGSCAT(node1, node2, loc);
24448}
24449
24450static NODE *
24451last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
24452{
24453 NODE *n1;
24454 if ((n1 = splat_array(args)) != 0) {
24455 return list_append(p, n1, last_arg);
24456 }
24457 return arg_append(p, args, last_arg, loc);
24458}
24459
24460static NODE *
24461rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
24462{
24463 NODE *n1;
24464 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
24465 return list_concat(n1, rest_arg);
24466 }
24467 return arg_concat(p, args, rest_arg, loc);
24468}
24469
24470static NODE *
24471splat_array(NODE* node)
24472{
24473 if (nd_type_p(node, NODE_SPLAT)) node = RNODE_SPLAT(node)->nd_head;
24474 if (nd_type_p(node, NODE_LIST)) return node;
24475 return 0;
24476}
24477
24478static void
24479mark_lvar_used(struct parser_params *p, NODE *rhs)
24480{
24481 ID *vidp = NULL;
24482 if (!rhs) return;
24483 switch (nd_type(rhs)) {
24484 case NODE_LASGN:
24485 if (local_id_ref(p, RNODE_LASGN(rhs)->nd_vid, &vidp)) {
24486 if (vidp) *vidp |= LVAR_USED;
24487 }
24488 break;
24489 case NODE_DASGN:
24490 if (dvar_defined_ref(p, RNODE_DASGN(rhs)->nd_vid, &vidp)) {
24491 if (vidp) *vidp |= LVAR_USED;
24492 }
24493 break;
24494#if 0
24495 case NODE_MASGN:
24496 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
24497 mark_lvar_used(p, rhs->nd_head);
24498 }
24499 break;
24500#endif
24501 }
24502}
24503
24504static int is_static_content(NODE *node);
24505
24506static NODE *
24507node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
24508{
24509 if (!lhs) return 0;
24510
24511 switch (nd_type(lhs)) {
24512 case NODE_CDECL:
24513 case NODE_GASGN:
24514 case NODE_IASGN:
24515 case NODE_LASGN:
24516 case NODE_DASGN:
24517 case NODE_MASGN:
24518 case NODE_CVASGN:
24519 set_nd_value(p, lhs, rhs);
24520 nd_set_loc(lhs, loc);
24521 break;
24522
24523 case NODE_ATTRASGN:
24524 RNODE_ATTRASGN(lhs)->nd_args = arg_append(p, RNODE_ATTRASGN(lhs)->nd_args, rhs, loc);
24525 nd_set_loc(lhs, loc);
24526 break;
24527
24528 default:
24529 /* should not happen */
24530 break;
24531 }
24532
24533 return lhs;
24534}
24535
24536static NODE *
24537value_expr_check(struct parser_params *p, NODE *node)
24538{
24539 NODE *void_node = 0, *vn;
24540
24541 if (!node) {
24542 rb_warning0("empty expression");
24543 }
24544 while (node) {
24545 switch (nd_type(node)) {
24546 case NODE_ENSURE:
24547 vn = RNODE_ENSURE(node)->nd_head;
24548 node = RNODE_ENSURE(node)->nd_ensr;
24549 /* nd_ensr should not be NULL, check it out next */
24550 if (vn && (vn = value_expr_check(p, vn))) {
24551 goto found;
24552 }
24553 break;
24554
24555 case NODE_RESCUE:
24556 /* void only if all children are void */
24557 vn = RNODE_RESCUE(node)->nd_head;
24558 if (!vn || !(vn = value_expr_check(p, vn))) return NULL;
24559 if (!void_node) void_node = vn;
24560 for (NODE *r = RNODE_RESCUE(node)->nd_resq; r; r = RNODE_RESBODY(r)->nd_next) {
24561 if (!nd_type_p(r, NODE_RESBODY)) {
24562 compile_error(p, "unexpected node");
24563 return NULL;
24564 }
24565 if (!(vn = value_expr_check(p, RNODE_RESBODY(r)->nd_body))) {
24566 void_node = 0;
24567 break;
24568 }
24569 if (!void_node) void_node = vn;
24570 }
24571 node = RNODE_RESCUE(node)->nd_else;
24572 if (!node) return void_node;
24573 break;
24574
24575 case NODE_RETURN:
24576 case NODE_BREAK:
24577 case NODE_NEXT:
24578 case NODE_REDO:
24579 case NODE_RETRY:
24580 goto found;
24581
24582 case NODE_CASE3:
24583 if (!RNODE_CASE3(node)->nd_body || !nd_type_p(RNODE_CASE3(node)->nd_body, NODE_IN)) {
24584 compile_error(p, "unexpected node");
24585 return NULL;
24586 }
24587 if (RNODE_IN(RNODE_CASE3(node)->nd_body)->nd_body) {
24588 return NULL;
24589 }
24590 /* single line pattern matching with "=>" operator */
24591 goto found;
24592
24593 case NODE_BLOCK:
24594 while (RNODE_BLOCK(node)->nd_next) {
24595 node = RNODE_BLOCK(node)->nd_next;
24596 }
24597 node = RNODE_BLOCK(node)->nd_head;
24598 break;
24599
24600 case NODE_BEGIN:
24601 node = RNODE_BEGIN(node)->nd_body;
24602 break;
24603
24604 case NODE_IF:
24605 case NODE_UNLESS:
24606 if (!RNODE_IF(node)->nd_body) {
24607 return NULL;
24608 }
24609 else if (!RNODE_IF(node)->nd_else) {
24610 return NULL;
24611 }
24612 vn = value_expr_check(p, RNODE_IF(node)->nd_body);
24613 if (!vn) return NULL;
24614 if (!void_node) void_node = vn;
24615 node = RNODE_IF(node)->nd_else;
24616 break;
24617
24618 case NODE_AND:
24619 case NODE_OR:
24620 node = RNODE_AND(node)->nd_1st;
24621 break;
24622
24623 case NODE_LASGN:
24624 case NODE_DASGN:
24625 case NODE_MASGN:
24626 mark_lvar_used(p, node);
24627 return NULL;
24628
24629 default:
24630 return NULL;
24631 }
24632 }
24633
24634 return NULL;
24635
24636 found:
24637 /* return the first found node */
24638 return void_node ? void_node : node;
24639}
24640
24641static int
24642value_expr_gen(struct parser_params *p, NODE *node)
24643{
24644 NODE *void_node = value_expr_check(p, node);
24645 if (void_node) {
24646 yyerror1(&void_node->nd_loc, "void value expression");
24647 /* or "control never reach"? */
24648 return FALSE;
24649 }
24650 return TRUE;
24651}
24652
24653static void
24654void_expr(struct parser_params *p, NODE *node)
24655{
24656 const char *useless = 0;
24657
24658 if (!RTEST(ruby_verbose)) return;
24659
24660 if (!node || !(node = nd_once_body(node))) return;
24661 switch (nd_type(node)) {
24662 case NODE_OPCALL:
24663 switch (RNODE_OPCALL(node)->nd_mid) {
24664 case '+':
24665 case '-':
24666 case '*':
24667 case '/':
24668 case '%':
24669 case tPOW:
24670 case tUPLUS:
24671 case tUMINUS:
24672 case '|':
24673 case '^':
24674 case '&':
24675 case tCMP:
24676 case '>':
24677 case tGEQ:
24678 case '<':
24679 case tLEQ:
24680 case tEQ:
24681 case tNEQ:
24682 useless = rb_id2name(RNODE_OPCALL(node)->nd_mid);
24683 break;
24684 }
24685 break;
24686
24687 case NODE_LVAR:
24688 case NODE_DVAR:
24689 case NODE_GVAR:
24690 case NODE_IVAR:
24691 case NODE_CVAR:
24692 case NODE_NTH_REF:
24693 case NODE_BACK_REF:
24694 useless = "a variable";
24695 break;
24696 case NODE_CONST:
24697 useless = "a constant";
24698 break;
24699 case NODE_SYM:
24700 case NODE_LINE:
24701 case NODE_FILE:
24702 case NODE_ENCODING:
24703 case NODE_INTEGER:
24704 case NODE_FLOAT:
24705 case NODE_RATIONAL:
24706 case NODE_IMAGINARY:
24707 case NODE_STR:
24708 case NODE_DSTR:
24709 case NODE_REGX:
24710 case NODE_DREGX:
24711 useless = "a literal";
24712 break;
24713 case NODE_COLON2:
24714 case NODE_COLON3:
24715 useless = "::";
24716 break;
24717 case NODE_DOT2:
24718 useless = "..";
24719 break;
24720 case NODE_DOT3:
24721 useless = "...";
24722 break;
24723 case NODE_SELF:
24724 useless = "self";
24725 break;
24726 case NODE_NIL:
24727 useless = "nil";
24728 break;
24729 case NODE_TRUE:
24730 useless = "true";
24731 break;
24732 case NODE_FALSE:
24733 useless = "false";
24734 break;
24735 case NODE_DEFINED:
24736 useless = "defined?";
24737 break;
24738 }
24739
24740 if (useless) {
24741 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
24742 }
24743}
24744
24745/* warns useless use of block and returns the last statement node */
24746static NODE *
24747void_stmts(struct parser_params *p, NODE *node)
24748{
24749 NODE *const n = node;
24750 if (!RTEST(ruby_verbose)) return n;
24751 if (!node) return n;
24752 if (!nd_type_p(node, NODE_BLOCK)) return n;
24753
24754 while (RNODE_BLOCK(node)->nd_next) {
24755 void_expr(p, RNODE_BLOCK(node)->nd_head);
24756 node = RNODE_BLOCK(node)->nd_next;
24757 }
24758 return RNODE_BLOCK(node)->nd_head;
24759}
24760
24761static NODE *
24762remove_begin(NODE *node)
24763{
24764 NODE **n = &node, *n1 = node;
24765 while (n1 && nd_type_p(n1, NODE_BEGIN) && RNODE_BEGIN(n1)->nd_body) {
24766 *n = n1 = RNODE_BEGIN(n1)->nd_body;
24767 }
24768 return node;
24769}
24770
24771static void
24772reduce_nodes(struct parser_params *p, NODE **body)
24773{
24774 NODE *node = *body;
24775
24776 if (!node) {
24777 *body = NEW_NIL(&NULL_LOC);
24778 return;
24779 }
24780#define subnodes(type, n1, n2) \
24781 ((!type(node)->n1) ? (type(node)->n2 ? (body = &type(node)->n2, 1) : 0) : \
24782 (!type(node)->n2) ? (body = &type(node)->n1, 1) : \
24783 (reduce_nodes(p, &type(node)->n1), body = &type(node)->n2, 1))
24784
24785 while (node) {
24786 int newline = (int)nd_fl_newline(node);
24787 switch (nd_type(node)) {
24788 end:
24789 case NODE_NIL:
24790 *body = 0;
24791 return;
24792 case NODE_BEGIN:
24793 *body = node = RNODE_BEGIN(node)->nd_body;
24794 if (newline && node) nd_set_fl_newline(node);
24795 continue;
24796 case NODE_BLOCK:
24797 body = &RNODE_BLOCK(RNODE_BLOCK(node)->nd_end)->nd_head;
24798 break;
24799 case NODE_IF:
24800 case NODE_UNLESS:
24801 if (subnodes(RNODE_IF, nd_body, nd_else)) break;
24802 return;
24803 case NODE_CASE:
24804 body = &RNODE_CASE(node)->nd_body;
24805 break;
24806 case NODE_WHEN:
24807 if (!subnodes(RNODE_WHEN, nd_body, nd_next)) goto end;
24808 break;
24809 case NODE_ENSURE:
24810 body = &RNODE_ENSURE(node)->nd_head;
24811 break;
24812 case NODE_RESCUE:
24813 newline = 0; // RESBODY should not be a NEWLINE
24814 if (RNODE_RESCUE(node)->nd_else) {
24815 body = &RNODE_RESCUE(node)->nd_resq;
24816 break;
24817 }
24818 if (!subnodes(RNODE_RESCUE, nd_head, nd_resq)) goto end;
24819 break;
24820 default:
24821 return;
24822 }
24823 node = *body;
24824 if (newline && node) nd_set_fl_newline(node);
24825 }
24826
24827#undef subnodes
24828}
24829
24830static int
24831is_static_content(NODE *node)
24832{
24833 if (!node) return 1;
24834 switch (nd_type(node)) {
24835 case NODE_HASH:
24836 if (!(node = RNODE_HASH(node)->nd_head)) break;
24837 case NODE_LIST:
24838 do {
24839 if (!is_static_content(RNODE_LIST(node)->nd_head)) return 0;
24840 } while ((node = RNODE_LIST(node)->nd_next) != 0);
24841 case NODE_SYM:
24842 case NODE_REGX:
24843 case NODE_LINE:
24844 case NODE_FILE:
24845 case NODE_ENCODING:
24846 case NODE_INTEGER:
24847 case NODE_FLOAT:
24848 case NODE_RATIONAL:
24849 case NODE_IMAGINARY:
24850 case NODE_STR:
24851 case NODE_NIL:
24852 case NODE_TRUE:
24853 case NODE_FALSE:
24854 case NODE_ZLIST:
24855 break;
24856 default:
24857 return 0;
24858 }
24859 return 1;
24860}
24861
24862static int
24863assign_in_cond(struct parser_params *p, NODE *node)
24864{
24865 switch (nd_type(node)) {
24866 case NODE_MASGN:
24867 case NODE_LASGN:
24868 case NODE_DASGN:
24869 case NODE_GASGN:
24870 case NODE_IASGN:
24871 case NODE_CVASGN:
24872 case NODE_CDECL:
24873 break;
24874
24875 default:
24876 return 0;
24877 }
24878
24879 if (!get_nd_value(p, node)) return 1;
24880 if (is_static_content(get_nd_value(p, node))) {
24881 /* reports always */
24882 rb_warn0L(nd_line(get_nd_value(p, node)), "found '= literal' in conditional, should be ==");
24883 }
24884 return 1;
24885}
24886
24887enum cond_type {
24888 COND_IN_OP,
24889 COND_IN_COND,
24890 COND_IN_FF
24891};
24892
24893#define SWITCH_BY_COND_TYPE(t, w, arg) do { \
24894 switch (t) { \
24895 case COND_IN_OP: break; \
24896 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
24897 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
24898 } \
24899} while (0)
24900
24901static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*,bool);
24902
24903static NODE*
24904range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24905{
24906 enum node_type type;
24907
24908 if (node == 0) return 0;
24909
24910 type = nd_type(node);
24911 value_expr(node);
24912 if (type == NODE_INTEGER) {
24913 if (!e_option_supplied(p)) rb_warn0L(nd_line(node), "integer literal in flip-flop");
24914 ID lineno = rb_intern("$.");
24915 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
24916 }
24917 return cond0(p, node, COND_IN_FF, loc, true);
24918}
24919
24920static NODE*
24921cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc, bool top)
24922{
24923 if (node == 0) return 0;
24924 if (!(node = nd_once_body(node))) return 0;
24925 assign_in_cond(p, node);
24926
24927 switch (nd_type(node)) {
24928 case NODE_BEGIN:
24929 RNODE_BEGIN(node)->nd_body = cond0(p, RNODE_BEGIN(node)->nd_body, type, loc, top);
24930 break;
24931
24932 case NODE_DSTR:
24933 case NODE_EVSTR:
24934 case NODE_STR:
24935 case NODE_FILE:
24936 SWITCH_BY_COND_TYPE(type, warn, "string ");
24937 break;
24938
24939 case NODE_REGX:
24940 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ");
24941 nd_set_type(node, NODE_MATCH);
24942 break;
24943
24944 case NODE_DREGX:
24945 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ");
24946
24947 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
24948
24949 case NODE_BLOCK:
24950 {
24951 NODE *end = RNODE_BLOCK(node)->nd_end;
24952 NODE **expr = &RNODE_BLOCK(end)->nd_head;
24953 if (top) top = node == end;
24954 *expr = cond0(p, *expr, type, loc, top);
24955 }
24956 break;
24957
24958 case NODE_AND:
24959 case NODE_OR:
24960 RNODE_AND(node)->nd_1st = cond0(p, RNODE_AND(node)->nd_1st, COND_IN_COND, loc, true);
24961 RNODE_AND(node)->nd_2nd = cond0(p, RNODE_AND(node)->nd_2nd, COND_IN_COND, loc, true);
24962 break;
24963
24964 case NODE_DOT2:
24965 case NODE_DOT3:
24966 if (!top) break;
24967 RNODE_DOT2(node)->nd_beg = range_op(p, RNODE_DOT2(node)->nd_beg, loc);
24968 RNODE_DOT2(node)->nd_end = range_op(p, RNODE_DOT2(node)->nd_end, loc);
24969 switch (nd_type(node)) {
24970 case NODE_DOT2:
24971 nd_set_type(node,NODE_FLIP2);
24972 rb_node_flip2_t *flip2 = RNODE_FLIP2(node); /* for debug info */
24973 (void)flip2;
24974 break;
24975 case NODE_DOT3:
24976 nd_set_type(node, NODE_FLIP3);
24977 rb_node_flip3_t *flip3 = RNODE_FLIP3(node); /* for debug info */
24978 (void)flip3;
24979 break;
24980 }
24981 break;
24982
24983 case NODE_SYM:
24984 case NODE_DSYM:
24985 SWITCH_BY_COND_TYPE(type, warning, "symbol ");
24986 break;
24987
24988 case NODE_LINE:
24989 SWITCH_BY_COND_TYPE(type, warning, "");
24990 break;
24991
24992 case NODE_ENCODING:
24993 SWITCH_BY_COND_TYPE(type, warning, "");
24994 break;
24995
24996 case NODE_INTEGER:
24997 case NODE_FLOAT:
24998 case NODE_RATIONAL:
24999 case NODE_IMAGINARY:
25000 SWITCH_BY_COND_TYPE(type, warning, "");
25001 break;
25002
25003 default:
25004 break;
25005 }
25006 return node;
25007}
25008
25009static NODE*
25010cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25011{
25012 if (node == 0) return 0;
25013 return cond0(p, node, COND_IN_COND, loc, true);
25014}
25015
25016static NODE*
25017method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25018{
25019 if (node == 0) return 0;
25020 return cond0(p, node, COND_IN_OP, loc, true);
25021}
25022
25023static NODE*
25024new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
25025{
25026 YYLTYPE loc = {*pos, *pos};
25027 return NEW_NIL(&loc);
25028}
25029
25030static NODE*
25031new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
25032{
25033 if (!cc) return right;
25034 cc = cond0(p, cc, COND_IN_COND, loc, true);
25035 return newline_node(NEW_IF(cc, left, right, loc));
25036}
25037
25038static NODE*
25039new_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)
25040{
25041 if (!cc) return right;
25042 cc = cond0(p, cc, COND_IN_COND, loc, true);
25043 return newline_node(NEW_UNLESS(cc, left, right, loc, keyword_loc, then_keyword_loc, end_keyword_loc));
25044}
25045
25046#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))
25047
25048static NODE*
25049logop(struct parser_params *p, ID id, NODE *left, NODE *right,
25050 const YYLTYPE *op_loc, const YYLTYPE *loc)
25051{
25052 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
25053 NODE *op;
25054 value_expr(left);
25055 if (left && nd_type_p(left, type)) {
25056 NODE *node = left, *second;
25057 while ((second = RNODE_AND(node)->nd_2nd) != 0 && nd_type_p(second, type)) {
25058 node = second;
25059 }
25060 RNODE_AND(node)->nd_2nd = NEW_AND_OR(type, second, right, loc, op_loc);
25061 nd_set_line(RNODE_AND(node)->nd_2nd, op_loc->beg_pos.lineno);
25062 left->nd_loc.end_pos = loc->end_pos;
25063 return left;
25064 }
25065 op = NEW_AND_OR(type, left, right, loc, op_loc);
25066 nd_set_line(op, op_loc->beg_pos.lineno);
25067 return op;
25068}
25069
25070#undef NEW_AND_OR
25071
25072static void
25073no_blockarg(struct parser_params *p, NODE *node)
25074{
25075 if (nd_type_p(node, NODE_BLOCK_PASS)) {
25076 compile_error(p, "block argument should not be given");
25077 }
25078}
25079
25080static NODE *
25081ret_args(struct parser_params *p, NODE *node)
25082{
25083 if (node) {
25084 no_blockarg(p, node);
25085 if (nd_type_p(node, NODE_LIST) && !RNODE_LIST(node)->nd_next) {
25086 node = RNODE_LIST(node)->nd_head;
25087 }
25088 }
25089 return node;
25090}
25091
25092static NODE *
25093new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25094{
25095 if (node) no_blockarg(p, node);
25096
25097 return NEW_YIELD(node, loc);
25098}
25099
25100static NODE*
25101negate_lit(struct parser_params *p, NODE* node)
25102{
25103 switch (nd_type(node)) {
25104 case NODE_INTEGER:
25105 RNODE_INTEGER(node)->minus = TRUE;
25106 break;
25107 case NODE_FLOAT:
25108 RNODE_FLOAT(node)->minus = TRUE;
25109 break;
25110 case NODE_RATIONAL:
25111 RNODE_RATIONAL(node)->minus = TRUE;
25112 break;
25113 case NODE_IMAGINARY:
25114 RNODE_IMAGINARY(node)->minus = TRUE;
25115 break;
25116 }
25117 return node;
25118}
25119
25120static NODE *
25121arg_blk_pass(NODE *node1, rb_node_block_pass_t *node2)
25122{
25123 if (node2) {
25124 if (!node1) return (NODE *)node2;
25125 node2->nd_head = node1;
25126 nd_set_first_lineno(node2, nd_first_lineno(node1));
25127 nd_set_first_column(node2, nd_first_column(node1));
25128 return (NODE *)node2;
25129 }
25130 return node1;
25131}
25132
25133static bool
25134args_info_empty_p(struct rb_args_info *args)
25135{
25136 if (args->pre_args_num) return false;
25137 if (args->post_args_num) return false;
25138 if (args->rest_arg) return false;
25139 if (args->opt_args) return false;
25140 if (args->block_arg) return false;
25141 if (args->kw_args) return false;
25142 if (args->kw_rest_arg) return false;
25143 return true;
25144}
25145
25146static rb_node_args_t *
25147new_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)
25148{
25149 struct rb_args_info *args = &tail->nd_ainfo;
25150
25151 if (args->forwarding) {
25152 if (rest_arg) {
25153 yyerror1(&RNODE(tail)->nd_loc, "... after rest argument");
25154 return tail;
25155 }
25156 rest_arg = idFWD_REST;
25157 }
25158
25159 args->pre_args_num = pre_args ? pre_args->nd_plen : 0;
25160 args->pre_init = pre_args ? pre_args->nd_next : 0;
25161
25162 args->post_args_num = post_args ? post_args->nd_plen : 0;
25163 args->post_init = post_args ? post_args->nd_next : 0;
25164 args->first_post_arg = post_args ? post_args->nd_pid : 0;
25165
25166 args->rest_arg = rest_arg;
25167
25168 args->opt_args = opt_args;
25169
25170#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25171 args->ruby2_keywords = args->forwarding;
25172#else
25173 args->ruby2_keywords = 0;
25174#endif
25175
25176 nd_set_loc(RNODE(tail), loc);
25177
25178 return tail;
25179}
25180
25181static rb_node_args_t *
25182new_args_tail(struct parser_params *p, rb_node_kw_arg_t *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
25183{
25184 rb_node_args_t *node = NEW_ARGS(&NULL_LOC);
25185 struct rb_args_info *args = &node->nd_ainfo;
25186 if (p->error_p) return node;
25187
25188 args->block_arg = block;
25189 args->kw_args = kw_args;
25190
25191 if (kw_args) {
25192 /*
25193 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
25194 * variable order: k1, kr1, k2, &b, internal_id, krest
25195 * #=> <reorder>
25196 * variable order: kr1, k1, k2, internal_id, krest, &b
25197 */
25198 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
25199 struct vtable *vtargs = p->lvtbl->args;
25200 rb_node_kw_arg_t *kwn = kw_args;
25201
25202 if (block) block = vtargs->tbl[vtargs->pos-1];
25203 vtable_pop(vtargs, !!block + !!kw_rest_arg);
25204 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
25205 while (kwn) {
25206 if (!NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body)))
25207 --kw_vars;
25208 --required_kw_vars;
25209 kwn = kwn->nd_next;
25210 }
25211
25212 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
25213 ID vid = get_nd_vid(p, kwn->nd_body);
25214 if (NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body))) {
25215 *required_kw_vars++ = vid;
25216 }
25217 else {
25218 *kw_vars++ = vid;
25219 }
25220 }
25221
25222 arg_var(p, kw_bits);
25223 if (kw_rest_arg) arg_var(p, kw_rest_arg);
25224 if (block) arg_var(p, block);
25225
25226 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
25227 }
25228 else if (kw_rest_arg == idNil) {
25229 args->no_kwarg = 1;
25230 }
25231 else if (kw_rest_arg) {
25232 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
25233 }
25234
25235 return node;
25236}
25237
25238static rb_node_args_t *
25239args_with_numbered(struct parser_params *p, rb_node_args_t *args, int max_numparam, ID it_id)
25240{
25241 if (max_numparam > NO_PARAM || it_id) {
25242 if (!args) {
25243 YYLTYPE loc = RUBY_INIT_YYLLOC();
25244 args = new_args_tail(p, 0, 0, 0, 0);
25245 nd_set_loc(RNODE(args), &loc);
25246 }
25247 args->nd_ainfo.pre_args_num = it_id ? 1 : max_numparam;
25248 }
25249 return args;
25250}
25251
25252static NODE*
25253new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
25254{
25255 RNODE_ARYPTN(aryptn)->nd_pconst = constant;
25256
25257 if (pre_arg) {
25258 NODE *pre_args = NEW_LIST(pre_arg, loc);
25259 if (RNODE_ARYPTN(aryptn)->pre_args) {
25260 RNODE_ARYPTN(aryptn)->pre_args = list_concat(pre_args, RNODE_ARYPTN(aryptn)->pre_args);
25261 }
25262 else {
25263 RNODE_ARYPTN(aryptn)->pre_args = pre_args;
25264 }
25265 }
25266 return aryptn;
25267}
25268
25269static NODE*
25270new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
25271{
25272 if (has_rest) {
25273 rest_arg = rest_arg ? rest_arg : NODE_SPECIAL_NO_NAME_REST;
25274 }
25275 else {
25276 rest_arg = NULL;
25277 }
25278 NODE *node = NEW_ARYPTN(pre_args, rest_arg, post_args, loc);
25279
25280 return node;
25281}
25282
25283static NODE*
25284new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
25285{
25286 RNODE_FNDPTN(fndptn)->nd_pconst = constant;
25287
25288 return fndptn;
25289}
25290
25291static NODE*
25292new_find_pattern_tail(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
25293{
25294 pre_rest_arg = pre_rest_arg ? pre_rest_arg : NODE_SPECIAL_NO_NAME_REST;
25295 post_rest_arg = post_rest_arg ? post_rest_arg : NODE_SPECIAL_NO_NAME_REST;
25296 NODE *node = NEW_FNDPTN(pre_rest_arg, args, post_rest_arg, loc);
25297
25298 return node;
25299}
25300
25301static NODE*
25302new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
25303{
25304 RNODE_HSHPTN(hshptn)->nd_pconst = constant;
25305 return hshptn;
25306}
25307
25308static NODE*
25309new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
25310{
25311 NODE *node, *kw_rest_arg_node;
25312
25313 if (kw_rest_arg == idNil) {
25314 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
25315 }
25316 else if (kw_rest_arg) {
25317 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
25318 }
25319 else {
25320 kw_rest_arg_node = NULL;
25321 }
25322
25323 node = NEW_HSHPTN(0, kw_args, kw_rest_arg_node, loc);
25324
25325 return node;
25326}
25327
25328static NODE*
25329dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
25330{
25331 if (!node) {
25332 return NEW_SYM(STR_NEW0(), loc);
25333 }
25334
25335 switch (nd_type(node)) {
25336 case NODE_DSTR:
25337 nd_set_type(node, NODE_DSYM);
25338 nd_set_loc(node, loc);
25339 break;
25340 case NODE_STR:
25341 node = str_to_sym_node(p, node, loc);
25342 break;
25343 default:
25344 node = NEW_DSYM(0, 1, NEW_LIST(node, loc), loc);
25345 break;
25346 }
25347 return node;
25348}
25349
25350static int
25351nd_type_st_key_enable_p(NODE *node)
25352{
25353 switch (nd_type(node)) {
25354 case NODE_INTEGER:
25355 case NODE_FLOAT:
25356 case NODE_RATIONAL:
25357 case NODE_IMAGINARY:
25358 case NODE_STR:
25359 case NODE_SYM:
25360 case NODE_REGX:
25361 case NODE_LINE:
25362 case NODE_FILE:
25363 case NODE_ENCODING:
25364 return true;
25365 default:
25366 return false;
25367 }
25368}
25369
25370static VALUE
25371nd_value(struct parser_params *p, NODE *node)
25372{
25373 switch (nd_type(node)) {
25374 case NODE_STR:
25375 return rb_node_str_string_val(node);
25376 case NODE_INTEGER:
25377 return rb_node_integer_literal_val(node);
25378 case NODE_FLOAT:
25379 return rb_node_float_literal_val(node);
25380 case NODE_RATIONAL:
25381 return rb_node_rational_literal_val(node);
25382 case NODE_IMAGINARY:
25383 return rb_node_imaginary_literal_val(node);
25384 case NODE_SYM:
25385 return rb_node_sym_string_val(node);
25386 case NODE_REGX:
25387 return rb_node_regx_string_val(node);
25388 case NODE_LINE:
25389 return rb_node_line_lineno_val(node);
25390 case NODE_ENCODING:
25391 return rb_node_encoding_val(node);
25392 case NODE_FILE:
25393 return rb_node_file_path_val(node);
25394 default:
25395 rb_bug("unexpected node: %s", ruby_node_name(nd_type(node)));
25397 }
25398}
25399
25400static void
25401warn_duplicate_keys(struct parser_params *p, NODE *hash)
25402{
25403 /* See https://bugs.ruby-lang.org/issues/20331 for discussion about what is warned. */
25404 p->warn_duplicate_keys_table = st_init_table_with_size(&literal_type, RNODE_LIST(hash)->as.nd_alen / 2);
25405 while (hash && RNODE_LIST(hash)->nd_next) {
25406 NODE *head = RNODE_LIST(hash)->nd_head;
25407 NODE *value = RNODE_LIST(hash)->nd_next;
25408 NODE *next = RNODE_LIST(value)->nd_next;
25409 st_data_t key;
25410 st_data_t data;
25411
25412 /* keyword splat, e.g. {k: 1, **z, k: 2} */
25413 if (!head) {
25414 head = value;
25415 }
25416
25417 if (nd_type_st_key_enable_p(head)) {
25418 key = (st_data_t)head;
25419
25420 if (st_delete(p->warn_duplicate_keys_table, &key, &data)) {
25421 rb_warn2L(nd_line((NODE *)data),
25422 "key %+"PRIsWARN" is duplicated and overwritten on line %d",
25423 nd_value(p, head), WARN_I(nd_line(head)));
25424 }
25425 st_insert(p->warn_duplicate_keys_table, (st_data_t)key, (st_data_t)hash);
25426 }
25427 hash = next;
25428 }
25429 st_free_table(p->warn_duplicate_keys_table);
25430 p->warn_duplicate_keys_table = NULL;
25431}
25432
25433static NODE *
25434new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
25435{
25436 if (hash) warn_duplicate_keys(p, hash);
25437 return NEW_HASH(hash, loc);
25438}
25439
25440static void
25441error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
25442{
25443 if (is_private_local_id(p, id)) {
25444 return;
25445 }
25446 if (st_is_member(p->pvtbl, id)) {
25447 yyerror1(loc, "duplicated variable name");
25448 }
25449 else {
25450 st_insert(p->pvtbl, (st_data_t)id, 0);
25451 }
25452}
25453
25454static void
25455error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
25456{
25457 if (!p->pktbl) {
25458 p->pktbl = st_init_numtable();
25459 }
25460 else if (st_is_member(p->pktbl, key)) {
25461 yyerror1(loc, "duplicated key name");
25462 return;
25463 }
25464 st_insert(p->pktbl, (st_data_t)key, 0);
25465}
25466
25467static NODE *
25468new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
25469{
25470 return NEW_HASH(hash, loc);
25471}
25472
25473static NODE *
25474new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
25475{
25476 NODE *asgn;
25477
25478 if (lhs) {
25479 ID vid = get_nd_vid(p, lhs);
25480 YYLTYPE lhs_loc = lhs->nd_loc;
25481 if (op == tOROP) {
25482 set_nd_value(p, lhs, rhs);
25483 nd_set_loc(lhs, loc);
25484 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
25485 }
25486 else if (op == tANDOP) {
25487 set_nd_value(p, lhs, rhs);
25488 nd_set_loc(lhs, loc);
25489 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
25490 }
25491 else {
25492 asgn = lhs;
25493 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
25494 set_nd_value(p, asgn, rhs);
25495 nd_set_loc(asgn, loc);
25496 }
25497 }
25498 else {
25499 asgn = NEW_ERROR(loc);
25500 }
25501 return asgn;
25502}
25503
25504static NODE *
25505new_ary_op_assign(struct parser_params *p, NODE *ary,
25506 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc,
25507 const YYLTYPE *call_operator_loc, const YYLTYPE *opening_loc, const YYLTYPE *closing_loc, const YYLTYPE *binary_operator_loc)
25508{
25509 NODE *asgn;
25510
25511 aryset_check(p, args);
25512 args = make_list(args, args_loc);
25513 asgn = NEW_OP_ASGN1(ary, op, args, rhs, loc, call_operator_loc, opening_loc, closing_loc, binary_operator_loc);
25514 fixpos(asgn, ary);
25515 return asgn;
25516}
25517
25518static NODE *
25519new_attr_op_assign(struct parser_params *p, NODE *lhs,
25520 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc,
25521 const YYLTYPE *call_operator_loc, const YYLTYPE *message_loc, const YYLTYPE *binary_operator_loc)
25522{
25523 NODE *asgn;
25524
25525 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc, call_operator_loc, message_loc, binary_operator_loc);
25526 fixpos(asgn, lhs);
25527 return asgn;
25528}
25529
25530static NODE *
25531new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
25532{
25533 NODE *asgn;
25534
25535 if (lhs) {
25536 asgn = NEW_OP_CDECL(lhs, op, rhs, ctxt.shareable_constant_value, loc);
25537 }
25538 else {
25539 asgn = NEW_ERROR(loc);
25540 }
25541 fixpos(asgn, lhs);
25542 return asgn;
25543}
25544
25545static NODE *
25546const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
25547{
25548 if (p->ctxt.in_def) {
25549#ifndef RIPPER
25550 yyerror1(loc, "dynamic constant assignment");
25551#else
25552 set_value(assign_error(p, "dynamic constant assignment", p->s_lvalue));
25553#endif
25554 }
25555 return NEW_CDECL(0, 0, (path), p->ctxt.shareable_constant_value, loc);
25556}
25557
25558#ifdef RIPPER
25559static VALUE
25560assign_error(struct parser_params *p, const char *mesg, VALUE a)
25561{
25562 a = dispatch2(assign_error, ERR_MESG(), a);
25563 ripper_error(p);
25564 return a;
25565}
25566#endif
25567
25568static NODE *
25569new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
25570{
25571 NODE *result = head;
25572 if (rescue) {
25573 NODE *tmp = rescue_else ? rescue_else : rescue;
25574 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
25575
25576 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
25577 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
25578 }
25579 if (ensure) {
25580 result = NEW_ENSURE(result, ensure, loc);
25581 }
25582 fixpos(result, head);
25583 return result;
25584}
25585
25586static void
25587warn_unused_var(struct parser_params *p, struct local_vars *local)
25588{
25589 int cnt;
25590
25591 if (!local->used) return;
25592 cnt = local->used->pos;
25593 if (cnt != local->vars->pos) {
25594 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
25595 }
25596#ifndef RIPPER
25597 ID *v = local->vars->tbl;
25598 ID *u = local->used->tbl;
25599 for (int i = 0; i < cnt; ++i) {
25600 if (!v[i] || (u[i] & LVAR_USED)) continue;
25601 if (is_private_local_id(p, v[i])) continue;
25602 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
25603 }
25604#endif
25605}
25606
25607static void
25608local_push(struct parser_params *p, int toplevel_scope)
25609{
25610 struct local_vars *local;
25611 int inherits_dvars = toplevel_scope && compile_for_eval;
25612 int warn_unused_vars = RTEST(ruby_verbose);
25613
25614 local = ALLOC(struct local_vars);
25615 local->prev = p->lvtbl;
25616 local->args = vtable_alloc(0);
25617 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
25618#ifndef RIPPER
25619 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
25620 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
25621#endif
25622 local->numparam.outer = 0;
25623 local->numparam.inner = 0;
25624 local->numparam.current = 0;
25625 local->it = 0;
25626 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
25627
25628# if WARN_PAST_SCOPE
25629 local->past = 0;
25630# endif
25631 CMDARG_PUSH(0);
25632 COND_PUSH(0);
25633 p->lvtbl = local;
25634}
25635
25636static void
25637vtable_chain_free(struct parser_params *p, struct vtable *table)
25638{
25639 while (!DVARS_TERMINAL_P(table)) {
25640 struct vtable *cur_table = table;
25641 table = cur_table->prev;
25642 vtable_free(cur_table);
25643 }
25644}
25645
25646static void
25647local_free(struct parser_params *p, struct local_vars *local)
25648{
25649 vtable_chain_free(p, local->used);
25650
25651# if WARN_PAST_SCOPE
25652 vtable_chain_free(p, local->past);
25653# endif
25654
25655 vtable_chain_free(p, local->args);
25656 vtable_chain_free(p, local->vars);
25657
25658 ruby_sized_xfree(local, sizeof(struct local_vars));
25659}
25660
25661static void
25662local_pop(struct parser_params *p)
25663{
25664 struct local_vars *local = p->lvtbl->prev;
25665 if (p->lvtbl->used) {
25666 warn_unused_var(p, p->lvtbl);
25667 }
25668
25669 local_free(p, p->lvtbl);
25670 p->lvtbl = local;
25671
25672 CMDARG_POP();
25673 COND_POP();
25674}
25675
25676static rb_ast_id_table_t *
25677local_tbl(struct parser_params *p)
25678{
25679 int cnt_args = vtable_size(p->lvtbl->args);
25680 int cnt_vars = vtable_size(p->lvtbl->vars);
25681 int cnt = cnt_args + cnt_vars;
25682 int i, j;
25683 rb_ast_id_table_t *tbl;
25684
25685 if (cnt <= 0) return 0;
25686 tbl = rb_ast_new_local_table(p->ast, cnt);
25687 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
25688 /* remove IDs duplicated to warn shadowing */
25689 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
25690 ID id = p->lvtbl->vars->tbl[i];
25691 if (!vtable_included(p->lvtbl->args, id)) {
25692 tbl->ids[j++] = id;
25693 }
25694 }
25695 if (j < cnt) {
25696 tbl = rb_ast_resize_latest_local_table(p->ast, j);
25697 }
25698
25699 return tbl;
25700}
25701
25702static void
25703numparam_name(struct parser_params *p, ID id)
25704{
25705 if (!NUMPARAM_ID_P(id)) return;
25706 compile_error(p, "_%d is reserved for numbered parameter",
25707 NUMPARAM_ID_TO_IDX(id));
25708}
25709
25710static void
25711arg_var(struct parser_params *p, ID id)
25712{
25713 numparam_name(p, id);
25714 vtable_add(p->lvtbl->args, id);
25715}
25716
25717static void
25718local_var(struct parser_params *p, ID id)
25719{
25720 numparam_name(p, id);
25721 vtable_add(p->lvtbl->vars, id);
25722 if (p->lvtbl->used) {
25723 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
25724 }
25725}
25726
25727#ifndef RIPPER
25728int
25729rb_parser_local_defined(struct parser_params *p, ID id, const struct rb_iseq_struct *iseq)
25730{
25731 return rb_local_defined(id, iseq);
25732}
25733#endif
25734
25735static int
25736local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
25737{
25738 struct vtable *vars, *args, *used;
25739
25740 vars = p->lvtbl->vars;
25741 args = p->lvtbl->args;
25742 used = p->lvtbl->used;
25743
25744 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25745 vars = vars->prev;
25746 args = args->prev;
25747 if (used) used = used->prev;
25748 }
25749
25750 if (vars && vars->prev == DVARS_INHERIT) {
25751 return rb_parser_local_defined(p, id, p->parent_iseq);
25752 }
25753 else if (vtable_included(args, id)) {
25754 return 1;
25755 }
25756 else {
25757 int i = vtable_included(vars, id);
25758 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
25759 return i != 0;
25760 }
25761}
25762
25763static int
25764local_id(struct parser_params *p, ID id)
25765{
25766 return local_id_ref(p, id, NULL);
25767}
25768
25769static int
25770check_forwarding_args(struct parser_params *p)
25771{
25772 if (local_id(p, idFWD_ALL)) return TRUE;
25773 compile_error(p, "unexpected ...");
25774 return FALSE;
25775}
25776
25777static void
25778add_forwarding_args(struct parser_params *p)
25779{
25780 arg_var(p, idFWD_REST);
25781#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25782 arg_var(p, idFWD_KWREST);
25783#endif
25784 arg_var(p, idFWD_BLOCK);
25785 arg_var(p, idFWD_ALL);
25786}
25787
25788static void
25789forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var)
25790{
25791 bool conflict = false;
25792
25793 struct vtable *vars, *args;
25794
25795 vars = p->lvtbl->vars;
25796 args = p->lvtbl->args;
25797
25798 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25799 conflict |= (vtable_included(args, arg) && !(all && vtable_included(args, all)));
25800 vars = vars->prev;
25801 args = args->prev;
25802 }
25803
25804 bool found = false;
25805 if (vars && vars->prev == DVARS_INHERIT && !found) {
25806 found = (rb_parser_local_defined(p, arg, p->parent_iseq) &&
25807 !(all && rb_parser_local_defined(p, all, p->parent_iseq)));
25808 }
25809 else {
25810 found = (vtable_included(args, arg) &&
25811 !(all && vtable_included(args, all)));
25812 }
25813
25814 if (!found) {
25815 compile_error(p, "no anonymous %s parameter", var);
25816 }
25817 else if (conflict) {
25818 compile_error(p, "anonymous %s parameter is also used within block", var);
25819 }
25820}
25821
25822static NODE *
25823new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
25824{
25825 NODE *rest = NEW_LVAR(idFWD_REST, loc);
25826#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25827 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
25828#endif
25829 rb_node_block_pass_t *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), argsloc, &NULL_LOC);
25830 NODE *args = leading ? rest_arg_append(p, leading, rest, argsloc) : NEW_SPLAT(rest, loc, &NULL_LOC);
25831 block->forwarding = TRUE;
25832#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25833 args = arg_append(p, args, new_hash(p, kwrest, loc), argsloc);
25834#endif
25835 return arg_blk_pass(args, block);
25836}
25837
25838static NODE *
25839numparam_push(struct parser_params *p)
25840{
25841 struct local_vars *local = p->lvtbl;
25842 NODE *inner = local->numparam.inner;
25843 if (!local->numparam.outer) {
25844 local->numparam.outer = local->numparam.current;
25845 }
25846 local->numparam.inner = 0;
25847 local->numparam.current = 0;
25848 local->it = 0;
25849 return inner;
25850}
25851
25852static void
25853numparam_pop(struct parser_params *p, NODE *prev_inner)
25854{
25855 struct local_vars *local = p->lvtbl;
25856 if (prev_inner) {
25857 /* prefer first one */
25858 local->numparam.inner = prev_inner;
25859 }
25860 else if (local->numparam.current) {
25861 /* current and inner are exclusive */
25862 local->numparam.inner = local->numparam.current;
25863 }
25864 if (p->max_numparam > NO_PARAM) {
25865 /* current and outer are exclusive */
25866 local->numparam.current = local->numparam.outer;
25867 local->numparam.outer = 0;
25868 }
25869 else {
25870 /* no numbered parameter */
25871 local->numparam.current = 0;
25872 }
25873 local->it = 0;
25874}
25875
25876static const struct vtable *
25877dyna_push(struct parser_params *p)
25878{
25879 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
25880 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
25881 if (p->lvtbl->used) {
25882 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
25883 }
25884 return p->lvtbl->args;
25885}
25886
25887static void
25888dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
25889{
25890 struct vtable *tmp = *vtblp;
25891 *vtblp = tmp->prev;
25892# if WARN_PAST_SCOPE
25893 if (p->past_scope_enabled) {
25894 tmp->prev = p->lvtbl->past;
25895 p->lvtbl->past = tmp;
25896 return;
25897 }
25898# endif
25899 vtable_free(tmp);
25900}
25901
25902static void
25903dyna_pop_1(struct parser_params *p)
25904{
25905 struct vtable *tmp;
25906
25907 if ((tmp = p->lvtbl->used) != 0) {
25908 warn_unused_var(p, p->lvtbl);
25909 p->lvtbl->used = p->lvtbl->used->prev;
25910 vtable_free(tmp);
25911 }
25912 dyna_pop_vtable(p, &p->lvtbl->args);
25913 dyna_pop_vtable(p, &p->lvtbl->vars);
25914}
25915
25916static void
25917dyna_pop(struct parser_params *p, const struct vtable *lvargs)
25918{
25919 while (p->lvtbl->args != lvargs) {
25920 dyna_pop_1(p);
25921 if (!p->lvtbl->args) {
25922 struct local_vars *local = p->lvtbl->prev;
25923 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
25924 p->lvtbl = local;
25925 }
25926 }
25927 dyna_pop_1(p);
25928}
25929
25930static int
25931dyna_in_block(struct parser_params *p)
25932{
25933 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
25934}
25935
25936#ifndef RIPPER
25937int
25938dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
25939{
25940 struct vtable *vars, *args, *used;
25941 int i;
25942
25943 args = p->lvtbl->args;
25944 vars = p->lvtbl->vars;
25945 used = p->lvtbl->used;
25946
25947 while (!DVARS_TERMINAL_P(vars)) {
25948 if (vtable_included(args, id)) {
25949 return 1;
25950 }
25951 if ((i = vtable_included(vars, id)) != 0) {
25952 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
25953 return 1;
25954 }
25955 args = args->prev;
25956 vars = vars->prev;
25957 if (!vidrefp) used = 0;
25958 if (used) used = used->prev;
25959 }
25960
25961 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
25962 return rb_dvar_defined(id, p->parent_iseq);
25963 }
25964
25965 return 0;
25966}
25967#endif
25968
25969static int
25970dvar_defined(struct parser_params *p, ID id)
25971{
25972 return dvar_defined_ref(p, id, NULL);
25973}
25974
25975static int
25976dvar_curr(struct parser_params *p, ID id)
25977{
25978 return (vtable_included(p->lvtbl->args, id) ||
25979 vtable_included(p->lvtbl->vars, id));
25980}
25981
25982static void
25983reg_fragment_enc_error(struct parser_params* p, rb_parser_string_t *str, int c)
25984{
25985 compile_error(p,
25986 "regexp encoding option '%c' differs from source encoding '%s'",
25987 c, rb_enc_name(rb_parser_str_get_encoding(str)));
25988}
25989
25990#ifndef RIPPER
25991static rb_encoding *
25992find_enc(struct parser_params* p, const char *name)
25993{
25994 int idx = rb_enc_find_index(name);
25995 if (idx < 0) {
25996 rb_bug("unknown encoding name: %s", name);
25997 }
25998
25999 return rb_enc_from_index(idx);
26000}
26001
26002static rb_encoding *
26003kcode_to_enc(struct parser_params* p, int kcode)
26004{
26005 rb_encoding *enc;
26006
26007 switch (kcode) {
26008 case ENC_ASCII8BIT:
26009 enc = rb_ascii8bit_encoding();
26010 break;
26011 case ENC_EUC_JP:
26012 enc = find_enc(p, "EUC-JP");
26013 break;
26014 case ENC_Windows_31J:
26015 enc = find_enc(p, "Windows-31J");
26016 break;
26017 case ENC_UTF8:
26018 enc = rb_utf8_encoding();
26019 break;
26020 default:
26021 enc = NULL;
26022 break;
26023 }
26024
26025 return enc;
26026}
26027
26028int
26029rb_reg_fragment_setenc(struct parser_params* p, rb_parser_string_t *str, int options)
26030{
26031 int c = RE_OPTION_ENCODING_IDX(options);
26032
26033 if (c) {
26034 int opt, idx;
26035 rb_encoding *enc;
26036
26037 char_to_option_kcode(c, &opt, &idx);
26038 enc = kcode_to_enc(p, idx);
26039 if (enc != rb_parser_str_get_encoding(str) &&
26040 !rb_parser_is_ascii_string(p, str)) {
26041 goto error;
26042 }
26043 rb_parser_string_set_encoding(str, enc);
26044 }
26045 else if (RE_OPTION_ENCODING_NONE(options)) {
26046 if (!PARSER_ENCODING_IS_ASCII8BIT(p, str) &&
26047 !rb_parser_is_ascii_string(p, str)) {
26048 c = 'n';
26049 goto error;
26050 }
26051 rb_parser_enc_associate(p, str, rb_ascii8bit_encoding());
26052 }
26053 else if (rb_is_usascii_enc(p->enc)) {
26054 if (!rb_parser_is_ascii_string(p, str)) {
26055 /* raise in re.c */
26056 rb_parser_enc_associate(p, str, rb_usascii_encoding());
26057 }
26058 else {
26059 rb_parser_enc_associate(p, str, rb_ascii8bit_encoding());
26060 }
26061 }
26062 return 0;
26063
26064 error:
26065 return c;
26066}
26067#endif
26068
26069static void
26070reg_fragment_setenc(struct parser_params* p, rb_parser_string_t *str, int options)
26071{
26072 int c = rb_reg_fragment_setenc(p, str, options);
26073 if (c) reg_fragment_enc_error(p, str, c);
26074}
26075
26076static void
26077reg_fragment_error(struct parser_params* p, VALUE err)
26078{
26079 compile_error(p, "%"PRIsVALUE, err);
26080}
26081
26082#ifndef RIPPER
26083int
26084rb_parser_reg_fragment_check(struct parser_params* p, rb_parser_string_t *str, int options, rb_parser_reg_fragment_error_func error)
26085{
26086 VALUE err, str2;
26087 reg_fragment_setenc(p, str, options);
26088 /* TODO */
26089 str2 = rb_str_new_parser_string(str);
26090 err = rb_reg_check_preprocess(str2);
26091 if (err != Qnil) {
26092 err = rb_obj_as_string(err);
26093 error(p, err);
26094 return 0;
26095 }
26096 return 1;
26097}
26098#endif
26099
26100#ifndef UNIVERSAL_PARSER
26101typedef struct {
26102 struct parser_params* parser;
26103 rb_encoding *enc;
26104 NODE *succ_block;
26105 const YYLTYPE *loc;
26106 rb_parser_assignable_func assignable;
26108
26109static int
26110reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
26111 int back_num, int *back_refs, OnigRegex regex, void *arg0)
26112{
26114 struct parser_params* p = arg->parser;
26115 rb_encoding *enc = arg->enc;
26116 long len = name_end - name;
26117 const char *s = (const char *)name;
26118
26119 return rb_reg_named_capture_assign_iter_impl(p, s, len, enc, &arg->succ_block, arg->loc, arg->assignable);
26120}
26121
26122static NODE *
26123reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc, rb_parser_assignable_func assignable)
26124{
26126
26127 arg.parser = p;
26128 arg.enc = rb_enc_get(regexp);
26129 arg.succ_block = 0;
26130 arg.loc = loc;
26131 arg.assignable = assignable;
26132 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
26133
26134 if (!arg.succ_block) return 0;
26135 return RNODE_BLOCK(arg.succ_block)->nd_next;
26136}
26137#endif
26138
26139#ifndef RIPPER
26140NODE *
26141rb_parser_assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
26142{
26143 return assignable(p, id, val, loc);
26144}
26145
26146int
26147rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len,
26148 rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc, rb_parser_assignable_func assignable)
26149{
26150 ID var;
26151 NODE *node, *succ;
26152
26153 if (!len) return ST_CONTINUE;
26154 if (!VALID_SYMNAME_P(s, len, enc, ID_LOCAL))
26155 return ST_CONTINUE;
26156
26157 var = intern_cstr(s, len, enc);
26158 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
26159 if (!lvar_defined(p, var)) return ST_CONTINUE;
26160 }
26161 node = node_assign(p, assignable(p, var, 0, loc), NEW_SYM(rb_id2str(var), loc), NO_LEX_CTXT, loc);
26162 succ = *succ_block;
26163 if (!succ) succ = NEW_ERROR(loc);
26164 succ = block_append(p, succ, node);
26165 *succ_block = succ;
26166 return ST_CONTINUE;
26167}
26168#endif
26169
26170static VALUE
26171parser_reg_compile(struct parser_params* p, rb_parser_string_t *str, int options)
26172{
26173 VALUE str2;
26174 reg_fragment_setenc(p, str, options);
26175 str2 = rb_str_new_parser_string(str);
26176 return rb_parser_reg_compile(p, str2, options);
26177}
26178
26179#ifndef RIPPER
26180VALUE
26181rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
26182{
26183 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
26184}
26185#endif
26186
26187static VALUE
26188reg_compile(struct parser_params* p, rb_parser_string_t *str, int options)
26189{
26190 VALUE re;
26191 VALUE err;
26192
26193 err = rb_errinfo();
26194 re = parser_reg_compile(p, str, options);
26195 if (NIL_P(re)) {
26196 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
26197 rb_set_errinfo(err);
26198 reg_fragment_error(p, m);
26199 return Qnil;
26200 }
26201 return re;
26202}
26203
26204#ifndef RIPPER
26205void
26206rb_ruby_parser_set_options(struct parser_params *p, int print, int loop, int chomp, int split)
26207{
26208 p->do_print = print;
26209 p->do_loop = loop;
26210 p->do_chomp = chomp;
26211 p->do_split = split;
26212}
26213
26214static NODE *
26215parser_append_options(struct parser_params *p, NODE *node)
26216{
26217 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
26218 const YYLTYPE *const LOC = &default_location;
26219
26220 if (p->do_print) {
26221 NODE *print = (NODE *)NEW_FCALL(rb_intern("print"),
26222 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
26223 LOC);
26224 node = block_append(p, node, print);
26225 }
26226
26227 if (p->do_loop) {
26228 NODE *irs = NEW_LIST(NEW_GVAR(rb_intern("$/"), LOC), LOC);
26229
26230 if (p->do_split) {
26231 ID ifs = rb_intern("$;");
26232 ID fields = rb_intern("$F");
26233 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
26234 NODE *split = NEW_GASGN(fields,
26235 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
26236 rb_intern("split"), args, LOC),
26237 LOC);
26238 node = block_append(p, split, node);
26239 }
26240 if (p->do_chomp) {
26241 NODE *chomp = NEW_SYM(rb_str_new_cstr("chomp"), LOC);
26242 chomp = list_append(p, NEW_LIST(chomp, LOC), NEW_TRUE(LOC));
26243 irs = list_append(p, irs, NEW_HASH(chomp, LOC));
26244 }
26245
26246 node = NEW_WHILE((NODE *)NEW_FCALL(idGets, irs, LOC), node, 1, LOC, &NULL_LOC, &NULL_LOC);
26247 }
26248
26249 return node;
26250}
26251
26252void
26253rb_init_parse(void)
26254{
26255 /* just to suppress unused-function warnings */
26256 (void)nodetype;
26257 (void)nodeline;
26258}
26259
26260ID
26261internal_id(struct parser_params *p)
26262{
26263 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
26264}
26265#endif /* !RIPPER */
26266
26267static void
26268parser_initialize(struct parser_params *p)
26269{
26270 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
26271 p->command_start = TRUE;
26272 p->ruby_sourcefile_string = Qnil;
26273 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
26274 string_buffer_init(p);
26275 p->node_id = 0;
26276 p->delayed.token = NULL;
26277 p->frozen_string_literal = -1; /* not specified */
26278#ifndef RIPPER
26279 p->error_buffer = Qfalse;
26280 p->end_expect_token_locations = NULL;
26281 p->token_id = 0;
26282 p->tokens = NULL;
26283#else
26284 p->result = Qnil;
26285 p->parsing_thread = Qnil;
26286 p->s_value = Qnil;
26287 p->s_lvalue = Qnil;
26288 p->s_value_stack = rb_ary_new();
26289#endif
26290 p->debug_buffer = Qnil;
26291 p->debug_output = rb_ractor_stdout();
26292 p->enc = rb_utf8_encoding();
26293 p->exits = 0;
26294}
26295
26296#ifdef RIPPER
26297#define rb_ruby_parser_mark ripper_parser_mark
26298#define rb_ruby_parser_free ripper_parser_free
26299#define rb_ruby_parser_memsize ripper_parser_memsize
26300#endif
26301
26302void
26303rb_ruby_parser_mark(void *ptr)
26304{
26305 struct parser_params *p = (struct parser_params*)ptr;
26306
26307 rb_gc_mark(p->ruby_sourcefile_string);
26308#ifndef RIPPER
26309 rb_gc_mark(p->error_buffer);
26310#else
26311 rb_gc_mark(p->value);
26312 rb_gc_mark(p->result);
26313 rb_gc_mark(p->parsing_thread);
26314 rb_gc_mark(p->s_value);
26315 rb_gc_mark(p->s_lvalue);
26316 rb_gc_mark(p->s_value_stack);
26317#endif
26318 rb_gc_mark(p->debug_buffer);
26319 rb_gc_mark(p->debug_output);
26320}
26321
26322void
26323rb_ruby_parser_free(void *ptr)
26324{
26325 struct parser_params *p = (struct parser_params*)ptr;
26326 struct local_vars *local, *prev;
26327
26328 if (p->ast) {
26329 rb_ast_free(p->ast);
26330 }
26331
26332 if (p->warn_duplicate_keys_table) {
26333 st_free_table(p->warn_duplicate_keys_table);
26334 }
26335
26336#ifndef RIPPER
26337 if (p->tokens) {
26338 rb_parser_ary_free(p, p->tokens);
26339 }
26340#endif
26341
26342 if (p->tokenbuf) {
26343 ruby_sized_xfree(p->tokenbuf, p->toksiz);
26344 }
26345
26346 for (local = p->lvtbl; local; local = prev) {
26347 prev = local->prev;
26348 local_free(p, local);
26349 }
26350
26351 {
26352 token_info *ptinfo;
26353 while ((ptinfo = p->token_info) != 0) {
26354 p->token_info = ptinfo->next;
26355 xfree(ptinfo);
26356 }
26357 }
26358 string_buffer_free(p);
26359
26360 if (p->pvtbl) {
26361 st_free_table(p->pvtbl);
26362 }
26363
26364 if (CASE_LABELS_ENABLED_P(p->case_labels)) {
26365 st_free_table(p->case_labels);
26366 }
26367
26368 xfree(p->lex.strterm);
26369 p->lex.strterm = 0;
26370
26371 xfree(ptr);
26372}
26373
26374size_t
26375rb_ruby_parser_memsize(const void *ptr)
26376{
26377 struct parser_params *p = (struct parser_params*)ptr;
26378 struct local_vars *local;
26379 size_t size = sizeof(*p);
26380
26381 size += p->toksiz;
26382 for (local = p->lvtbl; local; local = local->prev) {
26383 size += sizeof(*local);
26384 if (local->vars) size += local->vars->capa * sizeof(ID);
26385 }
26386 return size;
26387}
26388
26389#ifndef RIPPER
26390#undef rb_reserved_word
26391
26392const struct kwtable *
26393rb_reserved_word(const char *str, unsigned int len)
26394{
26395 return reserved_word(str, len);
26396}
26397
26398#ifdef UNIVERSAL_PARSER
26399rb_parser_t *
26400rb_ruby_parser_allocate(const rb_parser_config_t *config)
26401{
26402 /* parser_initialize expects fields to be set to 0 */
26403 rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t));
26404 p->config = config;
26405 return p;
26406}
26407
26408rb_parser_t *
26409rb_ruby_parser_new(const rb_parser_config_t *config)
26410{
26411 /* parser_initialize expects fields to be set to 0 */
26412 rb_parser_t *p = rb_ruby_parser_allocate(config);
26413 parser_initialize(p);
26414 return p;
26415}
26416#else
26417rb_parser_t *
26418rb_ruby_parser_allocate(void)
26419{
26420 /* parser_initialize expects fields to be set to 0 */
26421 rb_parser_t *p = (rb_parser_t *)ruby_xcalloc(1, sizeof(rb_parser_t));
26422 return p;
26423}
26424
26425rb_parser_t *
26426rb_ruby_parser_new(void)
26427{
26428 /* parser_initialize expects fields to be set to 0 */
26429 rb_parser_t *p = rb_ruby_parser_allocate();
26430 parser_initialize(p);
26431 return p;
26432}
26433#endif
26434
26435rb_parser_t *
26436rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main)
26437{
26438 p->error_buffer = main ? Qfalse : Qnil;
26439 p->parent_iseq = base;
26440 return p;
26441}
26442
26443void
26444rb_ruby_parser_set_script_lines(rb_parser_t *p)
26445{
26446 p->debug_lines = rb_parser_ary_new_capa_for_script_line(p, 10);
26447}
26448
26449void
26450rb_ruby_parser_error_tolerant(rb_parser_t *p)
26451{
26452 p->error_tolerant = 1;
26453}
26454
26455void
26456rb_ruby_parser_keep_tokens(rb_parser_t *p)
26457{
26458 p->keep_tokens = 1;
26459 p->tokens = rb_parser_ary_new_capa_for_ast_token(p, 10);
26460}
26461
26462rb_encoding *
26463rb_ruby_parser_encoding(rb_parser_t *p)
26464{
26465 return p->enc;
26466}
26467
26468int
26469rb_ruby_parser_end_seen_p(rb_parser_t *p)
26470{
26471 return p->ruby__end__seen;
26472}
26473
26474int
26475rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag)
26476{
26477 p->debug = flag;
26478 return flag;
26479}
26480#endif /* !RIPPER */
26481
26482#ifdef RIPPER
26483int
26484rb_ruby_parser_get_yydebug(rb_parser_t *p)
26485{
26486 return p->debug;
26487}
26488
26489void
26490rb_ruby_parser_set_value(rb_parser_t *p, VALUE value)
26491{
26492 p->value = value;
26493}
26494
26495int
26496rb_ruby_parser_error_p(rb_parser_t *p)
26497{
26498 return p->error_p;
26499}
26500
26501VALUE
26502rb_ruby_parser_debug_output(rb_parser_t *p)
26503{
26504 return p->debug_output;
26505}
26506
26507void
26508rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output)
26509{
26510 p->debug_output = output;
26511}
26512
26513VALUE
26514rb_ruby_parser_parsing_thread(rb_parser_t *p)
26515{
26516 return p->parsing_thread;
26517}
26518
26519void
26520rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread)
26521{
26522 p->parsing_thread = parsing_thread;
26523}
26524
26525void
26526rb_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)
26527{
26528 p->lex.gets = gets;
26529 p->lex.input = input;
26530 p->eofp = 0;
26531 p->ruby_sourcefile_string = sourcefile_string;
26532 p->ruby_sourcefile = sourcefile;
26533 p->ruby_sourceline = sourceline;
26534}
26535
26536VALUE
26537rb_ruby_parser_result(rb_parser_t *p)
26538{
26539 return p->result;
26540}
26541
26542rb_encoding *
26543rb_ruby_parser_enc(rb_parser_t *p)
26544{
26545 return p->enc;
26546}
26547
26548VALUE
26549rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p)
26550{
26551 return p->ruby_sourcefile_string;
26552}
26553
26554int
26555rb_ruby_parser_ruby_sourceline(rb_parser_t *p)
26556{
26557 return p->ruby_sourceline;
26558}
26559
26560int
26561rb_ruby_parser_lex_state(rb_parser_t *p)
26562{
26563 return p->lex.state;
26564}
26565
26566void
26567rb_ruby_ripper_parse0(rb_parser_t *p)
26568{
26569 parser_prepare(p);
26570 p->ast = rb_ast_new();
26571 ripper_yyparse((void*)p);
26572 rb_ast_free(p->ast);
26573 p->ast = 0;
26574 p->eval_tree = 0;
26575 p->eval_tree_begin = 0;
26576}
26577
26578int
26579rb_ruby_ripper_dedent_string(rb_parser_t *p, rb_parser_string_t *string, int width)
26580{
26581 return dedent_string(p, string, width);
26582}
26583
26584int
26585rb_ruby_ripper_initialized_p(rb_parser_t *p)
26586{
26587 return p->lex.input != 0;
26588}
26589
26590void
26591rb_ruby_ripper_parser_initialize(rb_parser_t *p)
26592{
26593 parser_initialize(p);
26594}
26595
26596long
26597rb_ruby_ripper_column(rb_parser_t *p)
26598{
26599 return p->lex.ptok - p->lex.pbeg;
26600}
26601
26602long
26603rb_ruby_ripper_token_len(rb_parser_t *p)
26604{
26605 return p->lex.pcur - p->lex.ptok;
26606}
26607
26608rb_parser_string_t *
26609rb_ruby_ripper_lex_lastline(rb_parser_t *p)
26610{
26611 return p->lex.lastline;
26612}
26613
26614VALUE
26615rb_ruby_ripper_lex_state_name(struct parser_params *p, int state)
26616{
26617 return rb_parser_lex_state_name(p, (enum lex_state_e)state);
26618}
26619
26620#ifdef UNIVERSAL_PARSER
26621rb_parser_t *
26622rb_ripper_parser_params_allocate(const rb_parser_config_t *config)
26623{
26624 rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t));
26625 p->config = config;
26626 return p;
26627}
26628#endif
26629
26630struct parser_params*
26631rb_ruby_ripper_parser_allocate(void)
26632{
26633 return (struct parser_params *)ruby_xcalloc(1, sizeof(struct parser_params));
26634}
26635#endif /* RIPPER */
26636
26637#ifndef RIPPER
26638void
26639rb_parser_printf(struct parser_params *p, const char *fmt, ...)
26640{
26641 va_list ap;
26642 VALUE mesg = p->debug_buffer;
26643
26644 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
26645 va_start(ap, fmt);
26646 rb_str_vcatf(mesg, fmt, ap);
26647 va_end(ap);
26648 if (char_at_end(p, mesg, 0) == '\n') {
26649 rb_io_write(p->debug_output, mesg);
26650 p->debug_buffer = Qnil;
26651 }
26652}
26653
26654static void
26655parser_compile_error(struct parser_params *p, const rb_code_location_t *loc, const char *fmt, ...)
26656{
26657 va_list ap;
26658 int lineno, column;
26659
26660 if (loc) {
26661 lineno = loc->end_pos.lineno;
26662 column = loc->end_pos.column;
26663 }
26664 else {
26665 lineno = p->ruby_sourceline;
26666 column = rb_long2int(p->lex.pcur - p->lex.pbeg);
26667 }
26668
26669 rb_io_flush(p->debug_output);
26670 p->error_p = 1;
26671 va_start(ap, fmt);
26672 p->error_buffer =
26673 rb_syntax_error_append(p->error_buffer,
26674 p->ruby_sourcefile_string,
26675 lineno, column,
26676 p->enc, fmt, ap);
26677 va_end(ap);
26678}
26679
26680static size_t
26681count_char(const char *str, int c)
26682{
26683 int n = 0;
26684 while (str[n] == c) ++n;
26685 return n;
26686}
26687
26688/*
26689 * strip enclosing double-quotes, same as the default yytnamerr except
26690 * for that single-quotes matching back-quotes do not stop stripping.
26691 *
26692 * "\"`class' keyword\"" => "`class' keyword"
26693 */
26694size_t
26695rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
26696{
26697 if (*yystr == '"') {
26698 size_t yyn = 0, bquote = 0;
26699 const char *yyp = yystr;
26700
26701 while (*++yyp) {
26702 switch (*yyp) {
26703 case '\'':
26704 if (!bquote) {
26705 bquote = count_char(yyp+1, '\'') + 1;
26706 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
26707 yyn += bquote;
26708 yyp += bquote - 1;
26709 break;
26710 }
26711 else {
26712 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
26713 if (yyres) memcpy(yyres + yyn, yyp, bquote);
26714 yyn += bquote;
26715 yyp += bquote - 1;
26716 bquote = 0;
26717 break;
26718 }
26719 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
26720 if (yyres) memcpy(yyres + yyn, yyp, 3);
26721 yyn += 3;
26722 yyp += 2;
26723 break;
26724 }
26725 goto do_not_strip_quotes;
26726 }
26727
26728 case ',':
26729 goto do_not_strip_quotes;
26730
26731 case '\\':
26732 if (*++yyp != '\\')
26733 goto do_not_strip_quotes;
26734 /* Fall through. */
26735 default:
26736 if (yyres)
26737 yyres[yyn] = *yyp;
26738 yyn++;
26739 break;
26740
26741 case '"':
26742 case '\0':
26743 if (yyres)
26744 yyres[yyn] = '\0';
26745 return yyn;
26746 }
26747 }
26748 do_not_strip_quotes: ;
26749 }
26750
26751 if (!yyres) return strlen(yystr);
26752
26753 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
26754}
26755#endif
26756
26757#ifdef RIPPER
26758#define validate(x) (void)(x)
26759
26760static VALUE
26761ripper_dispatch0(struct parser_params *p, ID mid)
26762{
26763 return rb_funcall(p->value, mid, 0);
26764}
26765
26766static VALUE
26767ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
26768{
26769 validate(a);
26770 return rb_funcall(p->value, mid, 1, a);
26771}
26772
26773static VALUE
26774ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
26775{
26776 validate(a);
26777 validate(b);
26778 return rb_funcall(p->value, mid, 2, a, b);
26779}
26780
26781static VALUE
26782ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
26783{
26784 validate(a);
26785 validate(b);
26786 validate(c);
26787 return rb_funcall(p->value, mid, 3, a, b, c);
26788}
26789
26790static VALUE
26791ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
26792{
26793 validate(a);
26794 validate(b);
26795 validate(c);
26796 validate(d);
26797 return rb_funcall(p->value, mid, 4, a, b, c, d);
26798}
26799
26800static VALUE
26801ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
26802{
26803 validate(a);
26804 validate(b);
26805 validate(c);
26806 validate(d);
26807 validate(e);
26808 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
26809}
26810
26811static VALUE
26812ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
26813{
26814 validate(a);
26815 validate(b);
26816 validate(c);
26817 validate(d);
26818 validate(e);
26819 validate(f);
26820 validate(g);
26821 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
26822}
26823
26824void
26825ripper_error(struct parser_params *p)
26826{
26827 p->error_p = TRUE;
26828}
26829
26830VALUE
26831ripper_value(struct parser_params *p)
26832{
26833 (void)yystpcpy; /* may not used in newer bison */
26834
26835 return p->value;
26836}
26837
26838#endif /* RIPPER */
26839/*
26840 * Local variables:
26841 * mode: c
26842 * c-file-style: "ruby"
26843 * End:
26844 */
#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.