Ruby 3.3.2p78 (2024-05-30 revision e5a195edf62fe1bf7146a191da13fa1c4fecbd71)
parse.c
1/* A Bison parser, made by Lrama 0.5.12. */
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 14 "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#define YYLTYPE rb_code_location_t
78#define YYLTYPE_IS_DECLARED 1
79
80/* For Ripper */
81#ifdef RUBY_EXTCONF_H
82# include RUBY_EXTCONF_H
83#endif
84
85#include "ruby/internal/config.h"
86
87#include <errno.h>
88
89#ifdef UNIVERSAL_PARSER
90
91#include "internal/ruby_parser.h"
92#include "parser_node.h"
93#include "universal_parser.c"
94
95#ifdef RIPPER
96#undef T_NODE
97#define T_NODE 0x1b
98#define STATIC_ID2SYM p->config->static_id2sym
99#define rb_str_coderange_scan_restartable p->config->str_coderange_scan_restartable
100#endif
101
102#else
103
104#include "internal.h"
105#include "internal/compile.h"
106#include "internal/compilers.h"
107#include "internal/complex.h"
108#include "internal/encoding.h"
109#include "internal/error.h"
110#include "internal/hash.h"
111#include "internal/imemo.h"
112#include "internal/io.h"
113#include "internal/numeric.h"
114#include "internal/parse.h"
115#include "internal/rational.h"
116#include "internal/re.h"
117#include "internal/ruby_parser.h"
118#include "internal/symbol.h"
119#include "internal/thread.h"
120#include "internal/variable.h"
121#include "node.h"
122#include "parser_node.h"
123#include "probes.h"
124#include "regenc.h"
125#include "ruby/encoding.h"
126#include "ruby/regex.h"
127#include "ruby/ruby.h"
128#include "ruby/st.h"
129#include "ruby/util.h"
130#include "ruby/ractor.h"
131#include "symbol.h"
132
133#ifndef RIPPER
134static void
135bignum_negate(VALUE b)
136{
137 BIGNUM_NEGATE(b);
138}
139
140static void
141rational_set_num(VALUE r, VALUE n)
142{
143 RATIONAL_SET_NUM(r, n);
144}
145
146static VALUE
147rational_get_num(VALUE obj)
148{
149 return RRATIONAL(obj)->num;
150}
151
152static void
153rcomplex_set_real(VALUE cmp, VALUE r)
154{
155 RCOMPLEX_SET_REAL(cmp, r);
156}
157
158static VALUE
159rcomplex_get_real(VALUE obj)
160{
161 return RCOMPLEX(obj)->real;
162}
163
164static void
165rcomplex_set_imag(VALUE cmp, VALUE i)
166{
167 RCOMPLEX_SET_IMAG(cmp, i);
168}
169
170static VALUE
171rcomplex_get_imag(VALUE obj)
172{
173 return RCOMPLEX(obj)->imag;
174}
175
176static bool
177hash_literal_key_p(VALUE k)
178{
179 switch (OBJ_BUILTIN_TYPE(k)) {
180 case T_NODE:
181 return false;
182 default:
183 return true;
184 }
185}
186
187static int
188literal_cmp(VALUE val, VALUE lit)
189{
190 if (val == lit) return 0;
191 if (!hash_literal_key_p(val) || !hash_literal_key_p(lit)) return -1;
192 return rb_iseq_cdhash_cmp(val, lit);
193}
194
195static st_index_t
196literal_hash(VALUE a)
197{
198 if (!hash_literal_key_p(a)) return (st_index_t)a;
199 return rb_iseq_cdhash_hash(a);
200}
201
202static VALUE
203syntax_error_new(void)
204{
206}
207
208static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc);
209#endif /* !RIPPER */
210
211#define compile_callback rb_suppress_tracing
212VALUE rb_io_gets_internal(VALUE io);
213
214VALUE rb_node_case_when_optimizable_literal(const NODE *const node);
215#endif /* !UNIVERSAL_PARSER */
216
217static inline int
218parse_isascii(int c)
219{
220 return '\0' <= c && c <= '\x7f';
221}
222
223#undef ISASCII
224#define ISASCII parse_isascii
225
226static inline int
227parse_isspace(int c)
228{
229 return c == ' ' || ('\t' <= c && c <= '\r');
230}
231
232#undef ISSPACE
233#define ISSPACE parse_isspace
234
235static inline int
236parse_iscntrl(int c)
237{
238 return ('\0' <= c && c < ' ') || c == '\x7f';
239}
240
241#undef ISCNTRL
242#define ISCNTRL(c) parse_iscntrl(c)
243
244static inline int
245parse_isupper(int c)
246{
247 return 'A' <= c && c <= 'Z';
248}
249
250static inline int
251parse_islower(int c)
252{
253 return 'a' <= c && c <= 'z';
254}
255
256static inline int
257parse_isalpha(int c)
258{
259 return parse_isupper(c) || parse_islower(c);
260}
261
262#undef ISALPHA
263#define ISALPHA(c) parse_isalpha(c)
264
265static inline int
266parse_isdigit(int c)
267{
268 return '0' <= c && c <= '9';
269}
270
271#undef ISDIGIT
272#define ISDIGIT(c) parse_isdigit(c)
273
274static inline int
275parse_isalnum(int c)
276{
277 return parse_isalpha(c) || parse_isdigit(c);
278}
279
280#undef ISALNUM
281#define ISALNUM(c) parse_isalnum(c)
282
283static inline int
284parse_isxdigit(int c)
285{
286 return parse_isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
287}
288
289#undef ISXDIGIT
290#define ISXDIGIT(c) parse_isxdigit(c)
291
292#include "parser_st.h"
293
294#undef STRCASECMP
295#define STRCASECMP rb_parser_st_locale_insensitive_strcasecmp
296
297#undef STRNCASECMP
298#define STRNCASECMP rb_parser_st_locale_insensitive_strncasecmp
299
300#ifdef RIPPER
301#include "ripper_init.h"
302#endif
303
304enum shareability {
305 shareable_none,
306 shareable_literal,
307 shareable_copy,
308 shareable_everything,
309};
310
311enum rescue_context {
312 before_rescue,
313 after_rescue,
314 after_else,
315 after_ensure,
316};
317
319 unsigned int in_defined: 1;
320 unsigned int in_kwarg: 1;
321 unsigned int in_argdef: 1;
322 unsigned int in_def: 1;
323 unsigned int in_class: 1;
324 BITFIELD(enum shareability, shareable_constant_value, 2);
325 BITFIELD(enum rescue_context, in_rescue, 2);
326};
327
329typedef struct RNode_EXITS rb_node_exits_t;
330
331#if defined(__GNUC__) && !defined(__clang__)
332// Suppress "parameter passing for argument of type 'struct
333// lex_context' changed" notes. `struct lex_context` is file scope,
334// and has no ABI compatibility issue.
338// Not sure why effective even after popped.
339#endif
340
341#include "parse.h"
342
343#define NO_LEX_CTXT (struct lex_context){0}
344
345#define AREF(ary, i) RARRAY_AREF(ary, i)
346
347#ifndef WARN_PAST_SCOPE
348# define WARN_PAST_SCOPE 0
349#endif
350
351#define TAB_WIDTH 8
352
353#define yydebug (p->debug) /* disable the global variable definition */
354
355#define YYMALLOC(size) rb_parser_malloc(p, (size))
356#define YYREALLOC(ptr, size) rb_parser_realloc(p, (ptr), (size))
357#define YYCALLOC(nelem, size) rb_parser_calloc(p, (nelem), (size))
358#define YYFREE(ptr) rb_parser_free(p, (ptr))
359#define YYFPRINTF(out, ...) rb_parser_printf(p, __VA_ARGS__)
360#define YY_LOCATION_PRINT(File, loc, p) \
361 rb_parser_printf(p, "%d.%d-%d.%d", \
362 (loc).beg_pos.lineno, (loc).beg_pos.column,\
363 (loc).end_pos.lineno, (loc).end_pos.column)
364#define YYLLOC_DEFAULT(Current, Rhs, N) \
365 do \
366 if (N) \
367 { \
368 (Current).beg_pos = YYRHSLOC(Rhs, 1).beg_pos; \
369 (Current).end_pos = YYRHSLOC(Rhs, N).end_pos; \
370 } \
371 else \
372 { \
373 (Current).beg_pos = YYRHSLOC(Rhs, 0).end_pos; \
374 (Current).end_pos = YYRHSLOC(Rhs, 0).end_pos; \
375 } \
376 while (0)
377#define YY_(Msgid) \
378 (((Msgid)[0] == 'm') && (strcmp((Msgid), "memory exhausted") == 0) ? \
379 "nesting too deep" : (Msgid))
380
381#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current) \
382 rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))
383#define RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(Current) \
384 rb_parser_set_location_of_delayed_token(p, &(Current))
385#define RUBY_SET_YYLLOC_OF_HEREDOC_END(Current) \
386 rb_parser_set_location_of_heredoc_end(p, &(Current))
387#define RUBY_SET_YYLLOC_OF_DUMMY_END(Current) \
388 rb_parser_set_location_of_dummy_end(p, &(Current))
389#define RUBY_SET_YYLLOC_OF_NONE(Current) \
390 rb_parser_set_location_of_none(p, &(Current))
391#define RUBY_SET_YYLLOC(Current) \
392 rb_parser_set_location(p, &(Current))
393#define RUBY_INIT_YYLLOC() \
394 { \
395 {p->ruby_sourceline, (int)(p->lex.ptok - p->lex.pbeg)}, \
396 {p->ruby_sourceline, (int)(p->lex.pcur - p->lex.pbeg)}, \
397 }
398
399#define IS_lex_state_for(x, ls) ((x) & (ls))
400#define IS_lex_state_all_for(x, ls) (((x) & (ls)) == (ls))
401#define IS_lex_state(ls) IS_lex_state_for(p->lex.state, (ls))
402#define IS_lex_state_all(ls) IS_lex_state_all_for(p->lex.state, (ls))
403
404# define SET_LEX_STATE(ls) \
405 parser_set_lex_state(p, ls, __LINE__)
406static inline enum lex_state_e parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line);
407
408typedef VALUE stack_type;
409
410static const rb_code_location_t NULL_LOC = { {0, -1}, {0, -1} };
411
412# define SHOW_BITSTACK(stack, name) (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)
413# define BITSTACK_PUSH(stack, n) (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))
414# define BITSTACK_POP(stack) (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))
415# define BITSTACK_SET_P(stack) (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)
416# define BITSTACK_SET(stack, n) ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))
417
418/* A flag to identify keyword_do_cond, "do" keyword after condition expression.
419 Examples: `while ... do`, `until ... do`, and `for ... in ... do` */
420#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n))
421#define COND_POP() BITSTACK_POP(cond_stack)
422#define COND_P() BITSTACK_SET_P(cond_stack)
423#define COND_SET(n) BITSTACK_SET(cond_stack, (n))
424
425/* A flag to identify keyword_do_block; "do" keyword after command_call.
426 Example: `foo 1, 2 do`. */
427#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n))
428#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
429#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
430#define CMDARG_SET(n) BITSTACK_SET(cmdarg_stack, (n))
431
432struct vtable {
433 ID *tbl;
434 int pos;
435 int capa;
436 struct vtable *prev;
437};
438
440 struct vtable *args;
441 struct vtable *vars;
442 struct vtable *used;
443# if WARN_PAST_SCOPE
444 struct vtable *past;
445# endif
446 struct local_vars *prev;
447# ifndef RIPPER
448 struct {
449 NODE *outer, *inner, *current;
450 } numparam;
451# endif
452};
453
454enum {
455 ORDINAL_PARAM = -1,
456 NO_PARAM = 0,
457 NUMPARAM_MAX = 9,
458};
459
460#define DVARS_INHERIT ((void*)1)
461#define DVARS_TOPSCOPE NULL
462#define DVARS_TERMINAL_P(tbl) ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)
463
464typedef struct token_info {
465 const char *token;
467 int indent;
468 int nonspc;
469 struct token_info *next;
470} token_info;
471
472/*
473 Structure of Lexer Buffer:
474
475 lex.pbeg lex.ptok lex.pcur lex.pend
476 | | | |
477 |------------+------------+------------|
478 |<---------->|
479 token
480*/
482 rb_imemo_tmpbuf_t *heap;
483
484 YYSTYPE *lval;
485 YYLTYPE *yylloc;
486
487 struct {
488 rb_strterm_t *strterm;
489 VALUE (*gets)(struct parser_params*,VALUE);
490 VALUE input;
491 VALUE lastline;
492 VALUE nextline;
493 const char *pbeg;
494 const char *pcur;
495 const char *pend;
496 const char *ptok;
497 union {
498 long ptr;
499 VALUE (*call)(VALUE, int);
500 } gets_;
501 enum lex_state_e state;
502 /* track the nest level of any parens "()[]{}" */
503 int paren_nest;
504 /* keep p->lex.paren_nest at the beginning of lambda "->" to detect tLAMBEG and keyword_do_LAMBDA */
505 int lpar_beg;
506 /* track the nest level of only braces "{}" */
507 int brace_nest;
508 } lex;
509 stack_type cond_stack;
510 stack_type cmdarg_stack;
511 int tokidx;
512 int toksiz;
513 int heredoc_end;
514 int heredoc_indent;
515 int heredoc_line_indent;
516 char *tokenbuf;
517 struct local_vars *lvtbl;
518 st_table *pvtbl;
519 st_table *pktbl;
520 int line_count;
521 int ruby_sourceline; /* current line no. */
522 const char *ruby_sourcefile; /* current source file */
523 VALUE ruby_sourcefile_string;
524 rb_encoding *enc;
526 VALUE case_labels;
527 rb_node_exits_t *exits;
528
529 VALUE debug_buffer;
530 VALUE debug_output;
531
532 struct {
533 VALUE token;
534 int beg_line;
535 int beg_col;
536 int end_line;
537 int end_col;
538 } delayed;
539
540 ID cur_arg;
541
542 rb_ast_t *ast;
543 int node_id;
544
545 int max_numparam;
546
547 struct lex_context ctxt;
548
549#ifdef UNIVERSAL_PARSER
550 rb_parser_config_t *config;
551#endif
552 /* compile_option */
553 signed int frozen_string_literal:2; /* -1: not specified, 0: false, 1: true */
554
555 unsigned int command_start:1;
556 unsigned int eofp: 1;
557 unsigned int ruby__end__seen: 1;
558 unsigned int debug: 1;
559 unsigned int has_shebang: 1;
560 unsigned int token_seen: 1;
561 unsigned int token_info_enabled: 1;
562# if WARN_PAST_SCOPE
563 unsigned int past_scope_enabled: 1;
564# endif
565 unsigned int error_p: 1;
566 unsigned int cr_seen: 1;
567
568#ifndef RIPPER
569 /* Ruby core only */
570
571 unsigned int do_print: 1;
572 unsigned int do_loop: 1;
573 unsigned int do_chomp: 1;
574 unsigned int do_split: 1;
575 unsigned int error_tolerant: 1;
576 unsigned int keep_tokens: 1;
577
578 NODE *eval_tree_begin;
579 NODE *eval_tree;
580 VALUE error_buffer;
581 VALUE debug_lines;
582 const struct rb_iseq_struct *parent_iseq;
583 /* store specific keyword locations to generate dummy end token */
584 VALUE end_expect_token_locations;
585 /* id for terms */
586 int token_id;
587 /* Array for term tokens */
588 VALUE tokens;
589#else
590 /* Ripper only */
591
592 VALUE value;
593 VALUE result;
594 VALUE parsing_thread;
595#endif
596};
597
598#define NUMPARAM_ID_P(id) numparam_id_p(p, id)
599#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - (tNUMPARAM_1 - 1))
600#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 - 1 + (idx)))
601static int
602numparam_id_p(struct parser_params *p, ID id)
603{
604 if (!is_local_id(id) || id < (tNUMPARAM_1 << ID_SCOPE_SHIFT)) return 0;
605 unsigned int idx = NUMPARAM_ID_TO_IDX(id);
606 return idx > 0 && idx <= NUMPARAM_MAX;
607}
608static void numparam_name(struct parser_params *p, ID id);
609
610
611#define intern_cstr(n,l,en) rb_intern3(n,l,en)
612
613#define STR_NEW(ptr,len) rb_enc_str_new((ptr),(len),p->enc)
614#define STR_NEW0() rb_enc_str_new(0,0,p->enc)
615#define STR_NEW2(ptr) rb_enc_str_new((ptr),strlen(ptr),p->enc)
616#define STR_NEW3(ptr,len,e,func) parser_str_new(p, (ptr),(len),(e),(func),p->enc)
617#define TOK_INTERN() intern_cstr(tok(p), toklen(p), p->enc)
618#define VALID_SYMNAME_P(s, l, enc, type) (rb_enc_symname_type(s, l, enc, (1U<<(type))) == (int)(type))
619
620static inline bool
621end_with_newline_p(struct parser_params *p, VALUE str)
622{
623 return RSTRING_LEN(str) > 0 && RSTRING_END(str)[-1] == '\n';
624}
625
626static void
627pop_pvtbl(struct parser_params *p, st_table *tbl)
628{
629 st_free_table(p->pvtbl);
630 p->pvtbl = tbl;
631}
632
633static void
634pop_pktbl(struct parser_params *p, st_table *tbl)
635{
636 if (p->pktbl) st_free_table(p->pktbl);
637 p->pktbl = tbl;
638}
639
640#ifndef RIPPER
641static void flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str);
642
643static void
644debug_end_expect_token_locations(struct parser_params *p, const char *name)
645{
646 if(p->debug) {
647 VALUE mesg = rb_sprintf("%s: ", name);
648 rb_str_catf(mesg, " %"PRIsVALUE"\n", p->end_expect_token_locations);
649 flush_debug_buffer(p, p->debug_output, mesg);
650 }
651}
652
653static void
654push_end_expect_token_locations(struct parser_params *p, const rb_code_position_t *pos)
655{
656 if(NIL_P(p->end_expect_token_locations)) return;
657 rb_ary_push(p->end_expect_token_locations, rb_ary_new_from_args(2, INT2NUM(pos->lineno), INT2NUM(pos->column)));
658 debug_end_expect_token_locations(p, "push_end_expect_token_locations");
659}
660
661static void
662pop_end_expect_token_locations(struct parser_params *p)
663{
664 if(NIL_P(p->end_expect_token_locations)) return;
665 rb_ary_pop(p->end_expect_token_locations);
666 debug_end_expect_token_locations(p, "pop_end_expect_token_locations");
667}
668
669static VALUE
670peek_end_expect_token_locations(struct parser_params *p)
671{
672 if(NIL_P(p->end_expect_token_locations)) return Qnil;
673 return rb_ary_last(0, 0, p->end_expect_token_locations);
674}
675
676static ID
677parser_token2id(struct parser_params *p, enum yytokentype tok)
678{
679 switch ((int) tok) {
680#define TOKEN2ID(tok) case tok: return rb_intern(#tok);
681#define TOKEN2ID2(tok, name) case tok: return rb_intern(name);
682 TOKEN2ID2(' ', "words_sep")
683 TOKEN2ID2('!', "!")
684 TOKEN2ID2('%', "%");
685 TOKEN2ID2('&', "&");
686 TOKEN2ID2('*', "*");
687 TOKEN2ID2('+', "+");
688 TOKEN2ID2('-', "-");
689 TOKEN2ID2('/', "/");
690 TOKEN2ID2('<', "<");
691 TOKEN2ID2('=', "=");
692 TOKEN2ID2('>', ">");
693 TOKEN2ID2('?', "?");
694 TOKEN2ID2('^', "^");
695 TOKEN2ID2('|', "|");
696 TOKEN2ID2('~', "~");
697 TOKEN2ID2(':', ":");
698 TOKEN2ID2(',', ",");
699 TOKEN2ID2('.', ".");
700 TOKEN2ID2(';', ";");
701 TOKEN2ID2('`', "`");
702 TOKEN2ID2('\n', "nl");
703 TOKEN2ID2('{', "{");
704 TOKEN2ID2('}', "}");
705 TOKEN2ID2('[', "[");
706 TOKEN2ID2(']', "]");
707 TOKEN2ID2('(', "(");
708 TOKEN2ID2(')', ")");
709 TOKEN2ID2('\\', "backslash");
710 TOKEN2ID(keyword_class);
711 TOKEN2ID(keyword_module);
712 TOKEN2ID(keyword_def);
713 TOKEN2ID(keyword_undef);
714 TOKEN2ID(keyword_begin);
715 TOKEN2ID(keyword_rescue);
716 TOKEN2ID(keyword_ensure);
717 TOKEN2ID(keyword_end);
718 TOKEN2ID(keyword_if);
719 TOKEN2ID(keyword_unless);
720 TOKEN2ID(keyword_then);
721 TOKEN2ID(keyword_elsif);
722 TOKEN2ID(keyword_else);
723 TOKEN2ID(keyword_case);
724 TOKEN2ID(keyword_when);
725 TOKEN2ID(keyword_while);
726 TOKEN2ID(keyword_until);
727 TOKEN2ID(keyword_for);
728 TOKEN2ID(keyword_break);
729 TOKEN2ID(keyword_next);
730 TOKEN2ID(keyword_redo);
731 TOKEN2ID(keyword_retry);
732 TOKEN2ID(keyword_in);
733 TOKEN2ID(keyword_do);
734 TOKEN2ID(keyword_do_cond);
735 TOKEN2ID(keyword_do_block);
736 TOKEN2ID(keyword_do_LAMBDA);
737 TOKEN2ID(keyword_return);
738 TOKEN2ID(keyword_yield);
739 TOKEN2ID(keyword_super);
740 TOKEN2ID(keyword_self);
741 TOKEN2ID(keyword_nil);
742 TOKEN2ID(keyword_true);
743 TOKEN2ID(keyword_false);
744 TOKEN2ID(keyword_and);
745 TOKEN2ID(keyword_or);
746 TOKEN2ID(keyword_not);
747 TOKEN2ID(modifier_if);
748 TOKEN2ID(modifier_unless);
749 TOKEN2ID(modifier_while);
750 TOKEN2ID(modifier_until);
751 TOKEN2ID(modifier_rescue);
752 TOKEN2ID(keyword_alias);
753 TOKEN2ID(keyword_defined);
754 TOKEN2ID(keyword_BEGIN);
755 TOKEN2ID(keyword_END);
756 TOKEN2ID(keyword__LINE__);
757 TOKEN2ID(keyword__FILE__);
758 TOKEN2ID(keyword__ENCODING__);
759 TOKEN2ID(tIDENTIFIER);
760 TOKEN2ID(tFID);
761 TOKEN2ID(tGVAR);
762 TOKEN2ID(tIVAR);
763 TOKEN2ID(tCONSTANT);
764 TOKEN2ID(tCVAR);
765 TOKEN2ID(tLABEL);
766 TOKEN2ID(tINTEGER);
767 TOKEN2ID(tFLOAT);
768 TOKEN2ID(tRATIONAL);
769 TOKEN2ID(tIMAGINARY);
770 TOKEN2ID(tCHAR);
771 TOKEN2ID(tNTH_REF);
772 TOKEN2ID(tBACK_REF);
773 TOKEN2ID(tSTRING_CONTENT);
774 TOKEN2ID(tREGEXP_END);
775 TOKEN2ID(tDUMNY_END);
776 TOKEN2ID(tSP);
777 TOKEN2ID(tUPLUS);
778 TOKEN2ID(tUMINUS);
779 TOKEN2ID(tPOW);
780 TOKEN2ID(tCMP);
781 TOKEN2ID(tEQ);
782 TOKEN2ID(tEQQ);
783 TOKEN2ID(tNEQ);
784 TOKEN2ID(tGEQ);
785 TOKEN2ID(tLEQ);
786 TOKEN2ID(tANDOP);
787 TOKEN2ID(tOROP);
788 TOKEN2ID(tMATCH);
789 TOKEN2ID(tNMATCH);
790 TOKEN2ID(tDOT2);
791 TOKEN2ID(tDOT3);
792 TOKEN2ID(tBDOT2);
793 TOKEN2ID(tBDOT3);
794 TOKEN2ID(tAREF);
795 TOKEN2ID(tASET);
796 TOKEN2ID(tLSHFT);
797 TOKEN2ID(tRSHFT);
798 TOKEN2ID(tANDDOT);
799 TOKEN2ID(tCOLON2);
800 TOKEN2ID(tCOLON3);
801 TOKEN2ID(tOP_ASGN);
802 TOKEN2ID(tASSOC);
803 TOKEN2ID(tLPAREN);
804 TOKEN2ID(tLPAREN_ARG);
805 TOKEN2ID(tRPAREN);
806 TOKEN2ID(tLBRACK);
807 TOKEN2ID(tLBRACE);
808 TOKEN2ID(tLBRACE_ARG);
809 TOKEN2ID(tSTAR);
810 TOKEN2ID(tDSTAR);
811 TOKEN2ID(tAMPER);
812 TOKEN2ID(tLAMBDA);
813 TOKEN2ID(tSYMBEG);
814 TOKEN2ID(tSTRING_BEG);
815 TOKEN2ID(tXSTRING_BEG);
816 TOKEN2ID(tREGEXP_BEG);
817 TOKEN2ID(tWORDS_BEG);
818 TOKEN2ID(tQWORDS_BEG);
819 TOKEN2ID(tSYMBOLS_BEG);
820 TOKEN2ID(tQSYMBOLS_BEG);
821 TOKEN2ID(tSTRING_END);
822 TOKEN2ID(tSTRING_DEND);
823 TOKEN2ID(tSTRING_DBEG);
824 TOKEN2ID(tSTRING_DVAR);
825 TOKEN2ID(tLAMBEG);
826 TOKEN2ID(tLABEL_END);
827 TOKEN2ID(tIGNORED_NL);
828 TOKEN2ID(tCOMMENT);
829 TOKEN2ID(tEMBDOC_BEG);
830 TOKEN2ID(tEMBDOC);
831 TOKEN2ID(tEMBDOC_END);
832 TOKEN2ID(tHEREDOC_BEG);
833 TOKEN2ID(tHEREDOC_END);
834 TOKEN2ID(k__END__);
835 TOKEN2ID(tLOWEST);
836 TOKEN2ID(tUMINUS_NUM);
837 TOKEN2ID(tLAST_TOKEN);
838#undef TOKEN2ID
839#undef TOKEN2ID2
840 }
841
842 rb_bug("parser_token2id: unknown token %d", tok);
843
844 UNREACHABLE_RETURN(0);
845}
846
847#endif
848
849RBIMPL_ATTR_NONNULL((1, 2, 3))
850static int parser_yyerror(struct parser_params*, const YYLTYPE *yylloc, const char*);
851RBIMPL_ATTR_NONNULL((1, 2))
852static int parser_yyerror0(struct parser_params*, const char*);
853#define yyerror0(msg) parser_yyerror0(p, (msg))
854#define yyerror1(loc, msg) parser_yyerror(p, (loc), (msg))
855#define yyerror(yylloc, p, msg) parser_yyerror(p, yylloc, msg)
856#define token_flush(ptr) ((ptr)->lex.ptok = (ptr)->lex.pcur)
857#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
858#define lex_eol_p(p) lex_eol_n_p(p, 0)
859#define lex_eol_n_p(p,n) lex_eol_ptr_n_p(p, (p)->lex.pcur, n)
860#define lex_eol_ptr_p(p,ptr) lex_eol_ptr_n_p(p,ptr,0)
861#define lex_eol_ptr_n_p(p,ptr,n) ((ptr)+(n) >= (p)->lex.pend)
862
863static void token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc);
864static void token_info_push(struct parser_params*, const char *token, const rb_code_location_t *loc);
865static void token_info_pop(struct parser_params*, const char *token, const rb_code_location_t *loc);
866static void token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc);
867static void token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos);
868
869#ifdef RIPPER
870#define compile_for_eval (0)
871#else
872#define compile_for_eval (p->parent_iseq != 0)
873#endif
874
875#define token_column ((int)(p->lex.ptok - p->lex.pbeg))
876
877#define CALL_Q_P(q) ((q) == TOKEN2VAL(tANDDOT))
878#define NEW_QCALL(q,r,m,a,loc) (CALL_Q_P(q) ? NEW_QCALL0(r,m,a,loc) : NEW_CALL(r,m,a,loc))
879
880#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
881
882static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
883
884#ifndef RIPPER
885static inline void
886rb_discard_node(struct parser_params *p, NODE *n)
887{
888 rb_ast_delete_node(p->ast, n);
889}
890#endif
891
892#ifdef RIPPER
893static inline VALUE
894add_mark_object(struct parser_params *p, VALUE obj)
895{
896 if (!SPECIAL_CONST_P(obj)
897 && !RB_TYPE_P(obj, T_NODE) /* Ripper jumbles NODE objects and other objects... */
898 ) {
899 rb_ast_add_mark_object(p->ast, obj);
900 }
901 return obj;
902}
903
904static rb_node_ripper_t *rb_node_ripper_new(struct parser_params *p, ID a, VALUE b, VALUE c, const YYLTYPE *loc);
905static rb_node_ripper_values_t *rb_node_ripper_values_new(struct parser_params *p, VALUE a, VALUE b, VALUE c, const YYLTYPE *loc);
906#define NEW_RIPPER(a,b,c,loc) (VALUE)rb_node_ripper_new(p,a,b,c,loc)
907#define NEW_RIPPER_VALUES(a,b,c,loc) (VALUE)rb_node_ripper_values_new(p,a,b,c,loc)
908
909#else
910static rb_node_scope_t *rb_node_scope_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
911static 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);
912static rb_node_block_t *rb_node_block_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
913static rb_node_if_t *rb_node_if_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc);
914static rb_node_unless_t *rb_node_unless_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc);
915static rb_node_case_t *rb_node_case_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc);
916static rb_node_case2_t *rb_node_case2_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
917static rb_node_case3_t *rb_node_case3_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc);
918static rb_node_when_t *rb_node_when_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc);
919static rb_node_in_t *rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc);
920static rb_node_while_t *rb_node_while_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc);
921static rb_node_until_t *rb_node_until_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc);
922static rb_node_iter_t *rb_node_iter_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
923static rb_node_for_t *rb_node_for_new(struct parser_params *p, NODE *nd_iter, NODE *nd_body, const YYLTYPE *loc);
924static rb_node_for_masgn_t *rb_node_for_masgn_new(struct parser_params *p, NODE *nd_var, const YYLTYPE *loc);
925static rb_node_retry_t *rb_node_retry_new(struct parser_params *p, const YYLTYPE *loc);
926static rb_node_begin_t *rb_node_begin_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
927static rb_node_rescue_t *rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *nd_else, const YYLTYPE *loc);
928static rb_node_resbody_t *rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_body, NODE *nd_head, const YYLTYPE *loc);
929static rb_node_ensure_t *rb_node_ensure_new(struct parser_params *p, NODE *nd_head, NODE *nd_ensr, const YYLTYPE *loc);
930static rb_node_and_t *rb_node_and_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc);
931static rb_node_or_t *rb_node_or_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc);
932static rb_node_masgn_t *rb_node_masgn_new(struct parser_params *p, NODE *nd_head, NODE *nd_args, const YYLTYPE *loc);
933static rb_node_lasgn_t *rb_node_lasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
934static rb_node_dasgn_t *rb_node_dasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
935static rb_node_gasgn_t *rb_node_gasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
936static rb_node_iasgn_t *rb_node_iasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
937static rb_node_cdecl_t *rb_node_cdecl_new(struct parser_params *p, ID nd_vid, NODE *nd_value, NODE *nd_else, const YYLTYPE *loc);
938static rb_node_cvasgn_t *rb_node_cvasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc);
939static 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);
940static 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);
941static 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);
942static 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);
943static rb_node_op_cdecl_t *rb_node_op_cdecl_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, ID nd_aid, const YYLTYPE *loc);
944static rb_node_call_t *rb_node_call_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
945static rb_node_opcall_t *rb_node_opcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
946static rb_node_fcall_t *rb_node_fcall_new(struct parser_params *p, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
947static rb_node_vcall_t *rb_node_vcall_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc);
948static rb_node_qcall_t *rb_node_qcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
949static rb_node_super_t *rb_node_super_new(struct parser_params *p, NODE *nd_args, const YYLTYPE *loc);
950static rb_node_zsuper_t * rb_node_zsuper_new(struct parser_params *p, const YYLTYPE *loc);
951static rb_node_list_t *rb_node_list_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
952static rb_node_list_t *rb_node_list_new2(struct parser_params *p, NODE *nd_head, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
953static rb_node_zlist_t *rb_node_zlist_new(struct parser_params *p, const YYLTYPE *loc);
954static rb_node_hash_t *rb_node_hash_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
955static rb_node_return_t *rb_node_return_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc);
956static rb_node_yield_t *rb_node_yield_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
957static rb_node_lvar_t *rb_node_lvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
958static rb_node_dvar_t *rb_node_dvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
959static rb_node_gvar_t *rb_node_gvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
960static rb_node_ivar_t *rb_node_ivar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
961static rb_node_const_t *rb_node_const_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
962static rb_node_cvar_t *rb_node_cvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc);
963static rb_node_nth_ref_t *rb_node_nth_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc);
964static rb_node_back_ref_t *rb_node_back_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc);
965static rb_node_match2_t *rb_node_match2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc);
966static rb_node_match3_t *rb_node_match3_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc);
967static rb_node_lit_t *rb_node_lit_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc);
968static rb_node_str_t *rb_node_str_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc);
969static rb_node_dstr_t *rb_node_dstr_new0(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
970static rb_node_dstr_t *rb_node_dstr_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc);
971static rb_node_xstr_t *rb_node_xstr_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc);
972static rb_node_dxstr_t *rb_node_dxstr_new(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
973static rb_node_evstr_t *rb_node_evstr_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
974static rb_node_once_t *rb_node_once_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
975static rb_node_args_t *rb_node_args_new(struct parser_params *p, const YYLTYPE *loc);
976static rb_node_args_aux_t *rb_node_args_aux_new(struct parser_params *p, ID nd_pid, long nd_plen, const YYLTYPE *loc);
977static rb_node_opt_arg_t *rb_node_opt_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
978static rb_node_kw_arg_t *rb_node_kw_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
979static rb_node_postarg_t *rb_node_postarg_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc);
980static rb_node_argscat_t *rb_node_argscat_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc);
981static rb_node_argspush_t *rb_node_argspush_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc);
982static rb_node_splat_t *rb_node_splat_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
983static rb_node_block_pass_t *rb_node_block_pass_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
984static rb_node_defn_t *rb_node_defn_new(struct parser_params *p, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc);
985static rb_node_defs_t *rb_node_defs_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc);
986static rb_node_alias_t *rb_node_alias_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc);
987static rb_node_valias_t *rb_node_valias_new(struct parser_params *p, ID nd_alias, ID nd_orig, const YYLTYPE *loc);
988static rb_node_undef_t *rb_node_undef_new(struct parser_params *p, NODE *nd_undef, const YYLTYPE *loc);
989static rb_node_class_t *rb_node_class_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, NODE *nd_super, const YYLTYPE *loc);
990static rb_node_module_t *rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc);
991static rb_node_sclass_t *rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const YYLTYPE *loc);
992static rb_node_colon2_t *rb_node_colon2_new(struct parser_params *p, NODE *nd_head, ID nd_mid, const YYLTYPE *loc);
993static rb_node_colon3_t *rb_node_colon3_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc);
994static rb_node_dot2_t *rb_node_dot2_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc);
995static rb_node_dot3_t *rb_node_dot3_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc);
996static rb_node_self_t *rb_node_self_new(struct parser_params *p, const YYLTYPE *loc);
997static rb_node_nil_t *rb_node_nil_new(struct parser_params *p, const YYLTYPE *loc);
998static rb_node_true_t *rb_node_true_new(struct parser_params *p, const YYLTYPE *loc);
999static rb_node_false_t *rb_node_false_new(struct parser_params *p, const YYLTYPE *loc);
1000static rb_node_errinfo_t *rb_node_errinfo_new(struct parser_params *p, const YYLTYPE *loc);
1001static rb_node_defined_t *rb_node_defined_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc);
1002static rb_node_postexe_t *rb_node_postexe_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1003static rb_node_dsym_t *rb_node_dsym_new(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc);
1004static rb_node_attrasgn_t *rb_node_attrasgn_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc);
1005static rb_node_lambda_t *rb_node_lambda_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
1006static rb_node_aryptn_t *rb_node_aryptn_new(struct parser_params *p, NODE *pre_args, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc);
1007static rb_node_hshptn_t *rb_node_hshptn_new(struct parser_params *p, NODE *nd_pconst, NODE *nd_pkwargs, NODE *nd_pkwrestarg, const YYLTYPE *loc);
1008static 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);
1009static rb_node_error_t *rb_node_error_new(struct parser_params *p, const YYLTYPE *loc);
1010
1011#define NEW_SCOPE(a,b,loc) (NODE *)rb_node_scope_new(p,a,b,loc)
1012#define NEW_SCOPE2(t,a,b,loc) (NODE *)rb_node_scope_new2(p,t,a,b,loc)
1013#define NEW_BLOCK(a,loc) (NODE *)rb_node_block_new(p,a,loc)
1014#define NEW_IF(c,t,e,loc) (NODE *)rb_node_if_new(p,c,t,e,loc)
1015#define NEW_UNLESS(c,t,e,loc) (NODE *)rb_node_unless_new(p,c,t,e,loc)
1016#define NEW_CASE(h,b,loc) (NODE *)rb_node_case_new(p,h,b,loc)
1017#define NEW_CASE2(b,loc) (NODE *)rb_node_case2_new(p,b,loc)
1018#define NEW_CASE3(h,b,loc) (NODE *)rb_node_case3_new(p,h,b,loc)
1019#define NEW_WHEN(c,t,e,loc) (NODE *)rb_node_when_new(p,c,t,e,loc)
1020#define NEW_IN(c,t,e,loc) (NODE *)rb_node_in_new(p,c,t,e,loc)
1021#define NEW_WHILE(c,b,n,loc) (NODE *)rb_node_while_new(p,c,b,n,loc)
1022#define NEW_UNTIL(c,b,n,loc) (NODE *)rb_node_until_new(p,c,b,n,loc)
1023#define NEW_ITER(a,b,loc) (NODE *)rb_node_iter_new(p,a,b,loc)
1024#define NEW_FOR(i,b,loc) (NODE *)rb_node_for_new(p,i,b,loc)
1025#define NEW_FOR_MASGN(v,loc) (NODE *)rb_node_for_masgn_new(p,v,loc)
1026#define NEW_RETRY(loc) (NODE *)rb_node_retry_new(p,loc)
1027#define NEW_BEGIN(b,loc) (NODE *)rb_node_begin_new(p,b,loc)
1028#define NEW_RESCUE(b,res,e,loc) (NODE *)rb_node_rescue_new(p,b,res,e,loc)
1029#define NEW_RESBODY(a,ex,n,loc) (NODE *)rb_node_resbody_new(p,a,ex,n,loc)
1030#define NEW_ENSURE(b,en,loc) (NODE *)rb_node_ensure_new(p,b,en,loc)
1031#define NEW_AND(f,s,loc) (NODE *)rb_node_and_new(p,f,s,loc)
1032#define NEW_OR(f,s,loc) (NODE *)rb_node_or_new(p,f,s,loc)
1033#define NEW_MASGN(l,r,loc) rb_node_masgn_new(p,l,r,loc)
1034#define NEW_LASGN(v,val,loc) (NODE *)rb_node_lasgn_new(p,v,val,loc)
1035#define NEW_DASGN(v,val,loc) (NODE *)rb_node_dasgn_new(p,v,val,loc)
1036#define NEW_GASGN(v,val,loc) (NODE *)rb_node_gasgn_new(p,v,val,loc)
1037#define NEW_IASGN(v,val,loc) (NODE *)rb_node_iasgn_new(p,v,val,loc)
1038#define NEW_CDECL(v,val,path,loc) (NODE *)rb_node_cdecl_new(p,v,val,path,loc)
1039#define NEW_CVASGN(v,val,loc) (NODE *)rb_node_cvasgn_new(p,v,val,loc)
1040#define NEW_OP_ASGN1(r,id,idx,rval,loc) (NODE *)rb_node_op_asgn1_new(p,r,id,idx,rval,loc)
1041#define NEW_OP_ASGN2(r,t,i,o,val,loc) (NODE *)rb_node_op_asgn2_new(p,r,val,i,o,t,loc)
1042#define NEW_OP_ASGN_OR(i,val,loc) (NODE *)rb_node_op_asgn_or_new(p,i,val,loc)
1043#define NEW_OP_ASGN_AND(i,val,loc) (NODE *)rb_node_op_asgn_and_new(p,i,val,loc)
1044#define NEW_OP_CDECL(v,op,val,loc) (NODE *)rb_node_op_cdecl_new(p,v,val,op,loc)
1045#define NEW_CALL(r,m,a,loc) (NODE *)rb_node_call_new(p,r,m,a,loc)
1046#define NEW_OPCALL(r,m,a,loc) (NODE *)rb_node_opcall_new(p,r,m,a,loc)
1047#define NEW_FCALL(m,a,loc) rb_node_fcall_new(p,m,a,loc)
1048#define NEW_VCALL(m,loc) (NODE *)rb_node_vcall_new(p,m,loc)
1049#define NEW_QCALL0(r,m,a,loc) (NODE *)rb_node_qcall_new(p,r,m,a,loc)
1050#define NEW_SUPER(a,loc) (NODE *)rb_node_super_new(p,a,loc)
1051#define NEW_ZSUPER(loc) (NODE *)rb_node_zsuper_new(p,loc)
1052#define NEW_LIST(a,loc) (NODE *)rb_node_list_new(p,a,loc)
1053#define NEW_LIST2(h,l,n,loc) (NODE *)rb_node_list_new2(p,h,l,n,loc)
1054#define NEW_ZLIST(loc) (NODE *)rb_node_zlist_new(p,loc)
1055#define NEW_HASH(a,loc) (NODE *)rb_node_hash_new(p,a,loc)
1056#define NEW_RETURN(s,loc) (NODE *)rb_node_return_new(p,s,loc)
1057#define NEW_YIELD(a,loc) (NODE *)rb_node_yield_new(p,a,loc)
1058#define NEW_LVAR(v,loc) (NODE *)rb_node_lvar_new(p,v,loc)
1059#define NEW_DVAR(v,loc) (NODE *)rb_node_dvar_new(p,v,loc)
1060#define NEW_GVAR(v,loc) (NODE *)rb_node_gvar_new(p,v,loc)
1061#define NEW_IVAR(v,loc) (NODE *)rb_node_ivar_new(p,v,loc)
1062#define NEW_CONST(v,loc) (NODE *)rb_node_const_new(p,v,loc)
1063#define NEW_CVAR(v,loc) (NODE *)rb_node_cvar_new(p,v,loc)
1064#define NEW_NTH_REF(n,loc) (NODE *)rb_node_nth_ref_new(p,n,loc)
1065#define NEW_BACK_REF(n,loc) (NODE *)rb_node_back_ref_new(p,n,loc)
1066#define NEW_MATCH2(n1,n2,loc) (NODE *)rb_node_match2_new(p,n1,n2,loc)
1067#define NEW_MATCH3(r,n2,loc) (NODE *)rb_node_match3_new(p,r,n2,loc)
1068#define NEW_LIT(l,loc) (NODE *)rb_node_lit_new(p,l,loc)
1069#define NEW_STR(s,loc) (NODE *)rb_node_str_new(p,s,loc)
1070#define NEW_DSTR0(s,l,n,loc) (NODE *)rb_node_dstr_new0(p,s,l,n,loc)
1071#define NEW_DSTR(s,loc) (NODE *)rb_node_dstr_new(p,s,loc)
1072#define NEW_XSTR(s,loc) (NODE *)rb_node_xstr_new(p,s,loc)
1073#define NEW_DXSTR(s,l,n,loc) (NODE *)rb_node_dxstr_new(p,s,l,n,loc)
1074#define NEW_EVSTR(n,loc) (NODE *)rb_node_evstr_new(p,n,loc)
1075#define NEW_ONCE(b,loc) (NODE *)rb_node_once_new(p,b,loc)
1076#define NEW_ARGS(loc) rb_node_args_new(p,loc)
1077#define NEW_ARGS_AUX(r,b,loc) rb_node_args_aux_new(p,r,b,loc)
1078#define NEW_OPT_ARG(v,loc) rb_node_opt_arg_new(p,v,loc)
1079#define NEW_KW_ARG(v,loc) rb_node_kw_arg_new(p,v,loc)
1080#define NEW_POSTARG(i,v,loc) (NODE *)rb_node_postarg_new(p,i,v,loc)
1081#define NEW_ARGSCAT(a,b,loc) (NODE *)rb_node_argscat_new(p,a,b,loc)
1082#define NEW_ARGSPUSH(a,b,loc) (NODE *)rb_node_argspush_new(p,a,b,loc)
1083#define NEW_SPLAT(a,loc) (NODE *)rb_node_splat_new(p,a,loc)
1084#define NEW_BLOCK_PASS(b,loc) rb_node_block_pass_new(p,b,loc)
1085#define NEW_DEFN(i,s,loc) (NODE *)rb_node_defn_new(p,i,s,loc)
1086#define NEW_DEFS(r,i,s,loc) (NODE *)rb_node_defs_new(p,r,i,s,loc)
1087#define NEW_ALIAS(n,o,loc) (NODE *)rb_node_alias_new(p,n,o,loc)
1088#define NEW_VALIAS(n,o,loc) (NODE *)rb_node_valias_new(p,n,o,loc)
1089#define NEW_UNDEF(i,loc) (NODE *)rb_node_undef_new(p,i,loc)
1090#define NEW_CLASS(n,b,s,loc) (NODE *)rb_node_class_new(p,n,b,s,loc)
1091#define NEW_MODULE(n,b,loc) (NODE *)rb_node_module_new(p,n,b,loc)
1092#define NEW_SCLASS(r,b,loc) (NODE *)rb_node_sclass_new(p,r,b,loc)
1093#define NEW_COLON2(c,i,loc) (NODE *)rb_node_colon2_new(p,c,i,loc)
1094#define NEW_COLON3(i,loc) (NODE *)rb_node_colon3_new(p,i,loc)
1095#define NEW_DOT2(b,e,loc) (NODE *)rb_node_dot2_new(p,b,e,loc)
1096#define NEW_DOT3(b,e,loc) (NODE *)rb_node_dot3_new(p,b,e,loc)
1097#define NEW_SELF(loc) (NODE *)rb_node_self_new(p,loc)
1098#define NEW_NIL(loc) (NODE *)rb_node_nil_new(p,loc)
1099#define NEW_TRUE(loc) (NODE *)rb_node_true_new(p,loc)
1100#define NEW_FALSE(loc) (NODE *)rb_node_false_new(p,loc)
1101#define NEW_ERRINFO(loc) (NODE *)rb_node_errinfo_new(p,loc)
1102#define NEW_DEFINED(e,loc) (NODE *)rb_node_defined_new(p,e,loc)
1103#define NEW_POSTEXE(b,loc) (NODE *)rb_node_postexe_new(p,b,loc)
1104#define NEW_DSYM(s,l,n,loc) (NODE *)rb_node_dsym_new(p,s,l,n,loc)
1105#define NEW_ATTRASGN(r,m,a,loc) (NODE *)rb_node_attrasgn_new(p,r,m,a,loc)
1106#define NEW_LAMBDA(a,b,loc) (NODE *)rb_node_lambda_new(p,a,b,loc)
1107#define NEW_ARYPTN(pre,r,post,loc) (NODE *)rb_node_aryptn_new(p,pre,r,post,loc)
1108#define NEW_HSHPTN(c,kw,kwrest,loc) (NODE *)rb_node_hshptn_new(p,c,kw,kwrest,loc)
1109#define NEW_FNDPTN(pre,a,post,loc) (NODE *)rb_node_fndptn_new(p,pre,a,post,loc)
1110#define NEW_ERROR(loc) (NODE *)rb_node_error_new(p,loc)
1111
1112#endif
1113
1114enum internal_node_type {
1115 NODE_INTERNAL_ONLY = NODE_LAST,
1116 NODE_DEF_TEMP,
1117 NODE_EXITS,
1118 NODE_INTERNAL_LAST
1119};
1120
1121static const char *
1122parser_node_name(int node)
1123{
1124 switch (node) {
1125 case NODE_DEF_TEMP:
1126 return "NODE_DEF_TEMP";
1127 case NODE_EXITS:
1128 return "NODE_EXITS";
1129 default:
1130 return ruby_node_name(node);
1131 }
1132}
1133
1134/* This node is parse.y internal */
1135struct RNode_DEF_TEMP {
1136 NODE node;
1137
1138 /* for NODE_DEFN/NODE_DEFS */
1139#ifndef RIPPER
1140 struct RNode *nd_def;
1141 ID nd_mid;
1142#else
1143 VALUE nd_recv;
1144 VALUE nd_mid;
1145 VALUE dot_or_colon;
1146#endif
1147
1148 struct {
1149 ID cur_arg;
1150 int max_numparam;
1151 NODE *numparam_save;
1152 struct lex_context ctxt;
1153 } save;
1154};
1155
1156#define RNODE_DEF_TEMP(node) ((struct RNode_DEF_TEMP *)(node))
1157
1158static rb_node_break_t *rb_node_break_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc);
1159static rb_node_next_t *rb_node_next_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc);
1160static rb_node_redo_t *rb_node_redo_new(struct parser_params *p, const YYLTYPE *loc);
1161static rb_node_def_temp_t *rb_node_def_temp_new(struct parser_params *p, const YYLTYPE *loc);
1162static rb_node_def_temp_t *def_head_save(struct parser_params *p, rb_node_def_temp_t *n);
1163
1164#define NEW_BREAK(s,loc) (NODE *)rb_node_break_new(p,s,loc)
1165#define NEW_NEXT(s,loc) (NODE *)rb_node_next_new(p,s,loc)
1166#define NEW_REDO(loc) (NODE *)rb_node_redo_new(p,loc)
1167#define NEW_DEF_TEMP(loc) rb_node_def_temp_new(p,loc)
1168
1169/* Make a new internal node, which should not be appeared in the
1170 * result AST and does not have node_id and location. */
1171static NODE* node_new_internal(struct parser_params *p, enum node_type type, size_t size, size_t alignment);
1172#define NODE_NEW_INTERNAL(ndtype, type) (type *)node_new_internal(p, (enum node_type)(ndtype), sizeof(type), RUBY_ALIGNOF(type))
1173
1174static NODE *nd_set_loc(NODE *nd, const YYLTYPE *loc);
1175
1176static int
1177parser_get_node_id(struct parser_params *p)
1178{
1179 int node_id = p->node_id;
1180 p->node_id++;
1181 return node_id;
1182}
1183
1184static void
1185anddot_multiple_assignment_check(struct parser_params* p, const YYLTYPE *loc, ID id)
1186{
1187 if (id == tANDDOT) {
1188 yyerror1(loc, "&. inside multiple assignment destination");
1189 }
1190}
1191
1192#ifndef RIPPER
1193static inline void
1194set_line_body(NODE *body, int line)
1195{
1196 if (!body) return;
1197 switch (nd_type(body)) {
1198 case NODE_RESCUE:
1199 case NODE_ENSURE:
1200 nd_set_line(body, line);
1201 }
1202}
1203
1204static void
1205set_embraced_location(NODE *node, const rb_code_location_t *beg, const rb_code_location_t *end)
1206{
1207 RNODE_ITER(node)->nd_body->nd_loc = code_loc_gen(beg, end);
1208 nd_set_line(node, beg->end_pos.lineno);
1209}
1210
1211static NODE *
1212last_expr_node(NODE *expr)
1213{
1214 while (expr) {
1215 if (nd_type_p(expr, NODE_BLOCK)) {
1216 expr = RNODE_BLOCK(RNODE_BLOCK(expr)->nd_end)->nd_head;
1217 }
1218 else if (nd_type_p(expr, NODE_BEGIN)) {
1219 expr = RNODE_BEGIN(expr)->nd_body;
1220 }
1221 else {
1222 break;
1223 }
1224 }
1225 return expr;
1226}
1227
1228#define yyparse ruby_yyparse
1229
1230static NODE* cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
1231static NODE* method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
1232#define new_nil(loc) NEW_NIL(loc)
1233static NODE *new_nil_at(struct parser_params *p, const rb_code_position_t *pos);
1234static NODE *new_if(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
1235static NODE *new_unless(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
1236static NODE *logop(struct parser_params*,ID,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
1237
1238static NODE *newline_node(NODE*);
1239static void fixpos(NODE*,NODE*);
1240
1241static int value_expr_gen(struct parser_params*,NODE*);
1242static void void_expr(struct parser_params*,NODE*);
1243static NODE *remove_begin(NODE*);
1244#define value_expr(node) value_expr_gen(p, (node))
1245static NODE *void_stmts(struct parser_params*,NODE*);
1246static void reduce_nodes(struct parser_params*,NODE**);
1247static void block_dup_check(struct parser_params*,NODE*,NODE*);
1248
1249static NODE *block_append(struct parser_params*,NODE*,NODE*);
1250static NODE *list_append(struct parser_params*,NODE*,NODE*);
1251static NODE *list_concat(NODE*,NODE*);
1252static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1253static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
1254static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
1255static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1256static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
1257static NODE *new_dstr(struct parser_params*,NODE*,const YYLTYPE*);
1258static NODE *str2dstr(struct parser_params*,NODE*);
1259static NODE *evstr2dstr(struct parser_params*,NODE*);
1260static NODE *splat_array(NODE*);
1261static void mark_lvar_used(struct parser_params *p, NODE *rhs);
1262
1263static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
1264static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
1265static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
1266static 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);
1267static 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;}
1268
1269static bool args_info_empty_p(struct rb_args_info *args);
1270static 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*);
1271static rb_node_args_t *new_args_tail(struct parser_params*,rb_node_kw_arg_t*,ID,ID,const YYLTYPE*);
1272static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
1273static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc);
1274static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc);
1275static NODE *new_find_pattern_tail(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc);
1276static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
1277static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
1278
1279static rb_node_kw_arg_t *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
1280static rb_node_args_t *args_with_numbered(struct parser_params*,rb_node_args_t*,int);
1281
1282static VALUE negate_lit(struct parser_params*, VALUE);
1283static NODE *ret_args(struct parser_params*,NODE*);
1284static NODE *arg_blk_pass(NODE*,rb_node_block_pass_t*);
1285static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
1286static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
1287
1288static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
1289static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
1290
1291static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1292static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
1293
1294static void rb_backref_error(struct parser_params*,NODE*);
1295static NODE *node_assign(struct parser_params*,NODE*,NODE*,struct lex_context,const YYLTYPE*);
1296
1297static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
1298static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc);
1299static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc);
1300static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
1301static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
1302
1303static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
1304
1305static rb_node_opt_arg_t *opt_arg_append(rb_node_opt_arg_t*, rb_node_opt_arg_t*);
1306static rb_node_kw_arg_t *kwd_append(rb_node_kw_arg_t*, rb_node_kw_arg_t*);
1307
1308static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
1309static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
1310
1311static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
1312
1313static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
1314
1315#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
1316
1317static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
1318
1319static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
1320
1321static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
1322
1323static rb_ast_id_table_t *local_tbl(struct parser_params*);
1324
1325static VALUE reg_compile(struct parser_params*, VALUE, int);
1326static void reg_fragment_setenc(struct parser_params*, VALUE, int);
1327static int reg_fragment_check(struct parser_params*, VALUE, int);
1328
1329static int literal_concat0(struct parser_params *p, VALUE head, VALUE tail);
1330static NODE *heredoc_dedent(struct parser_params*,NODE*);
1331
1332static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
1333
1334#define get_id(id) (id)
1335#define get_value(val) (val)
1336#define get_num(num) (num)
1337#else /* RIPPER */
1338
1339static inline int ripper_is_node_yylval(struct parser_params *p, VALUE n);
1340
1341static inline VALUE
1342ripper_new_yylval(struct parser_params *p, ID a, VALUE b, VALUE c)
1343{
1344 if (ripper_is_node_yylval(p, c)) c = RNODE_RIPPER(c)->nd_cval;
1345 add_mark_object(p, b);
1346 add_mark_object(p, c);
1347 return NEW_RIPPER(a, b, c, &NULL_LOC);
1348}
1349
1350static inline VALUE
1351ripper_new_yylval2(struct parser_params *p, VALUE a, VALUE b, VALUE c)
1352{
1353 add_mark_object(p, a);
1354 add_mark_object(p, b);
1355 add_mark_object(p, c);
1356 return NEW_RIPPER_VALUES(a, b, c, &NULL_LOC);
1357}
1358
1359static inline int
1360ripper_is_node_yylval(struct parser_params *p, VALUE n)
1361{
1362 return RB_TYPE_P(n, T_NODE) && nd_type_p(RNODE(n), NODE_RIPPER);
1363}
1364
1365#define value_expr(node) ((void)(node))
1366#define remove_begin(node) (node)
1367#define void_stmts(p,x) (x)
1368#undef rb_dvar_defined
1369#define rb_dvar_defined(id, base) 0
1370#undef rb_local_defined
1371#define rb_local_defined(id, base) 0
1372#define get_id(id) ripper_get_id(id)
1373#define get_value(val) ripper_get_value(val)
1374#define get_num(num) (int)get_id(num)
1375static VALUE assignable(struct parser_params*,VALUE);
1376static int id_is_var(struct parser_params *p, ID id);
1377
1378#define method_cond(p,node,loc) (node)
1379#define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
1380#define match_op(p,node1,node2,op_loc,loc) call_bin_op(0, (node1), idEqTilde, (node2), op_loc, loc)
1381#define call_uni_op(p, recv,id,op_loc,loc) dispatch2(unary, STATIC_ID2SYM(id), (recv))
1382#define logop(p,id,node1,node2,op_loc,loc) call_bin_op(0, (node1), (id), (node2), op_loc, loc)
1383
1384#define new_nil(loc) Qnil
1385
1386static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *);
1387
1388static VALUE const_decl(struct parser_params *p, VALUE path);
1389
1390static VALUE var_field(struct parser_params *p, VALUE a);
1391static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
1392
1393static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
1394
1395static VALUE backref_error(struct parser_params*, NODE *, VALUE);
1396#endif /* !RIPPER */
1397
1398RUBY_SYMBOL_EXPORT_BEGIN
1399VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
1400int rb_reg_fragment_setenc(struct parser_params*, VALUE, int);
1401enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
1402VALUE rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state);
1403void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
1404PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
1405YYLTYPE *rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
1406YYLTYPE *rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc);
1407YYLTYPE *rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc);
1408YYLTYPE *rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc);
1409YYLTYPE *rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc);
1410YYLTYPE *rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc);
1411RUBY_SYMBOL_EXPORT_END
1412
1413static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
1414static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
1415#ifndef RIPPER
1416static ID formal_argument(struct parser_params*, ID);
1417#else
1418static ID formal_argument(struct parser_params*, VALUE);
1419#endif
1420static ID shadowing_lvar(struct parser_params*,ID);
1421static void new_bv(struct parser_params*,ID);
1422
1423static void local_push(struct parser_params*,int);
1424static void local_pop(struct parser_params*);
1425static void local_var(struct parser_params*, ID);
1426static void arg_var(struct parser_params*, ID);
1427static int local_id(struct parser_params *p, ID id);
1428static int local_id_ref(struct parser_params*, ID, ID **);
1429#ifndef RIPPER
1430static ID internal_id(struct parser_params*);
1431static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
1432#endif
1433static int check_forwarding_args(struct parser_params*);
1434static void add_forwarding_args(struct parser_params *p);
1435static void forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var);
1436
1437static const struct vtable *dyna_push(struct parser_params *);
1438static void dyna_pop(struct parser_params*, const struct vtable *);
1439static int dyna_in_block(struct parser_params*);
1440#define dyna_var(p, id) local_var(p, id)
1441static int dvar_defined(struct parser_params*, ID);
1442static int dvar_defined_ref(struct parser_params*, ID, ID**);
1443static int dvar_curr(struct parser_params*,ID);
1444
1445static int lvar_defined(struct parser_params*, ID);
1446
1447static NODE *numparam_push(struct parser_params *p);
1448static void numparam_pop(struct parser_params *p, NODE *prev_inner);
1449
1450#ifdef RIPPER
1451# define METHOD_NOT idNOT
1452#else
1453# define METHOD_NOT '!'
1454#endif
1455
1456#define idFWD_REST '*'
1457#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
1458#define idFWD_BLOCK '&'
1459#define idFWD_ALL idDot3
1460#ifdef RIPPER
1461#define arg_FWD_BLOCK Qnone
1462#else
1463#define arg_FWD_BLOCK idFWD_BLOCK
1464#endif
1465#define FORWARD_ARGS_WITH_RUBY2_KEYWORDS
1466
1467#define RE_OPTION_ONCE (1<<16)
1468#define RE_OPTION_ENCODING_SHIFT 8
1469#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
1470#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
1471#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
1472#define RE_OPTION_MASK 0xff
1473#define RE_OPTION_ARG_ENCODING_NONE 32
1474
1475#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
1476size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
1477
1478#define TOKEN2ID(tok) ( \
1479 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
1480 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
1481 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
1482 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
1483 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
1484 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
1485 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
1486
1487/****** Ripper *******/
1488
1489#ifdef RIPPER
1490
1491#include "eventids1.h"
1492#include "eventids2.h"
1493
1494extern const struct ripper_parser_ids ripper_parser_ids;
1495
1496static VALUE ripper_dispatch0(struct parser_params*,ID);
1497static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
1498static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
1499static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
1500static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
1501static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
1502static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
1503void ripper_error(struct parser_params *p);
1504
1505#define dispatch0(n) ripper_dispatch0(p, TOKEN_PASTE(ripper_id_, n))
1506#define dispatch1(n,a) ripper_dispatch1(p, TOKEN_PASTE(ripper_id_, n), (a))
1507#define dispatch2(n,a,b) ripper_dispatch2(p, TOKEN_PASTE(ripper_id_, n), (a), (b))
1508#define dispatch3(n,a,b,c) ripper_dispatch3(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c))
1509#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d))
1510#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e))
1511#define dispatch7(n,a,b,c,d,e,f,g) ripper_dispatch7(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e), (f), (g))
1512
1513#define yyparse ripper_yyparse
1514
1515#define ID2VAL(id) STATIC_ID2SYM(id)
1516#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
1517#define KWD2EID(t, v) ripper_new_yylval(p, keyword_##t, get_value(v), 0)
1518
1519#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
1520 dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
1521
1522static inline VALUE
1523new_args(struct parser_params *p, VALUE pre_args, VALUE opt_args, VALUE rest_arg, VALUE post_args, VALUE tail, YYLTYPE *loc)
1524{
1525 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(tail);
1526 VALUE kw_args = t->nd_val1, kw_rest_arg = t->nd_val2, block = t->nd_val3;
1527 return params_new(pre_args, opt_args, rest_arg, post_args, kw_args, kw_rest_arg, block);
1528}
1529
1530static inline VALUE
1531new_args_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, VALUE block, YYLTYPE *loc)
1532{
1533 return ripper_new_yylval2(p, kw_args, kw_rest_arg, block);
1534}
1535
1536static inline VALUE
1537args_with_numbered(struct parser_params *p, VALUE args, int max_numparam)
1538{
1539 return args;
1540}
1541
1542static VALUE
1543new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE aryptn, const YYLTYPE *loc)
1544{
1545 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(aryptn);
1546 VALUE pre_args = t->nd_val1, rest_arg = t->nd_val2, post_args = t->nd_val3;
1547
1548 if (!NIL_P(pre_arg)) {
1549 if (!NIL_P(pre_args)) {
1550 rb_ary_unshift(pre_args, pre_arg);
1551 }
1552 else {
1553 pre_args = rb_ary_new_from_args(1, pre_arg);
1554 }
1555 }
1556 return dispatch4(aryptn, constant, pre_args, rest_arg, post_args);
1557}
1558
1559static VALUE
1560new_array_pattern_tail(struct parser_params *p, VALUE pre_args, VALUE has_rest, VALUE rest_arg, VALUE post_args, const YYLTYPE *loc)
1561{
1562 return ripper_new_yylval2(p, pre_args, rest_arg, post_args);
1563}
1564
1565static VALUE
1566new_find_pattern(struct parser_params *p, VALUE constant, VALUE fndptn, const YYLTYPE *loc)
1567{
1568 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(fndptn);
1569 VALUE pre_rest_arg = t->nd_val1, args = t->nd_val2, post_rest_arg = t->nd_val3;
1570
1571 return dispatch4(fndptn, constant, pre_rest_arg, args, post_rest_arg);
1572}
1573
1574static VALUE
1575new_find_pattern_tail(struct parser_params *p, VALUE pre_rest_arg, VALUE args, VALUE post_rest_arg, const YYLTYPE *loc)
1576{
1577 return ripper_new_yylval2(p, pre_rest_arg, args, post_rest_arg);
1578}
1579
1580#define new_hash(p,h,l) rb_ary_new_from_args(0)
1581
1582static VALUE
1583new_unique_key_hash(struct parser_params *p, VALUE ary, const YYLTYPE *loc)
1584{
1585 return ary;
1586}
1587
1588static VALUE
1589new_hash_pattern(struct parser_params *p, VALUE constant, VALUE hshptn, const YYLTYPE *loc)
1590{
1591 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(hshptn);
1592 VALUE kw_args = t->nd_val1, kw_rest_arg = t->nd_val2;
1593 return dispatch3(hshptn, constant, kw_args, kw_rest_arg);
1594}
1595
1596static VALUE
1597new_hash_pattern_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, const YYLTYPE *loc)
1598{
1599 if (kw_rest_arg) {
1600 kw_rest_arg = dispatch1(var_field, kw_rest_arg);
1601 }
1602 else {
1603 kw_rest_arg = Qnil;
1604 }
1605 return ripper_new_yylval2(p, kw_args, kw_rest_arg, Qnil);
1606}
1607
1608#define new_defined(p,expr,loc) dispatch1(defined, (expr))
1609
1610static VALUE heredoc_dedent(struct parser_params*,VALUE);
1611
1612#else
1613#define ID2VAL(id) (id)
1614#define TOKEN2VAL(t) ID2VAL(t)
1615#define KWD2EID(t, v) keyword_##t
1616
1617static NODE *
1618new_scope_body(struct parser_params *p, rb_node_args_t *args, NODE *body, const YYLTYPE *loc)
1619{
1620 body = remove_begin(body);
1621 reduce_nodes(p, &body);
1622 NODE *n = NEW_SCOPE(args, body, loc);
1623 nd_set_line(n, loc->end_pos.lineno);
1624 set_line_body(body, loc->beg_pos.lineno);
1625 return n;
1626}
1627
1628static NODE *
1629rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1630 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1631{
1632 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1633 rescue = NEW_RESBODY(0, remove_begin(rescue), 0, &loc);
1634 loc.beg_pos = arg_loc->beg_pos;
1635 return NEW_RESCUE(arg, rescue, 0, &loc);
1636}
1637
1638#endif /* RIPPER */
1639
1640static NODE *add_block_exit(struct parser_params *p, NODE *node);
1641static rb_node_exits_t *init_block_exit(struct parser_params *p);
1642static rb_node_exits_t *allow_block_exit(struct parser_params *p);
1643static void restore_block_exit(struct parser_params *p, rb_node_exits_t *exits);
1644static void clear_block_exit(struct parser_params *p, bool error);
1645
1646static void
1647next_rescue_context(struct lex_context *next, const struct lex_context *outer, enum rescue_context def)
1648{
1649 next->in_rescue = outer->in_rescue == after_rescue ? after_rescue : def;
1650}
1651
1652static void
1653restore_defun(struct parser_params *p, rb_node_def_temp_t *temp)
1654{
1655 /* See: def_name action */
1656 struct lex_context ctxt = temp->save.ctxt;
1657 p->cur_arg = temp->save.cur_arg;
1658 p->ctxt.in_def = ctxt.in_def;
1659 p->ctxt.shareable_constant_value = ctxt.shareable_constant_value;
1660 p->ctxt.in_rescue = ctxt.in_rescue;
1661 p->max_numparam = temp->save.max_numparam;
1662 numparam_pop(p, temp->save.numparam_save);
1663 clear_block_exit(p, true);
1664}
1665
1666static void
1667endless_method_name(struct parser_params *p, ID mid, const YYLTYPE *loc)
1668{
1669 if (is_attrset_id(mid)) {
1670 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1671 }
1672 token_info_drop(p, "def", loc->beg_pos);
1673}
1674
1675#define debug_token_line(p, name, line) do { \
1676 if (p->debug) { \
1677 const char *const pcur = p->lex.pcur; \
1678 const char *const ptok = p->lex.ptok; \
1679 rb_parser_printf(p, name ":%d (%d: %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF")\n", \
1680 line, p->ruby_sourceline, \
1681 ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur); \
1682 } \
1683 } while (0)
1684
1685#define begin_definition(k, loc_beg, loc_end) \
1686 do { \
1687 if (!(p->ctxt.in_class = (k)[0] != 0)) { \
1688 p->ctxt.in_def = 0; \
1689 } \
1690 else if (p->ctxt.in_def) { \
1691 YYLTYPE loc = code_loc_gen(loc_beg, loc_end); \
1692 yyerror1(&loc, k " definition in method body"); \
1693 } \
1694 local_push(p, 0); \
1695 } while (0)
1696
1697#ifndef RIPPER
1698# define Qnone 0
1699# define Qnull 0
1700# define ifndef_ripper(x) (x)
1701#else
1702# define Qnone Qnil
1703# define Qnull Qundef
1704# define ifndef_ripper(x)
1705#endif
1706
1707# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1708# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1709# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1710# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1711# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1712# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1713# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1714# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1715# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1716# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1717# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1718# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1719# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1720# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1721# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1722# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1723# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1724# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1725# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1726# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1727#ifdef RIPPER
1728extern const ID id_warn, id_warning, id_gets, id_assoc;
1729# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1730# define WARN_S_L(s,l) STR_NEW(s,l)
1731# define WARN_S(s) STR_NEW2(s)
1732# define WARN_I(i) INT2NUM(i)
1733# define WARN_ID(i) rb_id2str(i)
1734# define WARN_IVAL(i) i
1735# define PRIsWARN "s"
1736# define rb_warn0L_experimental(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1737# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1738# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1739# ifdef HAVE_VA_ARGS_MACRO
1740# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1741# else
1742# define WARN_CALL rb_funcall
1743# endif
1744# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1745# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1746# ifdef HAVE_VA_ARGS_MACRO
1747# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1748# else
1749# define WARNING_CALL rb_funcall
1750# endif
1751# define compile_error ripper_compile_error
1752#else
1753# define WARN_S_L(s,l) s
1754# define WARN_S(s) s
1755# define WARN_I(i) i
1756# define WARN_ID(i) rb_id2name(i)
1757# define WARN_IVAL(i) NUM2INT(i)
1758# define PRIsWARN PRIsVALUE
1759# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1760# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1761# define WARN_CALL rb_compile_warn
1762# define rb_warn0L_experimental(l,fmt) rb_category_compile_warn(RB_WARN_CATEGORY_EXPERIMENTAL, WARN_ARGS_L(l, fmt, 1))
1763# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1764# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1765# define WARNING_CALL rb_compile_warning
1766PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const rb_code_location_t *loc, const char *fmt, ...), 3, 4);
1767# define compile_error(p, ...) parser_compile_error(p, NULL, __VA_ARGS__)
1768#endif
1769
1770struct RNode_EXITS {
1771 NODE node;
1772
1773 NODE *nd_chain; /* Assume NODE_BREAK, NODE_NEXT, NODE_REDO have nd_chain here */
1774 NODE *nd_end;
1775};
1776
1777#define RNODE_EXITS(node) ((rb_node_exits_t*)(node))
1778
1779static NODE *
1780add_block_exit(struct parser_params *p, NODE *node)
1781{
1782 if (!node) {
1783 compile_error(p, "unexpected null node");
1784 return 0;
1785 }
1786 switch (nd_type(node)) {
1787 case NODE_BREAK: case NODE_NEXT: case NODE_REDO: break;
1788 default:
1789 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1790 return node;
1791 }
1792 if (!p->ctxt.in_defined) {
1793 rb_node_exits_t *exits = p->exits;
1794 if (exits) {
1795 RNODE_EXITS(exits->nd_end)->nd_chain = node;
1796 exits->nd_end = node;
1797 }
1798 }
1799 return node;
1800}
1801
1802static rb_node_exits_t *
1803init_block_exit(struct parser_params *p)
1804{
1805 rb_node_exits_t *old = p->exits;
1806 rb_node_exits_t *exits = NODE_NEW_INTERNAL(NODE_EXITS, rb_node_exits_t);
1807 exits->nd_chain = 0;
1808 exits->nd_end = RNODE(exits);
1809 p->exits = exits;
1810 return old;
1811}
1812
1813static rb_node_exits_t *
1814allow_block_exit(struct parser_params *p)
1815{
1816 rb_node_exits_t *exits = p->exits;
1817 p->exits = 0;
1818 return exits;
1819}
1820
1821static void
1822restore_block_exit(struct parser_params *p, rb_node_exits_t *exits)
1823{
1824 p->exits = exits;
1825}
1826
1827static void
1828clear_block_exit(struct parser_params *p, bool error)
1829{
1830 rb_node_exits_t *exits = p->exits;
1831 if (!exits) return;
1832 if (error && !compile_for_eval) {
1833 for (NODE *e = RNODE(exits); (e = RNODE_EXITS(e)->nd_chain) != 0; ) {
1834 switch (nd_type(e)) {
1835 case NODE_BREAK:
1836 yyerror1(&e->nd_loc, "Invalid break");
1837 break;
1838 case NODE_NEXT:
1839 yyerror1(&e->nd_loc, "Invalid next");
1840 break;
1841 case NODE_REDO:
1842 yyerror1(&e->nd_loc, "Invalid redo");
1843 break;
1844 default:
1845 yyerror1(&e->nd_loc, "unexpected node");
1846 goto end_checks; /* no nd_chain */
1847 }
1848 }
1849 end_checks:;
1850 }
1851 exits->nd_end = RNODE(exits);
1852 exits->nd_chain = 0;
1853}
1854
1855#define WARN_EOL(tok) \
1856 (looking_at_eol_p(p) ? \
1857 (void)rb_warning0("`" tok "' at the end of line without an expression") : \
1858 (void)0)
1859static int looking_at_eol_p(struct parser_params *p);
1860
1861#ifndef RIPPER
1862static NODE *
1863get_nd_value(struct parser_params *p, NODE *node)
1864{
1865 switch (nd_type(node)) {
1866 case NODE_GASGN:
1867 return RNODE_GASGN(node)->nd_value;
1868 case NODE_IASGN:
1869 return RNODE_IASGN(node)->nd_value;
1870 case NODE_LASGN:
1871 return RNODE_LASGN(node)->nd_value;
1872 case NODE_DASGN:
1873 return RNODE_DASGN(node)->nd_value;
1874 case NODE_MASGN:
1875 return RNODE_MASGN(node)->nd_value;
1876 case NODE_CVASGN:
1877 return RNODE_CVASGN(node)->nd_value;
1878 case NODE_CDECL:
1879 return RNODE_CDECL(node)->nd_value;
1880 default:
1881 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1882 return 0;
1883 }
1884}
1885
1886static void
1887set_nd_value(struct parser_params *p, NODE *node, NODE *rhs)
1888{
1889 switch (nd_type(node)) {
1890 case NODE_CDECL:
1891 RNODE_CDECL(node)->nd_value = rhs;
1892 break;
1893 case NODE_GASGN:
1894 RNODE_GASGN(node)->nd_value = rhs;
1895 break;
1896 case NODE_IASGN:
1897 RNODE_IASGN(node)->nd_value = rhs;
1898 break;
1899 case NODE_LASGN:
1900 RNODE_LASGN(node)->nd_value = rhs;
1901 break;
1902 case NODE_DASGN:
1903 RNODE_DASGN(node)->nd_value = rhs;
1904 break;
1905 case NODE_MASGN:
1906 RNODE_MASGN(node)->nd_value = rhs;
1907 break;
1908 case NODE_CVASGN:
1909 RNODE_CVASGN(node)->nd_value = rhs;
1910 break;
1911 default:
1912 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1913 break;
1914 }
1915}
1916
1917static ID
1918get_nd_vid(struct parser_params *p, NODE *node)
1919{
1920 switch (nd_type(node)) {
1921 case NODE_CDECL:
1922 return RNODE_CDECL(node)->nd_vid;
1923 case NODE_GASGN:
1924 return RNODE_GASGN(node)->nd_vid;
1925 case NODE_IASGN:
1926 return RNODE_IASGN(node)->nd_vid;
1927 case NODE_LASGN:
1928 return RNODE_LASGN(node)->nd_vid;
1929 case NODE_DASGN:
1930 return RNODE_DASGN(node)->nd_vid;
1931 case NODE_CVASGN:
1932 return RNODE_CVASGN(node)->nd_vid;
1933 default:
1934 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1935 return 0;
1936 }
1937}
1938
1939static NODE *
1940get_nd_args(struct parser_params *p, NODE *node)
1941{
1942 switch (nd_type(node)) {
1943 case NODE_CALL:
1944 return RNODE_CALL(node)->nd_args;
1945 case NODE_OPCALL:
1946 return RNODE_OPCALL(node)->nd_args;
1947 case NODE_FCALL:
1948 return RNODE_FCALL(node)->nd_args;
1949 case NODE_QCALL:
1950 return RNODE_QCALL(node)->nd_args;
1951 case NODE_VCALL:
1952 case NODE_SUPER:
1953 case NODE_ZSUPER:
1954 case NODE_YIELD:
1955 case NODE_RETURN:
1956 case NODE_BREAK:
1957 case NODE_NEXT:
1958 return 0;
1959 default:
1960 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1961 return 0;
1962 }
1963}
1964#endif
1965
1966#line 1967 "parse.c"
1967
1968# ifndef YY_CAST
1969# ifdef __cplusplus
1970# define YY_CAST(Type, Val) static_cast<Type> (Val)
1971# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
1972# else
1973# define YY_CAST(Type, Val) ((Type) (Val))
1974# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
1975# endif
1976# endif
1977# ifndef YY_NULLPTR
1978# if defined __cplusplus
1979# if 201103L <= __cplusplus
1980# define YY_NULLPTR nullptr
1981# else
1982# define YY_NULLPTR 0
1983# endif
1984# else
1985# define YY_NULLPTR ((void*)0)
1986# endif
1987# endif
1988
1989#include "parse.h"
1990/* Symbol kind. */
1991enum yysymbol_kind_t
1992{
1993 YYSYMBOL_YYEMPTY = -2,
1994 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
1995 YYSYMBOL_YYerror = 1, /* error */
1996 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
1997 YYSYMBOL_keyword_class = 3, /* "`class'" */
1998 YYSYMBOL_keyword_module = 4, /* "`module'" */
1999 YYSYMBOL_keyword_def = 5, /* "`def'" */
2000 YYSYMBOL_keyword_undef = 6, /* "`undef'" */
2001 YYSYMBOL_keyword_begin = 7, /* "`begin'" */
2002 YYSYMBOL_keyword_rescue = 8, /* "`rescue'" */
2003 YYSYMBOL_keyword_ensure = 9, /* "`ensure'" */
2004 YYSYMBOL_keyword_end = 10, /* "`end'" */
2005 YYSYMBOL_keyword_if = 11, /* "`if'" */
2006 YYSYMBOL_keyword_unless = 12, /* "`unless'" */
2007 YYSYMBOL_keyword_then = 13, /* "`then'" */
2008 YYSYMBOL_keyword_elsif = 14, /* "`elsif'" */
2009 YYSYMBOL_keyword_else = 15, /* "`else'" */
2010 YYSYMBOL_keyword_case = 16, /* "`case'" */
2011 YYSYMBOL_keyword_when = 17, /* "`when'" */
2012 YYSYMBOL_keyword_while = 18, /* "`while'" */
2013 YYSYMBOL_keyword_until = 19, /* "`until'" */
2014 YYSYMBOL_keyword_for = 20, /* "`for'" */
2015 YYSYMBOL_keyword_break = 21, /* "`break'" */
2016 YYSYMBOL_keyword_next = 22, /* "`next'" */
2017 YYSYMBOL_keyword_redo = 23, /* "`redo'" */
2018 YYSYMBOL_keyword_retry = 24, /* "`retry'" */
2019 YYSYMBOL_keyword_in = 25, /* "`in'" */
2020 YYSYMBOL_keyword_do = 26, /* "`do'" */
2021 YYSYMBOL_keyword_do_cond = 27, /* "`do' for condition" */
2022 YYSYMBOL_keyword_do_block = 28, /* "`do' for block" */
2023 YYSYMBOL_keyword_do_LAMBDA = 29, /* "`do' for lambda" */
2024 YYSYMBOL_keyword_return = 30, /* "`return'" */
2025 YYSYMBOL_keyword_yield = 31, /* "`yield'" */
2026 YYSYMBOL_keyword_super = 32, /* "`super'" */
2027 YYSYMBOL_keyword_self = 33, /* "`self'" */
2028 YYSYMBOL_keyword_nil = 34, /* "`nil'" */
2029 YYSYMBOL_keyword_true = 35, /* "`true'" */
2030 YYSYMBOL_keyword_false = 36, /* "`false'" */
2031 YYSYMBOL_keyword_and = 37, /* "`and'" */
2032 YYSYMBOL_keyword_or = 38, /* "`or'" */
2033 YYSYMBOL_keyword_not = 39, /* "`not'" */
2034 YYSYMBOL_modifier_if = 40, /* "`if' modifier" */
2035 YYSYMBOL_modifier_unless = 41, /* "`unless' modifier" */
2036 YYSYMBOL_modifier_while = 42, /* "`while' modifier" */
2037 YYSYMBOL_modifier_until = 43, /* "`until' modifier" */
2038 YYSYMBOL_modifier_rescue = 44, /* "`rescue' modifier" */
2039 YYSYMBOL_keyword_alias = 45, /* "`alias'" */
2040 YYSYMBOL_keyword_defined = 46, /* "`defined?'" */
2041 YYSYMBOL_keyword_BEGIN = 47, /* "`BEGIN'" */
2042 YYSYMBOL_keyword_END = 48, /* "`END'" */
2043 YYSYMBOL_keyword__LINE__ = 49, /* "`__LINE__'" */
2044 YYSYMBOL_keyword__FILE__ = 50, /* "`__FILE__'" */
2045 YYSYMBOL_keyword__ENCODING__ = 51, /* "`__ENCODING__'" */
2046 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
2047 YYSYMBOL_tFID = 53, /* "method" */
2048 YYSYMBOL_tGVAR = 54, /* "global variable" */
2049 YYSYMBOL_tIVAR = 55, /* "instance variable" */
2050 YYSYMBOL_tCONSTANT = 56, /* "constant" */
2051 YYSYMBOL_tCVAR = 57, /* "class variable" */
2052 YYSYMBOL_tLABEL = 58, /* "label" */
2053 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
2054 YYSYMBOL_tFLOAT = 60, /* "float literal" */
2055 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
2056 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
2057 YYSYMBOL_tCHAR = 63, /* "char literal" */
2058 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
2059 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
2060 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
2061 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
2062 YYSYMBOL_tDUMNY_END = 68, /* "dummy end" */
2063 YYSYMBOL_69_ = 69, /* '.' */
2064 YYSYMBOL_70_backslash_ = 70, /* "backslash" */
2065 YYSYMBOL_tSP = 71, /* "escaped space" */
2066 YYSYMBOL_72_escaped_horizontal_tab_ = 72, /* "escaped horizontal tab" */
2067 YYSYMBOL_73_escaped_form_feed_ = 73, /* "escaped form feed" */
2068 YYSYMBOL_74_escaped_carriage_return_ = 74, /* "escaped carriage return" */
2069 YYSYMBOL_75_escaped_vertical_tab_ = 75, /* "escaped vertical tab" */
2070 YYSYMBOL_tUPLUS = 76, /* "unary+" */
2071 YYSYMBOL_tUMINUS = 77, /* "unary-" */
2072 YYSYMBOL_tPOW = 78, /* "**" */
2073 YYSYMBOL_tCMP = 79, /* "<=>" */
2074 YYSYMBOL_tEQ = 80, /* "==" */
2075 YYSYMBOL_tEQQ = 81, /* "===" */
2076 YYSYMBOL_tNEQ = 82, /* "!=" */
2077 YYSYMBOL_tGEQ = 83, /* ">=" */
2078 YYSYMBOL_tLEQ = 84, /* "<=" */
2079 YYSYMBOL_tANDOP = 85, /* "&&" */
2080 YYSYMBOL_tOROP = 86, /* "||" */
2081 YYSYMBOL_tMATCH = 87, /* "=~" */
2082 YYSYMBOL_tNMATCH = 88, /* "!~" */
2083 YYSYMBOL_tDOT2 = 89, /* ".." */
2084 YYSYMBOL_tDOT3 = 90, /* "..." */
2085 YYSYMBOL_tBDOT2 = 91, /* "(.." */
2086 YYSYMBOL_tBDOT3 = 92, /* "(..." */
2087 YYSYMBOL_tAREF = 93, /* "[]" */
2088 YYSYMBOL_tASET = 94, /* "[]=" */
2089 YYSYMBOL_tLSHFT = 95, /* "<<" */
2090 YYSYMBOL_tRSHFT = 96, /* ">>" */
2091 YYSYMBOL_tANDDOT = 97, /* "&." */
2092 YYSYMBOL_tCOLON2 = 98, /* "::" */
2093 YYSYMBOL_tCOLON3 = 99, /* ":: at EXPR_BEG" */
2094 YYSYMBOL_tOP_ASGN = 100, /* "operator-assignment" */
2095 YYSYMBOL_tASSOC = 101, /* "=>" */
2096 YYSYMBOL_tLPAREN = 102, /* "(" */
2097 YYSYMBOL_tLPAREN_ARG = 103, /* "( arg" */
2098 YYSYMBOL_tRPAREN = 104, /* ")" */
2099 YYSYMBOL_tLBRACK = 105, /* "[" */
2100 YYSYMBOL_tLBRACE = 106, /* "{" */
2101 YYSYMBOL_tLBRACE_ARG = 107, /* "{ arg" */
2102 YYSYMBOL_tSTAR = 108, /* "*" */
2103 YYSYMBOL_tDSTAR = 109, /* "**arg" */
2104 YYSYMBOL_tAMPER = 110, /* "&" */
2105 YYSYMBOL_tLAMBDA = 111, /* "->" */
2106 YYSYMBOL_tSYMBEG = 112, /* "symbol literal" */
2107 YYSYMBOL_tSTRING_BEG = 113, /* "string literal" */
2108 YYSYMBOL_tXSTRING_BEG = 114, /* "backtick literal" */
2109 YYSYMBOL_tREGEXP_BEG = 115, /* "regexp literal" */
2110 YYSYMBOL_tWORDS_BEG = 116, /* "word list" */
2111 YYSYMBOL_tQWORDS_BEG = 117, /* "verbatim word list" */
2112 YYSYMBOL_tSYMBOLS_BEG = 118, /* "symbol list" */
2113 YYSYMBOL_tQSYMBOLS_BEG = 119, /* "verbatim symbol list" */
2114 YYSYMBOL_tSTRING_END = 120, /* "terminator" */
2115 YYSYMBOL_tSTRING_DEND = 121, /* "'}'" */
2116 YYSYMBOL_tSTRING_DBEG = 122, /* tSTRING_DBEG */
2117 YYSYMBOL_tSTRING_DVAR = 123, /* tSTRING_DVAR */
2118 YYSYMBOL_tLAMBEG = 124, /* tLAMBEG */
2119 YYSYMBOL_tLABEL_END = 125, /* tLABEL_END */
2120 YYSYMBOL_tIGNORED_NL = 126, /* tIGNORED_NL */
2121 YYSYMBOL_tCOMMENT = 127, /* tCOMMENT */
2122 YYSYMBOL_tEMBDOC_BEG = 128, /* tEMBDOC_BEG */
2123 YYSYMBOL_tEMBDOC = 129, /* tEMBDOC */
2124 YYSYMBOL_tEMBDOC_END = 130, /* tEMBDOC_END */
2125 YYSYMBOL_tHEREDOC_BEG = 131, /* tHEREDOC_BEG */
2126 YYSYMBOL_tHEREDOC_END = 132, /* tHEREDOC_END */
2127 YYSYMBOL_k__END__ = 133, /* k__END__ */
2128 YYSYMBOL_tLOWEST = 134, /* tLOWEST */
2129 YYSYMBOL_135_ = 135, /* '=' */
2130 YYSYMBOL_136_ = 136, /* '?' */
2131 YYSYMBOL_137_ = 137, /* ':' */
2132 YYSYMBOL_138_ = 138, /* '>' */
2133 YYSYMBOL_139_ = 139, /* '<' */
2134 YYSYMBOL_140_ = 140, /* '|' */
2135 YYSYMBOL_141_ = 141, /* '^' */
2136 YYSYMBOL_142_ = 142, /* '&' */
2137 YYSYMBOL_143_ = 143, /* '+' */
2138 YYSYMBOL_144_ = 144, /* '-' */
2139 YYSYMBOL_145_ = 145, /* '*' */
2140 YYSYMBOL_146_ = 146, /* '/' */
2141 YYSYMBOL_147_ = 147, /* '%' */
2142 YYSYMBOL_tUMINUS_NUM = 148, /* tUMINUS_NUM */
2143 YYSYMBOL_149_ = 149, /* '!' */
2144 YYSYMBOL_150_ = 150, /* '~' */
2145 YYSYMBOL_tLAST_TOKEN = 151, /* tLAST_TOKEN */
2146 YYSYMBOL_152_ = 152, /* '{' */
2147 YYSYMBOL_153_ = 153, /* '}' */
2148 YYSYMBOL_154_ = 154, /* '[' */
2149 YYSYMBOL_155_ = 155, /* ',' */
2150 YYSYMBOL_156_ = 156, /* '`' */
2151 YYSYMBOL_157_ = 157, /* '(' */
2152 YYSYMBOL_158_ = 158, /* ')' */
2153 YYSYMBOL_159_ = 159, /* ']' */
2154 YYSYMBOL_160_ = 160, /* ';' */
2155 YYSYMBOL_161_ = 161, /* ' ' */
2156 YYSYMBOL_162_n_ = 162, /* '\n' */
2157 YYSYMBOL_YYACCEPT = 163, /* $accept */
2158 YYSYMBOL_program = 164, /* program */
2159 YYSYMBOL_165_1 = 165, /* $@1 */
2160 YYSYMBOL_top_compstmt = 166, /* top_compstmt */
2161 YYSYMBOL_top_stmts = 167, /* top_stmts */
2162 YYSYMBOL_top_stmt = 168, /* top_stmt */
2163 YYSYMBOL_block_open = 169, /* block_open */
2164 YYSYMBOL_begin_block = 170, /* begin_block */
2165 YYSYMBOL_bodystmt = 171, /* bodystmt */
2166 YYSYMBOL_172_2 = 172, /* $@2 */
2167 YYSYMBOL_173_3 = 173, /* $@3 */
2168 YYSYMBOL_174_4 = 174, /* $@4 */
2169 YYSYMBOL_compstmt = 175, /* compstmt */
2170 YYSYMBOL_stmts = 176, /* stmts */
2171 YYSYMBOL_stmt_or_begin = 177, /* stmt_or_begin */
2172 YYSYMBOL_178_5 = 178, /* $@5 */
2173 YYSYMBOL_allow_exits = 179, /* allow_exits */
2174 YYSYMBOL_k_END = 180, /* k_END */
2175 YYSYMBOL_stmt = 181, /* stmt */
2176 YYSYMBOL_182_6 = 182, /* $@6 */
2177 YYSYMBOL_command_asgn = 183, /* command_asgn */
2178 YYSYMBOL_endless_command = 184, /* endless_command */
2179 YYSYMBOL_command_rhs = 185, /* command_rhs */
2180 YYSYMBOL_expr = 186, /* expr */
2181 YYSYMBOL_187_7 = 187, /* $@7 */
2182 YYSYMBOL_188_8 = 188, /* $@8 */
2183 YYSYMBOL_def_name = 189, /* def_name */
2184 YYSYMBOL_defn_head = 190, /* defn_head */
2185 YYSYMBOL_defs_head = 191, /* defs_head */
2186 YYSYMBOL_192_9 = 192, /* $@9 */
2187 YYSYMBOL_expr_value = 193, /* expr_value */
2188 YYSYMBOL_expr_value_do = 194, /* expr_value_do */
2189 YYSYMBOL_195_10 = 195, /* $@10 */
2190 YYSYMBOL_196_11 = 196, /* $@11 */
2191 YYSYMBOL_command_call = 197, /* command_call */
2192 YYSYMBOL_block_command = 198, /* block_command */
2193 YYSYMBOL_cmd_brace_block = 199, /* cmd_brace_block */
2194 YYSYMBOL_fcall = 200, /* fcall */
2195 YYSYMBOL_command = 201, /* command */
2196 YYSYMBOL_mlhs = 202, /* mlhs */
2197 YYSYMBOL_mlhs_inner = 203, /* mlhs_inner */
2198 YYSYMBOL_mlhs_basic = 204, /* mlhs_basic */
2199 YYSYMBOL_mlhs_item = 205, /* mlhs_item */
2200 YYSYMBOL_mlhs_head = 206, /* mlhs_head */
2201 YYSYMBOL_mlhs_post = 207, /* mlhs_post */
2202 YYSYMBOL_mlhs_node = 208, /* mlhs_node */
2203 YYSYMBOL_lhs = 209, /* lhs */
2204 YYSYMBOL_cname = 210, /* cname */
2205 YYSYMBOL_cpath = 211, /* cpath */
2206 YYSYMBOL_fname = 212, /* fname */
2207 YYSYMBOL_fitem = 213, /* fitem */
2208 YYSYMBOL_undef_list = 214, /* undef_list */
2209 YYSYMBOL_215_12 = 215, /* $@12 */
2210 YYSYMBOL_op = 216, /* op */
2211 YYSYMBOL_reswords = 217, /* reswords */
2212 YYSYMBOL_arg = 218, /* arg */
2213 YYSYMBOL_endless_arg = 219, /* endless_arg */
2214 YYSYMBOL_relop = 220, /* relop */
2215 YYSYMBOL_rel_expr = 221, /* rel_expr */
2216 YYSYMBOL_lex_ctxt = 222, /* lex_ctxt */
2217 YYSYMBOL_begin_defined = 223, /* begin_defined */
2218 YYSYMBOL_after_rescue = 224, /* after_rescue */
2219 YYSYMBOL_arg_value = 225, /* arg_value */
2220 YYSYMBOL_aref_args = 226, /* aref_args */
2221 YYSYMBOL_arg_rhs = 227, /* arg_rhs */
2222 YYSYMBOL_paren_args = 228, /* paren_args */
2223 YYSYMBOL_opt_paren_args = 229, /* opt_paren_args */
2224 YYSYMBOL_opt_call_args = 230, /* opt_call_args */
2225 YYSYMBOL_call_args = 231, /* call_args */
2226 YYSYMBOL_command_args = 232, /* command_args */
2227 YYSYMBOL_233_13 = 233, /* $@13 */
2228 YYSYMBOL_block_arg = 234, /* block_arg */
2229 YYSYMBOL_opt_block_arg = 235, /* opt_block_arg */
2230 YYSYMBOL_args = 236, /* args */
2231 YYSYMBOL_arg_splat = 237, /* arg_splat */
2232 YYSYMBOL_mrhs_arg = 238, /* mrhs_arg */
2233 YYSYMBOL_mrhs = 239, /* mrhs */
2234 YYSYMBOL_primary = 240, /* primary */
2235 YYSYMBOL_241_14 = 241, /* $@14 */
2236 YYSYMBOL_242_15 = 242, /* $@15 */
2237 YYSYMBOL_243_16 = 243, /* @16 */
2238 YYSYMBOL_244_17 = 244, /* @17 */
2239 YYSYMBOL_245_18 = 245, /* $@18 */
2240 YYSYMBOL_246_19 = 246, /* $@19 */
2241 YYSYMBOL_247_20 = 247, /* $@20 */
2242 YYSYMBOL_248_21 = 248, /* $@21 */
2243 YYSYMBOL_249_22 = 249, /* $@22 */
2244 YYSYMBOL_primary_value = 250, /* primary_value */
2245 YYSYMBOL_k_begin = 251, /* k_begin */
2246 YYSYMBOL_k_if = 252, /* k_if */
2247 YYSYMBOL_k_unless = 253, /* k_unless */
2248 YYSYMBOL_k_while = 254, /* k_while */
2249 YYSYMBOL_k_until = 255, /* k_until */
2250 YYSYMBOL_k_case = 256, /* k_case */
2251 YYSYMBOL_k_for = 257, /* k_for */
2252 YYSYMBOL_k_class = 258, /* k_class */
2253 YYSYMBOL_k_module = 259, /* k_module */
2254 YYSYMBOL_k_def = 260, /* k_def */
2255 YYSYMBOL_k_do = 261, /* k_do */
2256 YYSYMBOL_k_do_block = 262, /* k_do_block */
2257 YYSYMBOL_k_rescue = 263, /* k_rescue */
2258 YYSYMBOL_k_ensure = 264, /* k_ensure */
2259 YYSYMBOL_k_when = 265, /* k_when */
2260 YYSYMBOL_k_else = 266, /* k_else */
2261 YYSYMBOL_k_elsif = 267, /* k_elsif */
2262 YYSYMBOL_k_end = 268, /* k_end */
2263 YYSYMBOL_k_return = 269, /* k_return */
2264 YYSYMBOL_k_yield = 270, /* k_yield */
2265 YYSYMBOL_then = 271, /* then */
2266 YYSYMBOL_do = 272, /* do */
2267 YYSYMBOL_if_tail = 273, /* if_tail */
2268 YYSYMBOL_opt_else = 274, /* opt_else */
2269 YYSYMBOL_for_var = 275, /* for_var */
2270 YYSYMBOL_f_marg = 276, /* f_marg */
2271 YYSYMBOL_f_marg_list = 277, /* f_marg_list */
2272 YYSYMBOL_f_margs = 278, /* f_margs */
2273 YYSYMBOL_f_rest_marg = 279, /* f_rest_marg */
2274 YYSYMBOL_f_any_kwrest = 280, /* f_any_kwrest */
2275 YYSYMBOL_f_eq = 281, /* f_eq */
2276 YYSYMBOL_282_23 = 282, /* $@23 */
2277 YYSYMBOL_block_args_tail = 283, /* block_args_tail */
2278 YYSYMBOL_opt_block_args_tail = 284, /* opt_block_args_tail */
2279 YYSYMBOL_excessed_comma = 285, /* excessed_comma */
2280 YYSYMBOL_block_param = 286, /* block_param */
2281 YYSYMBOL_opt_block_param = 287, /* opt_block_param */
2282 YYSYMBOL_block_param_def = 288, /* block_param_def */
2283 YYSYMBOL_opt_bv_decl = 289, /* opt_bv_decl */
2284 YYSYMBOL_bv_decls = 290, /* bv_decls */
2285 YYSYMBOL_bvar = 291, /* bvar */
2286 YYSYMBOL_max_numparam = 292, /* max_numparam */
2287 YYSYMBOL_numparam = 293, /* numparam */
2288 YYSYMBOL_lambda = 294, /* lambda */
2289 YYSYMBOL_295_24 = 295, /* @24 */
2290 YYSYMBOL_296_25 = 296, /* $@25 */
2291 YYSYMBOL_f_larglist = 297, /* f_larglist */
2292 YYSYMBOL_lambda_body = 298, /* lambda_body */
2293 YYSYMBOL_299_26 = 299, /* $@26 */
2294 YYSYMBOL_do_block = 300, /* do_block */
2295 YYSYMBOL_block_call = 301, /* block_call */
2296 YYSYMBOL_method_call = 302, /* method_call */
2297 YYSYMBOL_brace_block = 303, /* brace_block */
2298 YYSYMBOL_brace_body = 304, /* brace_body */
2299 YYSYMBOL_305_27 = 305, /* @27 */
2300 YYSYMBOL_do_body = 306, /* do_body */
2301 YYSYMBOL_307_28 = 307, /* @28 */
2302 YYSYMBOL_case_args = 308, /* case_args */
2303 YYSYMBOL_case_body = 309, /* case_body */
2304 YYSYMBOL_cases = 310, /* cases */
2305 YYSYMBOL_p_pvtbl = 311, /* p_pvtbl */
2306 YYSYMBOL_p_pktbl = 312, /* p_pktbl */
2307 YYSYMBOL_p_in_kwarg = 313, /* p_in_kwarg */
2308 YYSYMBOL_p_case_body = 314, /* p_case_body */
2309 YYSYMBOL_315_29 = 315, /* $@29 */
2310 YYSYMBOL_p_cases = 316, /* p_cases */
2311 YYSYMBOL_p_top_expr = 317, /* p_top_expr */
2312 YYSYMBOL_p_top_expr_body = 318, /* p_top_expr_body */
2313 YYSYMBOL_p_expr = 319, /* p_expr */
2314 YYSYMBOL_p_as = 320, /* p_as */
2315 YYSYMBOL_p_alt = 321, /* p_alt */
2316 YYSYMBOL_p_lparen = 322, /* p_lparen */
2317 YYSYMBOL_p_lbracket = 323, /* p_lbracket */
2318 YYSYMBOL_p_expr_basic = 324, /* p_expr_basic */
2319 YYSYMBOL_325_30 = 325, /* $@30 */
2320 YYSYMBOL_p_args = 326, /* p_args */
2321 YYSYMBOL_p_args_head = 327, /* p_args_head */
2322 YYSYMBOL_p_args_tail = 328, /* p_args_tail */
2323 YYSYMBOL_p_find = 329, /* p_find */
2324 YYSYMBOL_p_rest = 330, /* p_rest */
2325 YYSYMBOL_p_args_post = 331, /* p_args_post */
2326 YYSYMBOL_p_arg = 332, /* p_arg */
2327 YYSYMBOL_p_kwargs = 333, /* p_kwargs */
2328 YYSYMBOL_p_kwarg = 334, /* p_kwarg */
2329 YYSYMBOL_p_kw = 335, /* p_kw */
2330 YYSYMBOL_p_kw_label = 336, /* p_kw_label */
2331 YYSYMBOL_p_kwrest = 337, /* p_kwrest */
2332 YYSYMBOL_p_kwnorest = 338, /* p_kwnorest */
2333 YYSYMBOL_p_any_kwrest = 339, /* p_any_kwrest */
2334 YYSYMBOL_p_value = 340, /* p_value */
2335 YYSYMBOL_p_primitive = 341, /* p_primitive */
2336 YYSYMBOL_p_variable = 342, /* p_variable */
2337 YYSYMBOL_p_var_ref = 343, /* p_var_ref */
2338 YYSYMBOL_p_expr_ref = 344, /* p_expr_ref */
2339 YYSYMBOL_p_const = 345, /* p_const */
2340 YYSYMBOL_opt_rescue = 346, /* opt_rescue */
2341 YYSYMBOL_exc_list = 347, /* exc_list */
2342 YYSYMBOL_exc_var = 348, /* exc_var */
2343 YYSYMBOL_opt_ensure = 349, /* opt_ensure */
2344 YYSYMBOL_literal = 350, /* literal */
2345 YYSYMBOL_strings = 351, /* strings */
2346 YYSYMBOL_string = 352, /* string */
2347 YYSYMBOL_string1 = 353, /* string1 */
2348 YYSYMBOL_xstring = 354, /* xstring */
2349 YYSYMBOL_regexp = 355, /* regexp */
2350 YYSYMBOL_words_sep = 356, /* words_sep */
2351 YYSYMBOL_words = 357, /* words */
2352 YYSYMBOL_word_list = 358, /* word_list */
2353 YYSYMBOL_word = 359, /* word */
2354 YYSYMBOL_symbols = 360, /* symbols */
2355 YYSYMBOL_symbol_list = 361, /* symbol_list */
2356 YYSYMBOL_qwords = 362, /* qwords */
2357 YYSYMBOL_qsymbols = 363, /* qsymbols */
2358 YYSYMBOL_qword_list = 364, /* qword_list */
2359 YYSYMBOL_qsym_list = 365, /* qsym_list */
2360 YYSYMBOL_string_contents = 366, /* string_contents */
2361 YYSYMBOL_xstring_contents = 367, /* xstring_contents */
2362 YYSYMBOL_regexp_contents = 368, /* regexp_contents */
2363 YYSYMBOL_string_content = 369, /* string_content */
2364 YYSYMBOL_370_31 = 370, /* @31 */
2365 YYSYMBOL_371_32 = 371, /* @32 */
2366 YYSYMBOL_372_33 = 372, /* @33 */
2367 YYSYMBOL_373_34 = 373, /* @34 */
2368 YYSYMBOL_string_dend = 374, /* string_dend */
2369 YYSYMBOL_string_dvar = 375, /* string_dvar */
2370 YYSYMBOL_symbol = 376, /* symbol */
2371 YYSYMBOL_ssym = 377, /* ssym */
2372 YYSYMBOL_sym = 378, /* sym */
2373 YYSYMBOL_dsym = 379, /* dsym */
2374 YYSYMBOL_numeric = 380, /* numeric */
2375 YYSYMBOL_simple_numeric = 381, /* simple_numeric */
2376 YYSYMBOL_nonlocal_var = 382, /* nonlocal_var */
2377 YYSYMBOL_user_variable = 383, /* user_variable */
2378 YYSYMBOL_keyword_variable = 384, /* keyword_variable */
2379 YYSYMBOL_var_ref = 385, /* var_ref */
2380 YYSYMBOL_var_lhs = 386, /* var_lhs */
2381 YYSYMBOL_backref = 387, /* backref */
2382 YYSYMBOL_superclass = 388, /* superclass */
2383 YYSYMBOL_389_35 = 389, /* $@35 */
2384 YYSYMBOL_f_opt_paren_args = 390, /* f_opt_paren_args */
2385 YYSYMBOL_f_paren_args = 391, /* f_paren_args */
2386 YYSYMBOL_f_arglist = 392, /* f_arglist */
2387 YYSYMBOL_393_36 = 393, /* @36 */
2388 YYSYMBOL_args_tail = 394, /* args_tail */
2389 YYSYMBOL_opt_args_tail = 395, /* opt_args_tail */
2390 YYSYMBOL_f_args = 396, /* f_args */
2391 YYSYMBOL_args_forward = 397, /* args_forward */
2392 YYSYMBOL_f_bad_arg = 398, /* f_bad_arg */
2393 YYSYMBOL_f_norm_arg = 399, /* f_norm_arg */
2394 YYSYMBOL_f_arg_asgn = 400, /* f_arg_asgn */
2395 YYSYMBOL_f_arg_item = 401, /* f_arg_item */
2396 YYSYMBOL_f_arg = 402, /* f_arg */
2397 YYSYMBOL_f_label = 403, /* f_label */
2398 YYSYMBOL_f_kw = 404, /* f_kw */
2399 YYSYMBOL_f_block_kw = 405, /* f_block_kw */
2400 YYSYMBOL_f_block_kwarg = 406, /* f_block_kwarg */
2401 YYSYMBOL_f_kwarg = 407, /* f_kwarg */
2402 YYSYMBOL_kwrest_mark = 408, /* kwrest_mark */
2403 YYSYMBOL_f_no_kwarg = 409, /* f_no_kwarg */
2404 YYSYMBOL_f_kwrest = 410, /* f_kwrest */
2405 YYSYMBOL_f_opt = 411, /* f_opt */
2406 YYSYMBOL_f_block_opt = 412, /* f_block_opt */
2407 YYSYMBOL_f_block_optarg = 413, /* f_block_optarg */
2408 YYSYMBOL_f_optarg = 414, /* f_optarg */
2409 YYSYMBOL_restarg_mark = 415, /* restarg_mark */
2410 YYSYMBOL_f_rest_arg = 416, /* f_rest_arg */
2411 YYSYMBOL_blkarg_mark = 417, /* blkarg_mark */
2412 YYSYMBOL_f_block_arg = 418, /* f_block_arg */
2413 YYSYMBOL_opt_f_block_arg = 419, /* opt_f_block_arg */
2414 YYSYMBOL_singleton = 420, /* singleton */
2415 YYSYMBOL_421_37 = 421, /* $@37 */
2416 YYSYMBOL_assoc_list = 422, /* assoc_list */
2417 YYSYMBOL_assocs = 423, /* assocs */
2418 YYSYMBOL_assoc = 424, /* assoc */
2419 YYSYMBOL_operation = 425, /* operation */
2420 YYSYMBOL_operation2 = 426, /* operation2 */
2421 YYSYMBOL_operation3 = 427, /* operation3 */
2422 YYSYMBOL_dot_or_colon = 428, /* dot_or_colon */
2423 YYSYMBOL_call_op = 429, /* call_op */
2424 YYSYMBOL_call_op2 = 430, /* call_op2 */
2425 YYSYMBOL_opt_terms = 431, /* opt_terms */
2426 YYSYMBOL_opt_nl = 432, /* opt_nl */
2427 YYSYMBOL_rparen = 433, /* rparen */
2428 YYSYMBOL_rbracket = 434, /* rbracket */
2429 YYSYMBOL_rbrace = 435, /* rbrace */
2430 YYSYMBOL_trailer = 436, /* trailer */
2431 YYSYMBOL_term = 437, /* term */
2432 YYSYMBOL_terms = 438, /* terms */
2433 YYSYMBOL_none = 439 /* none */
2434};
2435typedef enum yysymbol_kind_t yysymbol_kind_t;
2436
2437
2438
2439
2440#ifdef short
2441# undef short
2442#endif
2443
2444/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
2445 <limits.h> and (if available) <stdint.h> are included
2446 so that the code can choose integer types of a good width. */
2447
2448#ifndef __PTRDIFF_MAX__
2449# include <limits.h> /* INFRINGES ON USER NAME SPACE */
2450# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2451# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
2452# define YY_STDINT_H
2453# endif
2454#endif
2455
2456/* Narrow types that promote to a signed type and that can represent a
2457 signed or unsigned integer of at least N bits. In tables they can
2458 save space and decrease cache pressure. Promoting to a signed type
2459 helps avoid bugs in integer arithmetic. */
2460
2461#ifdef __INT_LEAST8_MAX__
2462typedef __INT_LEAST8_TYPE__ yytype_int8;
2463#elif defined YY_STDINT_H
2464typedef int_least8_t yytype_int8;
2465#else
2466typedef signed char yytype_int8;
2467#endif
2468
2469#ifdef __INT_LEAST16_MAX__
2470typedef __INT_LEAST16_TYPE__ yytype_int16;
2471#elif defined YY_STDINT_H
2472typedef int_least16_t yytype_int16;
2473#else
2474typedef short yytype_int16;
2475#endif
2476
2477/* Work around bug in HP-UX 11.23, which defines these macros
2478 incorrectly for preprocessor constants. This workaround can likely
2479 be removed in 2023, as HPE has promised support for HP-UX 11.23
2480 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
2481 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
2482#ifdef __hpux
2483# undef UINT_LEAST8_MAX
2484# undef UINT_LEAST16_MAX
2485# define UINT_LEAST8_MAX 255
2486# define UINT_LEAST16_MAX 65535
2487#endif
2488
2489#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
2490typedef __UINT_LEAST8_TYPE__ yytype_uint8;
2491#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
2492 && UINT_LEAST8_MAX <= INT_MAX)
2493typedef uint_least8_t yytype_uint8;
2494#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
2495typedef unsigned char yytype_uint8;
2496#else
2497typedef short yytype_uint8;
2498#endif
2499
2500#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
2501typedef __UINT_LEAST16_TYPE__ yytype_uint16;
2502#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
2503 && UINT_LEAST16_MAX <= INT_MAX)
2504typedef uint_least16_t yytype_uint16;
2505#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
2506typedef unsigned short yytype_uint16;
2507#else
2508typedef int yytype_uint16;
2509#endif
2510
2511#ifndef YYPTRDIFF_T
2512# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
2513# define YYPTRDIFF_T __PTRDIFF_TYPE__
2514# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
2515# elif defined PTRDIFF_MAX
2516# ifndef ptrdiff_t
2517# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2518# endif
2519# define YYPTRDIFF_T ptrdiff_t
2520# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
2521# else
2522# define YYPTRDIFF_T long
2523# define YYPTRDIFF_MAXIMUM LONG_MAX
2524# endif
2525#endif
2526
2527#ifndef YYSIZE_T
2528# ifdef __SIZE_TYPE__
2529# define YYSIZE_T __SIZE_TYPE__
2530# elif defined size_t
2531# define YYSIZE_T size_t
2532# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2533# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2534# define YYSIZE_T size_t
2535# else
2536# define YYSIZE_T unsigned
2537# endif
2538#endif
2539
2540#define YYSIZE_MAXIMUM \
2541 YY_CAST (YYPTRDIFF_T, \
2542 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
2543 ? YYPTRDIFF_MAXIMUM \
2544 : YY_CAST (YYSIZE_T, -1)))
2545
2546#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
2547
2548
2549/* Stored state numbers (used for stacks). */
2550typedef yytype_int16 yy_state_t;
2551
2552/* State numbers in computations. */
2553typedef int yy_state_fast_t;
2554
2555#ifndef YY_
2556# if defined YYENABLE_NLS && YYENABLE_NLS
2557# if ENABLE_NLS
2558# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2559# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
2560# endif
2561# endif
2562# ifndef YY_
2563# define YY_(Msgid) Msgid
2564# endif
2565#endif
2566
2567
2568#ifndef YY_ATTRIBUTE_PURE
2569# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
2570# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
2571# else
2572# define YY_ATTRIBUTE_PURE
2573# endif
2574#endif
2575
2576#ifndef YY_ATTRIBUTE_UNUSED
2577# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
2578# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
2579# else
2580# define YY_ATTRIBUTE_UNUSED
2581# endif
2582#endif
2583
2584/* Suppress unused-variable warnings by "using" E. */
2585#if ! defined lint || defined __GNUC__
2586# define YY_USE(E) ((void) (E))
2587#else
2588# define YY_USE(E) /* empty */
2589#endif
2590
2591/* Suppress an incorrect diagnostic about yylval being uninitialized. */
2592#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
2593# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
2594# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2595 _Pragma ("GCC diagnostic push") \
2596 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
2597# else
2598# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2599 _Pragma ("GCC diagnostic push") \
2600 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
2601 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
2602# endif
2603# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
2604 _Pragma ("GCC diagnostic pop")
2605#else
2606# define YY_INITIAL_VALUE(Value) Value
2607#endif
2608#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2609# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2610# define YY_IGNORE_MAYBE_UNINITIALIZED_END
2611#endif
2612#ifndef YY_INITIAL_VALUE
2613# define YY_INITIAL_VALUE(Value) /* Nothing. */
2614#endif
2615
2616#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
2617# define YY_IGNORE_USELESS_CAST_BEGIN \
2618 _Pragma ("GCC diagnostic push") \
2619 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
2620# define YY_IGNORE_USELESS_CAST_END \
2621 _Pragma ("GCC diagnostic pop")
2622#endif
2623#ifndef YY_IGNORE_USELESS_CAST_BEGIN
2624# define YY_IGNORE_USELESS_CAST_BEGIN
2625# define YY_IGNORE_USELESS_CAST_END
2626#endif
2627
2628
2629#define YY_ASSERT(E) ((void) (0 && (E)))
2630
2631#if 1
2632
2633/* The parser invokes alloca or malloc; define the necessary symbols. */
2634
2635# ifdef YYSTACK_USE_ALLOCA
2636# if YYSTACK_USE_ALLOCA
2637# ifdef __GNUC__
2638# define YYSTACK_ALLOC __builtin_alloca
2639# elif defined __BUILTIN_VA_ARG_INCR
2640# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2641# elif defined _AIX
2642# define YYSTACK_ALLOC __alloca
2643# elif defined _MSC_VER
2644# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2645# define alloca _alloca
2646# else
2647# define YYSTACK_ALLOC alloca
2648# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
2649# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2650 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
2651# ifndef EXIT_SUCCESS
2652# define EXIT_SUCCESS 0
2653# endif
2654# endif
2655# endif
2656# endif
2657# endif
2658
2659# ifdef YYSTACK_ALLOC
2660 /* Pacify GCC's 'empty if-body' warning. */
2661# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
2662# ifndef YYSTACK_ALLOC_MAXIMUM
2663 /* The OS might guarantee only one guard page at the bottom of the stack,
2664 and a page size can be as small as 4096 bytes. So we cannot safely
2665 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2666 to allow for a few compiler-allocated temporary stack slots. */
2667# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2668# endif
2669# else
2670# define YYSTACK_ALLOC YYMALLOC
2671# define YYSTACK_FREE YYFREE
2672# ifndef YYSTACK_ALLOC_MAXIMUM
2673# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2674# endif
2675# if (defined __cplusplus && ! defined EXIT_SUCCESS \
2676 && ! ((defined YYMALLOC || defined malloc) \
2677 && (defined YYFREE || defined free)))
2678# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2679# ifndef EXIT_SUCCESS
2680# define EXIT_SUCCESS 0
2681# endif
2682# endif
2683# ifndef YYMALLOC
2684# define YYMALLOC malloc
2685# if ! defined malloc && ! defined EXIT_SUCCESS
2686void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2687# endif
2688# endif
2689# ifndef YYFREE
2690# define YYFREE free
2691# if ! defined free && ! defined EXIT_SUCCESS
2692void free (void *); /* INFRINGES ON USER NAME SPACE */
2693# endif
2694# endif
2695# endif
2696#endif /* 1 */
2697
2698#if (! defined yyoverflow \
2699 && (! defined __cplusplus \
2700 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
2701 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2702
2703/* A type that is properly aligned for any stack member. */
2704union yyalloc
2705{
2706 yy_state_t yyss_alloc;
2707 YYSTYPE yyvs_alloc;
2708 YYLTYPE yyls_alloc;
2709};
2710
2711/* The size of the maximum gap between one aligned stack and the next. */
2712# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
2713
2714/* The size of an array large to enough to hold all stacks, each with
2715 N elements. */
2716# define YYSTACK_BYTES(N) \
2717 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
2718 + YYSIZEOF (YYLTYPE)) \
2719 + 2 * YYSTACK_GAP_MAXIMUM)
2720
2721# define YYCOPY_NEEDED 1
2722
2723/* Relocate STACK from its old location to the new one. The
2724 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2725 elements in the stack, and YYPTR gives the new location of the
2726 stack. Advance YYPTR to a properly aligned location for the next
2727 stack. */
2728# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2729 do \
2730 { \
2731 YYPTRDIFF_T yynewbytes; \
2732 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2733 Stack = &yyptr->Stack_alloc; \
2734 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
2735 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
2736 } \
2737 while (0)
2738
2739#endif
2740
2741#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
2742/* Copy COUNT objects from SRC to DST. The source and destination do
2743 not overlap. */
2744# ifndef YYCOPY
2745# if defined __GNUC__ && 1 < __GNUC__
2746# define YYCOPY(Dst, Src, Count) \
2747 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
2748# else
2749# define YYCOPY(Dst, Src, Count) \
2750 do \
2751 { \
2752 YYPTRDIFF_T yyi; \
2753 for (yyi = 0; yyi < (Count); yyi++) \
2754 (Dst)[yyi] = (Src)[yyi]; \
2755 } \
2756 while (0)
2757# endif
2758# endif
2759#endif /* !YYCOPY_NEEDED */
2760
2761/* YYFINAL -- State number of the termination state. */
2762#define YYFINAL 3
2763/* YYLAST -- Last index in YYTABLE. */
2764#define YYLAST 15486
2765
2766/* YYNTOKENS -- Number of terminals. */
2767#define YYNTOKENS 163
2768/* YYNNTS -- Number of nonterminals. */
2769#define YYNNTS 277
2770/* YYNRULES -- Number of rules. */
2771#define YYNRULES 783
2772/* YYNSTATES -- Number of states. */
2773#define YYNSTATES 1341
2774
2775/* YYMAXUTOK -- Last valid token kind. */
2776#define YYMAXUTOK 362
2777
2778
2779/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
2780 as returned by yylex, with out-of-bounds checking. */
2781#define YYTRANSLATE(YYX) \
2782 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
2783 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
2784 : YYSYMBOL_YYUNDEF)
2785
2786/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
2787 as returned by yylex. */
2788static const yytype_uint8 yytranslate[] =
2789{
2790 0, 2, 2, 2, 2, 2, 2, 2, 2, 72,
2791 162, 75, 73, 74, 2, 2, 2, 2, 2, 2,
2792 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2793 2, 2, 161, 149, 2, 2, 2, 147, 142, 2,
2794 157, 158, 145, 143, 155, 144, 69, 146, 2, 2,
2795 2, 2, 2, 2, 2, 2, 2, 2, 137, 160,
2796 139, 135, 138, 136, 2, 2, 2, 2, 2, 2,
2797 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2798 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2799 2, 154, 70, 159, 141, 2, 156, 2, 2, 2,
2800 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2801 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2802 2, 2, 2, 152, 140, 153, 150, 2, 89, 90,
2803 91, 92, 76, 77, 78, 79, 95, 96, 84, 83,
2804 80, 81, 82, 87, 88, 93, 94, 98, 85, 86,
2805 97, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2806 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2807 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2808 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2809 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2810 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2811 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2812 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2813 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2814 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2815 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2816 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2817 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2818 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2819 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2820 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2821 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2822 65, 66, 67, 68, 71, 99, 100, 101, 102, 103,
2823 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2824 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
2825 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2826 134, 148, 151
2827};
2828
2829#if YYDEBUG
2830/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
2831static const yytype_int16 yyrline[] =
2832{
2833 0, 2193, 2193, 2193, 2221, 2227, 2234, 2241, 2250, 2255,
2834 2261, 2263, 2279, 2284, 2275, 2297, 2294, 2309, 2315, 2322,
2835 2329, 2338, 2343, 2342, 2352, 2354, 2360, 2360, 2367, 2374,
2836 2384, 2393, 2400, 2408, 2416, 2429, 2442, 2453, 2468, 2469,
2837 2477, 2484, 2497, 2504, 2505, 2514, 2521, 2528, 2536, 2543,
2838 2550, 2558, 2565, 2578, 2591, 2601, 2602, 2610, 2616, 2621,
2839 2631, 2634, 2635, 2639, 2643, 2647, 2652, 2651, 2667, 2666,
2840 2681, 2684, 2696, 2709, 2708, 2728, 2733, 2741, 2741, 2741,
2841 2747, 2748, 2751, 2752, 2761, 2770, 2779, 2788, 2799, 2806,
2842 2813, 2820, 2827, 2835, 2843, 2851, 2858, 2867, 2878, 2879,
2843 2888, 2889, 2898, 2905, 2912, 2919, 2926, 2933, 2940, 2947,
2844 2954, 2961, 2970, 2971, 2980, 2987, 2996, 3003, 3012, 3019,
2845 3026, 3033, 3041, 3048, 3056, 3063, 3070, 3080, 3087, 3094,
2846 3101, 3108, 3115, 3122, 3129, 3136, 3146, 3154, 3157, 3164,
2847 3171, 3180, 3181, 3182, 3183, 3188, 3191, 3198, 3201, 3208,
2848 3208, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226,
2849 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236,
2850 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246,
2851 3247, 3250, 3250, 3250, 3251, 3251, 3252, 3252, 3252, 3253,
2852 3253, 3253, 3253, 3254, 3254, 3254, 3254, 3255, 3255, 3255,
2853 3256, 3256, 3256, 3256, 3257, 3257, 3257, 3257, 3258, 3258,
2854 3258, 3258, 3259, 3259, 3259, 3259, 3260, 3260, 3260, 3260,
2855 3261, 3261, 3264, 3271, 3278, 3285, 3292, 3299, 3306, 3314,
2856 3322, 3330, 3339, 3348, 3356, 3364, 3372, 3380, 3384, 3388,
2857 3392, 3396, 3400, 3404, 3408, 3412, 3416, 3420, 3424, 3428,
2858 3432, 3433, 3437, 3441, 3445, 3449, 3453, 3457, 3461, 3465,
2859 3469, 3473, 3477, 3482, 3491, 3504, 3517, 3523, 3524, 3532,
2860 3538, 3539, 3540, 3541, 3544, 3548, 3555, 3561, 3568, 3575,
2861 3582, 3583, 3587, 3594, 3603, 3608, 3619, 3626, 3638, 3652,
2862 3653, 3656, 3657, 3658, 3662, 3669, 3678, 3686, 3693, 3701,
2863 3709, 3713, 3713, 3750, 3757, 3767, 3771, 3778, 3785, 3792,
2864 3799, 3809, 3813, 3824, 3825, 3829, 3836, 3843, 3852, 3853,
2865 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3870,
2866 3869, 3884, 3884, 3892, 3900, 3907, 3914, 3921, 3929, 3936,
2867 3943, 3950, 3957, 3962, 3966, 3970, 3977, 3978, 3986, 3987,
2868 3998, 4009, 4020, 4032, 4031, 4048, 4047, 4062, 4071, 4116,
2869 4115, 4134, 4133, 4154, 4153, 4173, 4171, 4192, 4190, 4209,
2870 4214, 4219, 4224, 4241, 4248, 4257, 4277, 4286, 4296, 4306,
2871 4315, 4325, 4336, 4347, 4355, 4364, 4373, 4381, 4388, 4394,
2872 4409, 4416, 4423, 4429, 4436, 4443, 4444, 4445, 4448, 4449,
2873 4452, 4453, 4465, 4466, 4475, 4476, 4479, 4487, 4496, 4503,
2874 4512, 4519, 4526, 4533, 4540, 4549, 4557, 4566, 4567, 4570,
2875 4570, 4572, 4576, 4580, 4584, 4590, 4595, 4600, 4610, 4614,
2876 4618, 4622, 4626, 4630, 4635, 4639, 4643, 4647, 4651, 4655,
2877 4659, 4663, 4667, 4673, 4674, 4680, 4691, 4704, 4708, 4717,
2878 4719, 4723, 4728, 4734, 4740, 4746, 4754, 4745, 4780, 4789,
2879 4800, 4806, 4805, 4817, 4826, 4840, 4847, 4854, 4863, 4872,
2880 4880, 4888, 4895, 4903, 4911, 4918, 4925, 4935, 4942, 4951,
2881 4951, 4968, 4968, 4989, 4997, 5004, 5012, 5021, 5033, 5034,
2882 5037, 5038, 5040, 5051, 5048, 5066, 5067, 5070, 5071, 5079,
2883 5089, 5090, 5095, 5103, 5107, 5111, 5117, 5120, 5129, 5132,
2884 5139, 5142, 5143, 5145, 5146, 5147, 5156, 5165, 5174, 5179,
2885 5188, 5197, 5206, 5211, 5215, 5219, 5225, 5224, 5234, 5239,
2886 5246, 5255, 5259, 5268, 5272, 5276, 5279, 5283, 5292, 5296,
2887 5302, 5309, 5317, 5326, 5327, 5336, 5345, 5349, 5353, 5357,
2888 5363, 5365, 5374, 5382, 5396, 5397, 5420, 5424, 5430, 5436,
2889 5437, 5440, 5441, 5450, 5459, 5467, 5475, 5476, 5477, 5478,
2890 5486, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504,
2891 5511, 5514, 5524, 5535, 5544, 5553, 5560, 5567, 5576, 5600,
2892 5603, 5610, 5617, 5620, 5624, 5627, 5635, 5638, 5639, 5642,
2893 5659, 5660, 5661, 5670, 5680, 5689, 5695, 5696, 5699, 5709,
2894 5715, 5724, 5726, 5735, 5745, 5751, 5760, 5769, 5779, 5785,
2895 5795, 5801, 5811, 5821, 5840, 5846, 5856, 5866, 5907, 5910,
2896 5909, 5926, 5935, 5939, 5925, 5960, 5961, 5964, 5971, 5974,
2897 5975, 5978, 5988, 5989, 5992, 6002, 6003, 6013, 6014, 6015,
2898 6016, 6019, 6020, 6021, 6024, 6025, 6026, 6029, 6030, 6031,
2899 6032, 6033, 6034, 6035, 6038, 6051, 6060, 6067, 6076, 6077,
2900 6081, 6080, 6090, 6098, 6099, 6107, 6119, 6120, 6120, 6136,
2901 6140, 6144, 6148, 6152, 6162, 6167, 6172, 6176, 6180, 6184,
2902 6188, 6192, 6196, 6200, 6204, 6208, 6212, 6216, 6220, 6224,
2903 6229, 6235, 6248, 6257, 6266, 6275, 6286, 6287, 6295, 6304,
2904 6312, 6333, 6335, 6348, 6358, 6367, 6378, 6386, 6396, 6403,
2905 6413, 6420, 6429, 6430, 6433, 6441, 6449, 6459, 6470, 6481,
2906 6488, 6497, 6504, 6513, 6514, 6517, 6525, 6535, 6536, 6539,
2907 6547, 6557, 6561, 6567, 6572, 6572, 6598, 6599, 6608, 6610,
2908 6633, 6644, 6651, 6660, 6668, 6685, 6696, 6697, 6698, 6701,
2909 6702, 6705, 6706, 6707, 6710, 6711, 6714, 6715, 6718, 6719,
2910 6722, 6723, 6726, 6727, 6730, 6733, 6736, 6739, 6740, 6743,
2911 6744, 6751, 6752, 6756
2912};
2913#endif
2914
2916#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
2917
2918#if 1
2919/* The user-facing name of the symbol whose (internal) number is
2920 YYSYMBOL. No bounds checking. */
2921static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
2922
2923/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2924 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2925static const char *const yytname[] =
2926{
2927 "\"end-of-input\"", "error", "\"invalid token\"", "\"`class'\"",
2928 "\"`module'\"", "\"`def'\"", "\"`undef'\"", "\"`begin'\"",
2929 "\"`rescue'\"", "\"`ensure'\"", "\"`end'\"", "\"`if'\"", "\"`unless'\"",
2930 "\"`then'\"", "\"`elsif'\"", "\"`else'\"", "\"`case'\"", "\"`when'\"",
2931 "\"`while'\"", "\"`until'\"", "\"`for'\"", "\"`break'\"", "\"`next'\"",
2932 "\"`redo'\"", "\"`retry'\"", "\"`in'\"", "\"`do'\"",
2933 "\"`do' for condition\"", "\"`do' for block\"", "\"`do' for lambda\"",
2934 "\"`return'\"", "\"`yield'\"", "\"`super'\"", "\"`self'\"", "\"`nil'\"",
2935 "\"`true'\"", "\"`false'\"", "\"`and'\"", "\"`or'\"", "\"`not'\"",
2936 "\"`if' modifier\"", "\"`unless' modifier\"", "\"`while' modifier\"",
2937 "\"`until' modifier\"", "\"`rescue' modifier\"", "\"`alias'\"",
2938 "\"`defined?'\"", "\"`BEGIN'\"", "\"`END'\"", "\"`__LINE__'\"",
2939 "\"`__FILE__'\"", "\"`__ENCODING__'\"", "\"local variable or method\"",
2940 "\"method\"", "\"global variable\"", "\"instance variable\"",
2941 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
2942 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
2943 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
2944 "\"literal content\"", "tREGEXP_END", "\"dummy end\"", "'.'",
2945 "\"backslash\"", "\"escaped space\"", "\"escaped horizontal tab\"",
2946 "\"escaped form feed\"", "\"escaped carriage return\"",
2947 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
2948 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
2949 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
2950 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
2951 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
2952 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
2953 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
2954 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
2955 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
2956 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "tSTRING_DBEG",
2957 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tIGNORED_NL", "tCOMMENT",
2958 "tEMBDOC_BEG", "tEMBDOC", "tEMBDOC_END", "tHEREDOC_BEG", "tHEREDOC_END",
2959 "k__END__", "tLOWEST", "'='", "'?'", "':'", "'>'", "'<'", "'|'", "'^'",
2960 "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "tUMINUS_NUM", "'!'", "'~'",
2961 "tLAST_TOKEN", "'{'", "'}'", "'['", "','", "'`'", "'('", "')'", "']'",
2962 "';'", "' '", "'\\n'", "$accept", "program", "$@1", "top_compstmt",
2963 "top_stmts", "top_stmt", "block_open", "begin_block", "bodystmt", "$@2",
2964 "$@3", "$@4", "compstmt", "stmts", "stmt_or_begin", "$@5", "allow_exits",
2965 "k_END", "stmt", "$@6", "command_asgn", "endless_command", "command_rhs",
2966 "expr", "$@7", "$@8", "def_name", "defn_head", "defs_head", "$@9",
2967 "expr_value", "expr_value_do", "$@10", "$@11", "command_call",
2968 "block_command", "cmd_brace_block", "fcall", "command", "mlhs",
2969 "mlhs_inner", "mlhs_basic", "mlhs_item", "mlhs_head", "mlhs_post",
2970 "mlhs_node", "lhs", "cname", "cpath", "fname", "fitem", "undef_list",
2971 "$@12", "op", "reswords", "arg", "endless_arg", "relop", "rel_expr",
2972 "lex_ctxt", "begin_defined", "after_rescue", "arg_value", "aref_args",
2973 "arg_rhs", "paren_args", "opt_paren_args", "opt_call_args", "call_args",
2974 "command_args", "$@13", "block_arg", "opt_block_arg", "args",
2975 "arg_splat", "mrhs_arg", "mrhs", "primary", "$@14", "$@15", "@16", "@17",
2976 "$@18", "$@19", "$@20", "$@21", "$@22", "primary_value", "k_begin",
2977 "k_if", "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
2978 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
2979 "k_when", "k_else", "k_elsif", "k_end", "k_return", "k_yield", "then",
2980 "do", "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list",
2981 "f_margs", "f_rest_marg", "f_any_kwrest", "f_eq", "$@23",
2982 "block_args_tail", "opt_block_args_tail", "excessed_comma",
2983 "block_param", "opt_block_param", "block_param_def", "opt_bv_decl",
2984 "bv_decls", "bvar", "max_numparam", "numparam", "lambda", "@24", "$@25",
2985 "f_larglist", "lambda_body", "$@26", "do_block", "block_call",
2986 "method_call", "brace_block", "brace_body", "@27", "do_body", "@28",
2987 "case_args", "case_body", "cases", "p_pvtbl", "p_pktbl", "p_in_kwarg",
2988 "p_case_body", "$@29", "p_cases", "p_top_expr", "p_top_expr_body",
2989 "p_expr", "p_as", "p_alt", "p_lparen", "p_lbracket", "p_expr_basic",
2990 "$@30", "p_args", "p_args_head", "p_args_tail", "p_find", "p_rest",
2991 "p_args_post", "p_arg", "p_kwargs", "p_kwarg", "p_kw", "p_kw_label",
2992 "p_kwrest", "p_kwnorest", "p_any_kwrest", "p_value", "p_primitive",
2993 "p_variable", "p_var_ref", "p_expr_ref", "p_const", "opt_rescue",
2994 "exc_list", "exc_var", "opt_ensure", "literal", "strings", "string",
2995 "string1", "xstring", "regexp", "words_sep", "words", "word_list",
2996 "word", "symbols", "symbol_list", "qwords", "qsymbols", "qword_list",
2997 "qsym_list", "string_contents", "xstring_contents", "regexp_contents",
2998 "string_content", "@31", "@32", "@33", "@34", "string_dend",
2999 "string_dvar", "symbol", "ssym", "sym", "dsym", "numeric",
3000 "simple_numeric", "nonlocal_var", "user_variable", "keyword_variable",
3001 "var_ref", "var_lhs", "backref", "superclass", "$@35",
3002 "f_opt_paren_args", "f_paren_args", "f_arglist", "@36", "args_tail",
3003 "opt_args_tail", "f_args", "args_forward", "f_bad_arg", "f_norm_arg",
3004 "f_arg_asgn", "f_arg_item", "f_arg", "f_label", "f_kw", "f_block_kw",
3005 "f_block_kwarg", "f_kwarg", "kwrest_mark", "f_no_kwarg", "f_kwrest",
3006 "f_opt", "f_block_opt", "f_block_optarg", "f_optarg", "restarg_mark",
3007 "f_rest_arg", "blkarg_mark", "f_block_arg", "opt_f_block_arg",
3008 "singleton", "$@37", "assoc_list", "assocs", "assoc", "operation",
3009 "operation2", "operation3", "dot_or_colon", "call_op", "call_op2",
3010 "opt_terms", "opt_nl", "rparen", "rbracket", "rbrace", "trailer", "term",
3011 "terms", "none", YY_NULLPTR
3012};
3013
3014static const char *
3015yysymbol_name (yysymbol_kind_t yysymbol)
3016{
3017 return yytname[yysymbol];
3018}
3019#endif
3020
3021#define YYPACT_NINF (-1088)
3022
3023#define yypact_value_is_default(Yyn) \
3024 ((Yyn) == YYPACT_NINF)
3025
3026#define YYTABLE_NINF (-784)
3027
3028#define yytable_value_is_error(Yyn) \
3029 ((Yyn) == YYTABLE_NINF)
3030
3031/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
3032 STATE-NUM. */
3033static const yytype_int16 yypact[] =
3034{
3035 -1088, 141, 4978, -1088, -1088, -1088, -1088, -1088, 10235, -1088,
3036 -1088, -1088, -1088, -1088, -1088, -1088, 11055, 11055, -1088, -1088,
3037 -1088, -1088, 6200, -1088, -1088, -1088, -1088, 527, 10081, 50,
3038 222, -1088, -1088, -1088, -1088, 5576, 6356, -1088, -1088, 5732,
3039 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 12507, 12507,
3040 12507, 12507, 427, 8462, 8622, 11539, 11781, 10537, -1088, 9927,
3041 -1088, -1088, -1088, 336, 336, 336, 336, 1285, 12628, 12507,
3042 -1088, 299, -1088, -1088, 1317, -1088, 485, 37, 37, -1088,
3043 -1088, 142, 480, 398, -1088, 406, 13112, -1088, 444, 1944,
3044 957, 57, 659, -1088, 10934, 10934, -1088, -1088, 9096, 13231,
3045 13350, 13469, 9772, 11055, 6824, -1088, 593, 97, -1088, -1088,
3046 476, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3047 -1088, -1088, -1088, -1088, 85, 561, -1088, 495, 645, -1088,
3048 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3049 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3050 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3051 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3052 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3053 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3054 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3055 -1088, -1088, -1088, -1088, -1088, -1088, -1088, 446, -1088, -1088,
3056 -1088, -1088, -1088, -1088, 496, 12507, 581, 8622, 12507, 12507,
3057 12507, -1088, 12507, 37, 37, -1088, 562, 5702, 599, -1088,
3058 -1088, 556, -1088, 763, 69, 71, 632, 108, 610, -1088,
3059 -1088, 11176, -1088, -1088, 11055, 9651, -1088, 12749, 823, -1088,
3060 606, -1088, 8782, -1088, -1088, -1088, -1088, -1088, 616, 142,
3061 -1088, 769, -1088, 626, 762, 5390, 5390, 667, -1088, 8462,
3062 661, 299, -1088, 1317, 50, 710, -1088, -1088, 688, 240,
3063 369, -1088, 599, 699, 369, -1088, 50, 794, 1285, 13588,
3064 702, 702, 718, -1088, 793, 830, 843, 853, -1088, -1088,
3065 73, -1088, -1088, 687, 858, 852, -1088, 724, 724, 724,
3066 724, 801, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 9379,
3067 786, 10934, 10934, 10934, 10934, -1088, 12749, 12749, 2194, 819,
3068 835, -1088, 2194, -1088, 836, -1088, -1088, -1088, -1088, 866,
3069 -1088, -1088, -1088, -1088, -1088, -1088, -1088, 8462, 10675, 834,
3070 -1088, -1088, 12507, 12507, 12507, 12507, 12507, -1088, -1088, 12507,
3071 12507, 12507, 12507, 12507, 12507, 12507, 12507, -1088, 12507, -1088,
3072 -1088, 12507, 12507, 12507, 12507, 12507, 12507, 12507, 12507, 12507,
3073 12507, -1088, -1088, 4666, 11055, 5066, 7608, -1088, 485, 169,
3074 169, 8340, 10934, 8340, 299, -1088, 832, 942, -1088, -1088,
3075 879, 979, 91, 113, 127, 697, 732, 10934, 493, -1088,
3076 871, 888, -1088, -1088, -1088, -1088, 119, 347, 371, 378,
3077 466, 569, 576, 693, 700, -1088, -1088, -1088, -1088, 767,
3078 -1088, 9530, -1088, -1088, -1088, 15330, -1088, -1088, -1088, -1088,
3079 -1088, -1088, 318, -1088, -1088, -1088, 698, 870, 878, -1088,
3080 12507, 11297, -1088, -1088, 13944, 11055, 14043, -1088, -1088, 11660,
3081 -1088, 12507, 50, -1088, 863, 50, 868, -1088, -1088, 83,
3082 896, -1088, -1088, -1088, -1088, -1088, 10235, -1088, -1088, 12507,
3083 875, 14142, 14043, -1088, 222, 50, -1088, -1088, 9218, 882,
3084 897, -1088, 11539, -1088, -1088, 11781, -1088, -1088, -1088, 606,
3085 914, -1088, -1088, 906, -1088, 13588, 14241, 11055, 14340, -1088,
3086 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3087 -1088, 930, 117, 953, 331, 12507, -1088, -1088, 8942, -1088,
3088 -1088, -1088, -1088, -1088, 10813, -1088, -1088, -1088, -1088, -1088,
3089 -1088, -1088, -1088, -1088, -1088, 1150, -1088, -1088, -1088, -1088,
3090 -1088, 908, -1088, -1088, 50, -1088, -1088, -1088, 945, -1088,
3091 910, 12507, -1088, 927, 158, -1088, -1088, -1088, 931, 1033,
3092 932, 1041, -1088, 12870, 7608, 299, 12870, 7608, 941, -1088,
3093 -1088, -1088, 156, -1088, 156, 11902, 50, 13588, 944, -1088,
3094 11902, -1088, 762, 4760, 4760, 4760, 4760, 5858, 4273, 4760,
3095 4760, 5390, 5390, 631, 631, -1088, 5546, 642, 642, 1120,
3096 326, 326, 762, 762, 762, 1458, 1458, 6980, 5888, 7292,
3097 6044, -1088, -1088, 616, -1088, 50, 955, 808, -1088, 929,
3098 -1088, -1088, 6512, 156, -1088, -1088, 7730, 1084, 8096, 156,
3099 320, 156, 1081, 1094, 136, 14439, 11055, 14538, -1088, -1088,
3100 -1088, 914, -1088, -1088, -1088, 14637, 11055, 14736, 7608, 12749,
3101 -1088, -1088, -1088, 50, -1088, -1088, -1088, 1852, 12628, 12628,
3102 10235, 12507, 12991, 12991, 12507, -1088, 599, -1088, -1088, 610,
3103 5420, 6668, 50, 363, 412, 12507, 12507, -1088, -1088, 11418,
3104 -1088, 11660, -1088, -1088, -1088, 12749, 5702, -1088, 416, 616,
3105 616, 12507, -1088, 595, -1088, -1088, 369, 13588, 906, 486,
3106 657, 50, 264, 552, -1088, -1088, 1132, -1088, 67, -1088,
3107 336, -1088, -1088, 67, 336, -1088, 762, 959, -1088, 1150,
3108 1274, -1088, 961, 50, 963, -1088, 36, -1088, -1088, -1088,
3109 12507, 989, 2194, -1088, -1088, 461, -1088, -1088, -1088, 2194,
3110 -1088, -1088, 2479, -1088, -1088, 527, 1070, -1088, 5702, 1082,
3111 156, -1088, 1070, 1082, 156, -1088, -1088, 972, -1088, -1088,
3112 -1088, -1088, -1088, 12507, -1088, 973, 974, 1092, -1088, -1088,
3113 906, 13588, -1088, -1088, 1096, 1008, 2581, -1088, -1088, -1088,
3114 934, 428, -1088, -1088, 1009, -1088, -1088, -1088, -1088, 866,
3115 992, 943, 11297, -1088, -1088, -1088, -1088, 866, -1088, -1088,
3116 1140, 671, -1088, 1141, -1088, -1088, -1088, -1088, -1088, -1088,
3117 1094, 156, -1088, 12023, 156, 233, 254, 50, 166, 175,
3118 8340, 299, 10934, 7608, 807, 657, -1088, 50, 156, 83,
3119 10389, -1088, 97, 480, -1088, 6947, -1088, -1088, -1088, -1088,
3120 -1088, 527, -1088, -1088, -1088, 492, -1088, -1088, 50, 1002,
3121 83, -1088, -1088, -1088, 563, 1615, -1088, -1088, -1088, -1088,
3122 724, -1088, 724, 724, 724, -1088, 50, -1088, 1150, -1088,
3123 1188, -1088, -1088, -1088, -1088, -1088, 1004, 1006, -1088, 1111,
3124 908, 1016, -1088, 1017, -1088, 1016, 12870, -1088, -1088, -1088,
3125 -1088, -1088, -1088, -1088, 1018, 12144, -1088, 906, -1088, -1088,
3126 -1088, 14835, 11055, 14934, -1088, -1088, 12507, 12628, 12628, 1024,
3127 -1088, -1088, -1088, 12628, 12628, -1088, -1088, 12265, 1141, -1088,
3128 -1088, -1088, 8340, 10934, 156, -1088, -1088, 156, -1088, -1088,
3129 156, -1088, 12507, -1088, 109, -1088, 214, 156, 7608, 299,
3130 156, -1088, -1088, -1088, -1088, -1088, -1088, 12991, 12507, 12507,
3131 -1088, 12507, 12507, -1088, 11660, -1088, 2194, -1088, -1088, 5294,
3132 -1088, -1088, 1026, 1029, 2194, -1088, 2479, -1088, -1088, 2479,
3133 -1088, 2479, -1088, -1088, 1070, 1082, 12507, 12507, 1045, 1045,
3134 12507, 1036, 10813, 10813, 12628, 12507, 7136, 7448, 50, 500,
3135 504, 4476, 4476, 5702, -1088, -1088, -1088, -1088, -1088, 12628,
3136 -1088, -1088, -1088, -1088, 973, -1088, 1091, -1088, 1185, -1088,
3137 -1088, 169, -1088, -1088, -1088, -1088, -1088, 12386, 7852, -1088,
3138 156, -1088, -1088, 12507, 50, 98, 95, 1188, 1188, 1016,
3139 1044, 1016, 1016, 5702, 5702, 1874, 8942, -1088, -1088, 7608,
3140 1018, -1088, -1088, 5702, 511, -1088, -1088, -1088, 2448, 2448,
3141 741, -1088, 4166, 14, 1148, -1088, 1078, -1088, -1088, 309,
3142 -1088, 1063, -1088, -1088, -1088, 1053, -1088, 1055, -1088, 1686,
3143 -1088, -1088, -1088, -1088, 682, -1088, -1088, -1088, 45, -1088,
3144 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 447, -1088,
3145 -1088, -1088, 13707, 169, -1088, -1088, 8340, -1088, -1088, 8218,
3146 7730, 4476, 12507, -1088, 608, -1088, 1056, 1058, -1088, 8942,
3147 -1088, -1088, -1088, -1088, 1029, -1088, 2479, -1088, -1088, -1088,
3148 908, -1088, 50, 1087, 945, 1074, 13826, -1088, 1077, -1088,
3149 1080, 1099, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 1686,
3150 324, 50, 13900, -1088, 50, 1100, -1088, -1088, 1086, -1088,
3151 -1088, 902, -1088, 10934, -1088, 1197, 13900, 1686, 1686, 958,
3152 1156, 2448, 2448, 741, 274, 739, 4476, 4476, -1088, 1195,
3153 -1088, 948, 188, 192, 200, 7608, -1088, -1088, 671, 169,
3154 831, -1088, -1088, -1088, -1088, -1088, 1280, 7608, 1115, 1016,
3155 -1088, 1129, -1088, 13826, 1539, -1088, -1088, 1217, 951, 461,
3156 -1088, 1539, -1088, 1472, -1088, 35, -1088, 1156, 1121, 1123,
3157 -1088, -1088, -1088, -1088, -1088, 50, -1088, -1088, 1124, -1088,
3158 1128, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3159 -1088, -1088, 50, 50, 50, 50, 50, 50, 218, 15033,
3160 11055, 15132, 1140, 1185, -1088, -1088, 10934, 10934, -1088, 467,
3161 -1088, -1088, 156, -1088, -1088, -1088, 951, -1088, 1134, 1137,
3162 -1088, 15231, -1088, 908, 1138, -1088, 1146, 1138, -1088, 1686,
3163 -1088, 958, -1088, 1686, 13900, 758, -1088, -1088, -1088, -1088,
3164 -1088, -1088, 121, 201, 50, 223, 238, -1088, -1088, 7974,
3165 -1088, -1088, 1280, -1088, -1088, 1539, -1088, 1472, -1088, 1118,
3166 1130, -1088, 1472, -1088, 1472, -1088, -1088, 1149, 50, 1149,
3167 -1088, -1088, 253, 417, -1088, 1138, 1155, 1138, 1138, 1686,
3168 -1088, -1088, -1088, -1088, -1088, 1472, -1088, -1088, -1088, 1138,
3169 -1088
3170};
3171
3172/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
3173 Performed when YYTABLE does not specify something else to do. Zero
3174 means the default is an error. */
3175static const yytype_int16 yydefact[] =
3176{
3177 2, 0, 0, 1, 44, 381, 382, 383, 0, 374,
3178 375, 376, 379, 24, 24, 24, 369, 370, 371, 372,
3179 393, 394, 301, 658, 657, 659, 660, 772, 0, 772,
3180 0, 783, 662, 661, 663, 756, 758, 652, 651, 757,
3181 653, 647, 648, 649, 650, 600, 668, 669, 0, 0,
3182 0, 0, 0, 0, 0, 783, 783, 110, 455, 622,
3183 622, 624, 626, 0, 0, 0, 0, 0, 0, 0,
3184 3, 770, 6, 24, 8, 38, 43, 677, 677, 61,
3185 81, 301, 80, 0, 98, 0, 102, 112, 0, 70,
3186 250, 266, 0, 329, 0, 0, 77, 77, 0, 0,
3187 0, 0, 0, 338, 301, 348, 82, 346, 318, 319,
3188 599, 601, 320, 321, 322, 324, 323, 325, 598, 639,
3189 640, 597, 645, 656, 664, 665, 326, 0, 327, 85,
3190 5, 191, 202, 192, 215, 188, 208, 198, 197, 218,
3191 219, 213, 196, 195, 190, 216, 220, 221, 200, 189,
3192 203, 207, 209, 201, 194, 210, 217, 212, 211, 204,
3193 214, 199, 187, 206, 205, 186, 193, 184, 185, 181,
3194 182, 183, 141, 143, 142, 176, 177, 172, 154, 155,
3195 156, 163, 160, 162, 157, 158, 178, 179, 164, 165,
3196 169, 173, 159, 161, 151, 152, 153, 166, 167, 168,
3197 170, 171, 174, 175, 180, 146, 148, 31, 144, 145,
3198 147, 377, 378, 380, 0, 752, 0, 0, 312, 755,
3199 304, 622, 0, 677, 677, 296, 0, 279, 307, 96,
3200 300, 783, 308, 0, 664, 665, 0, 327, 783, 748,
3201 97, 783, 474, 93, 0, 772, 773, 0, 0, 26,
3202 783, 10, 0, 9, 25, 276, 369, 370, 475, 0,
3203 244, 0, 338, 341, 245, 235, 236, 335, 22, 0,
3204 0, 770, 19, 21, 772, 100, 18, 331, 0, 772,
3205 772, 280, 0, 0, 772, 746, 772, 0, 0, 0,
3206 677, 677, 108, 373, 0, 118, 119, 126, 453, 642,
3207 0, 641, 643, 0, 0, 0, 606, 609, 618, 614,
3208 620, 646, 65, 256, 257, 779, 780, 4, 781, 0,
3209 0, 0, 0, 0, 0, 783, 0, 0, 700, 0,
3210 676, 365, 700, 674, 0, 367, 384, 479, 468, 86,
3211 481, 345, 385, 481, 464, 783, 114, 0, 106, 103,
3212 783, 68, 0, 0, 0, 0, 0, 272, 273, 0,
3213 0, 0, 0, 233, 234, 0, 0, 66, 0, 270,
3214 271, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3215 0, 766, 767, 0, 783, 0, 0, 76, 75, 0,
3216 0, 0, 0, 0, 770, 355, 771, 0, 405, 404,
3217 0, 0, 664, 665, 327, 136, 137, 0, 0, 139,
3218 672, 0, 664, 665, 327, 363, 211, 204, 214, 199,
3219 181, 182, 183, 141, 142, 744, 72, 71, 743, 0,
3220 95, 772, 94, 769, 768, 0, 347, 602, 783, 783,
3221 149, 751, 335, 311, 754, 303, 0, 0, 0, 783,
3222 0, 0, 297, 306, 0, 783, 0, 783, 783, 0,
3223 298, 701, 772, 292, 783, 772, 783, 291, 302, 772,
3224 0, 344, 64, 28, 30, 29, 0, 783, 277, 0,
3225 0, 0, 0, 783, 0, 772, 333, 17, 0, 99,
3226 0, 336, 778, 777, 281, 778, 283, 337, 747, 0,
3227 125, 646, 116, 111, 676, 0, 0, 783, 0, 454,
3228 628, 644, 631, 629, 623, 603, 604, 625, 605, 627,
3229 607, 0, 0, 0, 0, 0, 782, 7, 0, 32,
3230 33, 34, 35, 278, 0, 62, 63, 707, 704, 703,
3231 702, 705, 713, 722, 701, 0, 734, 723, 738, 737,
3232 733, 783, 724, 699, 772, 683, 706, 708, 709, 711,
3233 685, 715, 720, 783, 726, 418, 417, 731, 685, 736,
3234 685, 740, 682, 0, 0, 0, 0, 0, 0, 453,
3235 479, 87, 0, 453, 0, 0, 772, 0, 104, 115,
3236 0, 492, 242, 249, 251, 252, 253, 260, 261, 254,
3237 255, 231, 232, 258, 259, 492, 772, 246, 247, 248,
3238 237, 238, 239, 240, 241, 274, 275, 756, 758, 757,
3239 760, 473, 759, 301, 471, 772, 783, 756, 758, 757,
3240 760, 472, 301, 0, 783, 396, 0, 395, 0, 0,
3241 0, 0, 353, 0, 335, 0, 783, 0, 77, 361,
3242 136, 137, 138, 670, 359, 0, 783, 0, 0, 0,
3243 764, 765, 73, 772, 340, 756, 757, 301, 0, 0,
3244 0, 0, 0, 0, 0, 750, 309, 305, 310, 783,
3245 756, 757, 772, 756, 757, 0, 0, 749, 286, 293,
3246 288, 295, 343, 774, 27, 0, 262, 11, 334, 0,
3247 783, 0, 23, 101, 20, 332, 772, 0, 109, 761,
3248 124, 772, 756, 757, 24, 632, 0, 608, 0, 611,
3249 0, 616, 613, 0, 0, 617, 243, 0, 36, 0,
3250 416, 408, 410, 772, 413, 406, 0, 681, 742, 675,
3251 0, 0, 0, 692, 714, 0, 680, 558, 725, 0,
3252 695, 735, 0, 697, 739, 772, 52, 55, 267, 264,
3253 0, 678, 53, 265, 0, 477, 454, 0, 391, 392,
3254 478, 454, 463, 312, 39, 314, 0, 42, 313, 113,
3255 107, 0, 60, 45, 58, 0, 284, 307, 222, 40,
3256 0, 327, 490, 490, 0, 783, 783, 479, 470, 90,
3257 0, 476, 293, 783, 783, 290, 469, 88, 289, 330,
3258 783, 783, 397, 783, 351, 399, 78, 398, 352, 492,
3259 0, 0, 388, 0, 0, 761, 334, 772, 756, 757,
3260 0, 0, 0, 0, 136, 137, 140, 772, 0, 772,
3261 0, 339, 465, 83, 46, 284, 223, 54, 230, 150,
3262 753, 772, 299, 783, 783, 476, 783, 783, 772, 783,
3263 772, 229, 282, 117, 476, 700, 633, 630, 637, 638,
3264 610, 612, 619, 615, 621, 37, 772, 415, 0, 710,
3265 0, 741, 727, 420, 684, 712, 685, 685, 721, 726,
3266 783, 685, 732, 685, 709, 685, 0, 783, 783, 366,
3267 368, 24, 84, 24, 317, 0, 783, 105, 783, 783,
3268 783, 0, 783, 0, 491, 491, 0, 0, 0, 0,
3269 91, 775, 783, 0, 0, 89, 386, 783, 15, 589,
3270 390, 389, 0, 0, 0, 400, 402, 0, 79, 490,
3271 0, 357, 0, 483, 0, 356, 476, 0, 0, 0,
3272 0, 476, 364, 745, 74, 466, 467, 0, 0, 0,
3273 783, 0, 0, 287, 294, 342, 700, 456, 459, 0,
3274 407, 409, 411, 414, 0, 688, 0, 690, 679, 0,
3275 696, 0, 693, 698, 57, 269, 0, 0, 783, 783,
3276 312, 315, 0, 0, 0, 0, 756, 757, 772, 756,
3277 757, 0, 0, 263, 51, 227, 50, 228, 92, 0,
3278 48, 225, 49, 226, 590, 591, 783, 592, 783, 12,
3279 403, 0, 349, 350, 491, 354, 484, 0, 0, 358,
3280 0, 671, 360, 0, 772, 0, 0, 0, 0, 685,
3281 685, 685, 685, 56, 268, 772, 0, 444, 443, 0,
3282 316, 41, 59, 285, 476, 581, 587, 554, 0, 0,
3283 0, 491, 772, 491, 542, 622, 0, 580, 69, 500,
3284 506, 508, 510, 504, 503, 538, 505, 547, 550, 553,
3285 559, 560, 549, 513, 561, 514, 566, 567, 568, 571,
3286 572, 573, 574, 575, 577, 576, 578, 579, 557, 67,
3287 47, 224, 0, 0, 594, 387, 0, 16, 596, 0,
3288 0, 0, 0, 485, 783, 362, 0, 447, 461, 0,
3289 457, 636, 635, 634, 412, 689, 0, 686, 691, 694,
3290 783, 442, 772, 0, 709, 426, 717, 718, 783, 729,
3291 426, 426, 424, 480, 482, 569, 570, 137, 585, 0,
3292 530, 772, 531, 535, 772, 0, 525, 783, 0, 528,
3293 541, 0, 582, 0, 583, 0, 501, 0, 0, 548,
3294 552, 564, 565, 0, 491, 491, 0, 0, 556, 0,
3295 593, 0, 664, 665, 327, 0, 595, 13, 783, 0,
3296 497, 486, 488, 489, 487, 458, 0, 0, 0, 685,
3297 423, 0, 445, 0, 427, 435, 433, 0, 716, 0,
3298 422, 0, 438, 0, 440, 772, 523, 545, 533, 532,
3299 524, 536, 526, 776, 555, 772, 507, 502, 538, 509,
3300 539, 543, 622, 551, 546, 562, 563, 586, 512, 522,
3301 511, 518, 772, 772, 772, 772, 772, 772, 335, 0,
3302 783, 0, 783, 783, 401, 493, 0, 0, 451, 772,
3303 449, 452, 0, 460, 687, 446, 728, 425, 426, 426,
3304 335, 0, 719, 783, 426, 730, 426, 426, 529, 0,
3305 537, 0, 584, 0, 0, 0, 515, 516, 517, 519,
3306 520, 521, 761, 334, 772, 756, 757, 588, 14, 0,
3307 498, 499, 0, 448, 462, 0, 430, 0, 432, 761,
3308 334, 421, 0, 439, 0, 436, 441, 534, 772, 539,
3309 540, 544, 476, 783, 450, 426, 426, 426, 426, 0,
3310 527, 495, 496, 494, 431, 0, 428, 434, 437, 426,
3311 429
3312};
3313
3314/* YYPGOTO[NTERM-NUM]. */
3315static const yytype_int16 yypgoto[] =
3316{
3317 -1088, -1088, -1088, 1028, -1088, 976, -1088, 812, -540, -1088,
3318 -1088, -1088, -40, -1088, 817, -1088, 8, -1088, 9, -1088,
3319 -49, -510, -494, -26, -1088, -1088, 471, 2739, 3102, -1088,
3320 -89, -62, -1088, -1088, -60, -1088, -620, 1245, -14, 1213,
3321 -140, -7, -37, -1088, -425, 44, 3555, -392, 1214, -28,
3322 -10, -1088, -1088, 2, -1088, 4276, -500, 1226, -1088, 99,
3323 840, 340, 1165, -1088, 617, -17, 653, -372, 46, -39,
3324 -1088, -381, -212, 12, -401, -1088, -551, -13, -1088, -1088,
3325 -1088, -1088, -1088, -1088, -1088, -1088, -1088, 1125, -1088, -1088,
3326 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3327 -1088, -1088, -1088, 394, -1088, 32, 1883, 2367, -363, -1088,
3328 137, -789, -1088, -766, -767, 604, 463, -900, 190, -1088,
3329 304, 131, -1088, -1088, 361, -1088, -894, -1088, 49, -419,
3330 33, 1221, -1088, -1088, -1088, -1088, -1088, 509, -1088, -1088,
3331 -82, -478, -1088, 1011, -1088, -1088, -741, -1088, -662, -838,
3332 -495, 39, -1088, -1088, -1088, -885, -659, -1088, -1088, -1088,
3333 -1088, 196, -1088, -256, -1088, -637, -656, -968, -245, -1024,
3334 -721, -1088, 195, -1088, -1088, -854, 198, -1088, -468, 203,
3335 -1088, -1088, -1088, 122, -1088, -1088, 112, 1427, 1787, -1088,
3336 1261, 1866, 2213, 28, 2585, -1088, 850, 2724, -1088, 2820,
3337 2902, -1088, -1088, -56, -1088, -1088, -248, -1088, -1088, -1088,
3338 -1088, -1088, -1088, 25, -1088, -1088, -1088, -1088, 18, -52,
3339 3202, -2, 1273, 3772, 2516, -1088, -1088, 62, 641, 41,
3340 -1088, -287, 267, -285, -187, -817, -336, -311, -699, -599,
3341 -370, 633, 172, -1088, -1088, -663, -1088, -709, -641, -1087,
3342 178, 637, -1088, -617, -1088, 110, -531, -1088, -1088, -1088,
3343 3, -399, 170, -345, -1088, -1088, -91, -1088, -27, 433,
3344 262, 276, 68, -177, -23, 43, 103
3345};
3346
3347/* YYDEFGOTO[NTERM-NUM]. */
3348static const yytype_int16 yydefgoto[] =
3349{
3350 0, 1, 2, 70, 71, 72, 252, 253, 633, 1109,
3351 1253, 1018, 634, 271, 272, 484, 211, 73, 273, 476,
3352 75, 756, 783, 76, 605, 591, 426, 223, 224, 840,
3353 389, 391, 392, 938, 79, 80, 581, 259, 82, 83,
3354 274, 84, 85, 86, 503, 87, 226, 409, 410, 205,
3355 206, 207, 670, 620, 209, 89, 759, 379, 90, 533,
3356 479, 534, 228, 278, 788, 621, 806, 462, 463, 243,
3357 244, 230, 452, 626, 232, 777, 778, 91, 386, 490,
3358 820, 643, 833, 831, 658, 574, 577, 261, 93, 94,
3359 95, 96, 97, 98, 99, 100, 101, 102, 340, 343,
3360 927, 1106, 823, 932, 933, 770, 262, 263, 636, 816,
3361 934, 935, 401, 731, 732, 733, 734, 551, 740, 741,
3362 1267, 1205, 1206, 1132, 1046, 1047, 1116, 1259, 1260, 509,
3363 714, 105, 298, 1035, 967, 1120, 1197, 344, 106, 107,
3364 341, 578, 579, 582, 583, 944, 824, 1194, 914, 1001,
3365 792, 821, 1299, 1333, 1189, 1068, 1217, 1070, 1071, 1176,
3366 1177, 1072, 1281, 1151, 1152, 1153, 1074, 1075, 1230, 1155,
3367 1076, 1077, 1078, 1079, 1080, 552, 1082, 1083, 1084, 1085,
3368 1086, 1087, 1088, 928, 1016, 1103, 1107, 108, 109, 110,
3369 111, 112, 113, 307, 114, 521, 718, 115, 523, 116,
3370 117, 522, 524, 300, 304, 305, 514, 716, 715, 866,
3371 969, 1123, 867, 118, 119, 301, 120, 121, 122, 123,
3372 234, 235, 126, 236, 237, 654, 832, 329, 330, 331,
3373 332, 884, 743, 554, 555, 556, 557, 894, 559, 560,
3374 561, 562, 1137, 1138, 563, 564, 565, 566, 567, 1139,
3375 1140, 568, 569, 570, 571, 572, 737, 429, 659, 283,
3376 466, 239, 129, 699, 624, 662, 657, 435, 317, 470,
3377 471, 801, 1159, 494, 637, 396, 255
3378};
3379
3380/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
3381 positive, shift that token. If negative, reduce the rule whose
3382 number is the opposite. If YYTABLE_NINF, syntax error. */
3383static const yytype_int16 yytable[] =
3384{
3385 125, 385, 225, 225, 303, 242, 390, 302, 312, 394,
3386 208, 74, 625, 270, 277, 434, 652, 558, 249, 238,
3387 238, 558, 212, 213, 937, 436, 460, 638, 231, 231,
3388 208, 299, 746, 210, 760, 393, 890, 764, 623, 789,
3389 632, 553, 339, 885, 293, 553, 275, 575, 318, 349,
3390 678, 125, 125, 210, 465, 296, 517, 519, 280, 284,
3391 687, 208, 229, 240, 338, 432, 762, 279, 388, 388,
3392 677, 395, 388, 293, 427, 318, 763, 1002, 677, 940,
3393 708, 320, 889, 682, 296, 311, 293, 293, 293, 225,
3394 667, 678, 308, 309, 310, 1121, 687, 403, 413, 413,
3395 413, 292, 767, 496, 208, 130, 238, 498, 892, 623,
3396 793, 632, 971, 973, 319, 231, -127, 1099, 838, 335,
3397 326, 327, 635, 336, 1275, 887, -373, 1118, 1219, 485,
3398 254, 915, 893, 510, -131, 711, 1165, 700, -128, 510,
3399 334, 3, 456, 1173, 1231, 1130, 548, 1081, 1081, 430,
3400 891, 1133, -135, 895, -373, -373, 276, 276, 281, 285,
3401 766, -134, 780, 700, 771, 446, 768, -772, 336, -666,
3402 482, -667, -783, 763, 844, 847, 246, 270, 549, 920,
3403 333, 333, 635, 720, 1218, -666, 1111, 925, -658, 512,
3404 513, -130, 747, 511, 328, 512, 513, 246, 1228, 1174,
3405 -132, -127, 1175, 508, -127, -128, -128, 586, 458, 735,
3406 748, -373, 246, -135, -133, 125, 1122, -658, 1275, 469,
3407 -127, 472, 1119, 1149, 769, 1157, 1190, 225, 306, 270,
3408 225, -134, 529, 530, 531, 532, -130, 721, 1201, -129,
3409 -118, 242, 338, -135, 487, 246, -118, 238, 318, 337,
3410 125, -132, 502, 464, 460, 1231, 231, 1081, -131, 1231,
3411 1321, 74, 275, 836, 1027, 335, -129, 125, -119, 315,
3412 1124, 316, 971, 719, 827, 719, 293, 1024, -756, -133,
3413 885, -131, -126, -131, 837, 447, 448, 296, 678, -121,
3414 468, -125, 687, 950, 337, 388, 388, 388, 388, 241,
3415 535, 536, 700, 640, 1130, 1321, 501, 270, 677, 647,
3416 677, 1130, 700, 1130, 488, 1081, 1320, 125, 649, 919,
3417 276, -121, 1081, 1081, 939, 1192, 333, 333, 74, 315,
3418 -123, 316, 335, 892, 453, 293, 1238, 1240, 1098, 1098,
3419 275, 453, 1069, 1069, 467, 125, 296, 815, -127, 478,
3420 -127, 639, -128, 641, -128, 130, 907, 1040, -757, 978,
3421 -135, -133, -135, -133, 1073, 1073, 388, 642, 631, -120,
3422 225, 318, 276, 1193, 251, 1039, 1015, 1041, -134, 1261,
3423 -134, 388, 1042, -130, 125, -130, 984, 630, -122, 125,
3424 -756, 125, 588, 735, 877, 492, 985, 724, -132, -121,
3425 -132, 678, 246, 1150, 352, 1130, 1154, 1130, 1030, -124,
3426 1165, -757, 1130, -129, 1130, -129, -657, 225, 483, -121,
3427 1170, 677, -121, 1004, 1006, 1165, -121, 1081, 1141, 1010,
3428 1012, 558, 931, -772, 238, 1130, 246, 630, 558, 631,
3429 -659, 225, 819, 231, 585, -657, 1135, -660, 1098, 590,
3430 276, 725, 1069, -134, 679, 1244, 1247, 985, 630, 315,
3431 247, 316, 250, 856, 1166, 631, 694, 852, 502, -659,
3432 871, 376, 377, 378, 1073, 871, -660, 663, 208, -545,
3433 315, 747, 316, 267, 630, 1261, 125, 467, 727, 276,
3434 1215, 631, 293, 225, 276, 706, 276, 306, -130, 1178,
3435 1273, 210, 858, 296, 678, 885, 1098, 1150, 342, 1144,
3436 630, -122, 857, 1098, 1098, 1100, 854, 1150, 1150, 542,
3437 1243, 1246, 326, 327, 495, 774, 125, 1199, 439, 862,
3438 784, 246, 125, 345, 1331, -662, 489, 668, 669, 543,
3439 998, 782, 735, 728, 735, 650, 889, -132, 674, 651,
3440 502, -133, 761, 622, 558, 622, 685, 686, 467, 757,
3441 1318, 346, 757, -135, -662, 687, 623, 453, 632, 453,
3442 547, 548, 125, -757, 293, 125, 478, -123, 553, 350,
3443 968, 1028, 701, 677, 799, 296, 830, 1269, -120, 60,
3444 1145, 1146, 960, 807, 1276, 438, 811, 776, 813, 1200,
3445 803, 440, 776, 549, 804, 622, 798, 1210, 784, 784,
3446 467, 922, 1274, 885, 1277, 805, 772, 817, 1098, 782,
3447 782, -122, 1302, 931, 622, 822, 622, -129, 843, 246,
3448 631, 276, 225, 839, 125, -130, 125, 442, -661, -132,
3449 631, -122, 225, -756, -122, -663, -129, 852, -122, 630,
3450 805, 622, 622, 245, 738, 558, 125, 1262, 1110, 630,
3451 849, -667, 381, 558, 868, 809, 738, -661, 1148, 860,
3452 863, 814, 208, 818, -663, 1136, 622, 276, 622, 553,
3453 276, 1034, 798, 805, 245, 930, 931, -123, 1326, 246,
3454 382, 433, 859, 664, 293, 210, -128, 449, -120, 913,
3455 450, 735, 735, 1235, 1236, 296, 1325, -123, 1327, 352,
3456 -123, 451, 493, 493, -123, 1328, -119, 493, -120, 499,
3457 352, -120, 865, -756, 688, -120, -334, 690, 381, 453,
3458 -99, 692, 457, 810, 1134, 808, 1339, 365, 366, 276,
3459 1185, 276, 1311, 949, 502, 439, 870, 703, 872, 467,
3460 -113, 873, 874, 510, -334, -334, 382, 383, -757, 467,
3461 955, 276, -654, 477, 510, 459, -654, 483, 293, -655,
3462 808, 1171, 1172, 241, 374, 375, 376, 377, 378, 296,
3463 -135, 1237, 453, 431, 373, 374, 375, 376, 377, 378,
3464 947, -654, 899, 650, -654, -654, 900, 1147, -655, 901,
3465 -126, -655, -134, 808, 903, 859, 388, 515, 948, 512,
3466 513, -334, 427, 384, -757, 622, 739, 622, 515, 486,
3467 512, 513, -125, 671, 510, 622, 1255, 622, 125, -655,
3468 -655, 125, 381, -761, 1136, 750, 660, 753, 381, 1136,
3469 352, 1136, 208, 1136, 1021, -98, 881, 491, 779, -756,
3470 500, -654, 497, 941, -756, 881, 945, 784, 784, 328,
3471 382, 454, 381, 784, 784, 661, 382, 481, 782, 782,
3472 952, 1256, 1257, 505, 782, 782, -761, 473, 1294, 525,
3473 512, 513, 757, 1224, -757, 520, -655, 474, 475, -757,
3474 382, 506, 1020, 1134, 917, 918, 631, -772, 225, -664,
3475 1134, 246, 923, 924, -761, -761, 700, 388, 803, 988,
3476 1227, 989, -665, 929, 936, 630, 936, 455, 510, 518,
3477 1242, 1245, -327, 455, 510, 841, 1031, -664, -664, 1036,
3478 125, 504, 504, 276, 784, 1136, 276, 1136, 528, 776,
3479 -665, -665, 1136, -130, 1136, 782, 125, 507, 381, 784,
3480 -327, -327, 958, 959, 573, 961, 962, 381, 855, -761,
3481 782, -761, 453, -121, -756, 1136, 1022, 125, 510, 1023,
3482 -673, 576, 1025, 580, 512, 513, 382, 645, 516, 1029,
3483 512, 513, 1032, -335, -664, 382, 655, 864, 1114, 589,
3484 125, 125, 526, 738, 1134, 879, 510, -665, 644, 1097,
3485 1097, 1051, 1052, 381, 648, 672, 1143, -327, 994, 1161,
3486 653, -335, -335, 673, 1164, 467, 1057, 381, 689, 510,
3487 381, 1009, 515, 691, 512, 513, 125, 1224, 697, 804,
3488 1017, 382, 911, 646, 1317, 276, 543, -113, 1319, 794,
3489 357, 358, 656, 922, 125, 382, 1249, 125, 382, 1271,
3490 717, 276, 512, 513, 693, 705, 1097, 1097, 800, 1033,
3491 1097, 707, 1115, 736, -132, 742, 1186, 547, -335, 1187,
3492 1188, 1232, 276, 722, 1225, 512, 513, 1097, -129, 1198,
3493 -419, 622, 745, 622, -123, 751, 749, 752, 912, 293,
3494 1251, 1048, 1048, 754, 765, 369, 370, 812, -120, 781,
3495 1183, 953, 1250, 946, 125, 656, 819, 125, 125, 1097,
3496 802, 822, 875, 951, 897, 800, 878, 125, 880, 1104,
3497 963, 1108, 965, 293, 883, 902, 898, 92, -307, 905,
3498 1162, 276, 37, 38, 413, 40, 906, 388, 970, 493,
3499 908, 233, 233, 909, 800, 1252, 916, 1097, 926, 276,
3500 1097, 921, 276, 975, 977, 1142, 931, 964, 980, 974,
3501 982, 976, 983, 748, 1097, 1097, 1097, 1300, 1301, 1097,
3502 1097, 979, 981, -311, 1097, 1097, 1285, 1008, 92, 92,
3503 1163, 1037, 294, 125, 1038, 1045, 37, 38, 896, 40,
3504 293, -309, 1102, 233, 1105, 125, 46, 47, 352, 1126,
3505 1160, 413, 537, 1167, 538, 539, 540, 541, 1168, 276,
3506 1169, 294, 276, 276, 1195, 365, 366, 936, 1196, 233,
3507 233, 282, 276, 233, 400, 411, 411, 1202, 233, 1204,
3508 388, 388, 1209, 738, 631, 1211, 225, 986, 987, 1223,
3509 537, 738, 538, 539, 540, 541, 992, 81, 993, 1055,
3510 995, 1248, 729, 630, 1213, 1221, 1222, 1165, 730, 1323,
3511 800, 81, 81, 374, 375, 376, 377, 378, 1263, 1265,
3512 800, 1212, 1214, 1270, 1054, -756, 1279, 1097, 1280, 1283,
3513 480, 1097, 1097, 1284, 957, 846, 848, -757, 276, 1305,
3514 729, 936, 1307, 1312, 1304, 527, 702, 125, 81, 81,
3515 276, 1314, 846, 848, 1329, 704, 1125, 1127, 1128, 1129,
3516 1335, 954, 398, 81, 1142, 415, 380, 695, 861, 881,
3517 842, 1142, 1019, 1142, 1203, 1254, 537, 1097, 538, 539,
3518 540, 541, 1258, 876, 538, 539, 540, 541, 1156, 81,
3519 81, 972, 92, 81, 41, 42, 43, 44, 81, 1131,
3520 1049, 1324, 956, 467, 584, 929, 1108, 321, 322, 323,
3521 324, 325, 1332, 1229, 1233, 1298, 233, 1234, 1226, 233,
3522 233, 437, 233, 723, 1297, 428, 738, 92, 888, 886,
3523 441, 1272, 1268, 443, 444, 445, 1330, 0, 0, 0,
3524 0, 0, 0, 0, 92, 0, 0, 0, 0, 1306,
3525 1308, 0, 276, 0, 0, 1313, 0, 1315, 1316, 0,
3526 0, 0, 0, 0, 294, 1142, 0, 1142, 0, 622,
3527 0, 622, 1142, 0, 1142, 0, 936, 1216, 0, 0,
3528 1220, 800, 0, 0, 0, 0, 0, 1241, 0, 0,
3529 0, 622, 0, 0, 92, 1142, 233, 233, 233, 233,
3530 1239, 233, 233, 0, 0, 0, 1334, 1336, 1337, 1338,
3531 0, 0, 81, 0, 0, 0, 1264, 1117, 0, 0,
3532 1340, 0, 92, 294, 0, 0, 0, 1278, 1117, 0,
3533 0, 0, 0, 0, 0, 0, 81, 1282, 0, 81,
3534 81, 0, 81, 0, 0, 800, 1158, 81, 0, 0,
3535 0, 0, 0, 0, 1286, 1287, 1288, 0, 0, 233,
3536 0, 92, 0, 0, 81, 0, 92, 233, 92, 0,
3537 0, 1289, 1290, 1291, 537, 0, 538, 539, 540, 541,
3538 542, 0, 233, 0, 1005, 1007, 352, 0, 0, 0,
3539 1011, 1013, 0, 0, 0, 0, 0, 0, 0, 0,
3540 543, 0, 0, 365, 366, 0, 233, 0, 0, 0,
3541 0, 0, 0, 0, 81, 1117, 81, 81, 81, 81,
3542 1322, 81, 81, 0, 545, 1005, 1007, 0, 1011, 1013,
3543 233, 547, 548, 0, 800, 0, 0, 800, 0, 0,
3544 0, 537, 81, 538, 539, 540, 541, 542, 371, 372,
3545 373, 374, 375, 376, 377, 378, 0, 800, 0, 0,
3546 0, 0, 0, 92, 549, 675, 676, 543, 0, 0,
3547 0, 0, 0, 0, 282, 0, 1101, 0, 0, 81,
3548 294, 81, 233, 0, 0, 0, 81, 81, 81, 0,
3549 0, 545, 0, 0, 0, 0, 0, 546, 547, 548,
3550 1101, 0, 81, 92, 0, 0, 0, 676, 0, 92,
3551 282, 0, 0, 0, 0, 0, 0, 537, 0, 538,
3552 539, 540, 541, 542, 0, 0, 81, 0, 800, 800,
3553 800, 549, 0, 0, 550, 0, 0, 0, 0, 0,
3554 0, 0, 1303, 543, 0, 0, 0, 0, 233, 92,
3555 81, 233, 92, 0, 0, 0, 0, 544, 0, 0,
3556 233, 0, 294, 0, 0, 790, 0, 545, 0, 23,
3557 24, 25, 26, 546, 547, 548, 744, 800, 0, 0,
3558 0, 0, 0, 81, 0, 32, 33, 34, 1055, 0,
3559 0, 0, 1056, 0, 0, 41, 42, 43, 44, 45,
3560 775, 1158, 81, 0, 0, 787, 0, 549, 0, 0,
3561 550, 92, 0, 92, 0, 0, 0, 0, 0, 0,
3562 0, 233, 966, 81, 0, 0, 0, 1058, 1059, 81,
3563 0, 233, 0, 92, 233, 1060, 0, 0, 1061, 0,
3564 0, 1062, 1063, 790, 790, 0, 0, 58, 59, 60,
3565 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3566 0, 0, 0, 0, 0, 0, 0, 0, 81, 81,
3567 233, 81, 81, 0, 0, 0, 0, 1066, 0, 0,
3568 81, 0, 294, 0, 288, 81, 850, 0, 0, 0,
3569 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3570 0, 0, -783, 0, 676, 0, 282, 0, 0, 0,
3571 -783, -783, -783, 0, 0, -783, -783, -783, 0, -783,
3572 0, 0, 0, 0, 0, 0, 0, -783, -783, -783,
3573 0, 81, 0, 81, 0, 103, 0, 0, 0, -783,
3574 -783, 81, -783, -783, -783, -783, -783, 0, 0, 103,
3575 103, 81, 0, 81, 81, 882, 294, 0, 0, 0,
3576 0, 0, 0, 81, 81, 0, 0, 0, 0, 0,
3577 -783, -783, 0, 0, 0, 0, 537, 0, 538, 539,
3578 540, 541, 542, 0, 0, 0, 103, 103, 904, 0,
3579 81, 0, 0, 0, 0, 0, 0, 0, 0, -783,
3580 -783, 103, 543, 0, 0, 92, 0, 233, 92, 0,
3581 0, 0, 0, 0, 0, 0, 0, 676, 0, 351,
3582 0, 0, 0, -783, 0, 0, 545, 103, 103, 0,
3583 0, 103, 546, 547, 548, 0, 103, 0, 943, 0,
3584 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3585 0, 0, 0, 0, -783, -783, 0, 0, 0, 241,
3586 -783, 0, -783, 0, -783, 0, 549, 0, 0, 550,
3587 0, 233, 352, 353, 354, 355, 356, 357, 358, 359,
3588 360, 361, 362, 363, 364, 0, 246, 233, 0, 365,
3589 366, 0, 790, 790, 0, 367, 0, 0, 790, 790,
3590 0, 0, 0, 0, 0, 0, 0, 92, 233, 0,
3591 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3592 991, 0, 0, 92, 0, 81, 0, 81, 81, 0,
3593 368, 0, 369, 370, 371, 372, 373, 374, 375, 376,
3594 377, 378, 1014, 0, 92, 0, 0, 0, 0, 0,
3595 103, 0, 0, 0, 0, 0, 0, 1026, 0, 0,
3596 0, 0, 0, 0, 0, 0, 0, 92, 92, 790,
3597 0, 0, 0, 0, 103, 0, 0, 103, 103, 282,
3598 103, 0, 0, 0, 790, 103, 0, 0, 0, 0,
3599 0, 81, 0, 0, 0, 0, 0, 0, 0, 0,
3600 0, 0, 103, 92, 0, 1050, 0, 81, 0, 0,
3601 0, 0, 81, 81, 0, 0, 0, 0, 81, 81,
3602 0, 92, 0, 0, 92, 0, 0, 81, 81, 0,
3603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3604 0, 0, 1113, 81, 0, 0, 0, 0, 0, 0,
3605 0, 0, 103, 0, 103, 103, 103, 103, 0, 103,
3606 103, 0, 0, 0, 81, 0, 0, 0, 0, 0,
3607 0, 0, 1067, 1067, 0, 0, 0, 1181, 0, 0,
3608 103, 92, 0, 0, 92, 92, 0, 81, 81, 81,
3609 0, 0, 0, 0, 92, 0, 537, 0, 538, 539,
3610 540, 541, 542, 0, 81, 0, 0, 0, 0, 0,
3611 0, 1208, 0, 0, 0, 0, 0, 103, 0, 103,
3612 0, 0, 543, 81, 103, 103, 103, 1191, 0, 1067,
3613 1067, 0, 0, 1067, 0, 0, 544, 0, 233, 0,
3614 103, 81, 0, 0, 81, 0, 545, 0, 0, 0,
3615 1067, 0, 546, 547, 548, 0, 0, 0, 0, 0,
3616 92, 0, 0, 0, 103, 0, 0, 0, 0, 0,
3617 0, 0, 92, 0, 0, 0, 0, 0, 1266, 0,
3618 0, 0, 1067, 0, 0, 0, 549, 0, 103, 550,
3619 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3620 0, 81, 0, 0, 81, 81, 0, 0, 0, 0,
3621 0, 0, 0, 0, 81, 0, 0, 0, 0, 104,
3622 1067, 103, 0, 1067, 0, 233, 0, 0, 0, 0,
3623 0, 233, 233, 104, 104, 0, 0, 1067, 1067, 1067,
3624 103, 0, 1067, 1067, 0, 0, 0, 1067, 1067, 0,
3625 0, 0, 0, 0, 0, 0, 0, 0, 81, 0,
3626 0, 103, 0, 0, 0, 0, 0, 103, 0, 0,
3627 104, 104, 0, 0, 92, 0, 0, 0, 1089, 1089,
3628 81, 0, 0, 0, 0, 104, 0, 0, 0, 0,
3629 0, 0, 81, 0, 0, 0, 0, 0, 0, 0,
3630 0, 0, 0, 0, 0, 0, 103, 103, 0, 103,
3631 103, 104, 104, 0, 0, 104, 0, 0, 103, 0,
3632 104, 0, 0, 103, 0, 0, 0, 0, 0, 0,
3633 0, 23, 24, 25, 26, 1089, 1089, 0, 0, 1089,
3634 0, 0, 0, 0, 0, 81, 0, 32, 33, 34,
3635 1067, 81, 81, 0, 1067, 1067, 1089, 41, 42, 43,
3636 44, 45, 0, 0, 0, 0, 0, 0, 128, 103,
3637 0, 103, 0, 0, 0, 0, 0, 0, 0, 103,
3638 0, 537, 0, 538, 539, 540, 541, 542, 1089, 103,
3639 0, 103, 103, 0, 81, 0, 0, 0, 0, 0,
3640 1067, 103, 103, 0, 0, 0, 0, 543, 0, 58,
3641 59, 60, 61, 62, 63, 64, 65, 66, 0, 128,
3642 128, 544, 0, 297, 0, 0, 1089, 0, 103, 1089,
3643 0, 545, 0, 0, 104, 0, 0, 0, 547, 548,
3644 0, 0, 0, 1089, 1089, 1089, 288, 0, 1089, 1089,
3645 0, 0, 297, 1089, 1089, 0, 0, 0, 104, 0,
3646 0, 104, 104, 0, 104, 404, 414, 414, 0, 104,
3647 0, 549, 0, 0, 0, 910, 0, 0, 0, 0,
3648 0, 0, 0, 0, 0, 0, 104, 0, 0, 0,
3649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3650 0, 0, 0, 0, 0, 0, 0, 0, 0, 352,
3651 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
3652 363, 364, 0, 0, 0, 0, 365, 366, 0, 0,
3653 0, 0, 0, 0, 0, 0, 104, 0, 104, 104,
3654 104, 104, 0, 104, 104, 0, 0, 0, 0, 0,
3655 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0,
3656 1089, 1089, 0, 103, 104, 103, 103, 368, 0, 369,
3657 370, 371, 372, 373, 374, 375, 376, 377, 378, 0,
3658 0, 0, 0, 128, 0, 0, -279, 0, 0, 0,
3659 0, 77, 0, 0, 0, 0, 0, 0, 0, 0,
3660 0, 104, 0, 104, 0, 0, 1089, 0, 104, 104,
3661 104, 0, 0, 0, 0, 0, 0, 0, 128, 0,
3662 0, 0, 0, 0, 104, 0, 0, 0, 0, 103,
3663 0, 0, 0, 0, 0, 128, 0, 0, 1090, 1090,
3664 0, 0, 77, 77, 0, 103, 290, 0, 104, 0,
3665 103, 103, 0, 0, 0, 297, 103, 103, 0, 0,
3666 0, 0, 0, 0, 0, 103, 103, 0, 0, 0,
3667 0, 0, 104, 0, 0, 290, 0, 0, 0, 0,
3668 0, 103, 0, 0, 0, 128, 0, 0, 290, 290,
3669 290, 0, 0, 0, 0, 1090, 1090, 0, 0, 1090,
3670 0, 0, 103, 0, 0, 104, 0, 0, 0, 0,
3671 0, 0, 0, 128, 297, 0, 1090, 1091, 1091, 0,
3672 0, 0, 0, 0, 104, 103, 103, 103, 0, 0,
3673 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3674 0, 0, 103, 0, 0, 104, 0, 0, 1090, 0,
3675 0, 104, 128, 0, 0, 0, 0, 128, 0, 128,
3676 0, 103, 0, 0, 0, 0, 0, 0, 0, 0,
3677 0, 0, 0, 0, 1091, 1091, 0, 0, 1091, 103,
3678 0, 0, 103, 0, 0, 0, 1090, 0, 0, 1090,
3679 104, 104, 0, 104, 104, 1091, 0, 0, 0, 0,
3680 0, 0, 104, 1090, 1090, 1090, 77, 104, 1090, 1090,
3681 0, 0, 0, 1090, 1090, 0, 0, 0, 0, 0,
3682 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0,
3683 0, 0, 0, 0, 0, 0, 0, 0, 0, 103,
3684 0, 77, 103, 103, 0, 0, 0, 0, 0, 0,
3685 0, 0, 103, 104, 128, 104, 0, 0, 77, 0,
3686 0, 0, 0, 104, 0, 1091, 0, 0, 1091, 0,
3687 0, 297, 0, 104, 0, 104, 104, 0, 290, 0,
3688 0, 0, 1091, 1091, 1091, 104, 104, 1091, 1091, 0,
3689 0, 0, 1091, 1091, 128, 0, 103, 0, 0, 0,
3690 128, 0, 0, 0, 0, 0, 0, 0, 77, 0,
3691 0, 0, 104, 0, 0, 0, 1090, 0, 103, 0,
3692 1090, 1090, 0, 0, 0, 0, 0, 0, 0, 0,
3693 103, 0, 0, 0, 0, 0, 77, 290, 0, 0,
3694 128, 0, 0, 128, 0, 0, 0, 0, 0, 0,
3695 0, 0, 0, 297, 78, 0, 791, 0, 0, 0,
3696 0, 0, 0, 0, 0, 0, 1090, 0, 0, 0,
3697 0, 0, 0, 0, 0, 77, 0, 0, 0, 0,
3698 77, 0, 77, 103, 0, 0, 0, 0, 0, 103,
3699 103, 0, 0, 0, 0, 1091, 0, 0, 0, 1091,
3700 1091, 0, 128, 0, 128, 78, 78, 0, 0, 291,
3701 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3702 0, 0, 0, 0, 128, 0, 0, 0, 0, 0,
3703 0, 0, 103, 0, 791, 791, 0, 0, 291, 0,
3704 0, 0, 0, 0, 0, 1091, 0, 104, 0, 104,
3705 104, 291, 291, 291, 124, 0, 0, 0, 0, 0,
3706 0, 0, 0, 0, 1092, 1092, 0, 0, 0, 0,
3707 0, 0, 0, 297, 0, 0, 0, 77, 0, 0,
3708 0, 0, 869, 0, 0, 0, 0, 0, 0, 0,
3709 0, 0, 0, 0, 290, 0, 0, 0, 0, 0,
3710 0, 0, 0, 0, 0, 124, 124, 0, 0, 295,
3711 0, 0, 0, 104, 0, 0, 0, 77, 0, 0,
3712 0, 1092, 1092, 77, 0, 1092, 0, 0, 0, 104,
3713 0, 0, 0, 0, 104, 104, 0, 0, 295, 0,
3714 104, 104, 1092, 0, 0, 0, 0, 297, 0, 104,
3715 104, 402, 412, 412, 412, 0, 0, 0, 0, 0,
3716 0, 0, 0, 77, 0, 104, 77, 0, 0, 78,
3717 0, 0, 0, 0, 1092, 0, 290, 0, 0, 77,
3718 0, 0, 0, 0, 0, 0, 104, 0, 0, 0,
3719 0, 0, 0, 0, 0, 0, 128, 0, 0, 128,
3720 0, 0, 0, 0, 78, 0, 0, 0, 0, 104,
3721 104, 104, 1092, 0, 0, 1092, 0, 0, 0, 0,
3722 0, 78, 0, 0, 0, 77, 104, 77, 0, 1092,
3723 1092, 1092, 0, 0, 1092, 1092, 0, 0, 0, 1092,
3724 1092, 291, 0, 0, 0, 104, 0, 77, 0, 0,
3725 0, 0, 0, 0, 0, 0, 0, 77, 77, 0,
3726 0, 0, 0, 104, 0, 0, 104, 0, 0, 124,
3727 0, 78, 0, 0, 0, 0, 0, 0, 0, 0,
3728 0, 0, 0, 791, 791, 0, 0, 0, 0, 791,
3729 791, 0, 0, 0, 0, 0, 290, 0, 128, 78,
3730 291, 0, 0, 0, 124, 0, 0, 0, 0, 0,
3731 0, 0, 0, 0, 128, 0, 0, 0, 0, 0,
3732 0, 124, 0, 104, 0, 0, 104, 104, 0, 0,
3733 0, 0, 0, 0, 0, 128, 104, 0, 78, 0,
3734 0, 295, 1092, 78, 0, 78, 1092, 1092, 0, 0,
3735 0, 0, 0, 0, 0, 0, 0, 0, 128, 128,
3736 791, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3737 290, 124, 0, 0, 0, 791, 0, 0, 0, 0,
3738 104, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3739 0, 0, 1092, 0, 128, 0, 0, 0, 0, 124,
3740 295, 0, 104, 0, 0, 0, 0, 88, 0, 0,
3741 0, 0, 128, 0, 104, 128, 0, 0, 0, 77,
3742 0, 0, 77, 0, 0, 0, 0, 0, 0, 0,
3743 0, 0, 0, 0, 0, 0, 1093, 1093, 124, 0,
3744 78, 0, 0, 124, 0, 124, 0, 0, 0, 0,
3745 0, 0, 0, 0, 0, 0, 0, 291, 88, 88,
3746 0, 0, 0, 0, 0, 0, 0, 104, 1184, 0,
3747 0, 0, 128, 104, 104, 128, 128, 0, 0, 0,
3748 78, 0, 0, 0, 0, 128, 78, 0, 0, 0,
3749 0, 0, 0, 1093, 1093, 0, 0, 1093, 0, 0,
3750 0, 0, 414, 0, 399, 0, 77, 77, 0, 0,
3751 0, 0, 77, 77, 1093, 0, 104, 0, 0, 0,
3752 0, 77, 0, 0, 0, 0, 78, 0, 0, 78,
3753 0, 0, 0, 0, 0, 0, 0, 77, 0, 291,
3754 124, 0, 78, 0, 0, 0, 1093, 0, 0, 0,
3755 0, 128, 0, 0, 0, 0, 0, 295, 77, 0,
3756 0, 0, 0, 128, 0, 0, 0, 0, 0, 414,
3757 0, 0, 0, 0, 0, 1094, 1094, 0, 0, 0,
3758 124, 77, 77, 77, 1093, 0, 124, 1093, 78, 0,
3759 78, 0, 0, 0, 0, 0, 0, 0, 77, 0,
3760 0, 1093, 1093, 1093, 0, 0, 1093, 1093, 0, 0,
3761 78, 1093, 1093, 0, 0, 0, 0, 77, 0, 0,
3762 78, 78, 88, 0, 127, 0, 124, 0, 0, 124,
3763 0, 0, 1094, 1094, 0, 77, 1094, 0, 77, 295,
3764 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3765 0, 0, 0, 1094, 0, 0, 0, 88, 0, 291,
3766 0, 0, 0, 0, 0, 128, 0, 0, 0, 0,
3767 0, 1095, 1095, 0, 88, 127, 127, 0, 0, 0,
3768 0, 0, 0, 0, 0, 1094, 0, 0, 124, 0,
3769 124, 290, 0, 0, 0, 77, 0, 0, 77, 77,
3770 0, 0, 0, 0, 0, 0, 0, 0, 77, 0,
3771 124, 0, 0, 0, 1093, 0, 0, 0, 1093, 1093,
3772 0, 0, 0, 1094, 88, 290, 1094, 0, 1095, 1095,
3773 0, 0, 1095, 291, 0, 0, 0, 0, 0, 0,
3774 1094, 1094, 1094, 0, 0, 1094, 1094, 0, 0, 1095,
3775 1094, 1094, 88, 1096, 1096, 0, 0, 0, 0, 295,
3776 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0,
3777 0, 0, 0, 0, 77, 0, 0, 0, 0, 0,
3778 0, 1095, 78, 0, 0, 78, 77, 0, 0, 0,
3779 0, 88, 290, 0, 0, 0, 88, 0, 88, 0,
3780 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3781 1096, 1096, 0, 0, 1096, 0, 0, 0, 0, 1095,
3782 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0,
3783 0, 1096, 0, 295, 0, 0, 1095, 1095, 1095, 127,
3784 0, 1095, 1095, 0, 0, 0, 1095, 1095, 0, 0,
3785 0, 0, 0, 1094, 0, 0, 0, 1094, 1094, 0,
3786 0, 0, 0, 1096, 0, 0, 0, 0, 0, 78,
3787 78, 0, 0, 0, 127, 78, 78, 0, 0, 0,
3788 0, 0, 124, 0, 78, 124, 0, 0, 77, 0,
3789 0, 127, 0, 88, 0, 0, 0, 0, 0, 0,
3790 78, 1096, 0, 1094, 1096, 0, 0, 0, 0, 0,
3791 0, 0, 0, 0, 0, 0, 0, 0, 1096, 1096,
3792 1096, 78, 0, 1096, 1096, 0, 0, 0, 1096, 1096,
3793 0, 0, 0, 88, 0, 0, 0, 0, 0, 88,
3794 0, 127, 0, 0, 78, 78, 78, 0, 0, 1095,
3795 0, 0, 0, 1095, 1095, 0, 0, 0, 0, 0,
3796 0, 78, 0, 0, 0, 0, 0, 0, 0, 127,
3797 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,
3798 78, 0, 88, 0, 124, 0, 0, 0, 0, 0,
3799 0, 0, 0, 0, 0, 785, 0, 0, 78, 1095,
3800 124, 78, 0, 0, 0, 0, 0, 0, 127, 0,
3801 0, 0, 0, 127, 0, 127, 0, 0, 0, 0,
3802 0, 124, 0, 0, 0, 0, 0, 0, 0, 0,
3803 0, 1096, 0, 0, 0, 1096, 1096, 0, 0, 0,
3804 0, 88, 0, 88, 124, 124, 0, 0, 0, 23,
3805 24, 25, 26, 0, 291, 0, 0, 0, 78, 0,
3806 0, 78, 78, 88, 0, 32, 33, 34, 1055, 0,
3807 0, 78, 1056, 785, 785, 41, 42, 43, 44, 45,
3808 124, 1096, 0, 0, 0, 0, 0, 0, 291, 0,
3809 0, 0, 0, 0, 0, 0, 0, 0, 124, 0,
3810 0, 124, 0, 0, 0, 0, 0, 1058, 1059, 0,
3811 127, 0, 0, 0, 0, 1060, 0, 0, 1061, 0,
3812 0, 1062, 1063, 0, 1064, 0, 0, 58, 59, 60,
3813 61, 62, 63, 64, 65, 66, 0, 78, 0, 0,
3814 0, 0, 227, 227, 0, 0, 0, 0, 0, 78,
3815 127, 0, 0, 0, 1182, 291, 127, 1066, 124, 0,
3816 0, 124, 124, 0, 288, 0, 0, 0, 0, 0,
3817 0, 124, 0, 0, 260, 264, 265, 266, 246, 0,
3818 0, 227, 227, 0, 0, 0, 0, 0, 412, 0,
3819 0, 0, 0, 0, 313, 314, 127, 0, 0, 127,
3820 0, 352, 353, 354, 355, 356, 357, 358, 359, 0,
3821 361, 362, 127, 0, 0, 0, 0, 0, 365, 366,
3822 0, 0, 0, 0, 0, 0, 0, 0, 0, 227,
3823 0, 0, 0, 0, 0, 88, 0, 124, 88, 0,
3824 0, 0, 0, 0, 0, 0, 0, 0, 0, 124,
3825 0, 78, 0, 0, 0, 412, 0, 0, 127, 0,
3826 127, 369, 370, 371, 372, 373, 374, 375, 376, 377,
3827 378, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3828 127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3829 127, 127, 0, 0, 0, 0, 0, 0, 0, 0,
3830 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3832 0, 0, 785, 785, 0, 0, 0, 0, 785, 785,
3833 0, 0, 0, 0, 0, 0, 0, 88, 0, 0,
3834 0, 227, 0, 0, 227, 227, 227, 0, 313, 0,
3835 0, 124, 0, 88, 0, 0, 0, 0, 0, 23,
3836 24, 25, 26, 0, 0, 0, 0, 227, 0, 0,
3837 227, 0, 0, 0, 88, 32, 33, 34, 1055, 0,
3838 0, 0, 1056, 0, 1057, 41, 42, 43, 44, 45,
3839 0, 0, 0, 0, 0, 0, 0, 88, 88, 785,
3840 0, 0, 0, 0, 543, 0, 0, 0, 0, 0,
3841 0, 0, 0, 0, 785, 0, 0, 1058, 1059, 0,
3842 0, 0, 0, 0, 0, 1060, 0, 0, 1061, 0,
3843 0, 1062, 1063, 88, 1064, 547, 0, 58, 59, 1065,
3844 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3845 0, 88, 127, 0, 88, 127, 0, 0, 0, 0,
3846 0, 0, 0, 0, 0, 0, 0, 1066, 0, 0,
3847 0, 0, 0, 0, 288, 0, 0, 0, 592, 593,
3848 594, 595, 596, 0, 0, 597, 598, 599, 600, 601,
3849 602, 603, 604, 0, 606, 0, 0, 607, 608, 609,
3850 610, 611, 612, 613, 614, 615, 616, 1180, 0, 0,
3851 227, 88, 0, 0, 88, 88, 0, 0, 0, 0,
3852 0, 0, 0, 0, 88, 0, 0, 0, 0, 0,
3853 0, 0, 0, 0, 0, 0, 0, 0, 0, 127,
3854 127, 0, 0, 0, 0, 127, 127, 0, 0, 0,
3855 0, 0, 0, 0, 127, 0, 0, 227, 0, 0,
3856 0, 0, 0, 0, 0, 0, 0, 0, 617, 618,
3857 127, 0, 619, 0, 0, 0, 227, 227, 0, 0,
3858 0, 227, 0, 0, 0, 227, 0, 266, 0, 0,
3859 88, 127, 175, 176, 177, 178, 179, 180, 181, 182,
3860 183, 0, 88, 184, 185, 696, 0, 0, 0, 186,
3861 187, 188, 189, 0, 127, 127, 127, 0, 227, 0,
3862 0, 227, 0, 0, 190, 191, 0, 0, 0, 0,
3863 0, 127, 0, 227, 0, 0, 0, 0, 0, 0,
3864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3865 127, 726, 0, 0, 192, 193, 194, 195, 196, 197,
3866 198, 199, 200, 201, 0, 202, 203, 0, 127, 0,
3867 0, 127, 204, 241, 0, 0, 0, 0, 0, 0,
3868 0, 0, 0, 0, 0, 0, 0, 227, 352, -784,
3869 -784, -784, -784, 357, 358, 0, 0, -784, -784, 758,
3870 0, 0, 758, 0, 88, 365, 366, 0, 0, 0,
3871 0, 227, 0, 0, 0, 0, 786, 0, 0, 0,
3872 0, 0, 0, 0, 0, 0, 0, 0, 127, 0,
3873 0, 127, 127, 0, 0, 0, 0, 0, 0, 0,
3874 0, 127, 0, 0, 0, 0, 0, 0, 369, 370,
3875 371, 372, 373, 374, 375, 376, 377, 378, 0, 0,
3876 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3877 0, 0, 227, 0, 0, 0, 0, 0, 0, 0,
3878 0, 0, 227, 0, 0, 0, 0, 0, 0, 0,
3879 0, 0, 0, 0, 845, 845, 0, 227, 758, 758,
3880 845, 0, 0, 0, 0, 0, 0, 127, 0, 0,
3881 0, 845, 845, 0, 0, 227, 0, 227, 0, 127,
3882 0, 0, 0, 0, 0, 0, 0, 845, -783, 4,
3883 0, 5, 6, 7, 8, 9, 0, 0, 0, 10,
3884 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
3885 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
3886 22, 23, 24, 25, 26, 0, 227, 27, 0, 0,
3887 0, 0, 0, 28, 29, 30, 31, 32, 33, 34,
3888 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3889 44, 45, 46, 47, 0, 0, 0, 0, 0, 227,
3890 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3891 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3892 51, 127, 0, 0, 0, 0, 0, 52, 227, 0,
3893 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3894 59, 60, 61, 62, 63, 64, 65, 66, 0, 227,
3895 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3896 0, 0, 0, 0, 0, 0, 0, 0, 627, 628,
3897 0, 0, 629, 0, 0, 0, 67, 68, 69, 0,
3898 0, 0, 0, 0, 0, 0, 0, 0, -783, 0,
3899 -783, 0, 175, 176, 177, 178, 179, 180, 181, 182,
3900 183, 0, 0, 184, 185, 0, 0, 0, 0, 186,
3901 187, 188, 189, 0, 0, 0, 0, 0, 0, 0,
3902 0, 0, 758, 0, 190, 191, 0, 0, 0, 0,
3903 0, 227, 0, 0, 0, 0, 0, 0, 227, 0,
3904 0, 0, 1003, 845, 845, 0, 0, 0, 0, 845,
3905 845, 0, 0, 227, 192, 193, 194, 195, 196, 197,
3906 198, 199, 200, 201, 0, 202, 203, 0, 227, 0,
3907 0, 0, 204, 241, 0, 0, 0, 0, 0, 0,
3908 0, 0, 0, 758, 845, 845, 0, 845, 845, 0,
3909 227, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3910 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3911 0, 0, 1043, 1044, 0, 0, 227, 0, 0, 0,
3912 845, 1053, 0, 0, 0, 0, 0, 0, 0, 0,
3913 0, 0, 0, 0, 0, 845, 0, 0, 0, 0,
3914 0, 0, 0, 0, -783, 4, 0, 5, 6, 7,
3915 8, 9, 0, 227, 0, 10, 11, 0, 0, 845,
3916 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3917 0, 0, 0, 0, 20, 21, 22, 23, 24, 25,
3918 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3919 29, 268, 31, 32, 33, 34, 35, 36, 37, 38,
3920 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3921 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3922 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3923 0, 0, 0, 0, 0, 50, 51, 0, 227, 0,
3924 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3925 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3926 63, 64, 65, 66, 0, -783, 0, 0, 0, 0,
3927 -761, 0, 0, 0, 0, 0, 0, 0, -761, -761,
3928 -761, 0, 0, -761, -761, -761, 0, -761, 0, 0,
3929 0, 0, 67, 68, 69, -761, -761, -761, -761, -761,
3930 0, 0, 0, 0, -783, 0, -783, -761, -761, 0,
3931 -761, -761, -761, -761, -761, 0, 0, 0, 352, 353,
3932 354, 355, 356, 357, 358, 359, 360, 361, 362, -784,
3933 -784, 0, 0, 0, 0, 365, 366, 0, -761, -761,
3934 0, 0, 0, 0, 0, 0, 0, 0, -761, -761,
3935 -761, -761, -761, -761, -761, -761, -761, -761, -761, -761,
3936 -761, 0, 0, 0, 0, -761, -761, -761, -761, 0,
3937 853, -761, 0, 0, 0, 0, 227, -761, 369, 370,
3938 371, 372, 373, 374, 375, 376, 377, 378, 0, 0,
3939 0, -761, 0, 0, -761, 0, 0, 0, 0, 0,
3940 0, 0, 0, 0, 0, -131, -761, -761, -761, -761,
3941 -761, -761, -761, -761, -761, -761, -761, -761, 0, 0,
3942 0, 0, -761, -761, -761, -761, -654, 0, -761, -761,
3943 -761, 0, -761, 0, -654, -654, -654, 0, 0, -654,
3944 -654, -654, 0, -654, 0, 0, 0, 0, 0, 0,
3945 0, -654, 0, -654, -654, -654, 0, 0, 0, 0,
3946 0, 0, 0, -654, -654, 0, -654, -654, -654, -654,
3947 -654, 0, 0, 0, 352, 353, 354, 355, 356, 357,
3948 358, 359, 360, 361, 362, 363, 364, 0, 0, 0,
3949 0, 365, 366, 0, -654, -654, 0, 0, 0, 0,
3950 0, 0, 0, 0, -654, -654, -654, -654, -654, -654,
3951 -654, -654, -654, -654, -654, -654, -654, 0, 0, 0,
3952 0, -654, -654, -654, -654, 0, -654, -654, 0, 0,
3953 0, 0, 368, -654, 369, 370, 371, 372, 373, 374,
3954 375, 376, 377, 378, 0, 0, 0, -654, 0, 0,
3955 -654, 0, 0, 0, 0, 0, 0, 0, 246, 0,
3956 0, -654, -654, -654, -654, -654, -654, -654, -654, -654,
3957 -654, -654, -654, -654, 0, 0, 0, 0, 0, -654,
3958 -654, -654, -655, 0, -654, -654, -654, 0, -654, 0,
3959 -655, -655, -655, 0, 0, -655, -655, -655, 0, -655,
3960 0, 0, 0, 0, 0, 0, 0, -655, 0, -655,
3961 -655, -655, 0, 0, 0, 0, 0, 0, 0, -655,
3962 -655, 0, -655, -655, -655, -655, -655, 0, 0, 0,
3963 352, 353, 354, 355, 356, 357, 358, 359, 360, 361,
3964 362, 363, 364, 0, 0, 0, 0, 365, 366, 0,
3965 -655, -655, 0, 0, 0, 0, 0, 0, 0, 0,
3966 -655, -655, -655, -655, -655, -655, -655, -655, -655, -655,
3967 -655, -655, -655, 0, 0, 0, 0, -655, -655, -655,
3968 -655, 0, -655, -655, 0, 0, 0, 0, 368, -655,
3969 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,
3970 0, 0, 0, -655, 0, 0, -655, 0, 0, 0,
3971 0, 0, 0, 0, 0, 0, 0, -655, -655, -655,
3972 -655, -655, -655, -655, -655, -655, -655, -655, -655, -655,
3973 0, 0, 0, 0, 0, -655, -655, -655, -762, 0,
3974 -655, -655, -655, 0, -655, 0, -762, -762, -762, 0,
3975 0, -762, -762, -762, 0, -762, 0, 0, 0, 0,
3976 0, 0, 0, -762, -762, -762, -762, -762, 0, 0,
3977 0, 0, 0, 0, 0, -762, -762, 0, -762, -762,
3978 -762, -762, -762, 0, 0, 0, 352, 353, 354, 355,
3979 356, 357, 358, 0, 0, 361, 362, 0, 0, 0,
3980 0, 0, 0, 365, 366, 0, -762, -762, 0, 0,
3981 0, 0, 0, 0, 0, 0, -762, -762, -762, -762,
3982 -762, -762, -762, -762, -762, -762, -762, -762, -762, 0,
3983 0, 0, 0, -762, -762, -762, -762, 0, 0, -762,
3984 0, 0, 0, 0, 0, -762, 369, 370, 371, 372,
3985 373, 374, 375, 376, 377, 378, 0, 0, 0, -762,
3986 0, 0, -762, 0, 0, 0, 0, 0, 0, 0,
3987 0, 0, 0, 0, -762, -762, -762, -762, -762, -762,
3988 -762, -762, -762, -762, -762, -762, 0, 0, 0, 0,
3989 -762, -762, -762, -762, -763, 0, -762, -762, -762, 0,
3990 -762, 0, -763, -763, -763, 0, 0, -763, -763, -763,
3991 0, -763, 0, 0, 0, 0, 0, 0, 0, -763,
3992 -763, -763, -763, -763, 0, 0, 0, 0, 0, 0,
3993 0, -763, -763, 0, -763, -763, -763, -763, -763, 0,
3994 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3995 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3996 0, 0, -763, -763, 0, 0, 0, 0, 0, 0,
3997 0, 0, -763, -763, -763, -763, -763, -763, -763, -763,
3998 -763, -763, -763, -763, -763, 0, 0, 0, 0, -763,
3999 -763, -763, -763, 0, 0, -763, 0, 0, 0, 0,
4000 0, -763, 0, 0, 0, 0, 0, 0, 0, 0,
4001 0, 0, 0, 0, 0, -763, 0, 0, -763, 0,
4002 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4003 -763, -763, -763, -763, -763, -763, -763, -763, -763, -763,
4004 -763, -763, 0, 0, 0, 0, -763, -763, -763, -763,
4005 -475, 0, -763, -763, -763, 0, -763, 0, -475, -475,
4006 -475, 0, 0, -475, -475, -475, 0, -475, 0, 0,
4007 0, 0, 0, 0, 0, -475, -475, -475, -475, 0,
4008 0, 0, 0, 0, 0, 0, 0, -475, -475, 0,
4009 -475, -475, -475, -475, -475, 0, 0, 0, 0, 0,
4010 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4011 0, 0, 0, 0, 0, 0, 0, 0, -475, -475,
4012 0, 0, 0, 0, 0, 0, 0, 0, -475, -475,
4013 -475, -475, -475, -475, -475, -475, -475, -475, -475, -475,
4014 -475, 0, 0, 0, 0, -475, -475, -475, -475, 0,
4015 0, -475, 0, 0, 0, 0, 0, -475, 0, 0,
4016 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4017 0, -475, 0, 0, 0, 0, 0, 0, 0, 0,
4018 0, 0, 0, 0, 0, 0, -475, 0, -475, -475,
4019 -475, -475, -475, -475, -475, -475, -475, -475, 0, 0,
4020 0, 0, -475, -475, -475, -475, -328, 241, -475, -475,
4021 -475, 0, -475, 0, -328, -328, -328, 0, 0, -328,
4022 -328, -328, 0, -328, 0, 0, 0, 0, 0, 0,
4023 0, -328, 0, -328, -328, -328, 0, 0, 0, 0,
4024 0, 0, 0, -328, -328, 0, -328, -328, -328, -328,
4025 -328, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4026 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4027 0, 0, 0, 0, -328, -328, 0, 0, 0, 0,
4028 0, 0, 0, 0, -328, -328, -328, -328, -328, -328,
4029 -328, -328, -328, -328, -328, -328, -328, 0, 0, 0,
4030 0, -328, -328, -328, -328, 0, 0, -328, 0, 0,
4031 0, 0, 0, -328, 0, 0, 0, 0, 0, 0,
4032 0, 0, 0, 0, 0, 0, 0, -328, 0, 0,
4033 -328, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4034 0, 0, -328, -328, -328, -328, -328, -328, -328, -328,
4035 -328, -328, -328, -328, 0, 0, 0, 0, 0, -328,
4036 -328, -328, -783, 0, -328, -328, -328, 0, -328, 0,
4037 -783, -783, -783, 0, 0, -783, -783, -783, 0, -783,
4038 0, 0, 0, 0, 0, 0, 0, -783, -783, -783,
4039 -783, 0, 0, 0, 0, 0, 0, 0, 0, -783,
4040 -783, 0, -783, -783, -783, -783, -783, 0, 0, 0,
4041 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4043 -783, -783, 0, 0, 0, 0, 0, 0, 0, 0,
4044 -783, -783, -783, -783, -783, -783, -783, -783, -783, -783,
4045 -783, -783, -783, 0, 0, 0, 0, -783, -783, -783,
4046 -783, 0, 0, -783, 0, 0, 0, 0, 0, -783,
4047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4048 0, 0, 0, -783, 0, 0, 0, 0, 0, 0,
4049 0, 0, 0, 0, 0, 0, 0, 0, -783, 0,
4050 -783, -783, -783, -783, -783, -783, -783, -783, -783, -783,
4051 0, 0, 0, 0, -783, -783, -783, -783, -334, 241,
4052 -783, -783, -783, 0, -783, 0, -334, -334, -334, 0,
4053 0, -334, -334, -334, 0, -334, 0, 0, 0, 0,
4054 0, 0, 0, -334, 0, -334, -334, 0, 0, 0,
4055 0, 0, 0, 0, 0, -334, -334, 0, -334, -334,
4056 -334, -334, -334, 0, 0, 0, 0, 0, 0, 0,
4057 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4058 0, 0, 0, 0, 0, 0, -334, -334, 0, 0,
4059 0, 0, 0, 0, 0, 0, -334, -334, -334, -334,
4060 -334, -334, -334, -334, -334, -334, -334, -334, -334, 0,
4061 0, 0, 0, -334, -334, -334, -334, 0, 854, -334,
4062 0, 0, 0, 0, 0, -334, 0, 0, 0, 0,
4063 0, 0, 0, 0, 0, 0, 0, 0, 0, -334,
4064 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4065 0, 0, 0, -133, -334, 0, -334, -334, -334, -334,
4066 -334, -334, -334, -334, -334, -334, 0, 0, 0, 0,
4067 797, -334, -334, -334, -341, 0, -334, -334, -334, 0,
4068 -334, 0, -341, -341, -341, 0, 0, -341, -341, -341,
4069 0, -341, 0, 0, 0, 0, 0, 0, 0, -341,
4070 0, -341, -341, 0, 0, 0, 0, 0, 0, 0,
4071 0, -341, -341, 0, -341, -341, -341, -341, -341, 0,
4072 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4073 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4074 0, 0, -341, -341, 0, 0, 0, 0, 0, 0,
4075 0, 0, -341, -341, -341, -341, -341, -341, -341, -341,
4076 -341, -341, -341, -341, -341, 0, 0, 0, 0, -341,
4077 -341, -341, -341, 0, 0, -341, 0, 0, 0, 0,
4078 0, -341, 0, 0, 0, 0, 0, 0, 0, 0,
4079 0, 0, 0, 0, 0, -341, 0, 0, 0, 0,
4080 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4081 -341, 0, -341, -341, -341, -341, -341, -341, -341, -341,
4082 -341, -341, 0, 0, 0, 0, 0, -341, -341, -341,
4083 -761, 431, -341, -341, -341, 0, -341, 0, -761, -761,
4084 -761, 910, 0, 0, -761, -761, 0, -761, 0, 0,
4085 0, 0, 0, 0, 0, -761, -761, 0, 0, 0,
4086 0, 0, 0, 0, 0, 0, 0, -761, -761, 0,
4087 -761, -761, -761, -761, -761, 352, 353, 354, 355, 356,
4088 357, 358, 359, 360, 361, 362, 363, 364, 0, 0,
4089 0, 0, 365, 366, 0, 0, 0, 0, -761, -761,
4090 0, 0, 0, 0, 0, 0, 0, 0, -761, -761,
4091 -761, -761, -761, -761, -761, -761, -761, -761, -761, -761,
4092 -761, 0, 0, 0, 0, -761, -761, -761, -761, 0,
4093 795, -761, 0, 368, 0, 369, 370, 371, 372, 373,
4094 374, 375, 376, 377, 378, 0, 0, 0, 0, 0,
4095 0, -761, 0, 0, 0, 0, 0, 0, 0, 0,
4096 0, 0, 0, 0, 0, -131, -761, 0, -761, -761,
4097 -761, -761, -761, -761, -761, -761, -761, -761, 0, 0,
4098 0, 0, -761, -761, -761, -122, -761, 0, -761, 0,
4099 -761, 0, -761, 0, -761, -761, -761, 0, 0, 0,
4100 -761, -761, 0, -761, 0, 0, 0, 0, 0, 0,
4101 0, -761, -761, 0, 0, 0, 0, 0, 0, 0,
4102 0, 0, 0, -761, -761, 0, -761, -761, -761, -761,
4103 -761, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4105 0, 0, 0, 0, -761, -761, 0, 0, 0, 0,
4106 0, 0, 0, 0, -761, -761, -761, -761, -761, -761,
4107 -761, -761, -761, -761, -761, -761, -761, 0, 0, 0,
4108 0, -761, -761, -761, -761, 0, 795, -761, 0, 0,
4109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4110 0, 0, 0, 0, 0, 0, 0, -761, 0, 0,
4111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4112 0, -131, -761, 0, -761, -761, -761, -761, -761, -761,
4113 -761, -761, -761, -761, 0, 0, 0, 0, -761, -761,
4114 -761, -761, -334, 0, -761, 0, -761, 0, -761, 0,
4115 -334, -334, -334, 0, 0, 0, -334, -334, 0, -334,
4116 0, 0, 0, 0, 0, 0, 0, -334, 0, 0,
4117 0, 0, 0, 0, 0, 0, 0, 0, 0, -334,
4118 -334, 0, -334, -334, -334, -334, -334, 0, 0, 0,
4119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4121 -334, -334, 0, 0, 0, 0, 0, 0, 0, 0,
4122 -334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
4123 -334, -334, -334, 0, 0, 0, 0, -334, -334, -334,
4124 -334, 0, 796, -334, 0, 0, 0, 0, 0, 0,
4125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4126 0, 0, 0, -334, 0, 0, 0, 0, 0, 0,
4127 0, 0, 0, 0, 0, 0, 0, -133, -334, 0,
4128 -334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
4129 0, 0, 0, 0, 797, -334, -334, -124, -334, 0,
4130 -334, 0, -334, 0, -334, 0, -334, -334, -334, 0,
4131 0, 0, -334, -334, 0, -334, 0, 0, 0, 0,
4132 0, 0, 0, -334, 0, 0, 0, 0, 0, 0,
4133 0, 0, 0, 0, 0, -334, -334, 0, -334, -334,
4134 -334, -334, -334, 0, 0, 0, 0, 0, 0, 0,
4135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4136 0, 0, 0, 0, 0, 0, -334, -334, 0, 0,
4137 0, 0, 0, 0, 0, 0, -334, -334, -334, -334,
4138 -334, -334, -334, -334, -334, -334, -334, -334, -334, 0,
4139 0, 0, 0, -334, -334, -334, -334, 0, 796, -334,
4140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4141 0, 0, 0, 0, 0, 0, 0, 0, 0, -334,
4142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4143 0, 0, 0, -133, -334, 0, -334, -334, -334, -334,
4144 -334, -334, -334, -334, -334, -334, 0, 0, 0, 0,
4145 797, -334, -334, -334, 0, 0, -334, 0, -334, 4,
4146 -334, 5, 6, 7, 8, 9, -783, -783, -783, 10,
4147 11, 0, 0, -783, 12, 0, 13, 14, 15, 16,
4148 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
4149 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
4150 0, 0, 0, 28, 29, 268, 31, 32, 33, 34,
4151 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4152 44, 45, 46, 47, 0, 0, -783, 0, 0, 0,
4153 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4154 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4155 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
4156 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
4157 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4158 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
4159 -783, 10, 11, 0, -783, -783, 12, 0, 13, 14,
4160 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
4161 20, 21, 22, 23, 24, 25, 26, 0, -783, 27,
4162 -783, 0, 0, 0, 0, 28, 29, 268, 31, 32,
4163 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4164 42, 43, 44, 45, 46, 47, 0, 0, -783, 0,
4165 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4166 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4167 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
4168 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
4169 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4170 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
4171 0, 0, -783, 10, 11, 0, 0, -783, 12, -783,
4172 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
4173 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4174 -783, 27, -783, 0, 0, 0, 0, 28, 29, 268,
4175 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4176 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4177 -783, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4179 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4180 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4181 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4182 65, 66, 0, 0, 0, 4, 0, 5, 6, 7,
4183 8, 9, 0, 0, -783, 10, 11, 0, 0, -783,
4184 12, 0, 13, 14, 15, 16, 17, 18, 19, -783,
4185 67, 68, 69, 0, 20, 21, 22, 23, 24, 25,
4186 26, 0, -783, 27, -783, 0, 0, 0, 0, 28,
4187 29, 268, 31, 32, 33, 34, 35, 36, 37, 38,
4188 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4189 0, 0, -783, 0, 0, 0, 0, 0, 0, 0,
4190 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4191 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4192 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
4193 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
4194 63, 64, 65, 66, 0, 0, 0, 4, 0, 5,
4195 6, 7, 8, 9, 0, 0, -783, 10, 11, 0,
4196 0, -783, 12, 0, 13, 14, 15, 16, 17, 18,
4197 19, 0, 67, 68, 69, 0, 20, 21, 22, 23,
4198 24, 25, 26, 0, -783, 27, -783, 0, 0, 0,
4199 0, 28, 29, 268, 31, 32, 33, 34, 35, 36,
4200 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4201 46, 47, 0, 0, -783, 0, 0, 0, 0, 0,
4202 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4203 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4204 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
4205 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
4206 61, 62, 63, 64, 65, 66, 0, 0, 0, 4,
4207 0, 5, 6, 7, 8, 9, 0, -783, -783, 10,
4208 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
4209 17, 18, 19, 0, 67, 68, 69, 0, 20, 21,
4210 22, 23, 24, 25, 26, 0, -783, 27, -783, 0,
4211 0, 0, 0, 28, 29, 268, 31, 32, 33, 34,
4212 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4213 44, 45, 46, 47, 0, 0, -783, 0, 0, 0,
4214 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4215 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4216 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
4217 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
4218 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4219 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
4220 -783, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4221 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
4222 20, 21, 22, 23, 24, 25, 26, 0, -783, 27,
4223 -783, 0, 0, 0, 0, 28, 29, 268, 31, 32,
4224 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4225 42, 43, 44, 45, 46, 47, 0, 0, -783, 0,
4226 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4227 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4228 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
4229 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
4230 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4231 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
4232 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4233 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
4234 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4235 -783, 27, -783, 0, 0, 0, 0, 28, 29, 268,
4236 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4237 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4238 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4240 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4241 0, 52, 0, 0, 269, 54, 0, 55, 56, 0,
4242 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4243 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4246 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
4247 -783, 0, -783, 4, -783, 5, 6, 7, 8, 9,
4248 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4249 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
4250 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4251 0, 27, 0, 0, 0, 0, 0, 28, 29, 268,
4252 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4253 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4254 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4256 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4257 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4258 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4259 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4262 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
4263 -783, 0, -783, 4, -783, 5, 6, 7, 8, 9,
4264 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4265 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
4266 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4267 0, 27, 0, 0, 0, 0, 0, 28, 29, 30,
4268 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4269 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4270 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4271 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4272 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4273 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4274 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4275 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4276 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4277 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4278 67, 68, 69, 0, 0, -783, 0, 0, 0, 0,
4279 0, 0, -783, 4, -783, 5, 6, 7, 8, 9,
4280 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4281 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
4282 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4283 0, 27, 0, 0, 0, 0, 0, 28, 29, 268,
4284 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4285 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4286 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4287 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4288 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4289 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4290 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4291 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4292 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4293 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4294 67, 68, 69, 0, 0, -783, 0, 387, 0, 5,
4295 6, 7, -783, 9, -783, 0, 0, 10, 11, 0,
4296 0, 0, 12, -770, 13, 14, 15, 16, 17, 18,
4297 19, 0, 0, 0, 0, 0, 20, 21, 22, 23,
4298 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
4299 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4300 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4301 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4302 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4303 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4304 0, 0, 0, 0, 0, 216, 0, 0, 217, 54,
4305 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
4306 61, 62, 63, 64, 65, 66, 0, 0, -771, 4,
4307 0, 5, 6, 7, 8, 9, -771, -771, -771, 10,
4308 11, 0, -771, -771, 12, -771, 13, 14, 15, 16,
4309 17, 18, 19, -771, 67, 68, 69, 0, 20, 21,
4310 22, 23, 24, 25, 26, 0, 315, 27, 316, 0,
4311 0, 0, 0, 28, 29, 268, 31, 32, 33, 34,
4312 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4313 44, 45, 46, 47, 0, 0, -771, 0, 0, 0,
4314 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4315 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4316 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
4317 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
4318 59, 60, 61, 62, 63, 64, 65, 66, 0, -771,
4319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4320 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4321 0, 0, 0, 0, 0, 0, 67, 68, 69, 0,
4322 0, -771, 0, 0, 0, 0, -771, 0, 526, -771,
4323 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
4324 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4325 16, 17, 18, 19, 0, 0, 0, 0, 0, 20,
4326 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
4327 0, 0, 0, 0, 28, 29, 30, 31, 32, 33,
4328 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
4329 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4330 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4331 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4332 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
4333 0, 53, 54, 0, 55, 56, 0, 57, 0, 0,
4334 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
4335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4336 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4337 0, 0, 0, 0, 0, 0, 0, 67, 68, 69,
4338 0, 0, -771, 5, 6, 7, 0, 9, 0, 526,
4339 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4340 15, 16, 17, 18, 19, 0, 0, 0, 0, 0,
4341 20, 21, 22, 23, 24, 25, 26, 0, 0, 214,
4342 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4343 33, 34, 35, 36, 37, 38, 39, 40, 215, 41,
4344 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4345 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4347 0, 50, 51, 0, 0, 0, 0, 0, 0, 216,
4348 0, 0, 217, 54, 0, 55, 56, 0, 218, 219,
4349 220, 58, 59, 221, 61, 62, 63, 64, 65, 66,
4350 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4351 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4352 14, 15, 16, 17, 18, 19, 0, 0, 67, 222,
4353 69, 20, 21, 22, 23, 24, 25, 26, 0, 0,
4354 27, 0, 246, 0, 0, 0, 0, 29, 0, 0,
4355 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4356 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4357 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4359 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4360 216, 0, 0, 217, 54, 0, 55, 56, 0, 0,
4361 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4362 66, 0, 0, 0, 0, 131, 132, 133, 134, 135,
4363 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
4364 146, 147, 148, 149, 150, 151, 152, 153, 154, 67,
4365 68, 69, 155, 156, 157, 416, 417, 418, 419, 162,
4366 163, 164, 0, 246, 0, 0, 0, 165, 166, 167,
4367 168, 420, 421, 422, 423, 173, 37, 38, 424, 40,
4368 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4369 0, 0, 0, 0, 0, 0, 0, 0, 175, 176,
4370 177, 178, 179, 180, 181, 182, 183, 0, 0, 184,
4371 185, 0, 0, 0, 0, 186, 187, 188, 189, 0,
4372 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4373 190, 191, 0, 0, 0, 0, 0, 0, 0, 0,
4374 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4375 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4376 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
4377 0, 202, 203, 0, 0, 0, 0, 0, 204, 425,
4378 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
4379 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
4380 151, 152, 153, 154, 0, 0, 0, 155, 156, 157,
4381 158, 159, 160, 161, 162, 163, 164, 0, 0, 0,
4382 0, 0, 165, 166, 167, 168, 169, 170, 171, 172,
4383 173, 37, 38, 174, 40, 0, 0, 0, 0, 0,
4384 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4385 0, 0, 0, 175, 176, 177, 178, 179, 180, 181,
4386 182, 183, 0, 0, 184, 185, 0, 0, 0, 0,
4387 186, 187, 188, 189, 0, 0, 0, 0, 0, 0,
4388 0, 0, 0, 0, 0, 190, 191, 0, 0, 0,
4389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4391 0, 0, 0, 0, 0, 192, 193, 194, 195, 196,
4392 197, 198, 199, 200, 201, 0, 202, 203, 0, 0,
4393 0, 0, 0, 204, 131, 132, 133, 134, 135, 136,
4394 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
4395 147, 148, 149, 150, 151, 152, 153, 154, 0, 0,
4396 0, 155, 156, 157, 158, 159, 160, 161, 162, 163,
4397 164, 0, 0, 0, 0, 0, 165, 166, 167, 168,
4398 169, 170, 171, 172, 173, 248, 0, 174, 0, 0,
4399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4400 0, 0, 0, 0, 0, 0, 0, 175, 176, 177,
4401 178, 179, 180, 181, 182, 183, 0, 0, 184, 185,
4402 0, 0, 0, 0, 186, 187, 188, 189, 0, 0,
4403 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4404 191, 0, 0, 59, 0, 0, 0, 0, 0, 0,
4405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4406 0, 0, 0, 0, 0, 0, 0, 0, 0, 192,
4407 193, 194, 195, 196, 197, 198, 199, 200, 201, 0,
4408 202, 203, 0, 0, 0, 0, 0, 204, 131, 132,
4409 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
4410 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
4411 153, 154, 0, 0, 0, 155, 156, 157, 158, 159,
4412 160, 161, 162, 163, 164, 0, 0, 0, 0, 0,
4413 165, 166, 167, 168, 169, 170, 171, 172, 173, 0,
4414 0, 174, 0, 0, 0, 0, 0, 0, 0, 0,
4415 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4416 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
4417 0, 0, 184, 185, 0, 0, 0, 0, 186, 187,
4418 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4419 0, 0, 0, 190, 191, 0, 0, 59, 0, 0,
4420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4421 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4422 0, 0, 0, 192, 193, 194, 195, 196, 197, 198,
4423 199, 200, 201, 0, 202, 203, 0, 0, 0, 0,
4424 0, 204, 131, 132, 133, 134, 135, 136, 137, 138,
4425 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
4426 149, 150, 151, 152, 153, 154, 0, 0, 0, 155,
4427 156, 157, 158, 159, 160, 161, 162, 163, 164, 0,
4428 0, 0, 0, 0, 165, 166, 167, 168, 169, 170,
4429 171, 172, 173, 0, 0, 174, 0, 0, 0, 0,
4430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4431 0, 0, 0, 0, 0, 175, 176, 177, 178, 179,
4432 180, 181, 182, 183, 0, 0, 184, 185, 0, 0,
4433 0, 0, 186, 187, 188, 189, 0, 0, 0, 0,
4434 0, 0, 0, 0, 0, 0, 0, 190, 191, 0,
4435 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4436 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4437 0, 0, 0, 0, 0, 0, 0, 192, 193, 194,
4438 195, 196, 197, 198, 199, 200, 201, 0, 202, 203,
4439 5, 6, 7, 0, 9, 204, 0, 0, 10, 11,
4440 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4441 18, 19, 0, 0, 0, 0, 0, 20, 21, 258,
4442 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4443 0, 0, 0, 286, 0, 0, 32, 33, 34, 35,
4444 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4445 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4446 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4448 0, 0, 0, 0, 0, 0, 287, 0, 0, 217,
4449 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4450 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4452 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
4453 7, 0, 9, 0, 0, 288, 10, 11, 0, 0,
4454 0, 12, 289, 13, 14, 15, 256, 257, 18, 19,
4455 0, 0, 0, 0, 0, 20, 21, 258, 23, 24,
4456 25, 26, 0, 0, 214, 0, 0, 0, 0, 0,
4457 0, 286, 0, 0, 32, 33, 34, 35, 36, 37,
4458 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4459 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4460 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4461 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4462 0, 0, 0, 0, 287, 0, 0, 217, 54, 0,
4463 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
4464 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
4465 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4466 0, 0, 0, 0, 4, 0, 5, 6, 7, 8,
4467 9, 0, 0, 288, 10, 11, 0, 0, 0, 12,
4468 587, 13, 14, 15, 16, 17, 18, 19, 0, 0,
4469 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
4470 0, 0, 27, 0, 0, 0, 0, 0, 28, 29,
4471 0, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4472 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4473 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4474 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4475 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
4476 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
4477 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
4478 64, 65, 66, 0, 0, 387, 0, 5, 6, 7,
4479 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4480 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
4481 0, 67, 68, 69, 20, 21, 22, 23, 24, 25,
4482 26, 0, 0, 27, 0, 0, 0, 0, 0, 0,
4483 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4484 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4485 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4486 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4487 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4488 0, 0, 0, 216, 0, 0, 217, 54, 0, 55,
4489 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
4490 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4491 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4492 0, 12, 0, 13, 14, 15, 16, 17, 18, 19,
4493 0, 0, 67, 68, 69, 20, 21, 22, 23, 24,
4494 25, 26, 0, 0, 214, 0, 0, 0, 0, 0,
4495 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4496 38, 39, 40, 215, 41, 42, 43, 44, 45, 46,
4497 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4498 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4499 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
4500 0, 0, 0, 0, 216, 0, 0, 217, 54, 0,
4501 55, 56, 0, 218, 219, 220, 58, 59, 221, 61,
4502 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4503 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4504 0, 0, 12, 0, 13, 14, 15, 16, 17, 18,
4505 19, 0, 0, 67, 222, 69, 20, 21, 22, 23,
4506 24, 25, 26, 0, 0, 214, 0, 0, 0, 0,
4507 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4508 37, 38, 39, 40, 215, 41, 42, 43, 44, 45,
4509 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4510 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4511 0, 0, 0, 0, 0, 0, 0, 50, 461, 0,
4512 0, 0, 0, 0, 0, 216, 0, 0, 217, 54,
4513 0, 55, 56, 0, 218, 219, 220, 58, 59, 221,
4514 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4515 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4516 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4517 18, 19, 0, 0, 67, 222, 69, 20, 21, 258,
4518 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4519 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4520 36, 37, 38, 39, 40, 215, 41, 42, 43, 44,
4521 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4522 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4523 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4524 0, 0, 0, 0, 0, 0, 216, 0, 0, 217,
4525 54, 0, 55, 56, 0, 218, 219, 220, 58, 59,
4526 221, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4527 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4528 11, 0, 0, 0, 12, 0, 13, 14, 15, 256,
4529 257, 18, 19, 0, 0, 67, 222, 69, 20, 21,
4530 258, 23, 24, 25, 26, 0, 0, 214, 0, 0,
4531 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
4532 35, 36, 37, 38, 39, 40, 215, 41, 42, 43,
4533 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4534 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4535 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4536 461, 0, 0, 0, 0, 0, 0, 216, 0, 0,
4537 217, 54, 0, 55, 56, 0, 218, 219, 220, 58,
4538 59, 221, 61, 62, 63, 64, 65, 66, 0, 0,
4539 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4540 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4541 256, 257, 18, 19, 0, 0, 67, 222, 69, 20,
4542 21, 258, 23, 24, 25, 26, 0, 0, 214, 0,
4543 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
4544 34, 35, 36, 37, 38, 39, 40, 215, 41, 42,
4545 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4546 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4547 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4548 50, 51, 0, 0, 0, 0, 0, 0, 216, 0,
4549 0, 217, 54, 0, 55, 56, 0, 218, 219, 0,
4550 58, 59, 221, 61, 62, 63, 64, 65, 66, 0,
4551 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4552 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4553 15, 256, 257, 18, 19, 0, 0, 67, 222, 69,
4554 20, 21, 258, 23, 24, 25, 26, 0, 0, 214,
4555 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4556 33, 34, 35, 36, 37, 38, 39, 40, 215, 41,
4557 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4558 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4559 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4560 0, 50, 51, 0, 0, 0, 0, 0, 0, 216,
4561 0, 0, 217, 54, 0, 55, 56, 0, 0, 219,
4562 220, 58, 59, 221, 61, 62, 63, 64, 65, 66,
4563 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4564 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4565 14, 15, 256, 257, 18, 19, 0, 0, 67, 222,
4566 69, 20, 21, 258, 23, 24, 25, 26, 0, 0,
4567 214, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4568 32, 33, 34, 35, 36, 37, 38, 39, 40, 215,
4569 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4570 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4571 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4572 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4573 216, 0, 0, 217, 54, 0, 55, 56, 0, 0,
4574 219, 0, 58, 59, 221, 61, 62, 63, 64, 65,
4575 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4576 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4577 13, 14, 15, 16, 17, 18, 19, 0, 0, 67,
4578 222, 69, 20, 21, 22, 23, 24, 25, 26, 0,
4579 0, 214, 0, 0, 0, 0, 0, 0, 29, 0,
4580 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4581 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4582 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4583 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4584 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4585 0, 216, 0, 0, 217, 54, 0, 55, 56, 0,
4586 773, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4587 65, 66, 0, 0, 0, 0, 5, 6, 7, 0,
4588 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4589 0, 13, 14, 15, 256, 257, 18, 19, 0, 0,
4590 67, 222, 69, 20, 21, 258, 23, 24, 25, 26,
4591 0, 0, 214, 0, 0, 0, 0, 0, 0, 29,
4592 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4593 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4594 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4595 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4596 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
4597 0, 0, 216, 0, 0, 217, 54, 0, 55, 56,
4598 0, 942, 0, 0, 58, 59, 60, 61, 62, 63,
4599 64, 65, 66, 0, 0, 0, 0, 5, 6, 7,
4600 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4601 12, 0, 13, 14, 15, 256, 257, 18, 19, 0,
4602 0, 67, 222, 69, 20, 21, 258, 23, 24, 25,
4603 26, 0, 0, 214, 0, 0, 0, 0, 0, 0,
4604 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4605 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4606 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4607 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4608 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4609 0, 0, 0, 216, 0, 0, 217, 54, 0, 55,
4610 56, 0, 990, 0, 0, 58, 59, 60, 61, 62,
4611 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4612 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4613 0, 12, 0, 13, 14, 15, 256, 257, 18, 19,
4614 0, 0, 67, 222, 69, 20, 21, 258, 23, 24,
4615 25, 26, 0, 0, 214, 0, 0, 0, 0, 0,
4616 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4617 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4618 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4619 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4620 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
4621 0, 0, 0, 0, 216, 0, 0, 217, 54, 0,
4622 55, 56, 0, 773, 0, 0, 58, 59, 60, 61,
4623 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4624 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4625 0, 0, 12, 0, 13, 14, 15, 256, 257, 18,
4626 19, 0, 0, 67, 222, 69, 20, 21, 258, 23,
4627 24, 25, 26, 0, 0, 214, 0, 0, 0, 0,
4628 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4629 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4630 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4631 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4632 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4633 0, 0, 0, 0, 0, 216, 0, 0, 217, 54,
4634 0, 55, 56, 0, 1112, 0, 0, 58, 59, 60,
4635 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4636 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4637 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4638 18, 19, 0, 0, 67, 222, 69, 20, 21, 258,
4639 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4640 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4641 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4642 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4643 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4644 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4645 0, 0, 0, 0, 0, 0, 216, 0, 0, 217,
4646 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4647 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4648 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4649 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
4650 17, 18, 19, 0, 0, 67, 222, 69, 20, 21,
4651 22, 23, 24, 25, 26, 0, 0, 214, 0, 0,
4652 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
4653 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4654 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4655 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4656 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4657 51, 0, 0, 0, 0, 0, 0, 216, 0, 0,
4658 217, 54, 0, 55, 56, 0, 0, 0, 0, 58,
4659 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4660 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4661 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4662 16, 17, 18, 19, 0, 0, 67, 222, 69, 20,
4663 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
4664 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
4665 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
4666 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4667 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4668 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4669 50, 51, 0, 0, 0, 0, 0, 0, 216, 0,
4670 0, 217, 54, 0, 55, 56, 0, 0, 0, 0,
4671 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
4672 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4673 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4674 15, 16, 17, 18, 19, 0, 0, 67, 68, 69,
4675 20, 21, 22, 23, 24, 25, 26, 0, 0, 755,
4676 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4677 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4678 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4679 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4680 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4681 0, 50, 51, 0, 0, 0, 0, 0, 0, 216,
4682 0, 0, 217, 54, 0, 55, 56, 0, 0, 0,
4683 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4684 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4685 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4686 14, 15, 256, 257, 18, 19, 0, 0, 67, 222,
4687 69, 20, 21, 258, 23, 24, 25, 26, 0, 0,
4688 851, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4689 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4690 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4691 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4692 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4693 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4694 216, 0, 0, 217, 54, 0, 55, 56, 0, 0,
4695 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4696 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4697 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4698 13, 14, 15, 256, 257, 18, 19, 0, 0, 67,
4699 222, 69, 20, 21, 258, 23, 24, 25, 26, 0,
4700 0, 214, 0, 0, 0, 0, 0, 0, 286, 0,
4701 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4702 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4703 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4704 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4705 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4706 0, 287, 0, 0, 347, 54, 0, 55, 56, 0,
4707 348, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4708 65, 66, 0, 0, 5, 6, 7, 0, 9, 0,
4709 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4710 14, 15, 256, 257, 18, 19, 0, 0, 0, 0,
4711 288, 20, 21, 258, 23, 24, 25, 26, 0, 0,
4712 214, 0, 0, 0, 0, 0, 0, 286, 0, 0,
4713 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4714 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4715 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4716 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4717 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4718 397, 0, 0, 53, 54, 0, 55, 56, 0, 57,
4719 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4720 66, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4721 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4722 15, 256, 257, 18, 19, 0, 0, 0, 0, 288,
4723 20, 21, 258, 23, 24, 25, 26, 0, 0, 214,
4724 0, 0, 0, 0, 0, 0, 286, 0, 0, 32,
4725 33, 34, 405, 36, 37, 38, 406, 40, 0, 41,
4726 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4727 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4728 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4729 0, 0, 0, 0, 0, 407, 0, 0, 0, 408,
4730 0, 0, 217, 54, 0, 55, 56, 0, 0, 0,
4731 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4732 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4733 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4734 256, 257, 18, 19, 0, 0, 0, 0, 288, 20,
4735 21, 258, 23, 24, 25, 26, 0, 0, 214, 0,
4736 0, 0, 0, 0, 0, 286, 0, 0, 32, 33,
4737 34, 405, 36, 37, 38, 406, 40, 0, 41, 42,
4738 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4739 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4741 0, 0, 0, 0, 0, 0, 0, 0, 408, 0,
4742 0, 217, 54, 0, 55, 56, 0, 0, 0, 0,
4743 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
4744 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4745 11, 0, 0, 0, 12, 0, 13, 14, 15, 256,
4746 257, 18, 19, 0, 0, 0, 0, 288, 20, 21,
4747 258, 23, 24, 25, 26, 0, 0, 214, 0, 0,
4748 0, 0, 0, 0, 286, 0, 0, 32, 33, 34,
4749 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4750 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4751 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4753 0, 0, 0, 0, 0, 0, 0, 287, 0, 0,
4754 347, 54, 0, 55, 56, 0, 0, 0, 0, 58,
4755 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4756 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4757 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4758 18, 19, 0, 0, 0, 0, 288, 20, 21, 258,
4759 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4760 0, 0, 0, 286, 0, 0, 32, 33, 34, 35,
4761 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4762 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4763 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4764 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4765 0, 0, 0, 0, 0, 0, 1179, 0, 0, 217,
4766 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4767 60, 61, 62, 63, 64, 65, 66, 0, 0, 5,
4768 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4769 0, 0, 12, 0, 13, 14, 15, 256, 257, 18,
4770 19, 0, 0, 0, 0, 288, 20, 21, 258, 23,
4771 24, 25, 26, 0, 0, 214, 0, 0, 0, 0,
4772 0, 0, 286, 0, 0, 32, 33, 34, 35, 36,
4773 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4774 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4775 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4776 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4777 0, 0, 0, 0, 0, 1207, 0, 0, 217, 54,
4778 0, 55, 56, 23, 24, 25, 26, 58, 59, 60,
4779 61, 62, 63, 64, 65, 66, 0, 0, 0, 32,
4780 33, 34, 1055, 0, 0, 0, 1056, 0, 0, 41,
4781 42, 43, 44, 45, 0, 0, 0, 0, 0, 0,
4782 0, 0, 0, 0, 288, 0, 0, 0, 0, 0,
4783 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4784 0, 1058, 1059, 0, 0, 0, 680, 618, 0, 1060,
4785 681, 0, 1061, 0, 0, 1062, 1063, 0, 1064, 0,
4786 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4787 175, 176, 177, 178, 179, 180, 181, 182, 183, 0,
4788 0, 184, 185, 0, 0, 0, 0, 186, 187, 188,
4789 189, 1066, 0, 0, 0, 0, 0, 0, 288, 0,
4790 0, 0, 190, 191, 0, 0, 0, 0, 0, 0,
4791 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4792 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4793 0, 0, 192, 193, 194, 195, 196, 197, 198, 199,
4794 200, 201, 0, 202, 203, 683, 628, 0, 0, 684,
4795 204, 241, 0, 0, 0, 0, 0, 0, 0, 0,
4796 0, 0, 0, 0, 0, 0, 0, 0, 0, 175,
4797 176, 177, 178, 179, 180, 181, 182, 183, 0, 0,
4798 184, 185, 0, 0, 0, 0, 186, 187, 188, 189,
4799 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4800 0, 190, 191, 0, 0, 0, 0, 0, 0, 0,
4801 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4803 0, 192, 193, 194, 195, 196, 197, 198, 199, 200,
4804 201, 0, 202, 203, 680, 618, 0, 0, 698, 204,
4805 241, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4806 0, 0, 0, 0, 0, 0, 0, 0, 175, 176,
4807 177, 178, 179, 180, 181, 182, 183, 0, 0, 184,
4808 185, 0, 0, 0, 0, 186, 187, 188, 189, 0,
4809 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4810 190, 191, 0, 0, 0, 0, 0, 0, 0, 0,
4811 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4813 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
4814 0, 202, 203, 709, 618, 0, 0, 710, 204, 241,
4815 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4816 0, 0, 0, 0, 0, 0, 0, 175, 176, 177,
4817 178, 179, 180, 181, 182, 183, 0, 0, 184, 185,
4818 0, 0, 0, 0, 186, 187, 188, 189, 0, 0,
4819 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4820 191, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4821 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4822 0, 0, 0, 0, 0, 0, 0, 0, 0, 192,
4823 193, 194, 195, 196, 197, 198, 199, 200, 201, 0,
4824 202, 203, 712, 628, 0, 0, 713, 204, 241, 0,
4825 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4826 0, 0, 0, 0, 0, 0, 175, 176, 177, 178,
4827 179, 180, 181, 182, 183, 0, 0, 184, 185, 0,
4828 0, 0, 0, 186, 187, 188, 189, 0, 0, 0,
4829 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4830 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4832 0, 0, 0, 0, 0, 0, 0, 0, 192, 193,
4833 194, 195, 196, 197, 198, 199, 200, 201, 0, 202,
4834 203, 825, 618, 0, 0, 826, 204, 241, 0, 0,
4835 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4836 0, 0, 0, 0, 0, 175, 176, 177, 178, 179,
4837 180, 181, 182, 183, 0, 0, 184, 185, 0, 0,
4838 0, 0, 186, 187, 188, 189, 0, 0, 0, 0,
4839 0, 0, 0, 0, 0, 0, 0, 190, 191, 0,
4840 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4841 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4842 0, 0, 0, 0, 0, 0, 0, 192, 193, 194,
4843 195, 196, 197, 198, 199, 200, 201, 0, 202, 203,
4844 828, 628, 0, 0, 829, 204, 241, 0, 0, 0,
4845 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4846 0, 0, 0, 0, 175, 176, 177, 178, 179, 180,
4847 181, 182, 183, 0, 0, 184, 185, 0, 0, 0,
4848 0, 186, 187, 188, 189, 0, 0, 0, 0, 0,
4849 0, 0, 0, 0, 0, 0, 190, 191, 0, 0,
4850 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4851 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4852 0, 0, 0, 0, 0, 0, 192, 193, 194, 195,
4853 196, 197, 198, 199, 200, 201, 0, 202, 203, 834,
4854 618, 0, 0, 835, 204, 241, 0, 0, 0, 0,
4855 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4856 0, 0, 0, 175, 176, 177, 178, 179, 180, 181,
4857 182, 183, 0, 0, 184, 185, 0, 0, 0, 0,
4858 186, 187, 188, 189, 0, 0, 0, 0, 0, 0,
4859 0, 0, 0, 0, 0, 190, 191, 0, 0, 0,
4860 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4861 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4862 0, 0, 0, 0, 0, 192, 193, 194, 195, 196,
4863 197, 198, 199, 200, 201, 0, 202, 203, 665, 628,
4864 0, 0, 666, 204, 241, 0, 0, 0, 0, 0,
4865 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4866 0, 0, 175, 176, 177, 178, 179, 180, 181, 182,
4867 183, 0, 0, 184, 185, 0, 0, 0, 0, 186,
4868 187, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4869 0, 0, 0, 0, 190, 191, 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, 0, 192, 193, 194, 195, 196, 197,
4873 198, 199, 200, 201, 0, 202, 203, 996, 618, 0,
4874 0, 997, 204, 241, 0, 0, 0, 0, 0, 0,
4875 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4876 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
4877 0, 0, 184, 185, 0, 0, 0, 0, 186, 187,
4878 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4879 0, 0, 0, 190, 191, 0, 0, 0, 0, 0,
4880 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4881 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4882 0, 0, 0, 192, 193, 194, 195, 196, 197, 198,
4883 199, 200, 201, 0, 202, 203, 999, 628, 0, 0,
4884 1000, 204, 241, 0, 0, 0, 0, 0, 0, 0,
4885 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4886 175, 176, 177, 178, 179, 180, 181, 182, 183, 0,
4887 0, 184, 185, 0, 0, 0, 0, 186, 187, 188,
4888 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4889 0, 0, 190, 191, 0, 0, 0, 0, 0, 0,
4890 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4891 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4892 0, 0, 192, 193, 194, 195, 196, 197, 198, 199,
4893 200, 201, 0, 202, 203, 1292, 618, 0, 0, 1293,
4894 204, 241, 0, 0, 0, 0, 0, 0, 0, 0,
4895 0, 0, 0, 0, 0, 0, 0, 0, 0, 175,
4896 176, 177, 178, 179, 180, 181, 182, 183, 0, 0,
4897 184, 185, 0, 0, 0, 0, 186, 187, 188, 189,
4898 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4899 0, 190, 191, 0, 0, 0, 0, 0, 0, 0,
4900 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4901 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4902 0, 192, 193, 194, 195, 196, 197, 198, 199, 200,
4903 201, 0, 202, 203, 1295, 628, 0, 0, 1296, 204,
4904 241, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4905 0, 0, 0, 0, 0, 0, 0, 0, 175, 176,
4906 177, 178, 179, 180, 181, 182, 183, 0, 0, 184,
4907 185, 0, 0, 0, 0, 186, 187, 188, 189, 0,
4908 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4909 190, 191, 0, 0, 0, 0, 0, 0, 0, 0,
4910 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4911 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4912 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
4913 0, 202, 203, 1309, 618, 0, 0, 1310, 204, 241,
4914 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4915 0, 0, 0, 0, 0, 0, 0, 175, 176, 177,
4916 178, 179, 180, 181, 182, 183, 0, 0, 184, 185,
4917 0, 0, 0, 0, 186, 187, 188, 189, 0, 0,
4918 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4919 191, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4920 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4921 0, 0, 0, 0, 0, 0, 0, 0, 0, 192,
4922 193, 194, 195, 196, 197, 198, 199, 200, 201, 0,
4923 202, 203, 665, 628, 0, 0, 666, 204, 241, 0,
4924 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4925 0, 0, 0, 0, 0, 0, 175, 176, 177, 178,
4926 179, 180, 181, 182, 183, 0, 0, 184, 185, 0,
4927 0, 0, 0, 186, 187, 188, 189, 0, 0, 0,
4928 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4929 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4930 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4931 0, 0, 0, 0, 0, 0, 0, 0, 192, 193,
4932 194, 195, 196, 197, 198, 199, 200, 201, 0, 202,
4933 203, 0, 0, 0, 0, 0, 204
4934};
4935
4936static const yytype_int16 yycheck[] =
4937{
4938 2, 92, 16, 17, 60, 22, 95, 59, 68, 98,
4939 8, 2, 384, 53, 54, 106, 408, 328, 28, 16,
4940 17, 332, 14, 15, 813, 107, 238, 390, 16, 17,
4941 28, 59, 563, 8, 574, 97, 745, 577, 383, 590,
4942 385, 328, 81, 742, 57, 332, 53, 332, 71, 86,
4943 451, 53, 54, 28, 241, 57, 304, 305, 55, 56,
4944 459, 59, 16, 17, 81, 104, 576, 55, 94, 95,
4945 451, 98, 98, 86, 102, 98, 576, 915, 459, 820,
4946 505, 73, 745, 455, 86, 67, 99, 100, 101, 103,
4947 435, 492, 64, 65, 66, 0, 495, 99, 100, 101,
4948 102, 57, 580, 280, 102, 2, 103, 284, 749, 454,
4949 605, 456, 878, 880, 71, 103, 25, 1002, 658, 78,
4950 37, 38, 13, 26, 1211, 742, 69, 29, 1152, 269,
4951 31, 793, 749, 66, 13, 507, 101, 482, 25, 66,
4952 78, 0, 233, 98, 1168, 1045, 110, 1001, 1002, 103,
4953 749, 1045, 25, 752, 97, 98, 53, 54, 55, 56,
4954 579, 25, 587, 508, 583, 221, 10, 153, 26, 100,
4955 261, 100, 135, 673, 668, 669, 162, 217, 142, 799,
4956 77, 78, 13, 66, 1152, 100, 1024, 807, 69, 122,
4957 123, 25, 34, 120, 157, 122, 123, 162, 1166, 154,
4958 25, 13, 157, 294, 135, 13, 135, 347, 100, 545,
4959 52, 154, 162, 13, 13, 217, 121, 98, 1305, 245,
4960 135, 247, 124, 1061, 68, 1063, 1111, 241, 161, 269,
4961 244, 13, 321, 322, 323, 324, 13, 120, 1132, 25,
4962 155, 258, 259, 135, 271, 162, 155, 244, 271, 152,
4963 252, 13, 289, 241, 466, 1279, 244, 1111, 25, 1283,
4964 1284, 252, 269, 655, 155, 224, 13, 269, 155, 160,
4965 1037, 162, 1038, 521, 646, 523, 289, 939, 157, 25,
4966 979, 160, 155, 162, 656, 223, 224, 289, 689, 25,
4967 244, 155, 691, 833, 152, 321, 322, 323, 324, 157,
4968 326, 327, 647, 392, 1204, 1329, 288, 347, 689, 400,
4969 691, 1211, 657, 1213, 271, 1169, 1284, 319, 407, 797,
4970 217, 155, 1176, 1177, 819, 1114, 223, 224, 319, 160,
4971 155, 162, 291, 974, 231, 348, 1174, 1175, 1001, 1002,
4972 347, 238, 1001, 1002, 241, 347, 348, 27, 160, 250,
4973 162, 391, 160, 393, 162, 252, 781, 974, 157, 890,
4974 160, 160, 162, 162, 1001, 1002, 392, 394, 385, 155,
4975 384, 394, 269, 1114, 152, 974, 927, 976, 160, 1196,
4976 162, 407, 981, 160, 386, 162, 896, 385, 155, 391,
4977 157, 393, 348, 729, 730, 155, 896, 66, 160, 135,
4978 162, 802, 162, 1062, 78, 1305, 1062, 1307, 948, 155,
4979 101, 157, 1312, 160, 1314, 162, 69, 431, 100, 155,
4980 1079, 802, 158, 917, 918, 101, 162, 1281, 1045, 923,
4981 924, 742, 15, 159, 431, 1335, 162, 435, 749, 456,
4982 69, 455, 25, 431, 345, 98, 1045, 69, 1111, 350,
4983 347, 120, 1111, 135, 451, 1176, 1177, 957, 456, 160,
4984 27, 162, 29, 100, 155, 482, 476, 679, 505, 98,
4985 718, 145, 146, 147, 1111, 723, 98, 431, 476, 155,
4986 160, 34, 162, 56, 482, 1302, 488, 384, 528, 386,
4987 1149, 508, 505, 507, 391, 492, 393, 161, 135, 52,
4988 1209, 476, 689, 505, 905, 1204, 1169, 1166, 28, 1049,
4989 508, 25, 100, 1176, 1177, 1009, 100, 1176, 1177, 58,
4990 1176, 1177, 37, 38, 155, 585, 528, 1126, 100, 706,
4991 590, 162, 534, 135, 1323, 69, 274, 438, 439, 78,
4992 912, 590, 878, 534, 880, 52, 1209, 135, 449, 56,
4993 587, 135, 575, 383, 865, 385, 457, 458, 455, 573,
4994 1281, 155, 576, 135, 98, 964, 911, 464, 913, 466,
4995 109, 110, 574, 157, 587, 577, 477, 25, 865, 135,
4996 865, 944, 483, 964, 623, 587, 648, 1204, 25, 113,
4997 1058, 1059, 100, 632, 1211, 100, 636, 585, 638, 1130,
4998 100, 155, 590, 142, 100, 435, 623, 1138, 668, 669,
4999 507, 100, 1211, 1312, 1213, 632, 584, 640, 1281, 668,
5000 669, 135, 155, 15, 454, 17, 456, 135, 667, 162,
5001 647, 528, 646, 659, 636, 135, 638, 56, 69, 135,
5002 657, 155, 656, 157, 158, 69, 135, 859, 162, 647,
5003 667, 481, 482, 157, 551, 966, 658, 1197, 1021, 657,
5004 670, 100, 69, 974, 716, 633, 563, 98, 1060, 695,
5005 707, 639, 670, 641, 98, 1045, 506, 574, 508, 966,
5006 577, 966, 699, 700, 157, 14, 15, 135, 1305, 162,
5007 97, 98, 689, 431, 707, 670, 135, 135, 135, 790,
5008 101, 1037, 1038, 1171, 1172, 707, 1305, 155, 1307, 78,
5009 158, 155, 279, 280, 162, 1314, 155, 284, 155, 286,
5010 78, 158, 714, 26, 462, 162, 69, 465, 69, 626,
5011 135, 469, 100, 634, 1045, 632, 1335, 95, 96, 636,
5012 1103, 638, 1273, 832, 781, 100, 718, 485, 720, 646,
5013 155, 723, 724, 66, 97, 98, 97, 98, 26, 656,
5014 842, 658, 69, 157, 66, 155, 69, 100, 781, 69,
5015 667, 89, 90, 157, 143, 144, 145, 146, 147, 781,
5016 135, 1173, 679, 157, 142, 143, 144, 145, 146, 147,
5017 830, 98, 760, 52, 97, 98, 764, 56, 98, 766,
5018 155, 69, 135, 700, 771, 802, 832, 120, 831, 122,
5019 123, 154, 840, 154, 157, 645, 554, 647, 120, 158,
5020 122, 123, 155, 125, 66, 655, 1189, 657, 830, 97,
5021 98, 833, 69, 26, 1204, 568, 69, 570, 69, 1209,
5022 78, 1211, 840, 1213, 933, 135, 736, 159, 586, 152,
5023 56, 154, 153, 821, 157, 745, 824, 917, 918, 157,
5024 97, 98, 69, 923, 924, 98, 97, 98, 917, 918,
5025 838, 40, 41, 155, 923, 924, 69, 54, 1250, 78,
5026 122, 123, 896, 125, 152, 161, 154, 64, 65, 157,
5027 97, 98, 932, 1204, 795, 796, 913, 158, 912, 69,
5028 1211, 162, 803, 804, 97, 98, 1251, 933, 100, 901,
5029 1166, 903, 69, 810, 811, 913, 813, 154, 66, 67,
5030 1176, 1177, 69, 154, 66, 663, 949, 97, 98, 969,
5031 932, 290, 291, 830, 994, 1305, 833, 1307, 152, 927,
5032 97, 98, 1312, 135, 1314, 994, 948, 154, 69, 1009,
5033 97, 98, 853, 854, 135, 856, 857, 69, 682, 152,
5034 1009, 154, 859, 155, 157, 1335, 934, 969, 66, 937,
5035 135, 135, 940, 107, 122, 123, 97, 98, 120, 947,
5036 122, 123, 950, 69, 154, 97, 98, 711, 1028, 155,
5037 992, 993, 160, 890, 1305, 733, 66, 154, 56, 1001,
5038 1002, 992, 993, 69, 25, 135, 1046, 154, 909, 1065,
5039 139, 97, 98, 135, 1066, 912, 58, 69, 155, 66,
5040 69, 922, 120, 155, 122, 123, 1028, 125, 153, 100,
5041 927, 97, 98, 154, 1279, 932, 78, 155, 1283, 606,
5042 83, 84, 154, 100, 1046, 97, 98, 1049, 97, 98,
5043 120, 948, 122, 123, 158, 158, 1058, 1059, 625, 960,
5044 1062, 155, 1030, 155, 135, 155, 1106, 109, 154, 1109,
5045 1110, 113, 969, 120, 1163, 122, 123, 1079, 135, 1119,
5046 135, 911, 155, 913, 155, 52, 155, 155, 154, 1102,
5047 1181, 988, 989, 52, 153, 138, 139, 13, 155, 155,
5048 1102, 839, 154, 827, 1106, 154, 25, 1109, 1110, 1111,
5049 155, 17, 153, 837, 44, 682, 155, 1119, 155, 1016,
5050 858, 1018, 860, 1136, 135, 153, 44, 2, 155, 155,
5051 52, 1028, 54, 55, 1136, 57, 44, 1163, 876, 706,
5052 44, 16, 17, 135, 711, 1185, 137, 1149, 8, 1046,
5053 1152, 159, 1049, 886, 887, 1045, 15, 155, 891, 155,
5054 893, 155, 895, 52, 1166, 1167, 1168, 1256, 1257, 1171,
5055 1172, 155, 155, 155, 1176, 1177, 1232, 153, 53, 54,
5056 102, 155, 57, 1185, 155, 140, 54, 55, 755, 57,
5057 1203, 155, 101, 68, 9, 1197, 64, 65, 78, 155,
5058 52, 1203, 52, 140, 54, 55, 56, 57, 155, 1106,
5059 155, 86, 1109, 1110, 158, 95, 96, 1114, 160, 94,
5060 95, 56, 1119, 98, 99, 100, 101, 140, 103, 155,
5061 1256, 1257, 155, 1130, 1251, 155, 1250, 897, 898, 153,
5062 52, 1138, 54, 55, 56, 57, 906, 2, 908, 52,
5063 910, 56, 102, 1251, 155, 155, 1157, 101, 108, 1299,
5064 827, 16, 17, 143, 144, 145, 146, 147, 153, 140,
5065 837, 1140, 1141, 56, 998, 157, 155, 1279, 155, 155,
5066 252, 1283, 1284, 155, 851, 668, 669, 157, 1185, 155,
5067 102, 1188, 155, 155, 1262, 319, 484, 1299, 53, 54,
5068 1197, 155, 685, 686, 155, 488, 1039, 1040, 1041, 1042,
5069 155, 840, 99, 68, 1204, 101, 90, 477, 701, 1209,
5070 667, 1211, 928, 1213, 1134, 1188, 52, 1329, 54, 55,
5071 56, 57, 52, 729, 54, 55, 56, 57, 1062, 94,
5072 95, 878, 217, 98, 59, 60, 61, 62, 103, 1045,
5073 989, 1302, 843, 1250, 343, 1252, 1253, 40, 41, 42,
5074 43, 44, 1323, 1167, 1169, 1253, 241, 1169, 1165, 244,
5075 245, 110, 247, 523, 1252, 102, 1273, 252, 745, 742,
5076 215, 1209, 1204, 218, 219, 220, 1318, -1, -1, -1,
5077 -1, -1, -1, -1, 269, -1, -1, -1, -1, 1268,
5078 1269, -1, 1299, -1, -1, 1274, -1, 1276, 1277, -1,
5079 -1, -1, -1, -1, 289, 1305, -1, 1307, -1, 1249,
5080 -1, 1251, 1312, -1, 1314, -1, 1323, 1151, -1, -1,
5081 1154, 998, -1, -1, -1, -1, -1, 1175, -1, -1,
5082 -1, 1271, -1, -1, 319, 1335, 321, 322, 323, 324,
5083 1174, 326, 327, -1, -1, -1, 1325, 1326, 1327, 1328,
5084 -1, -1, 217, -1, -1, -1, 1199, 1034, -1, -1,
5085 1339, -1, 347, 348, -1, -1, -1, 1215, 1045, -1,
5086 -1, -1, -1, -1, -1, -1, 241, 1225, -1, 244,
5087 245, -1, 247, -1, -1, 1062, 1063, 252, -1, -1,
5088 -1, -1, -1, -1, 1242, 1243, 1244, -1, -1, 384,
5089 -1, 386, -1, -1, 269, -1, 391, 392, 393, -1,
5090 -1, 1245, 1246, 1247, 52, -1, 54, 55, 56, 57,
5091 58, -1, 407, -1, 917, 918, 78, -1, -1, -1,
5092 923, 924, -1, -1, -1, -1, -1, -1, -1, -1,
5093 78, -1, -1, 95, 96, -1, 431, -1, -1, -1,
5094 -1, -1, -1, -1, 319, 1132, 321, 322, 323, 324,
5095 1294, 326, 327, -1, 102, 958, 959, -1, 961, 962,
5096 455, 109, 110, -1, 1151, -1, -1, 1154, -1, -1,
5097 -1, 52, 347, 54, 55, 56, 57, 58, 140, 141,
5098 142, 143, 144, 145, 146, 147, -1, 1174, -1, -1,
5099 -1, -1, -1, 488, 142, 450, 451, 78, -1, -1,
5100 -1, -1, -1, -1, 459, -1, 1009, -1, -1, 384,
5101 505, 386, 507, -1, -1, -1, 391, 392, 393, -1,
5102 -1, 102, -1, -1, -1, -1, -1, 108, 109, 110,
5103 1033, -1, 407, 528, -1, -1, -1, 492, -1, 534,
5104 495, -1, -1, -1, -1, -1, -1, 52, -1, 54,
5105 55, 56, 57, 58, -1, -1, 431, -1, 1245, 1246,
5106 1247, 142, -1, -1, 145, -1, -1, -1, -1, -1,
5107 -1, -1, 1259, 78, -1, -1, -1, -1, 573, 574,
5108 455, 576, 577, -1, -1, -1, -1, 92, -1, -1,
5109 585, -1, 587, -1, -1, 590, -1, 102, -1, 33,
5110 34, 35, 36, 108, 109, 110, 561, 1294, -1, -1,
5111 -1, -1, -1, 488, -1, 49, 50, 51, 52, -1,
5112 -1, -1, 56, -1, -1, 59, 60, 61, 62, 63,
5113 585, 1318, 507, -1, -1, 590, -1, 142, -1, -1,
5114 145, 636, -1, 638, -1, -1, -1, -1, -1, -1,
5115 -1, 646, 157, 528, -1, -1, -1, 91, 92, 534,
5116 -1, 656, -1, 658, 659, 99, -1, -1, 102, -1,
5117 -1, 105, 106, 668, 669, -1, -1, 111, 112, 113,
5118 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5119 -1, -1, -1, -1, -1, -1, -1, -1, 573, 574,
5120 695, 576, 577, -1, -1, -1, -1, 141, -1, -1,
5121 585, -1, 707, -1, 148, 590, 671, -1, -1, -1,
5122 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5123 -1, -1, 0, -1, 689, -1, 691, -1, -1, -1,
5124 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5125 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
5126 -1, 636, -1, 638, -1, 2, -1, -1, -1, 37,
5127 38, 646, 40, 41, 42, 43, 44, -1, -1, 16,
5128 17, 656, -1, 658, 659, 740, 781, -1, -1, -1,
5129 -1, -1, -1, 668, 669, -1, -1, -1, -1, -1,
5130 68, 69, -1, -1, -1, -1, 52, -1, 54, 55,
5131 56, 57, 58, -1, -1, -1, 53, 54, 773, -1,
5132 695, -1, -1, -1, -1, -1, -1, -1, -1, 97,
5133 98, 68, 78, -1, -1, 830, -1, 832, 833, -1,
5134 -1, -1, -1, -1, -1, -1, -1, 802, -1, 25,
5135 -1, -1, -1, 121, -1, -1, 102, 94, 95, -1,
5136 -1, 98, 108, 109, 110, -1, 103, -1, 823, -1,
5137 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5138 -1, -1, -1, -1, 152, 153, -1, -1, -1, 157,
5139 158, -1, 160, -1, 162, -1, 142, -1, -1, 145,
5140 -1, 896, 78, 79, 80, 81, 82, 83, 84, 85,
5141 86, 87, 88, 89, 90, -1, 162, 912, -1, 95,
5142 96, -1, 917, 918, -1, 101, -1, -1, 923, 924,
5143 -1, -1, -1, -1, -1, -1, -1, 932, 933, -1,
5144 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5145 905, -1, -1, 948, -1, 830, -1, 832, 833, -1,
5146 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5147 146, 147, 927, -1, 969, -1, -1, -1, -1, -1,
5148 217, -1, -1, -1, -1, -1, -1, 942, -1, -1,
5149 -1, -1, -1, -1, -1, -1, -1, 992, 993, 994,
5150 -1, -1, -1, -1, 241, -1, -1, 244, 245, 964,
5151 247, -1, -1, -1, 1009, 252, -1, -1, -1, -1,
5152 -1, 896, -1, -1, -1, -1, -1, -1, -1, -1,
5153 -1, -1, 269, 1028, -1, 990, -1, 912, -1, -1,
5154 -1, -1, 917, 918, -1, -1, -1, -1, 923, 924,
5155 -1, 1046, -1, -1, 1049, -1, -1, 932, 933, -1,
5156 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5157 -1, -1, 1027, 948, -1, -1, -1, -1, -1, -1,
5158 -1, -1, 319, -1, 321, 322, 323, 324, -1, 326,
5159 327, -1, -1, -1, 969, -1, -1, -1, -1, -1,
5160 -1, -1, 1001, 1002, -1, -1, -1, 1102, -1, -1,
5161 347, 1106, -1, -1, 1109, 1110, -1, 992, 993, 994,
5162 -1, -1, -1, -1, 1119, -1, 52, -1, 54, 55,
5163 56, 57, 58, -1, 1009, -1, -1, -1, -1, -1,
5164 -1, 1136, -1, -1, -1, -1, -1, 384, -1, 386,
5165 -1, -1, 78, 1028, 391, 392, 393, 1112, -1, 1058,
5166 1059, -1, -1, 1062, -1, -1, 92, -1, 1163, -1,
5167 407, 1046, -1, -1, 1049, -1, 102, -1, -1, -1,
5168 1079, -1, 108, 109, 110, -1, -1, -1, -1, -1,
5169 1185, -1, -1, -1, 431, -1, -1, -1, -1, -1,
5170 -1, -1, 1197, -1, -1, -1, -1, -1, 1203, -1,
5171 -1, -1, 1111, -1, -1, -1, 142, -1, 455, 145,
5172 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5173 -1, 1106, -1, -1, 1109, 1110, -1, -1, -1, -1,
5174 -1, -1, -1, -1, 1119, -1, -1, -1, -1, 2,
5175 1149, 488, -1, 1152, -1, 1250, -1, -1, -1, -1,
5176 -1, 1256, 1257, 16, 17, -1, -1, 1166, 1167, 1168,
5177 507, -1, 1171, 1172, -1, -1, -1, 1176, 1177, -1,
5178 -1, -1, -1, -1, -1, -1, -1, -1, 1163, -1,
5179 -1, 528, -1, -1, -1, -1, -1, 534, -1, -1,
5180 53, 54, -1, -1, 1299, -1, -1, -1, 1001, 1002,
5181 1185, -1, -1, -1, -1, 68, -1, -1, -1, -1,
5182 -1, -1, 1197, -1, -1, -1, -1, -1, -1, -1,
5183 -1, -1, -1, -1, -1, -1, 573, 574, -1, 576,
5184 577, 94, 95, -1, -1, 98, -1, -1, 585, -1,
5185 103, -1, -1, 590, -1, -1, -1, -1, -1, -1,
5186 -1, 33, 34, 35, 36, 1058, 1059, -1, -1, 1062,
5187 -1, -1, -1, -1, -1, 1250, -1, 49, 50, 51,
5188 1279, 1256, 1257, -1, 1283, 1284, 1079, 59, 60, 61,
5189 62, 63, -1, -1, -1, -1, -1, -1, 2, 636,
5190 -1, 638, -1, -1, -1, -1, -1, -1, -1, 646,
5191 -1, 52, -1, 54, 55, 56, 57, 58, 1111, 656,
5192 -1, 658, 659, -1, 1299, -1, -1, -1, -1, -1,
5193 1329, 668, 669, -1, -1, -1, -1, 78, -1, 111,
5194 112, 113, 114, 115, 116, 117, 118, 119, -1, 53,
5195 54, 92, -1, 57, -1, -1, 1149, -1, 695, 1152,
5196 -1, 102, -1, -1, 217, -1, -1, -1, 109, 110,
5197 -1, -1, -1, 1166, 1167, 1168, 148, -1, 1171, 1172,
5198 -1, -1, 86, 1176, 1177, -1, -1, -1, 241, -1,
5199 -1, 244, 245, -1, 247, 99, 100, 101, -1, 252,
5200 -1, 142, -1, -1, -1, 44, -1, -1, -1, -1,
5201 -1, -1, -1, -1, -1, -1, 269, -1, -1, -1,
5202 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5203 -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
5204 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
5205 89, 90, -1, -1, -1, -1, 95, 96, -1, -1,
5206 -1, -1, -1, -1, -1, -1, 319, -1, 321, 322,
5207 323, 324, -1, 326, 327, -1, -1, -1, -1, -1,
5208 -1, -1, -1, -1, -1, -1, 1279, -1, -1, -1,
5209 1283, 1284, -1, 830, 347, 832, 833, 136, -1, 138,
5210 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
5211 -1, -1, -1, 217, -1, -1, 155, -1, -1, -1,
5212 -1, 2, -1, -1, -1, -1, -1, -1, -1, -1,
5213 -1, 384, -1, 386, -1, -1, 1329, -1, 391, 392,
5214 393, -1, -1, -1, -1, -1, -1, -1, 252, -1,
5215 -1, -1, -1, -1, 407, -1, -1, -1, -1, 896,
5216 -1, -1, -1, -1, -1, 269, -1, -1, 1001, 1002,
5217 -1, -1, 53, 54, -1, 912, 57, -1, 431, -1,
5218 917, 918, -1, -1, -1, 289, 923, 924, -1, -1,
5219 -1, -1, -1, -1, -1, 932, 933, -1, -1, -1,
5220 -1, -1, 455, -1, -1, 86, -1, -1, -1, -1,
5221 -1, 948, -1, -1, -1, 319, -1, -1, 99, 100,
5222 101, -1, -1, -1, -1, 1058, 1059, -1, -1, 1062,
5223 -1, -1, 969, -1, -1, 488, -1, -1, -1, -1,
5224 -1, -1, -1, 347, 348, -1, 1079, 1001, 1002, -1,
5225 -1, -1, -1, -1, 507, 992, 993, 994, -1, -1,
5226 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5227 -1, -1, 1009, -1, -1, 528, -1, -1, 1111, -1,
5228 -1, 534, 386, -1, -1, -1, -1, 391, -1, 393,
5229 -1, 1028, -1, -1, -1, -1, -1, -1, -1, -1,
5230 -1, -1, -1, -1, 1058, 1059, -1, -1, 1062, 1046,
5231 -1, -1, 1049, -1, -1, -1, 1149, -1, -1, 1152,
5232 573, 574, -1, 576, 577, 1079, -1, -1, -1, -1,
5233 -1, -1, 585, 1166, 1167, 1168, 217, 590, 1171, 1172,
5234 -1, -1, -1, 1176, 1177, -1, -1, -1, -1, -1,
5235 -1, -1, -1, -1, -1, -1, -1, 1111, -1, -1,
5236 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1106,
5237 -1, 252, 1109, 1110, -1, -1, -1, -1, -1, -1,
5238 -1, -1, 1119, 636, 488, 638, -1, -1, 269, -1,
5239 -1, -1, -1, 646, -1, 1149, -1, -1, 1152, -1,
5240 -1, 505, -1, 656, -1, 658, 659, -1, 289, -1,
5241 -1, -1, 1166, 1167, 1168, 668, 669, 1171, 1172, -1,
5242 -1, -1, 1176, 1177, 528, -1, 1163, -1, -1, -1,
5243 534, -1, -1, -1, -1, -1, -1, -1, 319, -1,
5244 -1, -1, 695, -1, -1, -1, 1279, -1, 1185, -1,
5245 1283, 1284, -1, -1, -1, -1, -1, -1, -1, -1,
5246 1197, -1, -1, -1, -1, -1, 347, 348, -1, -1,
5247 574, -1, -1, 577, -1, -1, -1, -1, -1, -1,
5248 -1, -1, -1, 587, 2, -1, 590, -1, -1, -1,
5249 -1, -1, -1, -1, -1, -1, 1329, -1, -1, -1,
5250 -1, -1, -1, -1, -1, 386, -1, -1, -1, -1,
5251 391, -1, 393, 1250, -1, -1, -1, -1, -1, 1256,
5252 1257, -1, -1, -1, -1, 1279, -1, -1, -1, 1283,
5253 1284, -1, 636, -1, 638, 53, 54, -1, -1, 57,
5254 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5255 -1, -1, -1, -1, 658, -1, -1, -1, -1, -1,
5256 -1, -1, 1299, -1, 668, 669, -1, -1, 86, -1,
5257 -1, -1, -1, -1, -1, 1329, -1, 830, -1, 832,
5258 833, 99, 100, 101, 2, -1, -1, -1, -1, -1,
5259 -1, -1, -1, -1, 1001, 1002, -1, -1, -1, -1,
5260 -1, -1, -1, 707, -1, -1, -1, 488, -1, -1,
5261 -1, -1, 716, -1, -1, -1, -1, -1, -1, -1,
5262 -1, -1, -1, -1, 505, -1, -1, -1, -1, -1,
5263 -1, -1, -1, -1, -1, 53, 54, -1, -1, 57,
5264 -1, -1, -1, 896, -1, -1, -1, 528, -1, -1,
5265 -1, 1058, 1059, 534, -1, 1062, -1, -1, -1, 912,
5266 -1, -1, -1, -1, 917, 918, -1, -1, 86, -1,
5267 923, 924, 1079, -1, -1, -1, -1, 781, -1, 932,
5268 933, 99, 100, 101, 102, -1, -1, -1, -1, -1,
5269 -1, -1, -1, 574, -1, 948, 577, -1, -1, 217,
5270 -1, -1, -1, -1, 1111, -1, 587, -1, -1, 590,
5271 -1, -1, -1, -1, -1, -1, 969, -1, -1, -1,
5272 -1, -1, -1, -1, -1, -1, 830, -1, -1, 833,
5273 -1, -1, -1, -1, 252, -1, -1, -1, -1, 992,
5274 993, 994, 1149, -1, -1, 1152, -1, -1, -1, -1,
5275 -1, 269, -1, -1, -1, 636, 1009, 638, -1, 1166,
5276 1167, 1168, -1, -1, 1171, 1172, -1, -1, -1, 1176,
5277 1177, 289, -1, -1, -1, 1028, -1, 658, -1, -1,
5278 -1, -1, -1, -1, -1, -1, -1, 668, 669, -1,
5279 -1, -1, -1, 1046, -1, -1, 1049, -1, -1, 217,
5280 -1, 319, -1, -1, -1, -1, -1, -1, -1, -1,
5281 -1, -1, -1, 917, 918, -1, -1, -1, -1, 923,
5282 924, -1, -1, -1, -1, -1, 707, -1, 932, 347,
5283 348, -1, -1, -1, 252, -1, -1, -1, -1, -1,
5284 -1, -1, -1, -1, 948, -1, -1, -1, -1, -1,
5285 -1, 269, -1, 1106, -1, -1, 1109, 1110, -1, -1,
5286 -1, -1, -1, -1, -1, 969, 1119, -1, 386, -1,
5287 -1, 289, 1279, 391, -1, 393, 1283, 1284, -1, -1,
5288 -1, -1, -1, -1, -1, -1, -1, -1, 992, 993,
5289 994, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5290 781, 319, -1, -1, -1, 1009, -1, -1, -1, -1,
5291 1163, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5292 -1, -1, 1329, -1, 1028, -1, -1, -1, -1, 347,
5293 348, -1, 1185, -1, -1, -1, -1, 2, -1, -1,
5294 -1, -1, 1046, -1, 1197, 1049, -1, -1, -1, 830,
5295 -1, -1, 833, -1, -1, -1, -1, -1, -1, -1,
5296 -1, -1, -1, -1, -1, -1, 1001, 1002, 386, -1,
5297 488, -1, -1, 391, -1, 393, -1, -1, -1, -1,
5298 -1, -1, -1, -1, -1, -1, -1, 505, 53, 54,
5299 -1, -1, -1, -1, -1, -1, -1, 1250, 1102, -1,
5300 -1, -1, 1106, 1256, 1257, 1109, 1110, -1, -1, -1,
5301 528, -1, -1, -1, -1, 1119, 534, -1, -1, -1,
5302 -1, -1, -1, 1058, 1059, -1, -1, 1062, -1, -1,
5303 -1, -1, 1136, -1, 99, -1, 917, 918, -1, -1,
5304 -1, -1, 923, 924, 1079, -1, 1299, -1, -1, -1,
5305 -1, 932, -1, -1, -1, -1, 574, -1, -1, 577,
5306 -1, -1, -1, -1, -1, -1, -1, 948, -1, 587,
5307 488, -1, 590, -1, -1, -1, 1111, -1, -1, -1,
5308 -1, 1185, -1, -1, -1, -1, -1, 505, 969, -1,
5309 -1, -1, -1, 1197, -1, -1, -1, -1, -1, 1203,
5310 -1, -1, -1, -1, -1, 1001, 1002, -1, -1, -1,
5311 528, 992, 993, 994, 1149, -1, 534, 1152, 636, -1,
5312 638, -1, -1, -1, -1, -1, -1, -1, 1009, -1,
5313 -1, 1166, 1167, 1168, -1, -1, 1171, 1172, -1, -1,
5314 658, 1176, 1177, -1, -1, -1, -1, 1028, -1, -1,
5315 668, 669, 217, -1, 2, -1, 574, -1, -1, 577,
5316 -1, -1, 1058, 1059, -1, 1046, 1062, -1, 1049, 587,
5317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5318 -1, -1, -1, 1079, -1, -1, -1, 252, -1, 707,
5319 -1, -1, -1, -1, -1, 1299, -1, -1, -1, -1,
5320 -1, 1001, 1002, -1, 269, 53, 54, -1, -1, -1,
5321 -1, -1, -1, -1, -1, 1111, -1, -1, 636, -1,
5322 638, 1102, -1, -1, -1, 1106, -1, -1, 1109, 1110,
5323 -1, -1, -1, -1, -1, -1, -1, -1, 1119, -1,
5324 658, -1, -1, -1, 1279, -1, -1, -1, 1283, 1284,
5325 -1, -1, -1, 1149, 319, 1136, 1152, -1, 1058, 1059,
5326 -1, -1, 1062, 781, -1, -1, -1, -1, -1, -1,
5327 1166, 1167, 1168, -1, -1, 1171, 1172, -1, -1, 1079,
5328 1176, 1177, 347, 1001, 1002, -1, -1, -1, -1, 707,
5329 -1, -1, -1, -1, 1329, -1, -1, -1, -1, -1,
5330 -1, -1, -1, -1, 1185, -1, -1, -1, -1, -1,
5331 -1, 1111, 830, -1, -1, 833, 1197, -1, -1, -1,
5332 -1, 386, 1203, -1, -1, -1, 391, -1, 393, -1,
5333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5334 1058, 1059, -1, -1, 1062, -1, -1, -1, -1, 1149,
5335 -1, -1, 1152, -1, -1, -1, -1, -1, -1, -1,
5336 -1, 1079, -1, 781, -1, -1, 1166, 1167, 1168, 217,
5337 -1, 1171, 1172, -1, -1, -1, 1176, 1177, -1, -1,
5338 -1, -1, -1, 1279, -1, -1, -1, 1283, 1284, -1,
5339 -1, -1, -1, 1111, -1, -1, -1, -1, -1, 917,
5340 918, -1, -1, -1, 252, 923, 924, -1, -1, -1,
5341 -1, -1, 830, -1, 932, 833, -1, -1, 1299, -1,
5342 -1, 269, -1, 488, -1, -1, -1, -1, -1, -1,
5343 948, 1149, -1, 1329, 1152, -1, -1, -1, -1, -1,
5344 -1, -1, -1, -1, -1, -1, -1, -1, 1166, 1167,
5345 1168, 969, -1, 1171, 1172, -1, -1, -1, 1176, 1177,
5346 -1, -1, -1, 528, -1, -1, -1, -1, -1, 534,
5347 -1, 319, -1, -1, 992, 993, 994, -1, -1, 1279,
5348 -1, -1, -1, 1283, 1284, -1, -1, -1, -1, -1,
5349 -1, 1009, -1, -1, -1, -1, -1, -1, -1, 347,
5350 -1, -1, -1, -1, -1, -1, -1, -1, -1, 574,
5351 1028, -1, 577, -1, 932, -1, -1, -1, -1, -1,
5352 -1, -1, -1, -1, -1, 590, -1, -1, 1046, 1329,
5353 948, 1049, -1, -1, -1, -1, -1, -1, 386, -1,
5354 -1, -1, -1, 391, -1, 393, -1, -1, -1, -1,
5355 -1, 969, -1, -1, -1, -1, -1, -1, -1, -1,
5356 -1, 1279, -1, -1, -1, 1283, 1284, -1, -1, -1,
5357 -1, 636, -1, 638, 992, 993, -1, -1, -1, 33,
5358 34, 35, 36, -1, 1102, -1, -1, -1, 1106, -1,
5359 -1, 1109, 1110, 658, -1, 49, 50, 51, 52, -1,
5360 -1, 1119, 56, 668, 669, 59, 60, 61, 62, 63,
5361 1028, 1329, -1, -1, -1, -1, -1, -1, 1136, -1,
5362 -1, -1, -1, -1, -1, -1, -1, -1, 1046, -1,
5363 -1, 1049, -1, -1, -1, -1, -1, 91, 92, -1,
5364 488, -1, -1, -1, -1, 99, -1, -1, 102, -1,
5365 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5366 114, 115, 116, 117, 118, 119, -1, 1185, -1, -1,
5367 -1, -1, 16, 17, -1, -1, -1, -1, -1, 1197,
5368 528, -1, -1, -1, 1102, 1203, 534, 141, 1106, -1,
5369 -1, 1109, 1110, -1, 148, -1, -1, -1, -1, -1,
5370 -1, 1119, -1, -1, 48, 49, 50, 51, 162, -1,
5371 -1, 55, 56, -1, -1, -1, -1, -1, 1136, -1,
5372 -1, -1, -1, -1, 68, 69, 574, -1, -1, 577,
5373 -1, 78, 79, 80, 81, 82, 83, 84, 85, -1,
5374 87, 88, 590, -1, -1, -1, -1, -1, 95, 96,
5375 -1, -1, -1, -1, -1, -1, -1, -1, -1, 103,
5376 -1, -1, -1, -1, -1, 830, -1, 1185, 833, -1,
5377 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1197,
5378 -1, 1299, -1, -1, -1, 1203, -1, -1, 636, -1,
5379 638, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5380 147, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5381 658, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5382 668, 669, -1, -1, -1, -1, -1, -1, -1, -1,
5383 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5384 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5385 -1, -1, 917, 918, -1, -1, -1, -1, 923, 924,
5386 -1, -1, -1, -1, -1, -1, -1, 932, -1, -1,
5387 -1, 215, -1, -1, 218, 219, 220, -1, 222, -1,
5388 -1, 1299, -1, 948, -1, -1, -1, -1, -1, 33,
5389 34, 35, 36, -1, -1, -1, -1, 241, -1, -1,
5390 244, -1, -1, -1, 969, 49, 50, 51, 52, -1,
5391 -1, -1, 56, -1, 58, 59, 60, 61, 62, 63,
5392 -1, -1, -1, -1, -1, -1, -1, 992, 993, 994,
5393 -1, -1, -1, -1, 78, -1, -1, -1, -1, -1,
5394 -1, -1, -1, -1, 1009, -1, -1, 91, 92, -1,
5395 -1, -1, -1, -1, -1, 99, -1, -1, 102, -1,
5396 -1, 105, 106, 1028, 108, 109, -1, 111, 112, 113,
5397 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5398 -1, 1046, 830, -1, 1049, 833, -1, -1, -1, -1,
5399 -1, -1, -1, -1, -1, -1, -1, 141, -1, -1,
5400 -1, -1, -1, -1, 148, -1, -1, -1, 352, 353,
5401 354, 355, 356, -1, -1, 359, 360, 361, 362, 363,
5402 364, 365, 366, -1, 368, -1, -1, 371, 372, 373,
5403 374, 375, 376, 377, 378, 379, 380, 1102, -1, -1,
5404 384, 1106, -1, -1, 1109, 1110, -1, -1, -1, -1,
5405 -1, -1, -1, -1, 1119, -1, -1, -1, -1, -1,
5406 -1, -1, -1, -1, -1, -1, -1, -1, -1, 917,
5407 918, -1, -1, -1, -1, 923, 924, -1, -1, -1,
5408 -1, -1, -1, -1, 932, -1, -1, 431, -1, -1,
5409 -1, -1, -1, -1, -1, -1, -1, -1, 52, 53,
5410 948, -1, 56, -1, -1, -1, 450, 451, -1, -1,
5411 -1, 455, -1, -1, -1, 459, -1, 461, -1, -1,
5412 1185, 969, 76, 77, 78, 79, 80, 81, 82, 83,
5413 84, -1, 1197, 87, 88, 479, -1, -1, -1, 93,
5414 94, 95, 96, -1, 992, 993, 994, -1, 492, -1,
5415 -1, 495, -1, -1, 108, 109, -1, -1, -1, -1,
5416 -1, 1009, -1, 507, -1, -1, -1, -1, -1, -1,
5417 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5418 1028, 525, -1, -1, 138, 139, 140, 141, 142, 143,
5419 144, 145, 146, 147, -1, 149, 150, -1, 1046, -1,
5420 -1, 1049, 156, 157, -1, -1, -1, -1, -1, -1,
5421 -1, -1, -1, -1, -1, -1, -1, 561, 78, 79,
5422 80, 81, 82, 83, 84, -1, -1, 87, 88, 573,
5423 -1, -1, 576, -1, 1299, 95, 96, -1, -1, -1,
5424 -1, 585, -1, -1, -1, -1, 590, -1, -1, -1,
5425 -1, -1, -1, -1, -1, -1, -1, -1, 1106, -1,
5426 -1, 1109, 1110, -1, -1, -1, -1, -1, -1, -1,
5427 -1, 1119, -1, -1, -1, -1, -1, -1, 138, 139,
5428 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5429 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5430 -1, -1, 646, -1, -1, -1, -1, -1, -1, -1,
5431 -1, -1, 656, -1, -1, -1, -1, -1, -1, -1,
5432 -1, -1, -1, -1, 668, 669, -1, 671, 672, 673,
5433 674, -1, -1, -1, -1, -1, -1, 1185, -1, -1,
5434 -1, 685, 686, -1, -1, 689, -1, 691, -1, 1197,
5435 -1, -1, -1, -1, -1, -1, -1, 701, 0, 1,
5436 -1, 3, 4, 5, 6, 7, -1, -1, -1, 11,
5437 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5438 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
5439 32, 33, 34, 35, 36, -1, 740, 39, -1, -1,
5440 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5441 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5442 62, 63, 64, 65, -1, -1, -1, -1, -1, 773,
5443 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5444 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5445 92, 1299, -1, -1, -1, -1, -1, 99, 802, -1,
5446 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5447 112, 113, 114, 115, 116, 117, 118, 119, -1, 823,
5448 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5449 -1, -1, -1, -1, -1, -1, -1, -1, 52, 53,
5450 -1, -1, 56, -1, -1, -1, 148, 149, 150, -1,
5451 -1, -1, -1, -1, -1, -1, -1, -1, 160, -1,
5452 162, -1, 76, 77, 78, 79, 80, 81, 82, 83,
5453 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
5454 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
5455 -1, -1, 896, -1, 108, 109, -1, -1, -1, -1,
5456 -1, 905, -1, -1, -1, -1, -1, -1, 912, -1,
5457 -1, -1, 916, 917, 918, -1, -1, -1, -1, 923,
5458 924, -1, -1, 927, 138, 139, 140, 141, 142, 143,
5459 144, 145, 146, 147, -1, 149, 150, -1, 942, -1,
5460 -1, -1, 156, 157, -1, -1, -1, -1, -1, -1,
5461 -1, -1, -1, 957, 958, 959, -1, 961, 962, -1,
5462 964, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5464 -1, -1, 986, 987, -1, -1, 990, -1, -1, -1,
5465 994, 995, -1, -1, -1, -1, -1, -1, -1, -1,
5466 -1, -1, -1, -1, -1, 1009, -1, -1, -1, -1,
5467 -1, -1, -1, -1, 0, 1, -1, 3, 4, 5,
5468 6, 7, -1, 1027, -1, 11, 12, -1, -1, 1033,
5469 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5470 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
5471 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
5472 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5473 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5474 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5475 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5476 -1, -1, -1, -1, -1, 91, 92, -1, 1112, -1,
5477 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5478 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5479 116, 117, 118, 119, -1, 121, -1, -1, -1, -1,
5480 0, -1, -1, -1, -1, -1, -1, -1, 8, 9,
5481 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
5482 -1, -1, 148, 149, 150, 25, 26, 27, 28, 29,
5483 -1, -1, -1, -1, 160, -1, 162, 37, 38, -1,
5484 40, 41, 42, 43, 44, -1, -1, -1, 78, 79,
5485 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5486 90, -1, -1, -1, -1, 95, 96, -1, 68, 69,
5487 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5488 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5489 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5490 100, 101, -1, -1, -1, -1, 1250, 107, 138, 139,
5491 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5492 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
5493 -1, -1, -1, -1, -1, 135, 136, 137, 138, 139,
5494 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5495 -1, -1, 152, 153, 154, 155, 0, -1, 158, 159,
5496 160, -1, 162, -1, 8, 9, 10, -1, -1, 13,
5497 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5498 -1, 25, -1, 27, 28, 29, -1, -1, -1, -1,
5499 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5500 44, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5501 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5502 -1, 95, 96, -1, 68, 69, -1, -1, -1, -1,
5503 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5504 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5505 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
5506 -1, -1, 136, 107, 138, 139, 140, 141, 142, 143,
5507 144, 145, 146, 147, -1, -1, -1, 121, -1, -1,
5508 124, -1, -1, -1, -1, -1, -1, -1, 162, -1,
5509 -1, 135, 136, 137, 138, 139, 140, 141, 142, 143,
5510 144, 145, 146, 147, -1, -1, -1, -1, -1, 153,
5511 154, 155, 0, -1, 158, 159, 160, -1, 162, -1,
5512 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5513 -1, -1, -1, -1, -1, -1, -1, 25, -1, 27,
5514 28, 29, -1, -1, -1, -1, -1, -1, -1, 37,
5515 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5516 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5517 88, 89, 90, -1, -1, -1, -1, 95, 96, -1,
5518 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5519 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5520 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5521 98, -1, 100, 101, -1, -1, -1, -1, 136, 107,
5522 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5523 -1, -1, -1, 121, -1, -1, 124, -1, -1, -1,
5524 -1, -1, -1, -1, -1, -1, -1, 135, 136, 137,
5525 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5526 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5527 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5528 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5529 -1, -1, -1, 25, 26, 27, 28, 29, -1, -1,
5530 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5531 42, 43, 44, -1, -1, -1, 78, 79, 80, 81,
5532 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
5533 -1, -1, -1, 95, 96, -1, 68, 69, -1, -1,
5534 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5535 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5536 -1, -1, -1, 95, 96, 97, 98, -1, -1, 101,
5537 -1, -1, -1, -1, -1, 107, 138, 139, 140, 141,
5538 142, 143, 144, 145, 146, 147, -1, -1, -1, 121,
5539 -1, -1, 124, -1, -1, -1, -1, -1, -1, -1,
5540 -1, -1, -1, -1, 136, 137, 138, 139, 140, 141,
5541 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5542 152, 153, 154, 155, 0, -1, 158, 159, 160, -1,
5543 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5544 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5545 26, 27, 28, 29, -1, -1, -1, -1, -1, -1,
5546 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5547 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5548 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5549 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5550 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5551 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5552 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5553 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5554 -1, -1, -1, -1, -1, 121, -1, -1, 124, -1,
5555 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5556 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5557 146, 147, -1, -1, -1, -1, 152, 153, 154, 155,
5558 0, -1, 158, 159, 160, -1, 162, -1, 8, 9,
5559 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
5560 -1, -1, -1, -1, -1, 25, 26, 27, 28, -1,
5561 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5562 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
5563 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5564 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
5565 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5566 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5567 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5568 -1, 101, -1, -1, -1, -1, -1, 107, -1, -1,
5569 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5570 -1, 121, -1, -1, -1, -1, -1, -1, -1, -1,
5571 -1, -1, -1, -1, -1, -1, 136, -1, 138, 139,
5572 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5573 -1, -1, 152, 153, 154, 155, 0, 157, 158, 159,
5574 160, -1, 162, -1, 8, 9, 10, -1, -1, 13,
5575 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5576 -1, 25, -1, 27, 28, 29, -1, -1, -1, -1,
5577 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5578 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5579 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5580 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5581 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5582 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5583 -1, 95, 96, 97, 98, -1, -1, 101, -1, -1,
5584 -1, -1, -1, 107, -1, -1, -1, -1, -1, -1,
5585 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5586 124, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5587 -1, -1, 136, 137, 138, 139, 140, 141, 142, 143,
5588 144, 145, 146, 147, -1, -1, -1, -1, -1, 153,
5589 154, 155, 0, -1, 158, 159, 160, -1, 162, -1,
5590 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5591 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
5592 28, -1, -1, -1, -1, -1, -1, -1, -1, 37,
5593 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5594 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5595 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5596 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5597 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5598 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5599 98, -1, -1, 101, -1, -1, -1, -1, -1, 107,
5600 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5601 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
5602 -1, -1, -1, -1, -1, -1, -1, -1, 136, -1,
5603 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5604 -1, -1, -1, -1, 152, 153, 154, 155, 0, 157,
5605 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5606 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5607 -1, -1, -1, 25, -1, 27, 28, -1, -1, -1,
5608 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5609 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5610 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5611 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5612 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5613 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5614 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
5615 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
5616 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5617 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5618 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
5619 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5620 152, 153, 154, 155, 0, -1, 158, 159, 160, -1,
5621 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5622 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5623 -1, 27, 28, -1, -1, -1, -1, -1, -1, -1,
5624 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5625 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5627 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5628 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5629 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5630 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5631 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5632 -1, -1, -1, -1, -1, 121, -1, -1, -1, -1,
5633 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5634 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5635 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
5636 0, 157, 158, 159, 160, -1, 162, -1, 8, 9,
5637 10, 44, -1, -1, 14, 15, -1, 17, -1, -1,
5638 -1, -1, -1, -1, -1, 25, 26, -1, -1, -1,
5639 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5640 40, 41, 42, 43, 44, 78, 79, 80, 81, 82,
5641 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
5642 -1, -1, 95, 96, -1, -1, -1, -1, 68, 69,
5643 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5644 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5645 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5646 100, 101, -1, 136, -1, 138, 139, 140, 141, 142,
5647 143, 144, 145, 146, 147, -1, -1, -1, -1, -1,
5648 -1, 121, -1, -1, -1, -1, -1, -1, -1, -1,
5649 -1, -1, -1, -1, -1, 135, 136, -1, 138, 139,
5650 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5651 -1, -1, 152, 153, 154, 155, 0, -1, 158, -1,
5652 160, -1, 162, -1, 8, 9, 10, -1, -1, -1,
5653 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5654 -1, 25, 26, -1, -1, -1, -1, -1, -1, -1,
5655 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5656 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5657 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5658 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5659 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5660 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5661 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
5662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5663 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5664 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5665 -1, 135, 136, -1, 138, 139, 140, 141, 142, 143,
5666 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
5667 154, 155, 0, -1, 158, -1, 160, -1, 162, -1,
5668 8, 9, 10, -1, -1, -1, 14, 15, -1, 17,
5669 -1, -1, -1, -1, -1, -1, -1, 25, -1, -1,
5670 -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
5671 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5672 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5673 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5674 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5675 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5676 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5677 98, -1, 100, 101, -1, -1, -1, -1, -1, -1,
5678 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5679 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
5680 -1, -1, -1, -1, -1, -1, -1, 135, 136, -1,
5681 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5682 -1, -1, -1, -1, 152, 153, 154, 155, 0, -1,
5683 158, -1, 160, -1, 162, -1, 8, 9, 10, -1,
5684 -1, -1, 14, 15, -1, 17, -1, -1, -1, -1,
5685 -1, -1, -1, 25, -1, -1, -1, -1, -1, -1,
5686 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5687 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5688 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5689 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5690 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5691 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5692 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
5693 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5694 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5695 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5696 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
5697 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5698 152, 153, 154, 155, -1, -1, 158, -1, 160, 1,
5699 162, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5700 12, -1, -1, 15, 16, -1, 18, 19, 20, 21,
5701 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
5702 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5703 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5704 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5705 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5706 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5707 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5708 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5709 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5710 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5711 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5712 10, 11, 12, -1, 14, 15, 16, -1, 18, 19,
5713 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5714 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5715 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5716 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5717 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5718 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5719 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5720 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5721 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5722 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5723 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5724 -1, -1, 10, 11, 12, -1, -1, 15, 16, 17,
5725 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5726 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5727 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5728 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5729 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5730 68, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5731 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5732 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5733 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5734 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5735 118, 119, -1, -1, -1, 1, -1, 3, 4, 5,
5736 6, 7, -1, -1, 10, 11, 12, -1, -1, 15,
5737 16, -1, 18, 19, 20, 21, 22, 23, 24, 25,
5738 148, 149, 150, -1, 30, 31, 32, 33, 34, 35,
5739 36, -1, 160, 39, 162, -1, -1, -1, -1, 45,
5740 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5741 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5742 -1, -1, 68, -1, -1, -1, -1, -1, -1, -1,
5743 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5744 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5745 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5746 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5747 116, 117, 118, 119, -1, -1, -1, 1, -1, 3,
5748 4, 5, 6, 7, -1, -1, 10, 11, 12, -1,
5749 -1, 15, 16, -1, 18, 19, 20, 21, 22, 23,
5750 24, -1, 148, 149, 150, -1, 30, 31, 32, 33,
5751 34, 35, 36, -1, 160, 39, 162, -1, -1, -1,
5752 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
5753 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5754 64, 65, -1, -1, 68, -1, -1, -1, -1, -1,
5755 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5756 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5757 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5758 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5759 114, 115, 116, 117, 118, 119, -1, -1, -1, 1,
5760 -1, 3, 4, 5, 6, 7, -1, 9, 10, 11,
5761 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5762 22, 23, 24, -1, 148, 149, 150, -1, 30, 31,
5763 32, 33, 34, 35, 36, -1, 160, 39, 162, -1,
5764 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5765 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5766 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5767 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5768 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5769 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5770 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5771 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5772 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5773 10, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5774 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5775 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5776 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5777 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5778 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5779 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5780 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5781 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5782 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5783 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5784 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5785 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5786 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5787 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5788 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5789 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5790 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5791 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5792 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5793 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5794 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5795 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5796 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5797 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5798 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5799 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5800 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5801 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5802 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5803 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5804 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5805 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5806 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5807 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5808 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5809 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5810 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5811 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5812 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5813 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5814 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5815 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5816 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5817 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5818 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5819 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5820 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5821 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5822 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5823 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5824 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5825 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5826 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5827 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5828 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5829 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5830 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5831 148, 149, 150, -1, -1, 153, -1, -1, -1, -1,
5832 -1, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5833 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5834 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5835 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5836 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5837 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5838 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5839 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5840 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5841 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5842 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5843 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5844 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5845 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5846 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5847 148, 149, 150, -1, -1, 153, -1, 1, -1, 3,
5848 4, 5, 160, 7, 162, -1, -1, 11, 12, -1,
5849 -1, -1, 16, 17, 18, 19, 20, 21, 22, 23,
5850 24, -1, -1, -1, -1, -1, 30, 31, 32, 33,
5851 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5852 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5853 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5854 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5855 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5856 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5857 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5858 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
5859 114, 115, 116, 117, 118, 119, -1, -1, 0, 1,
5860 -1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5861 12, -1, 14, 15, 16, 17, 18, 19, 20, 21,
5862 22, 23, 24, 25, 148, 149, 150, -1, 30, 31,
5863 32, 33, 34, 35, 36, -1, 160, 39, 162, -1,
5864 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5865 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5866 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5867 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5868 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5869 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5870 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5871 112, 113, 114, 115, 116, 117, 118, 119, -1, 121,
5872 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5873 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5874 -1, -1, -1, -1, -1, -1, 148, 149, 150, -1,
5875 -1, 153, -1, -1, -1, -1, 158, -1, 160, 0,
5876 1, -1, 3, 4, 5, 6, 7, -1, -1, -1,
5877 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
5878 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5879 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5880 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5881 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5882 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5883 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
5884 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5885 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
5886 -1, 102, 103, -1, 105, 106, -1, 108, -1, -1,
5887 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
5888 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5889 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5890 -1, -1, -1, -1, -1, -1, -1, 148, 149, 150,
5891 -1, -1, 153, 3, 4, 5, -1, 7, -1, 160,
5892 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5893 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
5894 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5895 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
5896 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
5897 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5898 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5899 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5900 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5901 -1, -1, 102, 103, -1, 105, 106, -1, 108, 109,
5902 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5903 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5904 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5905 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
5906 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5907 39, -1, 162, -1, -1, -1, -1, 46, -1, -1,
5908 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5909 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5910 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
5911 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5912 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
5913 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
5914 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
5915 119, -1, -1, -1, -1, 3, 4, 5, 6, 7,
5916 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
5917 18, 19, 20, 21, 22, 23, 24, 25, 26, 148,
5918 149, 150, 30, 31, 32, 33, 34, 35, 36, 37,
5919 38, 39, -1, 162, -1, -1, -1, 45, 46, 47,
5920 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5921 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5922 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5923 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5924 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5925 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5926 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
5927 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5928 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5929 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5930 -1, 149, 150, -1, -1, -1, -1, -1, 156, 157,
5931 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
5932 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
5933 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
5934 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
5935 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
5936 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,
5937 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5938 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
5939 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
5940 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
5941 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
5942 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5943 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5944 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
5945 143, 144, 145, 146, 147, -1, 149, 150, -1, -1,
5946 -1, -1, -1, 156, 3, 4, 5, 6, 7, 8,
5947 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
5948 19, 20, 21, 22, 23, 24, 25, 26, -1, -1,
5949 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38,
5950 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
5951 49, 50, 51, 52, 53, 54, -1, 56, -1, -1,
5952 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5953 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
5954 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
5955 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
5956 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
5957 109, -1, -1, 112, -1, -1, -1, -1, -1, -1,
5958 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5959 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
5960 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
5961 149, 150, -1, -1, -1, -1, -1, 156, 3, 4,
5962 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
5963 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
5964 25, 26, -1, -1, -1, 30, 31, 32, 33, 34,
5965 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
5966 45, 46, 47, 48, 49, 50, 51, 52, 53, -1,
5967 -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
5968 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5969 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
5970 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
5971 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
5972 -1, -1, -1, 108, 109, -1, -1, 112, -1, -1,
5973 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5974 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5975 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
5976 145, 146, 147, -1, 149, 150, -1, -1, -1, -1,
5977 -1, 156, 3, 4, 5, 6, 7, 8, 9, 10,
5978 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
5979 21, 22, 23, 24, 25, 26, -1, -1, -1, 30,
5980 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
5981 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5982 51, 52, 53, -1, -1, 56, -1, -1, -1, -1,
5983 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5984 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
5985 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
5986 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
5987 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
5988 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5989 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5990 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
5991 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
5992 3, 4, 5, -1, 7, 156, -1, -1, 11, 12,
5993 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5994 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5995 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5996 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5997 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5998 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5999 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6000 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6001 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6002 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6003 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6004 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6005 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
6006 5, -1, 7, -1, -1, 148, 11, 12, -1, -1,
6007 -1, 16, 155, 18, 19, 20, 21, 22, 23, 24,
6008 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
6009 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6010 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6011 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6012 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6013 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6014 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6015 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6016 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
6017 115, 116, 117, 118, 119, -1, -1, -1, -1, -1,
6018 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6019 -1, -1, -1, -1, 1, -1, 3, 4, 5, 6,
6020 7, -1, -1, 148, 11, 12, -1, -1, -1, 16,
6021 155, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6022 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6023 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
6024 -1, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6025 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6026 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6027 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6028 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6029 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6030 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6031 117, 118, 119, -1, -1, 1, -1, 3, 4, 5,
6032 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6033 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6034 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6035 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6036 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6037 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6038 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6039 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6040 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6041 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6042 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
6043 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6044 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6045 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6046 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6047 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6048 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6049 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
6050 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6051 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6052 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6053 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6054 105, 106, -1, 108, 109, 110, 111, 112, 113, 114,
6055 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6056 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6057 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6058 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6059 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6060 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6061 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
6062 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6063 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6064 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6065 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6066 -1, 105, 106, -1, 108, 109, 110, 111, 112, 113,
6067 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6068 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6069 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6070 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6071 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6072 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6073 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
6074 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6075 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6076 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6077 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6078 103, -1, 105, 106, -1, 108, 109, 110, 111, 112,
6079 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6080 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6081 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6082 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6083 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6084 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6085 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
6086 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6087 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6088 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6089 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6090 102, 103, -1, 105, 106, -1, 108, 109, 110, 111,
6091 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6092 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6093 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6094 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6095 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6096 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6097 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
6098 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6099 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6100 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6101 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6102 -1, 102, 103, -1, 105, 106, -1, 108, 109, -1,
6103 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6104 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6105 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6106 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6107 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6108 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6109 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
6110 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6111 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6112 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6113 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6114 -1, -1, 102, 103, -1, 105, 106, -1, -1, 109,
6115 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6116 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6117 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6118 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6119 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6120 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6121 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
6122 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6123 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6124 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6125 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6126 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6127 109, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6128 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6129 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6130 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6131 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6132 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6133 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6134 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6135 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6136 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6137 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6138 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6139 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6140 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
6141 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
6142 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6143 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
6144 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6145 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6146 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6147 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6148 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6149 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6150 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6151 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6152 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
6153 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6154 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6155 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6156 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6157 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6158 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6159 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6160 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6161 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6162 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6163 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6164 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6165 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6166 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6167 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6168 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6169 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6170 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6171 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6172 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6173 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6174 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6175 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
6176 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6177 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6178 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6179 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6180 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6181 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6182 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
6183 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6184 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6185 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6186 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6187 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
6188 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6189 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6190 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6191 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6192 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6193 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6194 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6195 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6196 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6197 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6198 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6199 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6200 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6201 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6202 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6203 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6204 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6205 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6206 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6207 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6208 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6209 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6210 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6211 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
6212 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6213 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6214 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6215 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6216 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6217 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6218 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6219 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6220 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6221 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6222 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6223 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6224 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6225 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6226 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6227 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6228 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6229 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6230 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6231 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6232 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6233 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6234 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6235 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6236 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6237 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6238 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6239 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6240 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6241 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6242 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6243 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6244 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6245 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6246 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6247 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6248 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6249 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6250 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6251 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6252 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6253 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6254 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6255 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6256 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6257 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6258 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6259 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6260 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6261 118, 119, -1, -1, 3, 4, 5, -1, 7, -1,
6262 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6263 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
6264 148, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6265 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6266 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6267 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6268 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6269 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6270 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6271 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6272 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6273 119, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6274 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6275 20, 21, 22, 23, 24, -1, -1, -1, -1, 148,
6276 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6277 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6278 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6279 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6280 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6281 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6282 -1, -1, -1, -1, -1, 95, -1, -1, -1, 99,
6283 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6284 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6285 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6286 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6287 21, 22, 23, 24, -1, -1, -1, -1, 148, 30,
6288 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6289 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6290 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6291 61, 62, 63, 64, 65, -1, -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, -1,
6294 -1, -1, -1, -1, -1, -1, -1, -1, 99, -1,
6295 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6296 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6297 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6298 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6299 22, 23, 24, -1, -1, -1, -1, 148, 30, 31,
6300 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6301 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6302 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6303 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6304 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6305 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6306 -1, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6307 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
6308 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6309 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6310 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6311 23, 24, -1, -1, -1, -1, 148, 30, 31, 32,
6312 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6313 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6314 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6315 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6318 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6319 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6320 113, 114, 115, 116, 117, 118, 119, -1, -1, 3,
6321 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6322 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6323 24, -1, -1, -1, -1, 148, 30, 31, 32, 33,
6324 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6325 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6326 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
6327 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6328 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6330 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6331 -1, 105, 106, 33, 34, 35, 36, 111, 112, 113,
6332 114, 115, 116, 117, 118, 119, -1, -1, -1, 49,
6333 50, 51, 52, -1, -1, -1, 56, -1, -1, 59,
6334 60, 61, 62, 63, -1, -1, -1, -1, -1, -1,
6335 -1, -1, -1, -1, 148, -1, -1, -1, -1, -1,
6336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6337 -1, 91, 92, -1, -1, -1, 52, 53, -1, 99,
6338 56, -1, 102, -1, -1, 105, 106, -1, 108, -1,
6339 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6340 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
6341 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
6342 96, 141, -1, -1, -1, -1, -1, -1, 148, -1,
6343 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
6344 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6345 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6346 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
6347 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
6348 156, 157, -1, -1, -1, -1, -1, -1, -1, -1,
6349 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6350 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
6351 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
6352 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6353 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
6354 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6355 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6356 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6357 147, -1, 149, 150, 52, 53, -1, -1, 56, 156,
6358 157, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6359 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6360 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6361 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6362 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6363 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
6364 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6365 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6366 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6367 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
6368 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6369 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
6370 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
6371 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
6372 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
6373 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6374 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6375 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
6376 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6377 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
6378 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6379 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
6380 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
6381 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
6382 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
6383 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6384 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6385 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
6386 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
6387 150, 52, 53, -1, -1, 56, 156, 157, -1, -1,
6388 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6389 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
6390 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
6391 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
6392 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
6393 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6394 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6395 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
6396 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
6397 52, 53, -1, -1, 56, 156, 157, -1, -1, -1,
6398 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6399 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
6400 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
6401 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
6402 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
6403 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6404 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6405 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
6406 142, 143, 144, 145, 146, 147, -1, 149, 150, 52,
6407 53, -1, -1, 56, 156, 157, -1, -1, -1, -1,
6408 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6409 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
6410 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
6411 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
6412 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
6413 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6415 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
6416 143, 144, 145, 146, 147, -1, 149, 150, 52, 53,
6417 -1, -1, 56, 156, 157, -1, -1, -1, -1, -1,
6418 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6419 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
6420 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
6421 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
6422 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
6423 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6424 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6425 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
6426 144, 145, 146, 147, -1, 149, 150, 52, 53, -1,
6427 -1, 56, 156, 157, -1, -1, -1, -1, -1, -1,
6428 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6429 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
6430 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
6431 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
6432 -1, -1, -1, 108, 109, -1, -1, -1, -1, -1,
6433 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6434 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6435 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
6436 145, 146, 147, -1, 149, 150, 52, 53, -1, -1,
6437 56, 156, 157, -1, -1, -1, -1, -1, -1, -1,
6438 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6439 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
6440 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
6441 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6442 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
6443 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6444 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6445 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
6446 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
6447 156, 157, -1, -1, -1, -1, -1, -1, -1, -1,
6448 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6449 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
6450 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
6451 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6452 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
6453 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6454 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6455 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6456 147, -1, 149, 150, 52, 53, -1, -1, 56, 156,
6457 157, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6458 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6459 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6460 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6461 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6462 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
6463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6464 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6465 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6466 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
6467 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6468 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
6469 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
6470 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
6471 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
6472 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6474 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
6475 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6476 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
6477 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6478 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
6479 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
6480 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
6481 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
6482 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6483 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6484 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
6485 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
6486 150, -1, -1, -1, -1, -1, 156
6487};
6488
6489/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
6490 state STATE-NUM. */
6491static const yytype_int16 yystos[] =
6492{
6493 0, 164, 165, 0, 1, 3, 4, 5, 6, 7,
6494 11, 12, 16, 18, 19, 20, 21, 22, 23, 24,
6495 30, 31, 32, 33, 34, 35, 36, 39, 45, 46,
6496 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6497 57, 59, 60, 61, 62, 63, 64, 65, 76, 77,
6498 91, 92, 99, 102, 103, 105, 106, 108, 111, 112,
6499 113, 114, 115, 116, 117, 118, 119, 148, 149, 150,
6500 166, 167, 168, 180, 181, 183, 186, 190, 191, 197,
6501 198, 200, 201, 202, 204, 205, 206, 208, 209, 218,
6502 221, 240, 250, 251, 252, 253, 254, 255, 256, 257,
6503 258, 259, 260, 269, 270, 294, 301, 302, 350, 351,
6504 352, 353, 354, 355, 357, 360, 362, 363, 376, 377,
6505 379, 380, 381, 382, 383, 384, 385, 386, 387, 425,
6506 439, 3, 4, 5, 6, 7, 8, 9, 10, 11,
6507 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
6508 22, 23, 24, 25, 26, 30, 31, 32, 33, 34,
6509 35, 36, 37, 38, 39, 45, 46, 47, 48, 49,
6510 50, 51, 52, 53, 56, 76, 77, 78, 79, 80,
6511 81, 82, 83, 84, 87, 88, 93, 94, 95, 96,
6512 108, 109, 138, 139, 140, 141, 142, 143, 144, 145,
6513 146, 147, 149, 150, 156, 212, 213, 214, 216, 217,
6514 376, 179, 179, 179, 39, 58, 99, 102, 108, 109,
6515 110, 113, 149, 190, 191, 201, 209, 218, 225, 231,
6516 234, 236, 237, 250, 383, 384, 386, 387, 423, 424,
6517 231, 157, 228, 232, 233, 157, 162, 432, 54, 213,
6518 432, 152, 169, 170, 222, 439, 21, 22, 32, 200,
6519 218, 250, 269, 270, 218, 218, 218, 56, 47, 102,
6520 175, 176, 177, 181, 203, 204, 439, 175, 226, 236,
6521 423, 439, 225, 422, 423, 439, 46, 99, 148, 155,
6522 190, 191, 208, 240, 250, 383, 384, 387, 295, 212,
6523 366, 378, 382, 366, 367, 368, 161, 356, 356, 356,
6524 356, 381, 197, 218, 218, 160, 162, 431, 437, 438,
6525 179, 40, 41, 42, 43, 44, 37, 38, 157, 390,
6526 391, 392, 393, 439, 390, 392, 26, 152, 228, 232,
6527 261, 303, 28, 262, 300, 135, 155, 102, 108, 205,
6528 135, 25, 78, 79, 80, 81, 82, 83, 84, 85,
6529 86, 87, 88, 89, 90, 95, 96, 101, 136, 138,
6530 139, 140, 141, 142, 143, 144, 145, 146, 147, 220,
6531 220, 69, 97, 98, 154, 429, 241, 1, 186, 193,
6532 193, 194, 195, 194, 193, 431, 438, 99, 202, 209,
6533 250, 275, 383, 384, 387, 52, 56, 95, 99, 210,
6534 211, 250, 383, 384, 387, 211, 33, 34, 35, 36,
6535 49, 50, 51, 52, 56, 157, 189, 212, 385, 420,
6536 231, 157, 232, 98, 429, 430, 303, 353, 100, 100,
6537 155, 225, 56, 225, 225, 225, 366, 390, 390, 135,
6538 101, 155, 235, 439, 98, 154, 429, 100, 100, 155,
6539 235, 92, 230, 231, 236, 397, 423, 439, 231, 186,
6540 432, 433, 186, 54, 64, 65, 182, 157, 222, 223,
6541 166, 98, 429, 100, 178, 203, 158, 431, 438, 433,
6542 242, 159, 155, 432, 436, 155, 436, 153, 436, 432,
6543 56, 381, 205, 207, 391, 155, 98, 154, 429, 292,
6544 66, 120, 122, 123, 369, 120, 120, 369, 67, 369,
6545 161, 358, 364, 361, 365, 78, 160, 168, 152, 193,
6546 193, 193, 193, 222, 224, 186, 186, 52, 54, 55,
6547 56, 57, 58, 78, 92, 102, 108, 109, 110, 142,
6548 145, 280, 338, 394, 396, 397, 398, 399, 400, 401,
6549 402, 403, 404, 407, 408, 409, 410, 411, 414, 415,
6550 416, 417, 418, 135, 248, 396, 135, 249, 304, 305,
6551 107, 199, 306, 307, 306, 222, 203, 155, 208, 155,
6552 222, 188, 218, 218, 218, 218, 218, 218, 218, 218,
6553 218, 218, 218, 218, 218, 187, 218, 218, 218, 218,
6554 218, 218, 218, 218, 218, 218, 218, 52, 53, 56,
6555 216, 228, 425, 426, 427, 230, 236, 52, 53, 56,
6556 216, 228, 426, 171, 175, 13, 271, 437, 271, 175,
6557 193, 175, 431, 244, 56, 98, 154, 429, 25, 193,
6558 52, 56, 210, 139, 388, 98, 154, 429, 247, 421,
6559 69, 98, 428, 231, 433, 52, 56, 426, 222, 222,
6560 215, 125, 135, 135, 222, 225, 225, 234, 237, 423,
6561 52, 56, 230, 52, 56, 222, 222, 424, 433, 155,
6562 433, 155, 433, 158, 213, 223, 218, 153, 56, 426,
6563 426, 222, 170, 433, 177, 158, 423, 155, 207, 52,
6564 56, 230, 52, 56, 293, 371, 370, 120, 359, 369,
6565 66, 120, 120, 359, 66, 120, 218, 175, 181, 102,
6566 108, 276, 277, 278, 279, 399, 155, 419, 439, 433,
6567 281, 282, 155, 395, 225, 155, 419, 34, 52, 155,
6568 395, 52, 155, 395, 52, 39, 184, 201, 218, 219,
6569 171, 437, 184, 219, 171, 153, 292, 304, 10, 68,
6570 268, 292, 268, 108, 197, 225, 236, 238, 239, 433,
6571 207, 155, 183, 185, 197, 209, 218, 225, 227, 239,
6572 250, 387, 313, 313, 432, 100, 100, 152, 228, 232,
6573 432, 434, 155, 100, 100, 228, 229, 232, 439, 268,
6574 222, 175, 13, 175, 268, 27, 272, 437, 268, 25,
6575 243, 314, 17, 265, 309, 52, 56, 230, 52, 56,
6576 194, 246, 389, 245, 52, 56, 210, 230, 171, 186,
6577 192, 433, 229, 232, 185, 218, 227, 185, 227, 213,
6578 225, 39, 235, 100, 100, 434, 100, 100, 397, 423,
6579 186, 227, 436, 205, 434, 179, 372, 375, 382, 387,
6580 356, 369, 356, 356, 356, 153, 278, 399, 155, 433,
6581 155, 418, 225, 135, 394, 401, 414, 416, 404, 408,
6582 410, 402, 411, 416, 400, 402, 432, 44, 44, 268,
6583 268, 293, 153, 293, 225, 155, 44, 207, 44, 135,
6584 44, 98, 154, 429, 311, 311, 137, 222, 222, 304,
6585 199, 159, 100, 222, 222, 199, 8, 263, 346, 439,
6586 14, 15, 266, 267, 273, 274, 439, 274, 196, 313,
6587 309, 268, 108, 225, 308, 268, 434, 175, 437, 193,
6588 171, 434, 268, 433, 189, 303, 300, 432, 222, 222,
6589 100, 222, 222, 433, 155, 433, 157, 297, 396, 373,
6590 433, 276, 279, 277, 155, 395, 155, 395, 419, 155,
6591 395, 155, 395, 395, 184, 219, 224, 224, 179, 179,
6592 108, 225, 224, 224, 222, 224, 52, 56, 230, 52,
6593 56, 312, 312, 218, 185, 227, 185, 227, 153, 222,
6594 185, 227, 185, 227, 225, 239, 347, 439, 174, 266,
6595 175, 193, 268, 268, 311, 268, 225, 155, 271, 268,
6596 171, 437, 268, 222, 396, 296, 175, 155, 155, 402,
6597 416, 402, 402, 218, 218, 140, 287, 288, 439, 287,
6598 225, 181, 181, 218, 434, 52, 56, 58, 91, 92,
6599 99, 102, 105, 106, 108, 113, 141, 294, 318, 319,
6600 320, 321, 324, 328, 329, 330, 333, 334, 335, 336,
6601 337, 338, 339, 340, 341, 342, 343, 344, 345, 350,
6602 351, 354, 355, 357, 360, 362, 363, 384, 408, 318,
6603 185, 227, 101, 348, 439, 9, 264, 349, 439, 172,
6604 271, 312, 108, 225, 175, 268, 289, 432, 29, 124,
6605 298, 0, 121, 374, 277, 395, 155, 395, 395, 395,
6606 280, 283, 286, 289, 400, 402, 403, 405, 406, 412,
6607 413, 416, 418, 175, 171, 341, 341, 56, 210, 312,
6608 319, 326, 327, 328, 329, 332, 434, 312, 432, 435,
6609 52, 366, 52, 102, 382, 101, 155, 140, 155, 155,
6610 319, 89, 90, 98, 154, 157, 322, 323, 52, 99,
6611 209, 250, 383, 384, 387, 271, 175, 175, 175, 317,
6612 318, 225, 274, 309, 310, 158, 160, 299, 175, 402,
6613 419, 289, 140, 281, 155, 284, 285, 99, 250, 155,
6614 419, 155, 284, 155, 284, 319, 434, 319, 330, 332,
6615 434, 155, 222, 153, 125, 193, 342, 326, 330, 324,
6616 331, 332, 113, 335, 339, 341, 341, 210, 312, 434,
6617 312, 433, 326, 329, 333, 326, 329, 333, 56, 98,
6618 154, 429, 175, 173, 273, 271, 40, 41, 52, 290,
6619 291, 398, 171, 153, 395, 140, 250, 283, 413, 416,
6620 56, 98, 405, 410, 402, 412, 416, 402, 433, 155,
6621 155, 325, 433, 155, 155, 366, 433, 433, 433, 434,
6622 434, 434, 52, 56, 230, 52, 56, 346, 349, 315,
6623 193, 193, 155, 432, 268, 155, 284, 155, 284, 52,
6624 56, 419, 155, 284, 155, 284, 284, 331, 333, 331,
6625 330, 332, 434, 175, 291, 402, 416, 402, 402, 155,
6626 435, 274, 314, 316, 284, 155, 284, 284, 284, 402,
6627 284
6628};
6629
6630/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
6631static const yytype_int16 yyr1[] =
6632{
6633 0, 163, 165, 164, 166, 167, 167, 167, 168, 168,
6634 169, 170, 172, 173, 171, 174, 171, 175, 176, 176,
6635 176, 177, 178, 177, 179, 180, 182, 181, 181, 181,
6636 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
6637 181, 181, 181, 181, 181, 183, 183, 183, 183, 183,
6638 183, 183, 183, 183, 183, 184, 184, 184, 185, 185,
6639 185, 186, 186, 186, 186, 186, 187, 186, 188, 186,
6640 186, 189, 190, 192, 191, 193, 193, 195, 196, 194,
6641 197, 197, 198, 198, 199, 200, 201, 201, 201, 201,
6642 201, 201, 201, 201, 201, 201, 201, 201, 202, 202,
6643 203, 203, 204, 204, 204, 204, 204, 204, 204, 204,
6644 204, 204, 205, 205, 206, 206, 207, 207, 208, 208,
6645 208, 208, 208, 208, 208, 208, 208, 209, 209, 209,
6646 209, 209, 209, 209, 209, 209, 210, 210, 211, 211,
6647 211, 212, 212, 212, 212, 212, 213, 213, 214, 215,
6648 214, 216, 216, 216, 216, 216, 216, 216, 216, 216,
6649 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
6650 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
6651 216, 217, 217, 217, 217, 217, 217, 217, 217, 217,
6652 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
6653 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
6654 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
6655 217, 217, 218, 218, 218, 218, 218, 218, 218, 218,
6656 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
6657 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
6658 218, 218, 218, 218, 218, 218, 218, 218, 218, 218,
6659 218, 218, 218, 218, 218, 218, 218, 219, 219, 219,
6660 220, 220, 220, 220, 221, 221, 222, 223, 224, 225,
6661 226, 226, 226, 226, 227, 227, 228, 228, 228, 229,
6662 229, 230, 230, 230, 230, 230, 231, 231, 231, 231,
6663 231, 233, 232, 234, 234, 235, 235, 236, 236, 236,
6664 236, 237, 237, 238, 238, 239, 239, 239, 240, 240,
6665 240, 240, 240, 240, 240, 240, 240, 240, 240, 241,
6666 240, 242, 240, 240, 240, 240, 240, 240, 240, 240,
6667 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
6668 240, 240, 240, 243, 240, 244, 240, 240, 240, 245,
6669 240, 246, 240, 247, 240, 248, 240, 249, 240, 240,
6670 240, 240, 240, 250, 251, 252, 253, 254, 255, 256,
6671 257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
6672 267, 268, 268, 269, 270, 271, 271, 271, 272, 272,
6673 273, 273, 274, 274, 275, 275, 276, 276, 277, 277,
6674 278, 278, 278, 278, 278, 279, 279, 280, 280, 282,
6675 281, 283, 283, 283, 283, 284, 284, 285, 286, 286,
6676 286, 286, 286, 286, 286, 286, 286, 286, 286, 286,
6677 286, 286, 286, 287, 287, 288, 288, 289, 289, 290,
6678 290, 291, 291, 292, 293, 295, 296, 294, 297, 297,
6679 298, 299, 298, 300, 301, 301, 301, 301, 302, 302,
6680 302, 302, 302, 302, 302, 302, 302, 303, 303, 305,
6681 304, 307, 306, 308, 308, 308, 308, 309, 310, 310,
6682 311, 312, 313, 315, 314, 316, 316, 317, 317, 317,
6683 318, 318, 318, 318, 318, 318, 319, 320, 320, 321,
6684 321, 322, 323, 324, 324, 324, 324, 324, 324, 324,
6685 324, 324, 324, 324, 324, 324, 325, 324, 324, 324,
6686 326, 326, 326, 326, 326, 326, 327, 327, 328, 328,
6687 329, 330, 330, 331, 331, 332, 333, 333, 333, 333,
6688 334, 334, 335, 335, 336, 336, 337, 337, 338, 339,
6689 339, 340, 340, 340, 340, 340, 340, 340, 340, 340,
6690 340, 341, 341, 341, 341, 341, 341, 341, 341, 341,
6691 341, 342, 343, 343, 344, 345, 345, 345, 346, 346,
6692 347, 347, 347, 348, 348, 349, 349, 350, 350, 351,
6693 352, 352, 352, 353, 354, 355, 356, 356, 357, 358,
6694 358, 359, 359, 360, 361, 361, 362, 363, 364, 364,
6695 365, 365, 366, 366, 367, 367, 368, 368, 369, 370,
6696 369, 371, 372, 373, 369, 374, 374, 375, 375, 376,
6697 376, 377, 378, 378, 379, 380, 380, 381, 381, 381,
6698 381, 382, 382, 382, 383, 383, 383, 384, 384, 384,
6699 384, 384, 384, 384, 385, 385, 386, 386, 387, 387,
6700 389, 388, 388, 390, 390, 391, 392, 393, 392, 394,
6701 394, 394, 394, 394, 395, 395, 396, 396, 396, 396,
6702 396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
6703 396, 397, 398, 398, 398, 398, 399, 399, 400, 401,
6704 401, 402, 402, 403, 404, 404, 405, 405, 406, 406,
6705 407, 407, 408, 408, 409, 410, 410, 411, 412, 413,
6706 413, 414, 414, 415, 415, 416, 416, 417, 417, 418,
6707 418, 419, 419, 420, 421, 420, 422, 422, 423, 423,
6708 424, 424, 424, 424, 424, 424, 425, 425, 425, 426,
6709 426, 427, 427, 427, 428, 428, 429, 429, 430, 430,
6710 431, 431, 432, 432, 433, 434, 435, 436, 436, 437,
6711 437, 438, 438, 439
6712};
6713
6714/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
6715static const yytype_int8 yyr2[] =
6716{
6717 0, 2, 0, 2, 2, 1, 1, 3, 1, 2,
6718 1, 3, 0, 0, 8, 0, 5, 2, 1, 1,
6719 3, 1, 0, 3, 0, 2, 0, 4, 3, 3,
6720 3, 2, 3, 3, 3, 3, 4, 5, 1, 4,
6721 4, 7, 4, 1, 1, 4, 4, 7, 6, 6,
6722 6, 6, 4, 4, 4, 1, 4, 3, 1, 4,
6723 1, 1, 3, 3, 3, 2, 0, 7, 0, 7,
6724 1, 1, 2, 0, 5, 1, 1, 0, 0, 4,
6725 1, 1, 1, 4, 3, 1, 2, 3, 4, 5,
6726 4, 5, 6, 2, 2, 2, 2, 2, 1, 3,
6727 1, 3, 1, 2, 3, 5, 2, 4, 2, 4,
6728 1, 3, 1, 3, 2, 3, 1, 3, 1, 1,
6729 4, 3, 3, 3, 3, 2, 1, 1, 1, 4,
6730 3, 3, 3, 3, 2, 1, 1, 1, 2, 1,
6731 3, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6732 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6733 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6734 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6735 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6736 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6737 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6738 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6739 1, 1, 4, 4, 7, 6, 6, 6, 6, 5,
6740 4, 3, 3, 2, 2, 2, 2, 3, 3, 3,
6741 3, 3, 3, 4, 2, 2, 3, 3, 3, 3,
6742 1, 3, 3, 3, 3, 3, 2, 2, 3, 3,
6743 3, 3, 4, 6, 4, 4, 1, 1, 4, 3,
6744 1, 1, 1, 1, 3, 3, 1, 1, 1, 1,
6745 1, 2, 4, 2, 1, 4, 3, 5, 3, 1,
6746 1, 1, 1, 2, 4, 2, 1, 2, 2, 4,
6747 1, 0, 2, 2, 1, 2, 1, 1, 1, 3,
6748 3, 2, 1, 1, 1, 3, 4, 2, 1, 1,
6749 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6750 4, 0, 4, 3, 3, 2, 3, 3, 1, 4,
6751 3, 1, 6, 4, 3, 2, 1, 2, 1, 6,
6752 6, 4, 4, 0, 6, 0, 5, 5, 6, 0,
6753 6, 0, 7, 0, 5, 0, 5, 0, 5, 1,
6754 1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
6755 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6756 1, 1, 1, 1, 1, 1, 1, 2, 1, 1,
6757 1, 5, 1, 2, 1, 1, 1, 3, 1, 3,
6758 1, 3, 5, 1, 3, 2, 1, 1, 1, 0,
6759 2, 4, 2, 2, 1, 2, 0, 1, 6, 8,
6760 4, 6, 4, 2, 6, 2, 4, 6, 2, 4,
6761 2, 4, 1, 1, 1, 3, 4, 1, 4, 1,
6762 3, 1, 1, 0, 0, 0, 0, 8, 4, 1,
6763 3, 0, 4, 3, 2, 4, 5, 5, 2, 4,
6764 4, 3, 3, 3, 2, 1, 4, 3, 3, 0,
6765 6, 0, 6, 1, 2, 3, 4, 5, 1, 1,
6766 0, 0, 0, 0, 9, 1, 1, 1, 3, 3,
6767 1, 2, 3, 1, 1, 1, 1, 3, 1, 3,
6768 1, 2, 2, 1, 1, 4, 4, 4, 3, 4,
6769 4, 4, 3, 3, 3, 2, 0, 6, 2, 4,
6770 1, 1, 2, 2, 4, 1, 2, 3, 1, 3,
6771 5, 2, 1, 1, 3, 1, 3, 1, 2, 1,
6772 1, 3, 2, 1, 1, 3, 2, 1, 2, 1,
6773 1, 1, 3, 3, 2, 2, 1, 1, 1, 2,
6774 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6775 1, 1, 2, 2, 4, 2, 3, 1, 6, 1,
6776 1, 1, 1, 2, 1, 2, 1, 1, 1, 1,
6777 1, 1, 2, 3, 3, 3, 1, 2, 4, 0,
6778 3, 1, 2, 4, 0, 3, 4, 4, 0, 3,
6779 0, 3, 0, 2, 0, 2, 0, 2, 1, 0,
6780 3, 0, 0, 0, 6, 1, 1, 1, 1, 1,
6781 1, 2, 1, 1, 3, 1, 2, 1, 1, 1,
6782 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6783 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6784 0, 4, 0, 1, 1, 3, 1, 0, 3, 4,
6785 2, 2, 1, 1, 2, 0, 6, 8, 4, 6,
6786 4, 6, 2, 4, 6, 2, 4, 2, 4, 1,
6787 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6788 3, 1, 3, 1, 2, 1, 2, 1, 1, 3,
6789 1, 3, 1, 1, 1, 2, 1, 3, 3, 1,
6790 3, 1, 3, 1, 1, 2, 1, 1, 1, 2,
6791 1, 2, 1, 1, 0, 4, 1, 2, 1, 3,
6792 3, 2, 1, 4, 2, 1, 1, 1, 1, 1,
6793 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6794 0, 1, 0, 1, 2, 2, 2, 1, 1, 1,
6795 1, 1, 2, 0
6796};
6797
6798
6799enum { YYENOMEM = -2 };
6800
6801#define yyerrok (yyerrstatus = 0)
6802#define yyclearin (yychar = YYEMPTY)
6803
6804#define YYACCEPT goto yyacceptlab
6805#define YYABORT goto yyabortlab
6806#define YYERROR goto yyerrorlab
6807#define YYNOMEM goto yyexhaustedlab
6808
6809
6810#define YYRECOVERING() (!!yyerrstatus)
6811
6812#define YYBACKUP(Token, Value) \
6813 do \
6814 if (yychar == YYEMPTY) \
6815 { \
6816 yychar = (Token); \
6817 yylval = (Value); \
6818 YYPOPSTACK (yylen); \
6819 yystate = *yyssp; \
6820 goto yybackup; \
6821 } \
6822 else \
6823 { \
6824 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
6825 YYERROR; \
6826 } \
6827 while (0)
6828
6829/* Backward compatibility with an undocumented macro.
6830 Use YYerror or YYUNDEF. */
6831#define YYERRCODE YYUNDEF
6832
6833/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6834 If N is 0, then set CURRENT to the empty location which ends
6835 the previous symbol: RHS[0] (always defined). */
6836
6837#ifndef YYLLOC_DEFAULT
6838# define YYLLOC_DEFAULT(Current, Rhs, N) \
6839 do \
6840 if (N) \
6841 { \
6842 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
6843 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
6844 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
6845 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
6846 } \
6847 else \
6848 { \
6849 (Current).first_line = (Current).last_line = \
6850 YYRHSLOC (Rhs, 0).last_line; \
6851 (Current).first_column = (Current).last_column = \
6852 YYRHSLOC (Rhs, 0).last_column; \
6853 } \
6854 while (0)
6855#endif
6856
6857#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6858
6859
6860/* Enable debugging if requested. */
6861#if YYDEBUG
6862
6863# ifndef YYFPRINTF
6864# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6865# define YYFPRINTF fprintf
6866# endif
6867
6868# define YYDPRINTF(Args) \
6869do { \
6870 if (yydebug) \
6871 YYFPRINTF Args; \
6872} while (0)
6873
6874
6875/* YYLOCATION_PRINT -- Print the location on the stream.
6876 This macro was not mandated originally: define only if we know
6877 we won't break user code: when these are the locations we know. */
6878
6879# ifndef YYLOCATION_PRINT
6880
6881# if defined YY_LOCATION_PRINT
6882
6883 /* Temporary convenience wrapper in case some people defined the
6884 undocumented and private YY_LOCATION_PRINT macros. */
6885# define YYLOCATION_PRINT(File, Loc, p) YY_LOCATION_PRINT(File, *(Loc), p)
6886
6887# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6888
6889/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
6890
6891YY_ATTRIBUTE_UNUSED
6892static int
6893yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
6894{
6895 int res = 0;
6896 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
6897 if (0 <= yylocp->first_line)
6898 {
6899 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
6900 if (0 <= yylocp->first_column)
6901 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
6902 }
6903 if (0 <= yylocp->last_line)
6904 {
6905 if (yylocp->first_line < yylocp->last_line)
6906 {
6907 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
6908 if (0 <= end_col)
6909 res += YYFPRINTF (yyo, ".%d", end_col);
6910 }
6911 else if (0 <= end_col && yylocp->first_column < end_col)
6912 res += YYFPRINTF (yyo, "-%d", end_col);
6913 }
6914 return res;
6915}
6916
6917# define YYLOCATION_PRINT yy_location_print_
6918
6919 /* Temporary convenience wrapper in case some people defined the
6920 undocumented and private YY_LOCATION_PRINT macros. */
6921# define YY_LOCATION_PRINT(File, Loc, p) YYLOCATION_PRINT(File, &(Loc), p)
6922
6923# else
6924
6925# define YYLOCATION_PRINT(File, Loc, p) ((void) 0)
6926 /* Temporary convenience wrapper in case some people defined the
6927 undocumented and private YY_LOCATION_PRINT macros. */
6928# define YY_LOCATION_PRINT YYLOCATION_PRINT
6929
6930# endif
6931# endif /* !defined YYLOCATION_PRINT */
6932
6933
6934# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p) \
6935do { \
6936 if (yydebug) \
6937 { \
6938 YYFPRINTF (stderr, "%s ", Title); \
6939 yy_symbol_print (stderr, \
6940 Kind, Value, Location, p); \
6941 YYFPRINTF (stderr, "\n"); \
6942 } \
6943} while (0)
6944
6945
6946/*-----------------------------------.
6947| Print this symbol's value on YYO. |
6948`-----------------------------------*/
6949
6950static void
6951yy_symbol_value_print (FILE *yyo,
6952 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6953{
6954 FILE *yyoutput = yyo;
6955 YY_USE (yyoutput);
6956 YY_USE (yylocationp);
6957 YY_USE (p);
6958 if (!yyvaluep)
6959 return;
6960 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6961switch (yykind)
6962 {
6963 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
6964#line 1926 "parse.y"
6965 {
6966#ifndef RIPPER
6967 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6968#else
6969 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
6970#endif
6971}
6972#line 6973 "parse.c"
6973 break;
6974
6975 case YYSYMBOL_tFID: /* "method" */
6976#line 1926 "parse.y"
6977 {
6978#ifndef RIPPER
6979 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6980#else
6981 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
6982#endif
6983}
6984#line 6985 "parse.c"
6985 break;
6986
6987 case YYSYMBOL_tGVAR: /* "global variable" */
6988#line 1926 "parse.y"
6989 {
6990#ifndef RIPPER
6991 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6992#else
6993 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
6994#endif
6995}
6996#line 6997 "parse.c"
6997 break;
6998
6999 case YYSYMBOL_tIVAR: /* "instance variable" */
7000#line 1926 "parse.y"
7001 {
7002#ifndef RIPPER
7003 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7004#else
7005 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7006#endif
7007}
7008#line 7009 "parse.c"
7009 break;
7010
7011 case YYSYMBOL_tCONSTANT: /* "constant" */
7012#line 1926 "parse.y"
7013 {
7014#ifndef RIPPER
7015 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7016#else
7017 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7018#endif
7019}
7020#line 7021 "parse.c"
7021 break;
7022
7023 case YYSYMBOL_tCVAR: /* "class variable" */
7024#line 1926 "parse.y"
7025 {
7026#ifndef RIPPER
7027 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7028#else
7029 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7030#endif
7031}
7032#line 7033 "parse.c"
7033 break;
7034
7035 case YYSYMBOL_tLABEL: /* "label" */
7036#line 1926 "parse.y"
7037 {
7038#ifndef RIPPER
7039 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7040#else
7041 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7042#endif
7043}
7044#line 7045 "parse.c"
7045 break;
7046
7047 case YYSYMBOL_tINTEGER: /* "integer literal" */
7048#line 1933 "parse.y"
7049 {
7050#ifndef RIPPER
7051 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7052#else
7053 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7054#endif
7055}
7056#line 7057 "parse.c"
7057 break;
7058
7059 case YYSYMBOL_tFLOAT: /* "float literal" */
7060#line 1933 "parse.y"
7061 {
7062#ifndef RIPPER
7063 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7064#else
7065 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7066#endif
7067}
7068#line 7069 "parse.c"
7069 break;
7070
7071 case YYSYMBOL_tRATIONAL: /* "rational literal" */
7072#line 1933 "parse.y"
7073 {
7074#ifndef RIPPER
7075 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7076#else
7077 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7078#endif
7079}
7080#line 7081 "parse.c"
7081 break;
7082
7083 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
7084#line 1933 "parse.y"
7085 {
7086#ifndef RIPPER
7087 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7088#else
7089 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7090#endif
7091}
7092#line 7093 "parse.c"
7093 break;
7094
7095 case YYSYMBOL_tCHAR: /* "char literal" */
7096#line 1933 "parse.y"
7097 {
7098#ifndef RIPPER
7099 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7100#else
7101 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7102#endif
7103}
7104#line 7105 "parse.c"
7105 break;
7106
7107 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
7108#line 1940 "parse.y"
7109 {
7110#ifndef RIPPER
7111 rb_parser_printf(p, "$%ld", RNODE_NTH_REF(((*yyvaluep).node))->nd_nth);
7112#else
7113 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
7114#endif
7115}
7116#line 7117 "parse.c"
7117 break;
7118
7119 case YYSYMBOL_tBACK_REF: /* "back reference" */
7120#line 1947 "parse.y"
7121 {
7122#ifndef RIPPER
7123 rb_parser_printf(p, "$%c", (int)RNODE_BACK_REF(((*yyvaluep).node))->nd_nth);
7124#else
7125 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
7126#endif
7127}
7128#line 7129 "parse.c"
7129 break;
7130
7131 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
7132#line 1933 "parse.y"
7133 {
7134#ifndef RIPPER
7135 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7136#else
7137 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7138#endif
7139}
7140#line 7141 "parse.c"
7141 break;
7142
7143 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
7144#line 1926 "parse.y"
7145 {
7146#ifndef RIPPER
7147 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7148#else
7149 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7150#endif
7151}
7152#line 7153 "parse.c"
7153 break;
7154
7155 case YYSYMBOL_top_compstmt: /* top_compstmt */
7156#line 1915 "parse.y"
7157 {
7158#ifndef RIPPER
7159 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7160 rb_parser_printf(p, "NODE_SPECIAL");
7161 }
7162 else if (((*yyvaluep).node)) {
7163 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7164 }
7165#else
7166#endif
7167}
7168#line 7169 "parse.c"
7169 break;
7170
7171 case YYSYMBOL_top_stmts: /* top_stmts */
7172#line 1915 "parse.y"
7173 {
7174#ifndef RIPPER
7175 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7176 rb_parser_printf(p, "NODE_SPECIAL");
7177 }
7178 else if (((*yyvaluep).node)) {
7179 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7180 }
7181#else
7182#endif
7183}
7184#line 7185 "parse.c"
7185 break;
7186
7187 case YYSYMBOL_top_stmt: /* top_stmt */
7188#line 1915 "parse.y"
7189 {
7190#ifndef RIPPER
7191 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7192 rb_parser_printf(p, "NODE_SPECIAL");
7193 }
7194 else if (((*yyvaluep).node)) {
7195 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7196 }
7197#else
7198#endif
7199}
7200#line 7201 "parse.c"
7201 break;
7202
7203 case YYSYMBOL_begin_block: /* begin_block */
7204#line 1915 "parse.y"
7205 {
7206#ifndef RIPPER
7207 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7208 rb_parser_printf(p, "NODE_SPECIAL");
7209 }
7210 else if (((*yyvaluep).node)) {
7211 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7212 }
7213#else
7214#endif
7215}
7216#line 7217 "parse.c"
7217 break;
7218
7219 case YYSYMBOL_bodystmt: /* bodystmt */
7220#line 1915 "parse.y"
7221 {
7222#ifndef RIPPER
7223 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7224 rb_parser_printf(p, "NODE_SPECIAL");
7225 }
7226 else if (((*yyvaluep).node)) {
7227 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7228 }
7229#else
7230#endif
7231}
7232#line 7233 "parse.c"
7233 break;
7234
7235 case YYSYMBOL_compstmt: /* compstmt */
7236#line 1915 "parse.y"
7237 {
7238#ifndef RIPPER
7239 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7240 rb_parser_printf(p, "NODE_SPECIAL");
7241 }
7242 else if (((*yyvaluep).node)) {
7243 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7244 }
7245#else
7246#endif
7247}
7248#line 7249 "parse.c"
7249 break;
7250
7251 case YYSYMBOL_stmts: /* stmts */
7252#line 1915 "parse.y"
7253 {
7254#ifndef RIPPER
7255 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7256 rb_parser_printf(p, "NODE_SPECIAL");
7257 }
7258 else if (((*yyvaluep).node)) {
7259 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7260 }
7261#else
7262#endif
7263}
7264#line 7265 "parse.c"
7265 break;
7266
7267 case YYSYMBOL_stmt_or_begin: /* stmt_or_begin */
7268#line 1915 "parse.y"
7269 {
7270#ifndef RIPPER
7271 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7272 rb_parser_printf(p, "NODE_SPECIAL");
7273 }
7274 else if (((*yyvaluep).node)) {
7275 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7276 }
7277#else
7278#endif
7279}
7280#line 7281 "parse.c"
7281 break;
7282
7283 case YYSYMBOL_stmt: /* stmt */
7284#line 1915 "parse.y"
7285 {
7286#ifndef RIPPER
7287 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7288 rb_parser_printf(p, "NODE_SPECIAL");
7289 }
7290 else if (((*yyvaluep).node)) {
7291 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7292 }
7293#else
7294#endif
7295}
7296#line 7297 "parse.c"
7297 break;
7298
7299 case YYSYMBOL_command_asgn: /* command_asgn */
7300#line 1915 "parse.y"
7301 {
7302#ifndef RIPPER
7303 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7304 rb_parser_printf(p, "NODE_SPECIAL");
7305 }
7306 else if (((*yyvaluep).node)) {
7307 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7308 }
7309#else
7310#endif
7311}
7312#line 7313 "parse.c"
7313 break;
7314
7315 case YYSYMBOL_endless_command: /* endless_command */
7316#line 1915 "parse.y"
7317 {
7318#ifndef RIPPER
7319 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7320 rb_parser_printf(p, "NODE_SPECIAL");
7321 }
7322 else if (((*yyvaluep).node)) {
7323 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7324 }
7325#else
7326#endif
7327}
7328#line 7329 "parse.c"
7329 break;
7330
7331 case YYSYMBOL_command_rhs: /* command_rhs */
7332#line 1915 "parse.y"
7333 {
7334#ifndef RIPPER
7335 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7336 rb_parser_printf(p, "NODE_SPECIAL");
7337 }
7338 else if (((*yyvaluep).node)) {
7339 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7340 }
7341#else
7342#endif
7343}
7344#line 7345 "parse.c"
7345 break;
7346
7347 case YYSYMBOL_expr: /* expr */
7348#line 1915 "parse.y"
7349 {
7350#ifndef RIPPER
7351 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7352 rb_parser_printf(p, "NODE_SPECIAL");
7353 }
7354 else if (((*yyvaluep).node)) {
7355 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7356 }
7357#else
7358#endif
7359}
7360#line 7361 "parse.c"
7361 break;
7362
7363 case YYSYMBOL_expr_value: /* expr_value */
7364#line 1915 "parse.y"
7365 {
7366#ifndef RIPPER
7367 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7368 rb_parser_printf(p, "NODE_SPECIAL");
7369 }
7370 else if (((*yyvaluep).node)) {
7371 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7372 }
7373#else
7374#endif
7375}
7376#line 7377 "parse.c"
7377 break;
7378
7379 case YYSYMBOL_expr_value_do: /* expr_value_do */
7380#line 1915 "parse.y"
7381 {
7382#ifndef RIPPER
7383 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7384 rb_parser_printf(p, "NODE_SPECIAL");
7385 }
7386 else if (((*yyvaluep).node)) {
7387 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7388 }
7389#else
7390#endif
7391}
7392#line 7393 "parse.c"
7393 break;
7394
7395 case YYSYMBOL_command_call: /* command_call */
7396#line 1915 "parse.y"
7397 {
7398#ifndef RIPPER
7399 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7400 rb_parser_printf(p, "NODE_SPECIAL");
7401 }
7402 else if (((*yyvaluep).node)) {
7403 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7404 }
7405#else
7406#endif
7407}
7408#line 7409 "parse.c"
7409 break;
7410
7411 case YYSYMBOL_block_command: /* block_command */
7412#line 1915 "parse.y"
7413 {
7414#ifndef RIPPER
7415 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7416 rb_parser_printf(p, "NODE_SPECIAL");
7417 }
7418 else if (((*yyvaluep).node)) {
7419 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7420 }
7421#else
7422#endif
7423}
7424#line 7425 "parse.c"
7425 break;
7426
7427 case YYSYMBOL_cmd_brace_block: /* cmd_brace_block */
7428#line 1915 "parse.y"
7429 {
7430#ifndef RIPPER
7431 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7432 rb_parser_printf(p, "NODE_SPECIAL");
7433 }
7434 else if (((*yyvaluep).node)) {
7435 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7436 }
7437#else
7438#endif
7439}
7440#line 7441 "parse.c"
7441 break;
7442
7443 case YYSYMBOL_fcall: /* fcall */
7444#line 1915 "parse.y"
7445 {
7446#ifndef RIPPER
7447 if ((NODE *)((*yyvaluep).node_fcall) == (NODE *)-1) {
7448 rb_parser_printf(p, "NODE_SPECIAL");
7449 }
7450 else if (((*yyvaluep).node_fcall)) {
7451 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_fcall)))));
7452 }
7453#else
7454#endif
7455}
7456#line 7457 "parse.c"
7457 break;
7458
7459 case YYSYMBOL_command: /* command */
7460#line 1915 "parse.y"
7461 {
7462#ifndef RIPPER
7463 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7464 rb_parser_printf(p, "NODE_SPECIAL");
7465 }
7466 else if (((*yyvaluep).node)) {
7467 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7468 }
7469#else
7470#endif
7471}
7472#line 7473 "parse.c"
7473 break;
7474
7475 case YYSYMBOL_mlhs_item: /* mlhs_item */
7476#line 1915 "parse.y"
7477 {
7478#ifndef RIPPER
7479 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7480 rb_parser_printf(p, "NODE_SPECIAL");
7481 }
7482 else if (((*yyvaluep).node)) {
7483 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7484 }
7485#else
7486#endif
7487}
7488#line 7489 "parse.c"
7489 break;
7490
7491 case YYSYMBOL_mlhs_head: /* mlhs_head */
7492#line 1915 "parse.y"
7493 {
7494#ifndef RIPPER
7495 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7496 rb_parser_printf(p, "NODE_SPECIAL");
7497 }
7498 else if (((*yyvaluep).node)) {
7499 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7500 }
7501#else
7502#endif
7503}
7504#line 7505 "parse.c"
7505 break;
7506
7507 case YYSYMBOL_mlhs_post: /* mlhs_post */
7508#line 1915 "parse.y"
7509 {
7510#ifndef RIPPER
7511 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7512 rb_parser_printf(p, "NODE_SPECIAL");
7513 }
7514 else if (((*yyvaluep).node)) {
7515 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7516 }
7517#else
7518#endif
7519}
7520#line 7521 "parse.c"
7521 break;
7522
7523 case YYSYMBOL_mlhs_node: /* mlhs_node */
7524#line 1915 "parse.y"
7525 {
7526#ifndef RIPPER
7527 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7528 rb_parser_printf(p, "NODE_SPECIAL");
7529 }
7530 else if (((*yyvaluep).node)) {
7531 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7532 }
7533#else
7534#endif
7535}
7536#line 7537 "parse.c"
7537 break;
7538
7539 case YYSYMBOL_lhs: /* lhs */
7540#line 1915 "parse.y"
7541 {
7542#ifndef RIPPER
7543 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7544 rb_parser_printf(p, "NODE_SPECIAL");
7545 }
7546 else if (((*yyvaluep).node)) {
7547 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7548 }
7549#else
7550#endif
7551}
7552#line 7553 "parse.c"
7553 break;
7554
7555 case YYSYMBOL_cpath: /* cpath */
7556#line 1915 "parse.y"
7557 {
7558#ifndef RIPPER
7559 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7560 rb_parser_printf(p, "NODE_SPECIAL");
7561 }
7562 else if (((*yyvaluep).node)) {
7563 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7564 }
7565#else
7566#endif
7567}
7568#line 7569 "parse.c"
7569 break;
7570
7571 case YYSYMBOL_fitem: /* fitem */
7572#line 1915 "parse.y"
7573 {
7574#ifndef RIPPER
7575 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7576 rb_parser_printf(p, "NODE_SPECIAL");
7577 }
7578 else if (((*yyvaluep).node)) {
7579 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7580 }
7581#else
7582#endif
7583}
7584#line 7585 "parse.c"
7585 break;
7586
7587 case YYSYMBOL_undef_list: /* undef_list */
7588#line 1915 "parse.y"
7589 {
7590#ifndef RIPPER
7591 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7592 rb_parser_printf(p, "NODE_SPECIAL");
7593 }
7594 else if (((*yyvaluep).node)) {
7595 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7596 }
7597#else
7598#endif
7599}
7600#line 7601 "parse.c"
7601 break;
7602
7603 case YYSYMBOL_arg: /* arg */
7604#line 1915 "parse.y"
7605 {
7606#ifndef RIPPER
7607 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7608 rb_parser_printf(p, "NODE_SPECIAL");
7609 }
7610 else if (((*yyvaluep).node)) {
7611 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7612 }
7613#else
7614#endif
7615}
7616#line 7617 "parse.c"
7617 break;
7618
7619 case YYSYMBOL_endless_arg: /* endless_arg */
7620#line 1915 "parse.y"
7621 {
7622#ifndef RIPPER
7623 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7624 rb_parser_printf(p, "NODE_SPECIAL");
7625 }
7626 else if (((*yyvaluep).node)) {
7627 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7628 }
7629#else
7630#endif
7631}
7632#line 7633 "parse.c"
7633 break;
7634
7635 case YYSYMBOL_rel_expr: /* rel_expr */
7636#line 1915 "parse.y"
7637 {
7638#ifndef RIPPER
7639 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7640 rb_parser_printf(p, "NODE_SPECIAL");
7641 }
7642 else if (((*yyvaluep).node)) {
7643 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7644 }
7645#else
7646#endif
7647}
7648#line 7649 "parse.c"
7649 break;
7650
7651 case YYSYMBOL_arg_value: /* arg_value */
7652#line 1915 "parse.y"
7653 {
7654#ifndef RIPPER
7655 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7656 rb_parser_printf(p, "NODE_SPECIAL");
7657 }
7658 else if (((*yyvaluep).node)) {
7659 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7660 }
7661#else
7662#endif
7663}
7664#line 7665 "parse.c"
7665 break;
7666
7667 case YYSYMBOL_aref_args: /* aref_args */
7668#line 1915 "parse.y"
7669 {
7670#ifndef RIPPER
7671 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7672 rb_parser_printf(p, "NODE_SPECIAL");
7673 }
7674 else if (((*yyvaluep).node)) {
7675 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7676 }
7677#else
7678#endif
7679}
7680#line 7681 "parse.c"
7681 break;
7682
7683 case YYSYMBOL_arg_rhs: /* arg_rhs */
7684#line 1915 "parse.y"
7685 {
7686#ifndef RIPPER
7687 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7688 rb_parser_printf(p, "NODE_SPECIAL");
7689 }
7690 else if (((*yyvaluep).node)) {
7691 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7692 }
7693#else
7694#endif
7695}
7696#line 7697 "parse.c"
7697 break;
7698
7699 case YYSYMBOL_paren_args: /* paren_args */
7700#line 1915 "parse.y"
7701 {
7702#ifndef RIPPER
7703 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7704 rb_parser_printf(p, "NODE_SPECIAL");
7705 }
7706 else if (((*yyvaluep).node)) {
7707 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7708 }
7709#else
7710#endif
7711}
7712#line 7713 "parse.c"
7713 break;
7714
7715 case YYSYMBOL_opt_paren_args: /* opt_paren_args */
7716#line 1915 "parse.y"
7717 {
7718#ifndef RIPPER
7719 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7720 rb_parser_printf(p, "NODE_SPECIAL");
7721 }
7722 else if (((*yyvaluep).node)) {
7723 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7724 }
7725#else
7726#endif
7727}
7728#line 7729 "parse.c"
7729 break;
7730
7731 case YYSYMBOL_opt_call_args: /* opt_call_args */
7732#line 1915 "parse.y"
7733 {
7734#ifndef RIPPER
7735 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7736 rb_parser_printf(p, "NODE_SPECIAL");
7737 }
7738 else if (((*yyvaluep).node)) {
7739 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7740 }
7741#else
7742#endif
7743}
7744#line 7745 "parse.c"
7745 break;
7746
7747 case YYSYMBOL_call_args: /* call_args */
7748#line 1915 "parse.y"
7749 {
7750#ifndef RIPPER
7751 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7752 rb_parser_printf(p, "NODE_SPECIAL");
7753 }
7754 else if (((*yyvaluep).node)) {
7755 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7756 }
7757#else
7758#endif
7759}
7760#line 7761 "parse.c"
7761 break;
7762
7763 case YYSYMBOL_command_args: /* command_args */
7764#line 1915 "parse.y"
7765 {
7766#ifndef RIPPER
7767 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7768 rb_parser_printf(p, "NODE_SPECIAL");
7769 }
7770 else if (((*yyvaluep).node)) {
7771 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7772 }
7773#else
7774#endif
7775}
7776#line 7777 "parse.c"
7777 break;
7778
7779 case YYSYMBOL_block_arg: /* block_arg */
7780#line 1915 "parse.y"
7781 {
7782#ifndef RIPPER
7783 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
7784 rb_parser_printf(p, "NODE_SPECIAL");
7785 }
7786 else if (((*yyvaluep).node_block_pass)) {
7787 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
7788 }
7789#else
7790#endif
7791}
7792#line 7793 "parse.c"
7793 break;
7794
7795 case YYSYMBOL_opt_block_arg: /* opt_block_arg */
7796#line 1915 "parse.y"
7797 {
7798#ifndef RIPPER
7799 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
7800 rb_parser_printf(p, "NODE_SPECIAL");
7801 }
7802 else if (((*yyvaluep).node_block_pass)) {
7803 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
7804 }
7805#else
7806#endif
7807}
7808#line 7809 "parse.c"
7809 break;
7810
7811 case YYSYMBOL_args: /* args */
7812#line 1915 "parse.y"
7813 {
7814#ifndef RIPPER
7815 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7816 rb_parser_printf(p, "NODE_SPECIAL");
7817 }
7818 else if (((*yyvaluep).node)) {
7819 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7820 }
7821#else
7822#endif
7823}
7824#line 7825 "parse.c"
7825 break;
7826
7827 case YYSYMBOL_arg_splat: /* arg_splat */
7828#line 1915 "parse.y"
7829 {
7830#ifndef RIPPER
7831 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7832 rb_parser_printf(p, "NODE_SPECIAL");
7833 }
7834 else if (((*yyvaluep).node)) {
7835 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7836 }
7837#else
7838#endif
7839}
7840#line 7841 "parse.c"
7841 break;
7842
7843 case YYSYMBOL_mrhs_arg: /* mrhs_arg */
7844#line 1915 "parse.y"
7845 {
7846#ifndef RIPPER
7847 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7848 rb_parser_printf(p, "NODE_SPECIAL");
7849 }
7850 else if (((*yyvaluep).node)) {
7851 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7852 }
7853#else
7854#endif
7855}
7856#line 7857 "parse.c"
7857 break;
7858
7859 case YYSYMBOL_mrhs: /* mrhs */
7860#line 1915 "parse.y"
7861 {
7862#ifndef RIPPER
7863 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7864 rb_parser_printf(p, "NODE_SPECIAL");
7865 }
7866 else if (((*yyvaluep).node)) {
7867 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7868 }
7869#else
7870#endif
7871}
7872#line 7873 "parse.c"
7873 break;
7874
7875 case YYSYMBOL_primary: /* primary */
7876#line 1915 "parse.y"
7877 {
7878#ifndef RIPPER
7879 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7880 rb_parser_printf(p, "NODE_SPECIAL");
7881 }
7882 else if (((*yyvaluep).node)) {
7883 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7884 }
7885#else
7886#endif
7887}
7888#line 7889 "parse.c"
7889 break;
7890
7891 case YYSYMBOL_primary_value: /* primary_value */
7892#line 1915 "parse.y"
7893 {
7894#ifndef RIPPER
7895 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7896 rb_parser_printf(p, "NODE_SPECIAL");
7897 }
7898 else if (((*yyvaluep).node)) {
7899 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7900 }
7901#else
7902#endif
7903}
7904#line 7905 "parse.c"
7905 break;
7906
7907 case YYSYMBOL_if_tail: /* if_tail */
7908#line 1915 "parse.y"
7909 {
7910#ifndef RIPPER
7911 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7912 rb_parser_printf(p, "NODE_SPECIAL");
7913 }
7914 else if (((*yyvaluep).node)) {
7915 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7916 }
7917#else
7918#endif
7919}
7920#line 7921 "parse.c"
7921 break;
7922
7923 case YYSYMBOL_opt_else: /* opt_else */
7924#line 1915 "parse.y"
7925 {
7926#ifndef RIPPER
7927 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7928 rb_parser_printf(p, "NODE_SPECIAL");
7929 }
7930 else if (((*yyvaluep).node)) {
7931 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7932 }
7933#else
7934#endif
7935}
7936#line 7937 "parse.c"
7937 break;
7938
7939 case YYSYMBOL_for_var: /* for_var */
7940#line 1915 "parse.y"
7941 {
7942#ifndef RIPPER
7943 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7944 rb_parser_printf(p, "NODE_SPECIAL");
7945 }
7946 else if (((*yyvaluep).node)) {
7947 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7948 }
7949#else
7950#endif
7951}
7952#line 7953 "parse.c"
7953 break;
7954
7955 case YYSYMBOL_f_marg: /* f_marg */
7956#line 1915 "parse.y"
7957 {
7958#ifndef RIPPER
7959 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7960 rb_parser_printf(p, "NODE_SPECIAL");
7961 }
7962 else if (((*yyvaluep).node)) {
7963 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7964 }
7965#else
7966#endif
7967}
7968#line 7969 "parse.c"
7969 break;
7970
7971 case YYSYMBOL_f_marg_list: /* f_marg_list */
7972#line 1915 "parse.y"
7973 {
7974#ifndef RIPPER
7975 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7976 rb_parser_printf(p, "NODE_SPECIAL");
7977 }
7978 else if (((*yyvaluep).node)) {
7979 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7980 }
7981#else
7982#endif
7983}
7984#line 7985 "parse.c"
7985 break;
7986
7987 case YYSYMBOL_f_rest_marg: /* f_rest_marg */
7988#line 1915 "parse.y"
7989 {
7990#ifndef RIPPER
7991 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7992 rb_parser_printf(p, "NODE_SPECIAL");
7993 }
7994 else if (((*yyvaluep).node)) {
7995 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7996 }
7997#else
7998#endif
7999}
8000#line 8001 "parse.c"
8001 break;
8002
8003 case YYSYMBOL_block_args_tail: /* block_args_tail */
8004#line 1915 "parse.y"
8005 {
8006#ifndef RIPPER
8007 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8008 rb_parser_printf(p, "NODE_SPECIAL");
8009 }
8010 else if (((*yyvaluep).node_args)) {
8011 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8012 }
8013#else
8014#endif
8015}
8016#line 8017 "parse.c"
8017 break;
8018
8019 case YYSYMBOL_opt_block_args_tail: /* opt_block_args_tail */
8020#line 1915 "parse.y"
8021 {
8022#ifndef RIPPER
8023 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8024 rb_parser_printf(p, "NODE_SPECIAL");
8025 }
8026 else if (((*yyvaluep).node_args)) {
8027 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8028 }
8029#else
8030#endif
8031}
8032#line 8033 "parse.c"
8033 break;
8034
8035 case YYSYMBOL_block_param: /* block_param */
8036#line 1915 "parse.y"
8037 {
8038#ifndef RIPPER
8039 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8040 rb_parser_printf(p, "NODE_SPECIAL");
8041 }
8042 else if (((*yyvaluep).node_args)) {
8043 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8044 }
8045#else
8046#endif
8047}
8048#line 8049 "parse.c"
8049 break;
8050
8051 case YYSYMBOL_opt_block_param: /* opt_block_param */
8052#line 1915 "parse.y"
8053 {
8054#ifndef RIPPER
8055 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8056 rb_parser_printf(p, "NODE_SPECIAL");
8057 }
8058 else if (((*yyvaluep).node_args)) {
8059 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8060 }
8061#else
8062#endif
8063}
8064#line 8065 "parse.c"
8065 break;
8066
8067 case YYSYMBOL_block_param_def: /* block_param_def */
8068#line 1915 "parse.y"
8069 {
8070#ifndef RIPPER
8071 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8072 rb_parser_printf(p, "NODE_SPECIAL");
8073 }
8074 else if (((*yyvaluep).node_args)) {
8075 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8076 }
8077#else
8078#endif
8079}
8080#line 8081 "parse.c"
8081 break;
8082
8083 case YYSYMBOL_opt_bv_decl: /* opt_bv_decl */
8084#line 1915 "parse.y"
8085 {
8086#ifndef RIPPER
8087 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8088 rb_parser_printf(p, "NODE_SPECIAL");
8089 }
8090 else if (((*yyvaluep).node)) {
8091 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8092 }
8093#else
8094#endif
8095}
8096#line 8097 "parse.c"
8097 break;
8098
8099 case YYSYMBOL_bv_decls: /* bv_decls */
8100#line 1915 "parse.y"
8101 {
8102#ifndef RIPPER
8103 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8104 rb_parser_printf(p, "NODE_SPECIAL");
8105 }
8106 else if (((*yyvaluep).node)) {
8107 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8108 }
8109#else
8110#endif
8111}
8112#line 8113 "parse.c"
8113 break;
8114
8115 case YYSYMBOL_bvar: /* bvar */
8116#line 1915 "parse.y"
8117 {
8118#ifndef RIPPER
8119 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8120 rb_parser_printf(p, "NODE_SPECIAL");
8121 }
8122 else if (((*yyvaluep).node)) {
8123 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8124 }
8125#else
8126#endif
8127}
8128#line 8129 "parse.c"
8129 break;
8130
8131 case YYSYMBOL_numparam: /* numparam */
8132#line 1915 "parse.y"
8133 {
8134#ifndef RIPPER
8135 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8136 rb_parser_printf(p, "NODE_SPECIAL");
8137 }
8138 else if (((*yyvaluep).node)) {
8139 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8140 }
8141#else
8142#endif
8143}
8144#line 8145 "parse.c"
8145 break;
8146
8147 case YYSYMBOL_lambda: /* lambda */
8148#line 1915 "parse.y"
8149 {
8150#ifndef RIPPER
8151 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8152 rb_parser_printf(p, "NODE_SPECIAL");
8153 }
8154 else if (((*yyvaluep).node)) {
8155 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8156 }
8157#else
8158#endif
8159}
8160#line 8161 "parse.c"
8161 break;
8162
8163 case YYSYMBOL_f_larglist: /* f_larglist */
8164#line 1915 "parse.y"
8165 {
8166#ifndef RIPPER
8167 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8168 rb_parser_printf(p, "NODE_SPECIAL");
8169 }
8170 else if (((*yyvaluep).node_args)) {
8171 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8172 }
8173#else
8174#endif
8175}
8176#line 8177 "parse.c"
8177 break;
8178
8179 case YYSYMBOL_lambda_body: /* lambda_body */
8180#line 1915 "parse.y"
8181 {
8182#ifndef RIPPER
8183 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8184 rb_parser_printf(p, "NODE_SPECIAL");
8185 }
8186 else if (((*yyvaluep).node)) {
8187 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8188 }
8189#else
8190#endif
8191}
8192#line 8193 "parse.c"
8193 break;
8194
8195 case YYSYMBOL_do_block: /* do_block */
8196#line 1915 "parse.y"
8197 {
8198#ifndef RIPPER
8199 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8200 rb_parser_printf(p, "NODE_SPECIAL");
8201 }
8202 else if (((*yyvaluep).node)) {
8203 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8204 }
8205#else
8206#endif
8207}
8208#line 8209 "parse.c"
8209 break;
8210
8211 case YYSYMBOL_block_call: /* block_call */
8212#line 1915 "parse.y"
8213 {
8214#ifndef RIPPER
8215 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8216 rb_parser_printf(p, "NODE_SPECIAL");
8217 }
8218 else if (((*yyvaluep).node)) {
8219 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8220 }
8221#else
8222#endif
8223}
8224#line 8225 "parse.c"
8225 break;
8226
8227 case YYSYMBOL_method_call: /* method_call */
8228#line 1915 "parse.y"
8229 {
8230#ifndef RIPPER
8231 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8232 rb_parser_printf(p, "NODE_SPECIAL");
8233 }
8234 else if (((*yyvaluep).node)) {
8235 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8236 }
8237#else
8238#endif
8239}
8240#line 8241 "parse.c"
8241 break;
8242
8243 case YYSYMBOL_brace_block: /* brace_block */
8244#line 1915 "parse.y"
8245 {
8246#ifndef RIPPER
8247 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8248 rb_parser_printf(p, "NODE_SPECIAL");
8249 }
8250 else if (((*yyvaluep).node)) {
8251 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8252 }
8253#else
8254#endif
8255}
8256#line 8257 "parse.c"
8257 break;
8258
8259 case YYSYMBOL_brace_body: /* brace_body */
8260#line 1915 "parse.y"
8261 {
8262#ifndef RIPPER
8263 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8264 rb_parser_printf(p, "NODE_SPECIAL");
8265 }
8266 else if (((*yyvaluep).node)) {
8267 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8268 }
8269#else
8270#endif
8271}
8272#line 8273 "parse.c"
8273 break;
8274
8275 case YYSYMBOL_do_body: /* do_body */
8276#line 1915 "parse.y"
8277 {
8278#ifndef RIPPER
8279 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8280 rb_parser_printf(p, "NODE_SPECIAL");
8281 }
8282 else if (((*yyvaluep).node)) {
8283 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8284 }
8285#else
8286#endif
8287}
8288#line 8289 "parse.c"
8289 break;
8290
8291 case YYSYMBOL_case_args: /* case_args */
8292#line 1915 "parse.y"
8293 {
8294#ifndef RIPPER
8295 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8296 rb_parser_printf(p, "NODE_SPECIAL");
8297 }
8298 else if (((*yyvaluep).node)) {
8299 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8300 }
8301#else
8302#endif
8303}
8304#line 8305 "parse.c"
8305 break;
8306
8307 case YYSYMBOL_case_body: /* case_body */
8308#line 1915 "parse.y"
8309 {
8310#ifndef RIPPER
8311 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8312 rb_parser_printf(p, "NODE_SPECIAL");
8313 }
8314 else if (((*yyvaluep).node)) {
8315 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8316 }
8317#else
8318#endif
8319}
8320#line 8321 "parse.c"
8321 break;
8322
8323 case YYSYMBOL_cases: /* cases */
8324#line 1915 "parse.y"
8325 {
8326#ifndef RIPPER
8327 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8328 rb_parser_printf(p, "NODE_SPECIAL");
8329 }
8330 else if (((*yyvaluep).node)) {
8331 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8332 }
8333#else
8334#endif
8335}
8336#line 8337 "parse.c"
8337 break;
8338
8339 case YYSYMBOL_p_case_body: /* p_case_body */
8340#line 1915 "parse.y"
8341 {
8342#ifndef RIPPER
8343 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8344 rb_parser_printf(p, "NODE_SPECIAL");
8345 }
8346 else if (((*yyvaluep).node)) {
8347 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8348 }
8349#else
8350#endif
8351}
8352#line 8353 "parse.c"
8353 break;
8354
8355 case YYSYMBOL_p_cases: /* p_cases */
8356#line 1915 "parse.y"
8357 {
8358#ifndef RIPPER
8359 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8360 rb_parser_printf(p, "NODE_SPECIAL");
8361 }
8362 else if (((*yyvaluep).node)) {
8363 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8364 }
8365#else
8366#endif
8367}
8368#line 8369 "parse.c"
8369 break;
8370
8371 case YYSYMBOL_p_top_expr: /* p_top_expr */
8372#line 1915 "parse.y"
8373 {
8374#ifndef RIPPER
8375 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8376 rb_parser_printf(p, "NODE_SPECIAL");
8377 }
8378 else if (((*yyvaluep).node)) {
8379 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8380 }
8381#else
8382#endif
8383}
8384#line 8385 "parse.c"
8385 break;
8386
8387 case YYSYMBOL_p_top_expr_body: /* p_top_expr_body */
8388#line 1915 "parse.y"
8389 {
8390#ifndef RIPPER
8391 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8392 rb_parser_printf(p, "NODE_SPECIAL");
8393 }
8394 else if (((*yyvaluep).node)) {
8395 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8396 }
8397#else
8398#endif
8399}
8400#line 8401 "parse.c"
8401 break;
8402
8403 case YYSYMBOL_p_expr: /* p_expr */
8404#line 1915 "parse.y"
8405 {
8406#ifndef RIPPER
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#else
8414#endif
8415}
8416#line 8417 "parse.c"
8417 break;
8418
8419 case YYSYMBOL_p_as: /* p_as */
8420#line 1915 "parse.y"
8421 {
8422#ifndef RIPPER
8423 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8424 rb_parser_printf(p, "NODE_SPECIAL");
8425 }
8426 else if (((*yyvaluep).node)) {
8427 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8428 }
8429#else
8430#endif
8431}
8432#line 8433 "parse.c"
8433 break;
8434
8435 case YYSYMBOL_p_alt: /* p_alt */
8436#line 1915 "parse.y"
8437 {
8438#ifndef RIPPER
8439 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8440 rb_parser_printf(p, "NODE_SPECIAL");
8441 }
8442 else if (((*yyvaluep).node)) {
8443 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8444 }
8445#else
8446#endif
8447}
8448#line 8449 "parse.c"
8449 break;
8450
8451 case YYSYMBOL_p_expr_basic: /* p_expr_basic */
8452#line 1915 "parse.y"
8453 {
8454#ifndef RIPPER
8455 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8456 rb_parser_printf(p, "NODE_SPECIAL");
8457 }
8458 else if (((*yyvaluep).node)) {
8459 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8460 }
8461#else
8462#endif
8463}
8464#line 8465 "parse.c"
8465 break;
8466
8467 case YYSYMBOL_p_args: /* p_args */
8468#line 1915 "parse.y"
8469 {
8470#ifndef RIPPER
8471 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8472 rb_parser_printf(p, "NODE_SPECIAL");
8473 }
8474 else if (((*yyvaluep).node)) {
8475 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8476 }
8477#else
8478#endif
8479}
8480#line 8481 "parse.c"
8481 break;
8482
8483 case YYSYMBOL_p_args_head: /* p_args_head */
8484#line 1915 "parse.y"
8485 {
8486#ifndef RIPPER
8487 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8488 rb_parser_printf(p, "NODE_SPECIAL");
8489 }
8490 else if (((*yyvaluep).node)) {
8491 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8492 }
8493#else
8494#endif
8495}
8496#line 8497 "parse.c"
8497 break;
8498
8499 case YYSYMBOL_p_args_tail: /* p_args_tail */
8500#line 1915 "parse.y"
8501 {
8502#ifndef RIPPER
8503 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8504 rb_parser_printf(p, "NODE_SPECIAL");
8505 }
8506 else if (((*yyvaluep).node)) {
8507 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8508 }
8509#else
8510#endif
8511}
8512#line 8513 "parse.c"
8513 break;
8514
8515 case YYSYMBOL_p_find: /* p_find */
8516#line 1915 "parse.y"
8517 {
8518#ifndef RIPPER
8519 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8520 rb_parser_printf(p, "NODE_SPECIAL");
8521 }
8522 else if (((*yyvaluep).node)) {
8523 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8524 }
8525#else
8526#endif
8527}
8528#line 8529 "parse.c"
8529 break;
8530
8531 case YYSYMBOL_p_rest: /* p_rest */
8532#line 1915 "parse.y"
8533 {
8534#ifndef RIPPER
8535 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8536 rb_parser_printf(p, "NODE_SPECIAL");
8537 }
8538 else if (((*yyvaluep).node)) {
8539 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8540 }
8541#else
8542#endif
8543}
8544#line 8545 "parse.c"
8545 break;
8546
8547 case YYSYMBOL_p_args_post: /* p_args_post */
8548#line 1915 "parse.y"
8549 {
8550#ifndef RIPPER
8551 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8552 rb_parser_printf(p, "NODE_SPECIAL");
8553 }
8554 else if (((*yyvaluep).node)) {
8555 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8556 }
8557#else
8558#endif
8559}
8560#line 8561 "parse.c"
8561 break;
8562
8563 case YYSYMBOL_p_arg: /* p_arg */
8564#line 1915 "parse.y"
8565 {
8566#ifndef RIPPER
8567 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8568 rb_parser_printf(p, "NODE_SPECIAL");
8569 }
8570 else if (((*yyvaluep).node)) {
8571 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8572 }
8573#else
8574#endif
8575}
8576#line 8577 "parse.c"
8577 break;
8578
8579 case YYSYMBOL_p_kwargs: /* p_kwargs */
8580#line 1915 "parse.y"
8581 {
8582#ifndef RIPPER
8583 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8584 rb_parser_printf(p, "NODE_SPECIAL");
8585 }
8586 else if (((*yyvaluep).node)) {
8587 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8588 }
8589#else
8590#endif
8591}
8592#line 8593 "parse.c"
8593 break;
8594
8595 case YYSYMBOL_p_kwarg: /* p_kwarg */
8596#line 1915 "parse.y"
8597 {
8598#ifndef RIPPER
8599 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8600 rb_parser_printf(p, "NODE_SPECIAL");
8601 }
8602 else if (((*yyvaluep).node)) {
8603 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8604 }
8605#else
8606#endif
8607}
8608#line 8609 "parse.c"
8609 break;
8610
8611 case YYSYMBOL_p_kw: /* p_kw */
8612#line 1915 "parse.y"
8613 {
8614#ifndef RIPPER
8615 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8616 rb_parser_printf(p, "NODE_SPECIAL");
8617 }
8618 else if (((*yyvaluep).node)) {
8619 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8620 }
8621#else
8622#endif
8623}
8624#line 8625 "parse.c"
8625 break;
8626
8627 case YYSYMBOL_p_value: /* p_value */
8628#line 1915 "parse.y"
8629 {
8630#ifndef RIPPER
8631 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8632 rb_parser_printf(p, "NODE_SPECIAL");
8633 }
8634 else if (((*yyvaluep).node)) {
8635 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8636 }
8637#else
8638#endif
8639}
8640#line 8641 "parse.c"
8641 break;
8642
8643 case YYSYMBOL_p_primitive: /* p_primitive */
8644#line 1915 "parse.y"
8645 {
8646#ifndef RIPPER
8647 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8648 rb_parser_printf(p, "NODE_SPECIAL");
8649 }
8650 else if (((*yyvaluep).node)) {
8651 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8652 }
8653#else
8654#endif
8655}
8656#line 8657 "parse.c"
8657 break;
8658
8659 case YYSYMBOL_p_variable: /* p_variable */
8660#line 1915 "parse.y"
8661 {
8662#ifndef RIPPER
8663 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8664 rb_parser_printf(p, "NODE_SPECIAL");
8665 }
8666 else if (((*yyvaluep).node)) {
8667 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8668 }
8669#else
8670#endif
8671}
8672#line 8673 "parse.c"
8673 break;
8674
8675 case YYSYMBOL_p_var_ref: /* p_var_ref */
8676#line 1915 "parse.y"
8677 {
8678#ifndef RIPPER
8679 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8680 rb_parser_printf(p, "NODE_SPECIAL");
8681 }
8682 else if (((*yyvaluep).node)) {
8683 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8684 }
8685#else
8686#endif
8687}
8688#line 8689 "parse.c"
8689 break;
8690
8691 case YYSYMBOL_p_expr_ref: /* p_expr_ref */
8692#line 1915 "parse.y"
8693 {
8694#ifndef RIPPER
8695 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8696 rb_parser_printf(p, "NODE_SPECIAL");
8697 }
8698 else if (((*yyvaluep).node)) {
8699 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8700 }
8701#else
8702#endif
8703}
8704#line 8705 "parse.c"
8705 break;
8706
8707 case YYSYMBOL_p_const: /* p_const */
8708#line 1915 "parse.y"
8709 {
8710#ifndef RIPPER
8711 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8712 rb_parser_printf(p, "NODE_SPECIAL");
8713 }
8714 else if (((*yyvaluep).node)) {
8715 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8716 }
8717#else
8718#endif
8719}
8720#line 8721 "parse.c"
8721 break;
8722
8723 case YYSYMBOL_opt_rescue: /* opt_rescue */
8724#line 1915 "parse.y"
8725 {
8726#ifndef RIPPER
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#else
8734#endif
8735}
8736#line 8737 "parse.c"
8737 break;
8738
8739 case YYSYMBOL_exc_list: /* exc_list */
8740#line 1915 "parse.y"
8741 {
8742#ifndef RIPPER
8743 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8744 rb_parser_printf(p, "NODE_SPECIAL");
8745 }
8746 else if (((*yyvaluep).node)) {
8747 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8748 }
8749#else
8750#endif
8751}
8752#line 8753 "parse.c"
8753 break;
8754
8755 case YYSYMBOL_exc_var: /* exc_var */
8756#line 1915 "parse.y"
8757 {
8758#ifndef RIPPER
8759 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8760 rb_parser_printf(p, "NODE_SPECIAL");
8761 }
8762 else if (((*yyvaluep).node)) {
8763 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8764 }
8765#else
8766#endif
8767}
8768#line 8769 "parse.c"
8769 break;
8770
8771 case YYSYMBOL_opt_ensure: /* opt_ensure */
8772#line 1915 "parse.y"
8773 {
8774#ifndef RIPPER
8775 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8776 rb_parser_printf(p, "NODE_SPECIAL");
8777 }
8778 else if (((*yyvaluep).node)) {
8779 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8780 }
8781#else
8782#endif
8783}
8784#line 8785 "parse.c"
8785 break;
8786
8787 case YYSYMBOL_literal: /* literal */
8788#line 1915 "parse.y"
8789 {
8790#ifndef RIPPER
8791 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8792 rb_parser_printf(p, "NODE_SPECIAL");
8793 }
8794 else if (((*yyvaluep).node)) {
8795 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8796 }
8797#else
8798#endif
8799}
8800#line 8801 "parse.c"
8801 break;
8802
8803 case YYSYMBOL_strings: /* strings */
8804#line 1915 "parse.y"
8805 {
8806#ifndef RIPPER
8807 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8808 rb_parser_printf(p, "NODE_SPECIAL");
8809 }
8810 else if (((*yyvaluep).node)) {
8811 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8812 }
8813#else
8814#endif
8815}
8816#line 8817 "parse.c"
8817 break;
8818
8819 case YYSYMBOL_string: /* string */
8820#line 1915 "parse.y"
8821 {
8822#ifndef RIPPER
8823 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8824 rb_parser_printf(p, "NODE_SPECIAL");
8825 }
8826 else if (((*yyvaluep).node)) {
8827 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8828 }
8829#else
8830#endif
8831}
8832#line 8833 "parse.c"
8833 break;
8834
8835 case YYSYMBOL_string1: /* string1 */
8836#line 1915 "parse.y"
8837 {
8838#ifndef RIPPER
8839 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8840 rb_parser_printf(p, "NODE_SPECIAL");
8841 }
8842 else if (((*yyvaluep).node)) {
8843 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8844 }
8845#else
8846#endif
8847}
8848#line 8849 "parse.c"
8849 break;
8850
8851 case YYSYMBOL_xstring: /* xstring */
8852#line 1915 "parse.y"
8853 {
8854#ifndef RIPPER
8855 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8856 rb_parser_printf(p, "NODE_SPECIAL");
8857 }
8858 else if (((*yyvaluep).node)) {
8859 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8860 }
8861#else
8862#endif
8863}
8864#line 8865 "parse.c"
8865 break;
8866
8867 case YYSYMBOL_regexp: /* regexp */
8868#line 1915 "parse.y"
8869 {
8870#ifndef RIPPER
8871 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8872 rb_parser_printf(p, "NODE_SPECIAL");
8873 }
8874 else if (((*yyvaluep).node)) {
8875 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8876 }
8877#else
8878#endif
8879}
8880#line 8881 "parse.c"
8881 break;
8882
8883 case YYSYMBOL_words: /* words */
8884#line 1915 "parse.y"
8885 {
8886#ifndef RIPPER
8887 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8888 rb_parser_printf(p, "NODE_SPECIAL");
8889 }
8890 else if (((*yyvaluep).node)) {
8891 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8892 }
8893#else
8894#endif
8895}
8896#line 8897 "parse.c"
8897 break;
8898
8899 case YYSYMBOL_word_list: /* word_list */
8900#line 1915 "parse.y"
8901 {
8902#ifndef RIPPER
8903 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8904 rb_parser_printf(p, "NODE_SPECIAL");
8905 }
8906 else if (((*yyvaluep).node)) {
8907 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8908 }
8909#else
8910#endif
8911}
8912#line 8913 "parse.c"
8913 break;
8914
8915 case YYSYMBOL_word: /* word */
8916#line 1915 "parse.y"
8917 {
8918#ifndef RIPPER
8919 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8920 rb_parser_printf(p, "NODE_SPECIAL");
8921 }
8922 else if (((*yyvaluep).node)) {
8923 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8924 }
8925#else
8926#endif
8927}
8928#line 8929 "parse.c"
8929 break;
8930
8931 case YYSYMBOL_symbols: /* symbols */
8932#line 1915 "parse.y"
8933 {
8934#ifndef RIPPER
8935 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8936 rb_parser_printf(p, "NODE_SPECIAL");
8937 }
8938 else if (((*yyvaluep).node)) {
8939 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8940 }
8941#else
8942#endif
8943}
8944#line 8945 "parse.c"
8945 break;
8946
8947 case YYSYMBOL_symbol_list: /* symbol_list */
8948#line 1915 "parse.y"
8949 {
8950#ifndef RIPPER
8951 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8952 rb_parser_printf(p, "NODE_SPECIAL");
8953 }
8954 else if (((*yyvaluep).node)) {
8955 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8956 }
8957#else
8958#endif
8959}
8960#line 8961 "parse.c"
8961 break;
8962
8963 case YYSYMBOL_qwords: /* qwords */
8964#line 1915 "parse.y"
8965 {
8966#ifndef RIPPER
8967 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8968 rb_parser_printf(p, "NODE_SPECIAL");
8969 }
8970 else if (((*yyvaluep).node)) {
8971 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8972 }
8973#else
8974#endif
8975}
8976#line 8977 "parse.c"
8977 break;
8978
8979 case YYSYMBOL_qsymbols: /* qsymbols */
8980#line 1915 "parse.y"
8981 {
8982#ifndef RIPPER
8983 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8984 rb_parser_printf(p, "NODE_SPECIAL");
8985 }
8986 else if (((*yyvaluep).node)) {
8987 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8988 }
8989#else
8990#endif
8991}
8992#line 8993 "parse.c"
8993 break;
8994
8995 case YYSYMBOL_qword_list: /* qword_list */
8996#line 1915 "parse.y"
8997 {
8998#ifndef RIPPER
8999 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9000 rb_parser_printf(p, "NODE_SPECIAL");
9001 }
9002 else if (((*yyvaluep).node)) {
9003 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9004 }
9005#else
9006#endif
9007}
9008#line 9009 "parse.c"
9009 break;
9010
9011 case YYSYMBOL_qsym_list: /* qsym_list */
9012#line 1915 "parse.y"
9013 {
9014#ifndef RIPPER
9015 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9016 rb_parser_printf(p, "NODE_SPECIAL");
9017 }
9018 else if (((*yyvaluep).node)) {
9019 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9020 }
9021#else
9022#endif
9023}
9024#line 9025 "parse.c"
9025 break;
9026
9027 case YYSYMBOL_string_contents: /* string_contents */
9028#line 1915 "parse.y"
9029 {
9030#ifndef RIPPER
9031 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9032 rb_parser_printf(p, "NODE_SPECIAL");
9033 }
9034 else if (((*yyvaluep).node)) {
9035 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9036 }
9037#else
9038#endif
9039}
9040#line 9041 "parse.c"
9041 break;
9042
9043 case YYSYMBOL_xstring_contents: /* xstring_contents */
9044#line 1915 "parse.y"
9045 {
9046#ifndef RIPPER
9047 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9048 rb_parser_printf(p, "NODE_SPECIAL");
9049 }
9050 else if (((*yyvaluep).node)) {
9051 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9052 }
9053#else
9054#endif
9055}
9056#line 9057 "parse.c"
9057 break;
9058
9059 case YYSYMBOL_regexp_contents: /* regexp_contents */
9060#line 1915 "parse.y"
9061 {
9062#ifndef RIPPER
9063 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9064 rb_parser_printf(p, "NODE_SPECIAL");
9065 }
9066 else if (((*yyvaluep).node)) {
9067 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9068 }
9069#else
9070#endif
9071}
9072#line 9073 "parse.c"
9073 break;
9074
9075 case YYSYMBOL_string_content: /* string_content */
9076#line 1915 "parse.y"
9077 {
9078#ifndef RIPPER
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#else
9086#endif
9087}
9088#line 9089 "parse.c"
9089 break;
9090
9091 case YYSYMBOL_string_dvar: /* string_dvar */
9092#line 1915 "parse.y"
9093 {
9094#ifndef RIPPER
9095 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9096 rb_parser_printf(p, "NODE_SPECIAL");
9097 }
9098 else if (((*yyvaluep).node)) {
9099 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9100 }
9101#else
9102#endif
9103}
9104#line 9105 "parse.c"
9105 break;
9106
9107 case YYSYMBOL_symbol: /* symbol */
9108#line 1915 "parse.y"
9109 {
9110#ifndef RIPPER
9111 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9112 rb_parser_printf(p, "NODE_SPECIAL");
9113 }
9114 else if (((*yyvaluep).node)) {
9115 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9116 }
9117#else
9118#endif
9119}
9120#line 9121 "parse.c"
9121 break;
9122
9123 case YYSYMBOL_ssym: /* ssym */
9124#line 1915 "parse.y"
9125 {
9126#ifndef RIPPER
9127 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9128 rb_parser_printf(p, "NODE_SPECIAL");
9129 }
9130 else if (((*yyvaluep).node)) {
9131 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9132 }
9133#else
9134#endif
9135}
9136#line 9137 "parse.c"
9137 break;
9138
9139 case YYSYMBOL_dsym: /* dsym */
9140#line 1915 "parse.y"
9141 {
9142#ifndef RIPPER
9143 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9144 rb_parser_printf(p, "NODE_SPECIAL");
9145 }
9146 else if (((*yyvaluep).node)) {
9147 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9148 }
9149#else
9150#endif
9151}
9152#line 9153 "parse.c"
9153 break;
9154
9155 case YYSYMBOL_numeric: /* numeric */
9156#line 1915 "parse.y"
9157 {
9158#ifndef RIPPER
9159 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9160 rb_parser_printf(p, "NODE_SPECIAL");
9161 }
9162 else if (((*yyvaluep).node)) {
9163 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9164 }
9165#else
9166#endif
9167}
9168#line 9169 "parse.c"
9169 break;
9170
9171 case YYSYMBOL_simple_numeric: /* simple_numeric */
9172#line 1915 "parse.y"
9173 {
9174#ifndef RIPPER
9175 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9176 rb_parser_printf(p, "NODE_SPECIAL");
9177 }
9178 else if (((*yyvaluep).node)) {
9179 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9180 }
9181#else
9182#endif
9183}
9184#line 9185 "parse.c"
9185 break;
9186
9187 case YYSYMBOL_var_ref: /* var_ref */
9188#line 1915 "parse.y"
9189 {
9190#ifndef RIPPER
9191 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9192 rb_parser_printf(p, "NODE_SPECIAL");
9193 }
9194 else if (((*yyvaluep).node)) {
9195 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9196 }
9197#else
9198#endif
9199}
9200#line 9201 "parse.c"
9201 break;
9202
9203 case YYSYMBOL_var_lhs: /* var_lhs */
9204#line 1915 "parse.y"
9205 {
9206#ifndef RIPPER
9207 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9208 rb_parser_printf(p, "NODE_SPECIAL");
9209 }
9210 else if (((*yyvaluep).node)) {
9211 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9212 }
9213#else
9214#endif
9215}
9216#line 9217 "parse.c"
9217 break;
9218
9219 case YYSYMBOL_backref: /* backref */
9220#line 1915 "parse.y"
9221 {
9222#ifndef RIPPER
9223 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9224 rb_parser_printf(p, "NODE_SPECIAL");
9225 }
9226 else if (((*yyvaluep).node)) {
9227 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9228 }
9229#else
9230#endif
9231}
9232#line 9233 "parse.c"
9233 break;
9234
9235 case YYSYMBOL_superclass: /* superclass */
9236#line 1915 "parse.y"
9237 {
9238#ifndef RIPPER
9239 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9240 rb_parser_printf(p, "NODE_SPECIAL");
9241 }
9242 else if (((*yyvaluep).node)) {
9243 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9244 }
9245#else
9246#endif
9247}
9248#line 9249 "parse.c"
9249 break;
9250
9251 case YYSYMBOL_f_opt_paren_args: /* f_opt_paren_args */
9252#line 1915 "parse.y"
9253 {
9254#ifndef RIPPER
9255 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9256 rb_parser_printf(p, "NODE_SPECIAL");
9257 }
9258 else if (((*yyvaluep).node_args)) {
9259 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9260 }
9261#else
9262#endif
9263}
9264#line 9265 "parse.c"
9265 break;
9266
9267 case YYSYMBOL_f_paren_args: /* f_paren_args */
9268#line 1915 "parse.y"
9269 {
9270#ifndef RIPPER
9271 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9272 rb_parser_printf(p, "NODE_SPECIAL");
9273 }
9274 else if (((*yyvaluep).node_args)) {
9275 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9276 }
9277#else
9278#endif
9279}
9280#line 9281 "parse.c"
9281 break;
9282
9283 case YYSYMBOL_f_arglist: /* f_arglist */
9284#line 1915 "parse.y"
9285 {
9286#ifndef RIPPER
9287 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9288 rb_parser_printf(p, "NODE_SPECIAL");
9289 }
9290 else if (((*yyvaluep).node_args)) {
9291 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9292 }
9293#else
9294#endif
9295}
9296#line 9297 "parse.c"
9297 break;
9298
9299 case YYSYMBOL_args_tail: /* args_tail */
9300#line 1915 "parse.y"
9301 {
9302#ifndef RIPPER
9303 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9304 rb_parser_printf(p, "NODE_SPECIAL");
9305 }
9306 else if (((*yyvaluep).node_args)) {
9307 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9308 }
9309#else
9310#endif
9311}
9312#line 9313 "parse.c"
9313 break;
9314
9315 case YYSYMBOL_opt_args_tail: /* opt_args_tail */
9316#line 1915 "parse.y"
9317 {
9318#ifndef RIPPER
9319 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9320 rb_parser_printf(p, "NODE_SPECIAL");
9321 }
9322 else if (((*yyvaluep).node_args)) {
9323 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9324 }
9325#else
9326#endif
9327}
9328#line 9329 "parse.c"
9329 break;
9330
9331 case YYSYMBOL_f_args: /* f_args */
9332#line 1915 "parse.y"
9333 {
9334#ifndef RIPPER
9335 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9336 rb_parser_printf(p, "NODE_SPECIAL");
9337 }
9338 else if (((*yyvaluep).node_args)) {
9339 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9340 }
9341#else
9342#endif
9343}
9344#line 9345 "parse.c"
9345 break;
9346
9347 case YYSYMBOL_f_arg_item: /* f_arg_item */
9348#line 1915 "parse.y"
9349 {
9350#ifndef RIPPER
9351 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
9352 rb_parser_printf(p, "NODE_SPECIAL");
9353 }
9354 else if (((*yyvaluep).node_args_aux)) {
9355 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
9356 }
9357#else
9358#endif
9359}
9360#line 9361 "parse.c"
9361 break;
9362
9363 case YYSYMBOL_f_arg: /* f_arg */
9364#line 1915 "parse.y"
9365 {
9366#ifndef RIPPER
9367 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
9368 rb_parser_printf(p, "NODE_SPECIAL");
9369 }
9370 else if (((*yyvaluep).node_args_aux)) {
9371 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
9372 }
9373#else
9374#endif
9375}
9376#line 9377 "parse.c"
9377 break;
9378
9379 case YYSYMBOL_f_kw: /* f_kw */
9380#line 1915 "parse.y"
9381 {
9382#ifndef RIPPER
9383 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9384 rb_parser_printf(p, "NODE_SPECIAL");
9385 }
9386 else if (((*yyvaluep).node_kw_arg)) {
9387 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9388 }
9389#else
9390#endif
9391}
9392#line 9393 "parse.c"
9393 break;
9394
9395 case YYSYMBOL_f_block_kw: /* f_block_kw */
9396#line 1915 "parse.y"
9397 {
9398#ifndef RIPPER
9399 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9400 rb_parser_printf(p, "NODE_SPECIAL");
9401 }
9402 else if (((*yyvaluep).node_kw_arg)) {
9403 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9404 }
9405#else
9406#endif
9407}
9408#line 9409 "parse.c"
9409 break;
9410
9411 case YYSYMBOL_f_block_kwarg: /* f_block_kwarg */
9412#line 1915 "parse.y"
9413 {
9414#ifndef RIPPER
9415 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9416 rb_parser_printf(p, "NODE_SPECIAL");
9417 }
9418 else if (((*yyvaluep).node_kw_arg)) {
9419 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9420 }
9421#else
9422#endif
9423}
9424#line 9425 "parse.c"
9425 break;
9426
9427 case YYSYMBOL_f_kwarg: /* f_kwarg */
9428#line 1915 "parse.y"
9429 {
9430#ifndef RIPPER
9431 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9432 rb_parser_printf(p, "NODE_SPECIAL");
9433 }
9434 else if (((*yyvaluep).node_kw_arg)) {
9435 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9436 }
9437#else
9438#endif
9439}
9440#line 9441 "parse.c"
9441 break;
9442
9443 case YYSYMBOL_f_opt: /* f_opt */
9444#line 1915 "parse.y"
9445 {
9446#ifndef RIPPER
9447 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9448 rb_parser_printf(p, "NODE_SPECIAL");
9449 }
9450 else if (((*yyvaluep).node_opt_arg)) {
9451 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9452 }
9453#else
9454#endif
9455}
9456#line 9457 "parse.c"
9457 break;
9458
9459 case YYSYMBOL_f_block_opt: /* f_block_opt */
9460#line 1915 "parse.y"
9461 {
9462#ifndef RIPPER
9463 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9464 rb_parser_printf(p, "NODE_SPECIAL");
9465 }
9466 else if (((*yyvaluep).node_opt_arg)) {
9467 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9468 }
9469#else
9470#endif
9471}
9472#line 9473 "parse.c"
9473 break;
9474
9475 case YYSYMBOL_f_block_optarg: /* f_block_optarg */
9476#line 1915 "parse.y"
9477 {
9478#ifndef RIPPER
9479 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9480 rb_parser_printf(p, "NODE_SPECIAL");
9481 }
9482 else if (((*yyvaluep).node_opt_arg)) {
9483 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9484 }
9485#else
9486#endif
9487}
9488#line 9489 "parse.c"
9489 break;
9490
9491 case YYSYMBOL_f_optarg: /* f_optarg */
9492#line 1915 "parse.y"
9493 {
9494#ifndef RIPPER
9495 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9496 rb_parser_printf(p, "NODE_SPECIAL");
9497 }
9498 else if (((*yyvaluep).node_opt_arg)) {
9499 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9500 }
9501#else
9502#endif
9503}
9504#line 9505 "parse.c"
9505 break;
9506
9507 case YYSYMBOL_singleton: /* singleton */
9508#line 1915 "parse.y"
9509 {
9510#ifndef RIPPER
9511 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9512 rb_parser_printf(p, "NODE_SPECIAL");
9513 }
9514 else if (((*yyvaluep).node)) {
9515 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9516 }
9517#else
9518#endif
9519}
9520#line 9521 "parse.c"
9521 break;
9522
9523 case YYSYMBOL_assoc_list: /* assoc_list */
9524#line 1915 "parse.y"
9525 {
9526#ifndef RIPPER
9527 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9528 rb_parser_printf(p, "NODE_SPECIAL");
9529 }
9530 else if (((*yyvaluep).node)) {
9531 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9532 }
9533#else
9534#endif
9535}
9536#line 9537 "parse.c"
9537 break;
9538
9539 case YYSYMBOL_assocs: /* assocs */
9540#line 1915 "parse.y"
9541 {
9542#ifndef RIPPER
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#else
9550#endif
9551}
9552#line 9553 "parse.c"
9553 break;
9554
9555 case YYSYMBOL_assoc: /* assoc */
9556#line 1915 "parse.y"
9557 {
9558#ifndef RIPPER
9559 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9560 rb_parser_printf(p, "NODE_SPECIAL");
9561 }
9562 else if (((*yyvaluep).node)) {
9563 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9564 }
9565#else
9566#endif
9567}
9568#line 9569 "parse.c"
9569 break;
9570
9571 case YYSYMBOL_none: /* none */
9572#line 1915 "parse.y"
9573 {
9574#ifndef RIPPER
9575 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9576 rb_parser_printf(p, "NODE_SPECIAL");
9577 }
9578 else if (((*yyvaluep).node)) {
9579 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9580 }
9581#else
9582#endif
9583}
9584#line 9585 "parse.c"
9585 break;
9586
9587 default:
9588 break;
9589 }
9590 YY_IGNORE_MAYBE_UNINITIALIZED_END
9591}
9592
9593
9594/*---------------------------.
9595| Print this symbol on YYO. |
9596`---------------------------*/
9597
9598static void
9599yy_symbol_print (FILE *yyo,
9600 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
9601{
9602 YYFPRINTF (yyo, "%s %s (",
9603 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
9604
9605 YYLOCATION_PRINT (yyo, yylocationp, p);
9606 YYFPRINTF (yyo, ": ");
9607 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
9608 YYFPRINTF (yyo, ")");
9609}
9610
9611/*------------------------------------------------------------------.
9612| yy_stack_print -- Print the state stack from its BOTTOM up to its |
9613| TOP (included). |
9614`------------------------------------------------------------------*/
9615
9616static void
9617yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
9618{
9619 YYFPRINTF (stderr, "Stack now");
9620 for (; yybottom <= yytop; yybottom++)
9621 {
9622 int yybot = *yybottom;
9623 YYFPRINTF (stderr, " %d", yybot);
9624 }
9625 YYFPRINTF (stderr, "\n");
9626}
9627
9628# define YY_STACK_PRINT(Bottom, Top, p) \
9629do { \
9630 if (yydebug) \
9631 yy_stack_print ((Bottom), (Top), p); \
9632} while (0)
9633
9634
9635/*------------------------------------------------.
9636| Report that the YYRULE is going to be reduced. |
9637`------------------------------------------------*/
9638
9639static void
9640yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
9641 int yyrule, struct parser_params *p)
9642{
9643 int yylno = yyrline[yyrule];
9644 int yynrhs = yyr2[yyrule];
9645 int yyi;
9646 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
9647 yyrule - 1, yylno);
9648 /* The symbols being reduced. */
9649 for (yyi = 0; yyi < yynrhs; yyi++)
9650 {
9651 YYFPRINTF (stderr, " $%d = ", yyi + 1);
9652 yy_symbol_print (stderr,
9653 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
9654 &yyvsp[(yyi + 1) - (yynrhs)],
9655 &(yylsp[(yyi + 1) - (yynrhs)]), p);
9656 YYFPRINTF (stderr, "\n");
9657 }
9658}
9659
9660# define YY_REDUCE_PRINT(Rule, p) \
9661do { \
9662 if (yydebug) \
9663 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
9664} while (0)
9665
9666/* Nonzero means print parse trace. It is left uninitialized so that
9667 multiple parsers can coexist. */
9668#ifndef yydebug
9669int yydebug;
9670#endif
9671#else /* !YYDEBUG */
9672# define YYDPRINTF(Args) ((void) 0)
9673# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p)
9674# define YY_STACK_PRINT(Bottom, Top, p)
9675# define YY_REDUCE_PRINT(Rule, p)
9676#endif /* !YYDEBUG */
9677
9678
9679/* YYINITDEPTH -- initial size of the parser's stacks. */
9680#ifndef YYINITDEPTH
9681# define YYINITDEPTH 200
9682#endif
9683
9684/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
9685 if the built-in stack extension method is used).
9686
9687 Do not make this value too large; the results are undefined if
9688 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
9689 evaluated with infinite-precision integer arithmetic. */
9690
9691#ifndef YYMAXDEPTH
9692# define YYMAXDEPTH 10000
9693#endif
9694
9695
9696/* Context of a parse error. */
9697typedef struct
9698{
9699 yy_state_t *yyssp;
9700 yysymbol_kind_t yytoken;
9701 YYLTYPE *yylloc;
9702} yypcontext_t;
9703
9704/* Put in YYARG at most YYARGN of the expected tokens given the
9705 current YYCTX, and return the number of tokens stored in YYARG. If
9706 YYARG is null, return the number of expected tokens (guaranteed to
9707 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
9708 Return 0 if there are more than YYARGN expected tokens, yet fill
9709 YYARG up to YYARGN. */
9710static int
9711yypcontext_expected_tokens (const yypcontext_t *yyctx,
9712 yysymbol_kind_t yyarg[], int yyargn)
9713{
9714 /* Actual size of YYARG. */
9715 int yycount = 0;
9716 int yyn = yypact[+*yyctx->yyssp];
9717 if (!yypact_value_is_default (yyn))
9718 {
9719 /* Start YYX at -YYN if negative to avoid negative indexes in
9720 YYCHECK. In other words, skip the first -YYN actions for
9721 this state because they are default actions. */
9722 int yyxbegin = yyn < 0 ? -yyn : 0;
9723 /* Stay within bounds of both yycheck and yytname. */
9724 int yychecklim = YYLAST - yyn + 1;
9725 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
9726 int yyx;
9727 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
9728 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
9729 && !yytable_value_is_error (yytable[yyx + yyn]))
9730 {
9731 if (!yyarg)
9732 ++yycount;
9733 else if (yycount == yyargn)
9734 return 0;
9735 else
9736 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
9737 }
9738 }
9739 if (yyarg && yycount == 0 && 0 < yyargn)
9740 yyarg[0] = YYSYMBOL_YYEMPTY;
9741 return yycount;
9742}
9743
9744
9745
9746
9747#ifndef yystrlen
9748# if defined __GLIBC__ && defined _STRING_H
9749# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
9750# else
9751/* Return the length of YYSTR. */
9752static YYPTRDIFF_T
9753yystrlen (const char *yystr)
9754{
9755 YYPTRDIFF_T yylen;
9756 for (yylen = 0; yystr[yylen]; yylen++)
9757 continue;
9758 return yylen;
9759}
9760# endif
9761#endif
9762
9763#ifndef yystpcpy
9764# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
9765# define yystpcpy stpcpy
9766# else
9767/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
9768 YYDEST. */
9769static char *
9770yystpcpy (char *yydest, const char *yysrc)
9771{
9772 char *yyd = yydest;
9773 const char *yys = yysrc;
9774
9775 while ((*yyd++ = *yys++) != '\0')
9776 continue;
9777
9778 return yyd - 1;
9779}
9780# endif
9781#endif
9782
9783#ifndef yytnamerr
9784/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
9785 quotes and backslashes, so that it's suitable for yyerror. The
9786 heuristic is that double-quoting is unnecessary unless the string
9787 contains an apostrophe, a comma, or backslash (other than
9788 backslash-backslash). YYSTR is taken from yytname. If YYRES is
9789 null, do not copy; instead, return the length of what the result
9790 would have been. */
9791static YYPTRDIFF_T
9792yytnamerr (char *yyres, const char *yystr)
9793{
9794 if (*yystr == '"')
9795 {
9796 YYPTRDIFF_T yyn = 0;
9797 char const *yyp = yystr;
9798 for (;;)
9799 switch (*++yyp)
9800 {
9801 case '\'':
9802 case ',':
9803 goto do_not_strip_quotes;
9804
9805 case '\\':
9806 if (*++yyp != '\\')
9807 goto do_not_strip_quotes;
9808 else
9809 goto append;
9810
9811 append:
9812 default:
9813 if (yyres)
9814 yyres[yyn] = *yyp;
9815 yyn++;
9816 break;
9817
9818 case '"':
9819 if (yyres)
9820 yyres[yyn] = '\0';
9821 return yyn;
9822 }
9823 do_not_strip_quotes: ;
9824 }
9825
9826 if (yyres)
9827 return yystpcpy (yyres, yystr) - yyres;
9828 else
9829 return yystrlen (yystr);
9830}
9831#endif
9832
9833
9834static int
9835yy_syntax_error_arguments (const yypcontext_t *yyctx,
9836 yysymbol_kind_t yyarg[], int yyargn)
9837{
9838 /* Actual size of YYARG. */
9839 int yycount = 0;
9840 /* There are many possibilities here to consider:
9841 - If this state is a consistent state with a default action, then
9842 the only way this function was invoked is if the default action
9843 is an error action. In that case, don't check for expected
9844 tokens because there are none.
9845 - The only way there can be no lookahead present (in yychar) is if
9846 this state is a consistent state with a default action. Thus,
9847 detecting the absence of a lookahead is sufficient to determine
9848 that there is no unexpected or expected token to report. In that
9849 case, just report a simple "syntax error".
9850 - Don't assume there isn't a lookahead just because this state is a
9851 consistent state with a default action. There might have been a
9852 previous inconsistent state, consistent state with a non-default
9853 action, or user semantic action that manipulated yychar.
9854 - Of course, the expected token list depends on states to have
9855 correct lookahead information, and it depends on the parser not
9856 to perform extra reductions after fetching a lookahead from the
9857 scanner and before detecting a syntax error. Thus, state merging
9858 (from LALR or IELR) and default reductions corrupt the expected
9859 token list. However, the list is correct for canonical LR with
9860 one exception: it will still contain any token that will not be
9861 accepted due to an error action in a later state.
9862 */
9863 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
9864 {
9865 int yyn;
9866 if (yyarg)
9867 yyarg[yycount] = yyctx->yytoken;
9868 ++yycount;
9869 yyn = yypcontext_expected_tokens (yyctx,
9870 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
9871 if (yyn == YYENOMEM)
9872 return YYENOMEM;
9873 else
9874 yycount += yyn;
9875 }
9876 return yycount;
9877}
9878
9879/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
9880 about the unexpected token YYTOKEN for the state stack whose top is
9881 YYSSP.
9882
9883 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
9884 not large enough to hold the message. In that case, also set
9885 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
9886 required number of bytes is too large to store. */
9887static int
9888yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
9889 const yypcontext_t *yyctx, struct parser_params *p)
9890{
9891 enum { YYARGS_MAX = 5 };
9892 /* Internationalized format string. */
9893 const char *yyformat = YY_NULLPTR;
9894 /* Arguments of yyformat: reported tokens (one for the "unexpected",
9895 one per "expected"). */
9896 yysymbol_kind_t yyarg[YYARGS_MAX];
9897 /* Cumulated lengths of YYARG. */
9898 YYPTRDIFF_T yysize = 0;
9899
9900 /* Actual size of YYARG. */
9901 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
9902 if (yycount == YYENOMEM)
9903 return YYENOMEM;
9904
9905 switch (yycount)
9906 {
9907#define YYCASE_(N, S) \
9908 case N: \
9909 yyformat = S; \
9910 break
9911 default: /* Avoid compiler warnings. */
9912 YYCASE_(0, YY_("syntax error"));
9913 YYCASE_(1, YY_("syntax error, unexpected %s"));
9914 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
9915 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
9916 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
9917 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
9918#undef YYCASE_
9919 }
9920
9921 /* Compute error message size. Don't count the "%s"s, but reserve
9922 room for the terminator. */
9923 yysize = yystrlen (yyformat) - 2 * yycount + 1;
9924 {
9925 int yyi;
9926 for (yyi = 0; yyi < yycount; ++yyi)
9927 {
9928 YYPTRDIFF_T yysize1
9929 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
9930 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
9931 yysize = yysize1;
9932 else
9933 return YYENOMEM;
9934 }
9935 }
9936
9937 if (*yymsg_alloc < yysize)
9938 {
9939 *yymsg_alloc = 2 * yysize;
9940 if (! (yysize <= *yymsg_alloc
9941 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
9942 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
9943 return -1;
9944 }
9945
9946 /* Avoid sprintf, as that infringes on the user's name space.
9947 Don't have undefined behavior even if the translation
9948 produced a string with the wrong number of "%s"s. */
9949 {
9950 char *yyp = *yymsg;
9951 int yyi = 0;
9952 while ((*yyp = *yyformat) != '\0')
9953 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
9954 {
9955 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
9956 yyformat += 2;
9957 }
9958 else
9959 {
9960 ++yyp;
9961 ++yyformat;
9962 }
9963 }
9964 return 0;
9965}
9966
9967
9968/*-----------------------------------------------.
9969| Release the memory associated to this symbol. |
9970`-----------------------------------------------*/
9971
9972static void
9973yydestruct (const char *yymsg,
9974 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
9975{
9976 YY_USE (yyvaluep);
9977 YY_USE (yylocationp);
9978 YY_USE (p);
9979 if (!yymsg)
9980 yymsg = "Deleting";
9981 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp, p);
9982
9983 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
9984 YY_USE (yykind);
9985 YY_IGNORE_MAYBE_UNINITIALIZED_END
9986}
9987
9988
9989
9990
9991
9992
9993/*----------.
9994| yyparse. |
9995`----------*/
9996
9997int
9998yyparse (struct parser_params *p)
9999{
10000/* Lookahead token kind. */
10001int yychar;
10002
10003
10004/* The semantic value of the lookahead symbol. */
10005/* Default value used for initialization, for pacifying older GCCs
10006 or non-GCC compilers. */
10007YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)
10008YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
10009
10010/* Location data for the lookahead symbol. */
10011static const YYLTYPE yyloc_default
10012# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
10013 = { 1, 1, 1, 1 }
10014# endif
10015;
10016YYLTYPE yylloc = yyloc_default;
10017
10018 /* Number of syntax errors so far. */
10019 int yynerrs = 0;
10020 YY_USE (yynerrs); /* Silence compiler warning. */
10021
10022 yy_state_fast_t yystate = 0;
10023 /* Number of tokens to shift before error messages enabled. */
10024 int yyerrstatus = 0;
10025
10026 /* Refer to the stacks through separate pointers, to allow yyoverflow
10027 to reallocate them elsewhere. */
10028
10029 /* Their size. */
10030 YYPTRDIFF_T yystacksize = YYINITDEPTH;
10031
10032 /* The state stack: array, bottom, top. */
10033 yy_state_t yyssa[YYINITDEPTH];
10034 yy_state_t *yyss = yyssa;
10035 yy_state_t *yyssp = yyss;
10036
10037 /* The semantic value stack: array, bottom, top. */
10038 YYSTYPE yyvsa[YYINITDEPTH];
10039 YYSTYPE *yyvs = yyvsa;
10040 YYSTYPE *yyvsp = yyvs;
10041
10042 /* The location stack: array, bottom, top. */
10043 YYLTYPE yylsa[YYINITDEPTH];
10044 YYLTYPE *yyls = yylsa;
10045 YYLTYPE *yylsp = yyls;
10046
10047 int yyn;
10048 /* The return value of yyparse. */
10049 int yyresult;
10050 /* Lookahead symbol kind. */
10051 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
10052 /* The variables used to return semantic value and location from the
10053 action routines. */
10054 YYSTYPE yyval;
10055 YYLTYPE yyloc;
10056
10057 /* The locations where the error started and ended. */
10058 YYLTYPE yyerror_range[3];
10059
10060 /* Buffer for error messages, and its allocated size. */
10061 char yymsgbuf[128];
10062 char *yymsg = yymsgbuf;
10063 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
10064
10065#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
10066
10067 /* The number of symbols on the RHS of the reduced rule.
10068 Keep to zero when no symbol should be popped. */
10069 int yylen = 0;
10070
10071 YYDPRINTF ((stderr, "Starting parse\n"));
10072
10073 yychar = YYEMPTY; /* Cause a token to be read. */
10074
10075
10076 /* User initialization code. */
10077#line 1958 "parse.y"
10078 {
10079 RUBY_SET_YYLLOC_OF_NONE(yylloc);
10080}
10081
10082#line 10083 "parse.c"
10083
10084 yylsp[0] = yylloc;
10085 goto yysetstate;
10086
10087
10088/*------------------------------------------------------------.
10089| yynewstate -- push a new state, which is found in yystate. |
10090`------------------------------------------------------------*/
10091yynewstate:
10092 /* In all cases, when you get here, the value and location stacks
10093 have just been pushed. So pushing a state here evens the stacks. */
10094 yyssp++;
10095
10096
10097/*--------------------------------------------------------------------.
10098| yysetstate -- set current state (the top of the stack) to yystate. |
10099`--------------------------------------------------------------------*/
10100yysetstate:
10101 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
10102 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
10103 YY_IGNORE_USELESS_CAST_BEGIN
10104 *yyssp = YY_CAST (yy_state_t, yystate);
10105 YY_IGNORE_USELESS_CAST_END
10106 YY_STACK_PRINT (yyss, yyssp, p);
10107
10108 if (yyss + yystacksize - 1 <= yyssp)
10109#if !defined yyoverflow && !defined YYSTACK_RELOCATE
10110 YYNOMEM;
10111#else
10112 {
10113 /* Get the current used size of the three stacks, in elements. */
10114 YYPTRDIFF_T yysize = yyssp - yyss + 1;
10115
10116# if defined yyoverflow
10117 {
10118 /* Give user a chance to reallocate the stack. Use copies of
10119 these so that the &'s don't force the real ones into
10120 memory. */
10121 yy_state_t *yyss1 = yyss;
10122 YYSTYPE *yyvs1 = yyvs;
10123 YYLTYPE *yyls1 = yyls;
10124
10125 /* Each stack pointer address is followed by the size of the
10126 data in use in that stack, in bytes. This used to be a
10127 conditional around just the two extra args, but that might
10128 be undefined if yyoverflow is a macro. */
10129 yyoverflow (YY_("memory exhausted"),
10130 &yyss1, yysize * YYSIZEOF (*yyssp),
10131 &yyvs1, yysize * YYSIZEOF (*yyvsp),
10132 &yyls1, yysize * YYSIZEOF (*yylsp),
10133 &yystacksize);
10134 yyss = yyss1;
10135 yyvs = yyvs1;
10136 yyls = yyls1;
10137 }
10138# else /* defined YYSTACK_RELOCATE */
10139 /* Extend the stack our own way. */
10140 if (YYMAXDEPTH <= yystacksize)
10141 YYNOMEM;
10142 yystacksize *= 2;
10143 if (YYMAXDEPTH < yystacksize)
10144 yystacksize = YYMAXDEPTH;
10145
10146 {
10147 yy_state_t *yyss1 = yyss;
10148 union yyalloc *yyptr =
10149 YY_CAST (union yyalloc *,
10150 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
10151 if (! yyptr)
10152 YYNOMEM;
10153 YYSTACK_RELOCATE (yyss_alloc, yyss);
10154 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
10155 YYSTACK_RELOCATE (yyls_alloc, yyls);
10156# undef YYSTACK_RELOCATE
10157 if (yyss1 != yyssa)
10158 YYSTACK_FREE (yyss1);
10159 }
10160# endif
10161
10162 yyssp = yyss + yysize - 1;
10163 yyvsp = yyvs + yysize - 1;
10164 yylsp = yyls + yysize - 1;
10165
10166 YY_IGNORE_USELESS_CAST_BEGIN
10167 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
10168 YY_CAST (long, yystacksize)));
10169 YY_IGNORE_USELESS_CAST_END
10170
10171 if (yyss + yystacksize - 1 <= yyssp)
10172 YYABORT;
10173 }
10174#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
10175
10176
10177 if (yystate == YYFINAL)
10178 YYACCEPT;
10179
10180 goto yybackup;
10181
10182
10183/*-----------.
10184| yybackup. |
10185`-----------*/
10186yybackup:
10187 /* Do appropriate processing given the current state. Read a
10188 lookahead token if we need one and don't already have one. */
10189
10190 /* First try to decide what to do without reference to lookahead token. */
10191 yyn = yypact[yystate];
10192 if (yypact_value_is_default (yyn))
10193 goto yydefault;
10194
10195 /* Not known => get a lookahead token if don't already have one. */
10196
10197 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
10198 if (yychar == YYEMPTY)
10199 {
10200 YYDPRINTF ((stderr, "Reading a token\n"));
10201 yychar = yylex (&yylval, &yylloc, p);
10202 }
10203
10204 if (yychar <= END_OF_INPUT)
10205 {
10206 yychar = END_OF_INPUT;
10207 yytoken = YYSYMBOL_YYEOF;
10208 YYDPRINTF ((stderr, "Now at end of input.\n"));
10209 }
10210 else if (yychar == YYerror)
10211 {
10212 /* The scanner already issued an error message, process directly
10213 to error recovery. But do not keep the error token as
10214 lookahead, it is too special and may lead us to an endless
10215 loop in error recovery. */
10216 yychar = YYUNDEF;
10217 yytoken = YYSYMBOL_YYerror;
10218 yyerror_range[1] = yylloc;
10219 goto yyerrlab1;
10220 }
10221 else
10222 {
10223 yytoken = YYTRANSLATE (yychar);
10224 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc, p);
10225 }
10226
10227 /* If the proper action on seeing token YYTOKEN is to reduce or to
10228 detect an error, take that action. */
10229 yyn += yytoken;
10230 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
10231 goto yydefault;
10232 yyn = yytable[yyn];
10233 if (yyn <= 0)
10234 {
10235 if (yytable_value_is_error (yyn))
10236 goto yyerrlab;
10237 yyn = -yyn;
10238 goto yyreduce;
10239 }
10240
10241 /* Count tokens shifted since error; after three, turn off error
10242 status. */
10243 if (yyerrstatus)
10244 yyerrstatus--;
10245
10246 /* Shift the lookahead token. */
10247 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc, p);
10248 yystate = yyn;
10249 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
10250 *++yyvsp = yylval;
10251 YY_IGNORE_MAYBE_UNINITIALIZED_END
10252 *++yylsp = yylloc;
10253
10254 /* Discard the shifted token. */
10255 yychar = YYEMPTY;
10256 goto yynewstate;
10257
10258
10259/*-----------------------------------------------------------.
10260| yydefault -- do the default action for the current state. |
10261`-----------------------------------------------------------*/
10262yydefault:
10263 yyn = yydefact[yystate];
10264 if (yyn == 0)
10265 goto yyerrlab;
10266 goto yyreduce;
10267
10268
10269/*-----------------------------.
10270| yyreduce -- do a reduction. |
10271`-----------------------------*/
10272yyreduce:
10273 /* yyn is the number of a rule to reduce with. */
10274 yylen = yyr2[yyn];
10275
10276 /* If YYLEN is nonzero, implement the default value of the action:
10277 '$$ = $1'.
10278
10279 Otherwise, the following line sets YYVAL to garbage.
10280 This behavior is undocumented and Bison
10281 users should not rely upon it. Assigning to YYVAL
10282 unconditionally makes the parser a bit smaller, and it avoids a
10283 GCC warning that YYVAL may be used uninitialized. */
10284 yyval = yyvsp[1-yylen];
10285
10286 /* Default location. */
10287 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
10288 yyerror_range[1] = yyloc;
10289 YY_REDUCE_PRINT (yyn, p);
10290 switch (yyn)
10291 {
10292 case 2: /* $@1: %empty */
10293#line 2193 "parse.y"
10294 {
10295 SET_LEX_STATE(EXPR_BEG);
10296 local_push(p, ifndef_ripper(1)+0);
10297 /* jumps are possible in the top-level loop. */
10298 if (!ifndef_ripper(p->do_loop) + 0) init_block_exit(p);
10299 }
10300#line 10301 "parse.c"
10301 break;
10302
10303 case 3: /* program: $@1 top_compstmt */
10304#line 2200 "parse.y"
10305 {
10306 /*%%%*/
10307 if ((yyvsp[0].node) && !compile_for_eval) {
10308 NODE *node = (yyvsp[0].node);
10309 /* last expression should not be void */
10310 if (nd_type_p(node, NODE_BLOCK)) {
10311 while (RNODE_BLOCK(node)->nd_next) {
10312 node = RNODE_BLOCK(node)->nd_next;
10313 }
10314 node = RNODE_BLOCK(node)->nd_head;
10315 }
10316 node = remove_begin(node);
10317 void_expr(p, node);
10318 }
10319 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
10320 /*% %*/
10321 /*% ripper[final]: program!($2) %*/
10322 local_pop(p);
10323 }
10324#line 10325 "parse.c"
10325 break;
10326
10327 case 4: /* top_compstmt: top_stmts opt_terms */
10328#line 2222 "parse.y"
10329 {
10330 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
10331 }
10332#line 10333 "parse.c"
10333 break;
10334
10335 case 5: /* top_stmts: none */
10336#line 2228 "parse.y"
10337 {
10338 /*%%%*/
10339 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10340 /*% %*/
10341 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
10342 }
10343#line 10344 "parse.c"
10344 break;
10345
10346 case 6: /* top_stmts: top_stmt */
10347#line 2235 "parse.y"
10348 {
10349 /*%%%*/
10350 (yyval.node) = newline_node((yyvsp[0].node));
10351 /*% %*/
10352 /*% ripper: stmts_add!(stmts_new!, $1) %*/
10353 }
10354#line 10355 "parse.c"
10355 break;
10356
10357 case 7: /* top_stmts: top_stmts terms top_stmt */
10358#line 2242 "parse.y"
10359 {
10360 /*%%%*/
10361 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
10362 /*% %*/
10363 /*% ripper: stmts_add!($1, $3) %*/
10364 }
10365#line 10366 "parse.c"
10366 break;
10367
10368 case 8: /* top_stmt: stmt */
10369#line 2251 "parse.y"
10370 {
10371 clear_block_exit(p, true);
10372 (yyval.node) = (yyvsp[0].node);
10373 }
10374#line 10375 "parse.c"
10375 break;
10376
10377 case 9: /* top_stmt: "`BEGIN'" begin_block */
10378#line 2256 "parse.y"
10379 {
10380 (yyval.node) = (yyvsp[0].node);
10381 }
10382#line 10383 "parse.c"
10383 break;
10384
10385 case 10: /* block_open: '{' */
10386#line 2261 "parse.y"
10387 {(yyval.node_exits) = init_block_exit(p);}
10388#line 10389 "parse.c"
10389 break;
10390
10391 case 11: /* begin_block: block_open top_compstmt '}' */
10392#line 2264 "parse.y"
10393 {
10394 restore_block_exit(p, (yyvsp[-2].node_exits));
10395 /*%%%*/
10396 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
10397 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
10398 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10399 /*% %*/
10400 /*% ripper: BEGIN!($2) %*/
10401 }
10402#line 10403 "parse.c"
10403 break;
10404
10405 case 12: /* $@2: %empty */
10406#line 2279 "parse.y"
10407 {
10408 if (!(yyvsp[-1].node)) yyerror1(&(yylsp[0]), "else without rescue is useless");
10409 next_rescue_context(&p->ctxt, &(yyvsp[-2].ctxt), after_else);
10410 }
10411#line 10412 "parse.c"
10412 break;
10413
10414 case 13: /* $@3: %empty */
10415#line 2284 "parse.y"
10416 {
10417 next_rescue_context(&p->ctxt, &(yyvsp[-4].ctxt), after_ensure);
10418 }
10419#line 10420 "parse.c"
10420 break;
10421
10422 case 14: /* bodystmt: compstmt lex_ctxt opt_rescue k_else $@2 compstmt $@3 opt_ensure */
10423#line 2288 "parse.y"
10424 {
10425 /*%%%*/
10426 (yyval.node) = new_bodystmt(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10427 /*% %*/
10428 /*% ripper: bodystmt!($body, $opt_rescue, $elsebody, $opt_ensure) %*/
10429 }
10430#line 10431 "parse.c"
10431 break;
10432
10433 case 15: /* $@4: %empty */
10434#line 2297 "parse.y"
10435 {
10436 next_rescue_context(&p->ctxt, &(yyvsp[-1].ctxt), after_ensure);
10437 }
10438#line 10439 "parse.c"
10439 break;
10440
10441 case 16: /* bodystmt: compstmt lex_ctxt opt_rescue $@4 opt_ensure */
10442#line 2301 "parse.y"
10443 {
10444 /*%%%*/
10445 (yyval.node) = new_bodystmt(p, (yyvsp[-4].node), (yyvsp[-2].node), 0, (yyvsp[0].node), &(yyloc));
10446 /*% %*/
10447 /*% ripper: bodystmt!($body, $opt_rescue, Qnil, $opt_ensure) %*/
10448 }
10449#line 10450 "parse.c"
10450 break;
10451
10452 case 17: /* compstmt: stmts opt_terms */
10453#line 2310 "parse.y"
10454 {
10455 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
10456 }
10457#line 10458 "parse.c"
10458 break;
10459
10460 case 18: /* stmts: none */
10461#line 2316 "parse.y"
10462 {
10463 /*%%%*/
10464 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10465 /*% %*/
10466 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
10467 }
10468#line 10469 "parse.c"
10469 break;
10470
10471 case 19: /* stmts: stmt_or_begin */
10472#line 2323 "parse.y"
10473 {
10474 /*%%%*/
10475 (yyval.node) = newline_node((yyvsp[0].node));
10476 /*% %*/
10477 /*% ripper: stmts_add!(stmts_new!, $1) %*/
10478 }
10479#line 10480 "parse.c"
10480 break;
10481
10482 case 20: /* stmts: stmts terms stmt_or_begin */
10483#line 2330 "parse.y"
10484 {
10485 /*%%%*/
10486 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
10487 /*% %*/
10488 /*% ripper: stmts_add!($1, $3) %*/
10489 }
10490#line 10491 "parse.c"
10491 break;
10492
10493 case 21: /* stmt_or_begin: stmt */
10494#line 2339 "parse.y"
10495 {
10496 (yyval.node) = (yyvsp[0].node);
10497 }
10498#line 10499 "parse.c"
10499 break;
10500
10501 case 22: /* $@5: %empty */
10502#line 2343 "parse.y"
10503 {
10504 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
10505 }
10506#line 10507 "parse.c"
10507 break;
10508
10509 case 23: /* stmt_or_begin: "`BEGIN'" $@5 begin_block */
10510#line 2347 "parse.y"
10511 {
10512 (yyval.node) = (yyvsp[0].node);
10513 }
10514#line 10515 "parse.c"
10515 break;
10516
10517 case 24: /* allow_exits: %empty */
10518#line 2352 "parse.y"
10519 {(yyval.node_exits) = allow_block_exit(p);}
10520#line 10521 "parse.c"
10521 break;
10522
10523 case 25: /* k_END: "`END'" lex_ctxt */
10524#line 2355 "parse.y"
10525 {
10526 (yyval.ctxt) = (yyvsp[0].ctxt);
10527 p->ctxt.in_rescue = before_rescue;
10528 }
10529#line 10530 "parse.c"
10530 break;
10531
10532 case 26: /* $@6: %empty */
10533#line 2360 "parse.y"
10534 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
10535#line 10536 "parse.c"
10536 break;
10537
10538 case 27: /* stmt: "`alias'" fitem $@6 fitem */
10539#line 2361 "parse.y"
10540 {
10541 /*%%%*/
10542 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10543 /*% %*/
10544 /*% ripper: alias!($2, $4) %*/
10545 }
10546#line 10547 "parse.c"
10547 break;
10548
10549 case 28: /* stmt: "`alias'" "global variable" "global variable" */
10550#line 2368 "parse.y"
10551 {
10552 /*%%%*/
10553 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10554 /*% %*/
10555 /*% ripper: var_alias!($2, $3) %*/
10556 }
10557#line 10558 "parse.c"
10558 break;
10559
10560 case 29: /* stmt: "`alias'" "global variable" "back reference" */
10561#line 2375 "parse.y"
10562 {
10563 /*%%%*/
10564 char buf[2];
10565 buf[0] = '$';
10566 buf[1] = (char)RNODE_BACK_REF((yyvsp[0].node))->nd_nth;
10567 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc));
10568 /*% %*/
10569 /*% ripper: var_alias!($2, $3) %*/
10570 }
10571#line 10572 "parse.c"
10572 break;
10573
10574 case 30: /* stmt: "`alias'" "global variable" "numbered reference" */
10575#line 2385 "parse.y"
10576 {
10577 static const char mesg[] = "can't make alias for the number variables";
10578 /*%%%*/
10579 yyerror1(&(yylsp[0]), mesg);
10580 (yyval.node) = NEW_ERROR(&(yyloc));
10581 /*% %*/
10582 /*% ripper[error]: alias_error!(ERR_MESG(), $3) %*/
10583 }
10584#line 10585 "parse.c"
10585 break;
10586
10587 case 31: /* stmt: "`undef'" undef_list */
10588#line 2394 "parse.y"
10589 {
10590 /*%%%*/
10591 (yyval.node) = (yyvsp[0].node);
10592 /*% %*/
10593 /*% ripper: undef!($2) %*/
10594 }
10595#line 10596 "parse.c"
10596 break;
10597
10598 case 32: /* stmt: stmt "`if' modifier" expr_value */
10599#line 2401 "parse.y"
10600 {
10601 /*%%%*/
10602 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10603 fixpos((yyval.node), (yyvsp[0].node));
10604 /*% %*/
10605 /*% ripper: if_mod!($3, $1) %*/
10606 }
10607#line 10608 "parse.c"
10608 break;
10609
10610 case 33: /* stmt: stmt "`unless' modifier" expr_value */
10611#line 2409 "parse.y"
10612 {
10613 /*%%%*/
10614 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10615 fixpos((yyval.node), (yyvsp[0].node));
10616 /*% %*/
10617 /*% ripper: unless_mod!($3, $1) %*/
10618 }
10619#line 10620 "parse.c"
10620 break;
10621
10622 case 34: /* stmt: stmt "`while' modifier" expr_value */
10623#line 2417 "parse.y"
10624 {
10625 clear_block_exit(p, false);
10626 /*%%%*/
10627 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
10628 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc));
10629 }
10630 else {
10631 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
10632 }
10633 /*% %*/
10634 /*% ripper: while_mod!($3, $1) %*/
10635 }
10636#line 10637 "parse.c"
10637 break;
10638
10639 case 35: /* stmt: stmt "`until' modifier" expr_value */
10640#line 2430 "parse.y"
10641 {
10642 clear_block_exit(p, false);
10643 /*%%%*/
10644 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
10645 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc));
10646 }
10647 else {
10648 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
10649 }
10650 /*% %*/
10651 /*% ripper: until_mod!($3, $1) %*/
10652 }
10653#line 10654 "parse.c"
10654 break;
10655
10656 case 36: /* stmt: stmt "`rescue' modifier" after_rescue stmt */
10657#line 2443 "parse.y"
10658 {
10659 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
10660 /*%%%*/
10661 NODE *resq;
10662 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10663 resq = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
10664 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-3].node)), resq, 0, &(yyloc));
10665 /*% %*/
10666 /*% ripper: rescue_mod!($1, $4) %*/
10667 }
10668#line 10669 "parse.c"
10669 break;
10670
10671 case 37: /* stmt: k_END allow_exits '{' compstmt '}' */
10672#line 2454 "parse.y"
10673 {
10674 if (p->ctxt.in_def) {
10675 rb_warn0("END in method; use at_exit");
10676 }
10677 restore_block_exit(p, (yyvsp[-3].node_exits));
10678 p->ctxt = (yyvsp[-4].ctxt);
10679 /*%%%*/
10680 {
10681 NODE *scope = NEW_SCOPE2(0 /* tbl */, 0 /* args */, (yyvsp[-1].node) /* body */, &(yyloc));
10682 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
10683 }
10684 /*% %*/
10685 /*% ripper: END!($compstmt) %*/
10686 }
10687#line 10688 "parse.c"
10688 break;
10689
10690 case 39: /* stmt: mlhs '=' lex_ctxt command_call */
10691#line 2470 "parse.y"
10692 {
10693 /*%%%*/
10694 value_expr((yyvsp[0].node));
10695 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10696 /*% %*/
10697 /*% ripper: massign!($1, $4) %*/
10698 }
10699#line 10700 "parse.c"
10700 break;
10701
10702 case 40: /* stmt: lhs '=' lex_ctxt mrhs */
10703#line 2478 "parse.y"
10704 {
10705 /*%%%*/
10706 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10707 /*% %*/
10708 /*% ripper: assign!($1, $4) %*/
10709 }
10710#line 10711 "parse.c"
10711 break;
10712
10713 case 41: /* stmt: mlhs '=' lex_ctxt mrhs_arg "`rescue' modifier" after_rescue stmt */
10714#line 2486 "parse.y"
10715 {
10716 p->ctxt.in_rescue = (yyvsp[-4].ctxt).in_rescue;
10717 /*%%%*/
10718 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10719 (yyvsp[0].node) = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
10720 loc.beg_pos = (yylsp[-3]).beg_pos;
10721 (yyvsp[-3].node) = NEW_RESCUE((yyvsp[-3].node), (yyvsp[0].node), 0, &loc);
10722 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-6].node_masgn), (yyvsp[-3].node), (yyvsp[-4].ctxt), &(yyloc));
10723 /*% %*/
10724 /*% ripper: massign!($1, rescue_mod!($4, $7)) %*/
10725 }
10726#line 10727 "parse.c"
10727 break;
10728
10729 case 42: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
10730#line 2498 "parse.y"
10731 {
10732 /*%%%*/
10733 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10734 /*% %*/
10735 /*% ripper: massign!($1, $4) %*/
10736 }
10737#line 10738 "parse.c"
10738 break;
10739
10740 case 44: /* stmt: error */
10741#line 2506 "parse.y"
10742 {
10743 (void)yynerrs;
10744 /*%%%*/
10745 (yyval.node) = NEW_ERROR(&(yyloc));
10746 /*% %*/
10747 }
10748#line 10749 "parse.c"
10749 break;
10750
10751 case 45: /* command_asgn: lhs '=' lex_ctxt command_rhs */
10752#line 2515 "parse.y"
10753 {
10754 /*%%%*/
10755 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10756 /*% %*/
10757 /*% ripper: assign!($1, $4) %*/
10758 }
10759#line 10760 "parse.c"
10760 break;
10761
10762 case 46: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
10763#line 2522 "parse.y"
10764 {
10765 /*%%%*/
10766 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10767 /*% %*/
10768 /*% ripper: opassign!($1, $2, $4) %*/
10769 }
10770#line 10771 "parse.c"
10771 break;
10772
10773 case 47: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
10774#line 2529 "parse.y"
10775 {
10776 /*%%%*/
10777 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
10778 /*% %*/
10779 /*% ripper: opassign!(aref_field!($1, $3), $5, $7) %*/
10780
10781 }
10782#line 10783 "parse.c"
10783 break;
10784
10785 case 48: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
10786#line 2537 "parse.y"
10787 {
10788 /*%%%*/
10789 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10790 /*% %*/
10791 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
10792 }
10793#line 10794 "parse.c"
10794 break;
10795
10796 case 49: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
10797#line 2544 "parse.y"
10798 {
10799 /*%%%*/
10800 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10801 /*% %*/
10802 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
10803 }
10804#line 10805 "parse.c"
10805 break;
10806
10807 case 50: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
10808#line 2551 "parse.y"
10809 {
10810 /*%%%*/
10811 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
10812 (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));
10813 /*% %*/
10814 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
10815 }
10816#line 10817 "parse.c"
10817 break;
10818
10819 case 51: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
10820#line 2559 "parse.y"
10821 {
10822 /*%%%*/
10823 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10824 /*% %*/
10825 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
10826 }
10827#line 10828 "parse.c"
10828 break;
10829
10830 case 52: /* command_asgn: defn_head f_opt_paren_args '=' endless_command */
10831#line 2566 "parse.y"
10832 {
10833 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
10834 restore_defun(p, (yyvsp[-3].node_def_temp));
10835 /*%%%*/
10836 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
10837 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
10838 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
10839 /*% %*/
10840 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
10841 /*% ripper: def!($head->nd_mid, $args, $bodystmt) %*/
10842 local_pop(p);
10843 }
10844#line 10845 "parse.c"
10845 break;
10846
10847 case 53: /* command_asgn: defs_head f_opt_paren_args '=' endless_command */
10848#line 2579 "parse.y"
10849 {
10850 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
10851 restore_defun(p, (yyvsp[-3].node_def_temp));
10852 /*%%%*/
10853 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
10854 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
10855 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
10856 /*% %*/
10857 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
10858 /*% ripper: defs!($head->nd_recv, $head->dot_or_colon, $head->nd_mid, $args, $bodystmt) %*/
10859 local_pop(p);
10860 }
10861#line 10862 "parse.c"
10862 break;
10863
10864 case 54: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
10865#line 2592 "parse.y"
10866 {
10867 /*%%%*/
10868 rb_backref_error(p, (yyvsp[-3].node));
10869 (yyval.node) = NEW_ERROR(&(yyloc));
10870 /*% %*/
10871 /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/
10872 }
10873#line 10874 "parse.c"
10874 break;
10875
10876 case 56: /* endless_command: endless_command "`rescue' modifier" after_rescue arg */
10877#line 2603 "parse.y"
10878 {
10879 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
10880 /*%%%*/
10881 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
10882 /*% %*/
10883 /*% ripper: rescue_mod!($1, $4) %*/
10884 }
10885#line 10886 "parse.c"
10886 break;
10887
10888 case 57: /* endless_command: "`not'" opt_nl endless_command */
10889#line 2611 "parse.y"
10890 {
10891 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
10892 }
10893#line 10894 "parse.c"
10894 break;
10895
10896 case 58: /* command_rhs: command_call */
10897#line 2617 "parse.y"
10898 {
10899 value_expr((yyvsp[0].node));
10900 (yyval.node) = (yyvsp[0].node);
10901 }
10902#line 10903 "parse.c"
10903 break;
10904
10905 case 59: /* command_rhs: command_call "`rescue' modifier" after_rescue stmt */
10906#line 2622 "parse.y"
10907 {
10908 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
10909 /*%%%*/
10910 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10911 value_expr((yyvsp[-3].node));
10912 (yyval.node) = NEW_RESCUE((yyvsp[-3].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
10913 /*% %*/
10914 /*% ripper: rescue_mod!($1, $4) %*/
10915 }
10916#line 10917 "parse.c"
10917 break;
10918
10919 case 62: /* expr: expr "`and'" expr */
10920#line 2636 "parse.y"
10921 {
10922 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10923 }
10924#line 10925 "parse.c"
10925 break;
10926
10927 case 63: /* expr: expr "`or'" expr */
10928#line 2640 "parse.y"
10929 {
10930 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10931 }
10932#line 10933 "parse.c"
10933 break;
10934
10935 case 64: /* expr: "`not'" opt_nl expr */
10936#line 2644 "parse.y"
10937 {
10938 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
10939 }
10940#line 10941 "parse.c"
10941 break;
10942
10943 case 65: /* expr: '!' command_call */
10944#line 2648 "parse.y"
10945 {
10946 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
10947 }
10948#line 10949 "parse.c"
10949 break;
10950
10951 case 66: /* $@7: %empty */
10952#line 2652 "parse.y"
10953 {
10954 value_expr((yyvsp[-1].node));
10955 }
10956#line 10957 "parse.c"
10957 break;
10958
10959 case 67: /* expr: arg "=>" $@7 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
10960#line 2657 "parse.y"
10961 {
10962 pop_pktbl(p, (yyvsp[-1].tbl));
10963 pop_pvtbl(p, (yyvsp[-2].tbl));
10964 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10965 /*%%%*/
10966 (yyval.node) = NEW_CASE3((yyvsp[-6].node), NEW_IN((yyvsp[0].node), 0, 0, &(yylsp[0])), &(yyloc));
10967 /*% %*/
10968 /*% ripper: case!($arg, in!($body, Qnil, Qnil)) %*/
10969 }
10970#line 10971 "parse.c"
10971 break;
10972
10973 case 68: /* $@8: %empty */
10974#line 2667 "parse.y"
10975 {
10976 value_expr((yyvsp[-1].node));
10977 }
10978#line 10979 "parse.c"
10979 break;
10980
10981 case 69: /* expr: arg "`in'" $@8 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
10982#line 2672 "parse.y"
10983 {
10984 pop_pktbl(p, (yyvsp[-1].tbl));
10985 pop_pvtbl(p, (yyvsp[-2].tbl));
10986 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10987 /*%%%*/
10988 (yyval.node) = NEW_CASE3((yyvsp[-6].node), NEW_IN((yyvsp[0].node), NEW_TRUE(&(yylsp[0])), NEW_FALSE(&(yylsp[0])), &(yylsp[0])), &(yyloc));
10989 /*% %*/
10990 /*% ripper: case!($arg, in!($body, Qnil, Qnil)) %*/
10991 }
10992#line 10993 "parse.c"
10993 break;
10994
10995 case 71: /* def_name: fname */
10996#line 2685 "parse.y"
10997 {
10998 ID fname = get_id((yyvsp[0].id));
10999 numparam_name(p, fname);
11000 local_push(p, 0);
11001 p->cur_arg = 0;
11002 p->ctxt.in_def = 1;
11003 p->ctxt.in_rescue = before_rescue;
11004 (yyval.id) = (yyvsp[0].id);
11005 }
11006#line 11007 "parse.c"
11007 break;
11008
11009 case 72: /* defn_head: k_def def_name */
11010#line 2697 "parse.y"
11011 {
11012 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-1].node_def_temp));
11013 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
11014 /*%%%*/
11015 (yyval.node_def_temp)->nd_def = NEW_DEFN((yyvsp[0].id), 0, &(yyloc));
11016 /*%
11017 add_mark_object(p, $def_name);
11018 %*/
11019 }
11020#line 11021 "parse.c"
11021 break;
11022
11023 case 73: /* $@9: %empty */
11024#line 2709 "parse.y"
11025 {
11026 SET_LEX_STATE(EXPR_FNAME);
11027 p->ctxt.in_argdef = 1;
11028 }
11029#line 11030 "parse.c"
11030 break;
11031
11032 case 74: /* defs_head: k_def singleton dot_or_colon $@9 def_name */
11033#line 2714 "parse.y"
11034 {
11035 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
11036 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-4].node_def_temp));
11037 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
11038 /*%%%*/
11039 (yyval.node_def_temp)->nd_def = NEW_DEFS((yyvsp[-3].node), (yyvsp[0].id), 0, &(yyloc));
11040 /*%
11041 add_mark_object(p, $def_name);
11042 $$->nd_recv = add_mark_object(p, $singleton);
11043 $$->dot_or_colon = add_mark_object(p, $dot_or_colon);
11044 %*/
11045 }
11046#line 11047 "parse.c"
11047 break;
11048
11049 case 75: /* expr_value: expr */
11050#line 2729 "parse.y"
11051 {
11052 value_expr((yyvsp[0].node));
11053 (yyval.node) = (yyvsp[0].node);
11054 }
11055#line 11056 "parse.c"
11056 break;
11057
11058 case 76: /* expr_value: error */
11059#line 2734 "parse.y"
11060 {
11061 /*%%%*/
11062 (yyval.node) = NEW_ERROR(&(yyloc));
11063 /*% %*/
11064 }
11065#line 11066 "parse.c"
11066 break;
11067
11068 case 77: /* $@10: %empty */
11069#line 2741 "parse.y"
11070 {COND_PUSH(1);}
11071#line 11072 "parse.c"
11072 break;
11073
11074 case 78: /* $@11: %empty */
11075#line 2741 "parse.y"
11076 {COND_POP();}
11077#line 11078 "parse.c"
11078 break;
11079
11080 case 79: /* expr_value_do: $@10 expr_value do $@11 */
11081#line 2742 "parse.y"
11082 {
11083 (yyval.node) = (yyvsp[-2].node);
11084 }
11085#line 11086 "parse.c"
11086 break;
11087
11088 case 83: /* block_command: block_call call_op2 operation2 command_args */
11089#line 2753 "parse.y"
11090 {
11091 /*%%%*/
11092 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11093 /*% %*/
11094 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
11095 }
11096#line 11097 "parse.c"
11097 break;
11098
11099 case 84: /* cmd_brace_block: "{ arg" brace_body '}' */
11100#line 2762 "parse.y"
11101 {
11102 (yyval.node) = (yyvsp[-1].node);
11103 /*%%%*/
11104 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
11105 /*% %*/
11106 }
11107#line 11108 "parse.c"
11108 break;
11109
11110 case 85: /* fcall: operation */
11111#line 2771 "parse.y"
11112 {
11113 /*%%%*/
11114 (yyval.node_fcall) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
11115 /*% %*/
11116 /*% ripper: $1 %*/
11117 }
11118#line 11119 "parse.c"
11119 break;
11120
11121 case 86: /* command: fcall command_args */
11122#line 2780 "parse.y"
11123 {
11124 /*%%%*/
11125 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
11126 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
11127 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
11128 /*% %*/
11129 /*% ripper: command!($1, $2) %*/
11130 }
11131#line 11132 "parse.c"
11132 break;
11133
11134 case 87: /* command: fcall command_args cmd_brace_block */
11135#line 2789 "parse.y"
11136 {
11137 /*%%%*/
11138 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
11139 (yyvsp[-2].node_fcall)->nd_args = (yyvsp[-1].node);
11140 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-2].node_fcall), (yyvsp[0].node), &(yyloc));
11141 fixpos((yyval.node), RNODE((yyvsp[-2].node_fcall)));
11142 nd_set_last_loc((yyvsp[-2].node_fcall), (yylsp[-1]).end_pos);
11143 /*% %*/
11144 /*% ripper: method_add_block!(command!($1, $2), $3) %*/
11145 }
11146#line 11147 "parse.c"
11147 break;
11148
11149 case 88: /* command: primary_value call_op operation2 command_args */
11150#line 2800 "parse.y"
11151 {
11152 /*%%%*/
11153 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
11154 /*% %*/
11155 /*% ripper: command_call!($1, $2, $3, $4) %*/
11156 }
11157#line 11158 "parse.c"
11158 break;
11159
11160 case 89: /* command: primary_value call_op operation2 command_args cmd_brace_block */
11161#line 2807 "parse.y"
11162 {
11163 /*%%%*/
11164 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
11165 /*% %*/
11166 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
11167 }
11168#line 11169 "parse.c"
11169 break;
11170
11171 case 90: /* command: primary_value "::" operation2 command_args */
11172#line 2814 "parse.y"
11173 {
11174 /*%%%*/
11175 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
11176 /*% %*/
11177 /*% ripper: command_call!($1, $2, $3, $4) %*/
11178 }
11179#line 11180 "parse.c"
11180 break;
11181
11182 case 91: /* command: primary_value "::" operation2 command_args cmd_brace_block */
11183#line 2821 "parse.y"
11184 {
11185 /*%%%*/
11186 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
11187 /*% %*/
11188 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
11189 }
11190#line 11191 "parse.c"
11191 break;
11192
11193 case 92: /* command: primary_value "::" "constant" '{' brace_body '}' */
11194#line 2828 "parse.y"
11195 {
11196 /*%%%*/
11197 set_embraced_location((yyvsp[-1].node), &(yylsp[-2]), &(yylsp[0]));
11198 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-5].node), (yyvsp[-3].id), Qnull, (yyvsp[-1].node), &(yylsp[-3]), &(yyloc));
11199 /*% %*/
11200 /*% ripper: method_add_block!(command_call!($1, $2, $3, Qnull), $5) %*/
11201 }
11202#line 11203 "parse.c"
11203 break;
11204
11205 case 93: /* command: "`super'" command_args */
11206#line 2836 "parse.y"
11207 {
11208 /*%%%*/
11209 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
11210 fixpos((yyval.node), (yyvsp[0].node));
11211 /*% %*/
11212 /*% ripper: super!($2) %*/
11213 }
11214#line 11215 "parse.c"
11215 break;
11216
11217 case 94: /* command: k_yield command_args */
11218#line 2844 "parse.y"
11219 {
11220 /*%%%*/
11221 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
11222 fixpos((yyval.node), (yyvsp[0].node));
11223 /*% %*/
11224 /*% ripper: yield!($2) %*/
11225 }
11226#line 11227 "parse.c"
11227 break;
11228
11229 case 95: /* command: k_return call_args */
11230#line 2852 "parse.y"
11231 {
11232 /*%%%*/
11233 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc));
11234 /*% %*/
11235 /*% ripper: return!($2) %*/
11236 }
11237#line 11238 "parse.c"
11238 break;
11239
11240 case 96: /* command: "`break'" call_args */
11241#line 2859 "parse.y"
11242 {
11243 NODE *args = 0;
11244 /*%%%*/
11245 args = ret_args(p, (yyvsp[0].node));
11246 /*% %*/
11247 (yyval.node) = add_block_exit(p, NEW_BREAK(args, &(yyloc)));
11248 /*% ripper: break!($2) %*/
11249 }
11250#line 11251 "parse.c"
11251 break;
11252
11253 case 97: /* command: "`next'" call_args */
11254#line 2868 "parse.y"
11255 {
11256 NODE *args = 0;
11257 /*%%%*/
11258 args = ret_args(p, (yyvsp[0].node));
11259 /*% %*/
11260 (yyval.node) = add_block_exit(p, NEW_NEXT(args, &(yyloc)));
11261 /*% ripper: next!($2) %*/
11262 }
11263#line 11264 "parse.c"
11264 break;
11265
11266 case 99: /* mlhs: "(" mlhs_inner rparen */
11267#line 2880 "parse.y"
11268 {
11269 /*%%%*/
11270 (yyval.node_masgn) = (yyvsp[-1].node_masgn);
11271 /*% %*/
11272 /*% ripper: mlhs_paren!($2) %*/
11273 }
11274#line 11275 "parse.c"
11275 break;
11276
11277 case 101: /* mlhs_inner: "(" mlhs_inner rparen */
11278#line 2890 "parse.y"
11279 {
11280 /*%%%*/
11281 (yyval.node_masgn) = NEW_MASGN(NEW_LIST((NODE *)(yyvsp[-1].node_masgn), &(yyloc)), 0, &(yyloc));
11282 /*% %*/
11283 /*% ripper: mlhs_paren!($2) %*/
11284 }
11285#line 11286 "parse.c"
11286 break;
11287
11288 case 102: /* mlhs_basic: mlhs_head */
11289#line 2899 "parse.y"
11290 {
11291 /*%%%*/
11292 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
11293 /*% %*/
11294 /*% ripper: $1 %*/
11295 }
11296#line 11297 "parse.c"
11297 break;
11298
11299 case 103: /* mlhs_basic: mlhs_head mlhs_item */
11300#line 2906 "parse.y"
11301 {
11302 /*%%%*/
11303 (yyval.node_masgn) = NEW_MASGN(list_append(p, (yyvsp[-1].node), (yyvsp[0].node)), 0, &(yyloc));
11304 /*% %*/
11305 /*% ripper: mlhs_add!($1, $2) %*/
11306 }
11307#line 11308 "parse.c"
11308 break;
11309
11310 case 104: /* mlhs_basic: mlhs_head "*" mlhs_node */
11311#line 2913 "parse.y"
11312 {
11313 /*%%%*/
11314 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11315 /*% %*/
11316 /*% ripper: mlhs_add_star!($1, $3) %*/
11317 }
11318#line 11319 "parse.c"
11319 break;
11320
11321 case 105: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
11322#line 2920 "parse.y"
11323 {
11324 /*%%%*/
11325 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
11326 /*% %*/
11327 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
11328 }
11329#line 11330 "parse.c"
11330 break;
11331
11332 case 106: /* mlhs_basic: mlhs_head "*" */
11333#line 2927 "parse.y"
11334 {
11335 /*%%%*/
11336 (yyval.node_masgn) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
11337 /*% %*/
11338 /*% ripper: mlhs_add_star!($1, Qnil) %*/
11339 }
11340#line 11341 "parse.c"
11341 break;
11342
11343 case 107: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
11344#line 2934 "parse.y"
11345 {
11346 /*%%%*/
11347 (yyval.node_masgn) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
11348 /*% %*/
11349 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/
11350 }
11351#line 11352 "parse.c"
11352 break;
11353
11354 case 108: /* mlhs_basic: "*" mlhs_node */
11355#line 2941 "parse.y"
11356 {
11357 /*%%%*/
11358 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
11359 /*% %*/
11360 /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/
11361 }
11362#line 11363 "parse.c"
11363 break;
11364
11365 case 109: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
11366#line 2948 "parse.y"
11367 {
11368 /*%%%*/
11369 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
11370 /*% %*/
11371 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/
11372 }
11373#line 11374 "parse.c"
11374 break;
11375
11376 case 110: /* mlhs_basic: "*" */
11377#line 2955 "parse.y"
11378 {
11379 /*%%%*/
11380 (yyval.node_masgn) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
11381 /*% %*/
11382 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
11383 }
11384#line 11385 "parse.c"
11385 break;
11386
11387 case 111: /* mlhs_basic: "*" ',' mlhs_post */
11388#line 2962 "parse.y"
11389 {
11390 /*%%%*/
11391 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
11392 /*% %*/
11393 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/
11394 }
11395#line 11396 "parse.c"
11396 break;
11397
11398 case 113: /* mlhs_item: "(" mlhs_inner rparen */
11399#line 2972 "parse.y"
11400 {
11401 /*%%%*/
11402 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
11403 /*% %*/
11404 /*% ripper: mlhs_paren!($2) %*/
11405 }
11406#line 11407 "parse.c"
11407 break;
11408
11409 case 114: /* mlhs_head: mlhs_item ',' */
11410#line 2981 "parse.y"
11411 {
11412 /*%%%*/
11413 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
11414 /*% %*/
11415 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
11416 }
11417#line 11418 "parse.c"
11418 break;
11419
11420 case 115: /* mlhs_head: mlhs_head mlhs_item ',' */
11421#line 2988 "parse.y"
11422 {
11423 /*%%%*/
11424 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
11425 /*% %*/
11426 /*% ripper: mlhs_add!($1, $2) %*/
11427 }
11428#line 11429 "parse.c"
11429 break;
11430
11431 case 116: /* mlhs_post: mlhs_item */
11432#line 2997 "parse.y"
11433 {
11434 /*%%%*/
11435 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11436 /*% %*/
11437 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
11438 }
11439#line 11440 "parse.c"
11440 break;
11441
11442 case 117: /* mlhs_post: mlhs_post ',' mlhs_item */
11443#line 3004 "parse.y"
11444 {
11445 /*%%%*/
11446 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
11447 /*% %*/
11448 /*% ripper: mlhs_add!($1, $3) %*/
11449 }
11450#line 11451 "parse.c"
11451 break;
11452
11453 case 118: /* mlhs_node: user_variable */
11454#line 3013 "parse.y"
11455 {
11456 /*%%%*/
11457 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11458 /*% %*/
11459 /*% ripper: assignable(p, var_field(p, $1)) %*/
11460 }
11461#line 11462 "parse.c"
11462 break;
11463
11464 case 119: /* mlhs_node: keyword_variable */
11465#line 3020 "parse.y"
11466 {
11467 /*%%%*/
11468 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11469 /*% %*/
11470 /*% ripper: assignable(p, var_field(p, $1)) %*/
11471 }
11472#line 11473 "parse.c"
11473 break;
11474
11475 case 120: /* mlhs_node: primary_value '[' opt_call_args rbracket */
11476#line 3027 "parse.y"
11477 {
11478 /*%%%*/
11479 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11480 /*% %*/
11481 /*% ripper: aref_field!($1, $3) %*/
11482 }
11483#line 11484 "parse.c"
11484 break;
11485
11486 case 121: /* mlhs_node: primary_value call_op "local variable or method" */
11487#line 3034 "parse.y"
11488 {
11489 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
11490 /*%%%*/
11491 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11492 /*% %*/
11493 /*% ripper: field!($1, $2, $3) %*/
11494 }
11495#line 11496 "parse.c"
11496 break;
11497
11498 case 122: /* mlhs_node: primary_value "::" "local variable or method" */
11499#line 3042 "parse.y"
11500 {
11501 /*%%%*/
11502 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
11503 /*% %*/
11504 /*% ripper: const_path_field!($1, $3) %*/
11505 }
11506#line 11507 "parse.c"
11507 break;
11508
11509 case 123: /* mlhs_node: primary_value call_op "constant" */
11510#line 3049 "parse.y"
11511 {
11512 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
11513 /*%%%*/
11514 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11515 /*% %*/
11516 /*% ripper: field!($1, $2, $3) %*/
11517 }
11518#line 11519 "parse.c"
11519 break;
11520
11521 case 124: /* mlhs_node: primary_value "::" "constant" */
11522#line 3057 "parse.y"
11523 {
11524 /*%%%*/
11525 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
11526 /*% %*/
11527 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
11528 }
11529#line 11530 "parse.c"
11530 break;
11531
11532 case 125: /* mlhs_node: ":: at EXPR_BEG" "constant" */
11533#line 3064 "parse.y"
11534 {
11535 /*%%%*/
11536 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
11537 /*% %*/
11538 /*% ripper: const_decl(p, top_const_field!($2)) %*/
11539 }
11540#line 11541 "parse.c"
11541 break;
11542
11543 case 126: /* mlhs_node: backref */
11544#line 3071 "parse.y"
11545 {
11546 /*%%%*/
11547 rb_backref_error(p, (yyvsp[0].node));
11548 (yyval.node) = NEW_ERROR(&(yyloc));
11549 /*% %*/
11550 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
11551 }
11552#line 11553 "parse.c"
11553 break;
11554
11555 case 127: /* lhs: user_variable */
11556#line 3081 "parse.y"
11557 {
11558 /*%%%*/
11559 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11560 /*% %*/
11561 /*% ripper: assignable(p, var_field(p, $1)) %*/
11562 }
11563#line 11564 "parse.c"
11564 break;
11565
11566 case 128: /* lhs: keyword_variable */
11567#line 3088 "parse.y"
11568 {
11569 /*%%%*/
11570 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11571 /*% %*/
11572 /*% ripper: assignable(p, var_field(p, $1)) %*/
11573 }
11574#line 11575 "parse.c"
11575 break;
11576
11577 case 129: /* lhs: primary_value '[' opt_call_args rbracket */
11578#line 3095 "parse.y"
11579 {
11580 /*%%%*/
11581 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11582 /*% %*/
11583 /*% ripper: aref_field!($1, $3) %*/
11584 }
11585#line 11586 "parse.c"
11586 break;
11587
11588 case 130: /* lhs: primary_value call_op "local variable or method" */
11589#line 3102 "parse.y"
11590 {
11591 /*%%%*/
11592 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11593 /*% %*/
11594 /*% ripper: field!($1, $2, $3) %*/
11595 }
11596#line 11597 "parse.c"
11597 break;
11598
11599 case 131: /* lhs: primary_value "::" "local variable or method" */
11600#line 3109 "parse.y"
11601 {
11602 /*%%%*/
11603 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
11604 /*% %*/
11605 /*% ripper: field!($1, $2, $3) %*/
11606 }
11607#line 11608 "parse.c"
11608 break;
11609
11610 case 132: /* lhs: primary_value call_op "constant" */
11611#line 3116 "parse.y"
11612 {
11613 /*%%%*/
11614 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11615 /*% %*/
11616 /*% ripper: field!($1, $2, $3) %*/
11617 }
11618#line 11619 "parse.c"
11619 break;
11620
11621 case 133: /* lhs: primary_value "::" "constant" */
11622#line 3123 "parse.y"
11623 {
11624 /*%%%*/
11625 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
11626 /*% %*/
11627 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
11628 }
11629#line 11630 "parse.c"
11630 break;
11631
11632 case 134: /* lhs: ":: at EXPR_BEG" "constant" */
11633#line 3130 "parse.y"
11634 {
11635 /*%%%*/
11636 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
11637 /*% %*/
11638 /*% ripper: const_decl(p, top_const_field!($2)) %*/
11639 }
11640#line 11641 "parse.c"
11641 break;
11642
11643 case 135: /* lhs: backref */
11644#line 3137 "parse.y"
11645 {
11646 /*%%%*/
11647 rb_backref_error(p, (yyvsp[0].node));
11648 (yyval.node) = NEW_ERROR(&(yyloc));
11649 /*% %*/
11650 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
11651 }
11652#line 11653 "parse.c"
11653 break;
11654
11655 case 136: /* cname: "local variable or method" */
11656#line 3147 "parse.y"
11657 {
11658 static const char mesg[] = "class/module name must be CONSTANT";
11659 /*%%%*/
11660 yyerror1(&(yylsp[0]), mesg);
11661 /*% %*/
11662 /*% ripper[error]: class_name_error!(ERR_MESG(), $1) %*/
11663 }
11664#line 11665 "parse.c"
11665 break;
11666
11667 case 138: /* cpath: ":: at EXPR_BEG" cname */
11668#line 3158 "parse.y"
11669 {
11670 /*%%%*/
11671 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
11672 /*% %*/
11673 /*% ripper: top_const_ref!($2) %*/
11674 }
11675#line 11676 "parse.c"
11676 break;
11677
11678 case 139: /* cpath: cname */
11679#line 3165 "parse.y"
11680 {
11681 /*%%%*/
11682 (yyval.node) = NEW_COLON2(0, (yyvsp[0].id), &(yyloc));
11683 /*% %*/
11684 /*% ripper: const_ref!($1) %*/
11685 }
11686#line 11687 "parse.c"
11687 break;
11688
11689 case 140: /* cpath: primary_value "::" cname */
11690#line 3172 "parse.y"
11691 {
11692 /*%%%*/
11693 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11694 /*% %*/
11695 /*% ripper: const_path_ref!($1, $3) %*/
11696 }
11697#line 11698 "parse.c"
11698 break;
11699
11700 case 144: /* fname: op */
11701#line 3184 "parse.y"
11702 {
11703 SET_LEX_STATE(EXPR_ENDFN);
11704 (yyval.id) = (yyvsp[0].id);
11705 }
11706#line 11707 "parse.c"
11707 break;
11708
11709 case 146: /* fitem: fname */
11710#line 3192 "parse.y"
11711 {
11712 /*%%%*/
11713 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
11714 /*% %*/
11715 /*% ripper: symbol_literal!($1) %*/
11716 }
11717#line 11718 "parse.c"
11718 break;
11719
11720 case 148: /* undef_list: fitem */
11721#line 3202 "parse.y"
11722 {
11723 /*%%%*/
11724 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
11725 /*% %*/
11726 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
11727 }
11728#line 11729 "parse.c"
11729 break;
11730
11731 case 149: /* $@12: %empty */
11732#line 3208 "parse.y"
11733 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
11734#line 11735 "parse.c"
11735 break;
11736
11737 case 150: /* undef_list: undef_list ',' $@12 fitem */
11738#line 3209 "parse.y"
11739 {
11740 /*%%%*/
11741 NODE *undef = NEW_UNDEF((yyvsp[0].node), &(yylsp[0]));
11742 (yyval.node) = block_append(p, (yyvsp[-3].node), undef);
11743 /*% %*/
11744 /*% ripper: rb_ary_push($1, get_value($4)) %*/
11745 }
11746#line 11747 "parse.c"
11747 break;
11748
11749 case 151: /* op: '|' */
11750#line 3218 "parse.y"
11751 { ifndef_ripper((yyval.id) = '|'); }
11752#line 11753 "parse.c"
11753 break;
11754
11755 case 152: /* op: '^' */
11756#line 3219 "parse.y"
11757 { ifndef_ripper((yyval.id) = '^'); }
11758#line 11759 "parse.c"
11759 break;
11760
11761 case 153: /* op: '&' */
11762#line 3220 "parse.y"
11763 { ifndef_ripper((yyval.id) = '&'); }
11764#line 11765 "parse.c"
11765 break;
11766
11767 case 154: /* op: "<=>" */
11768#line 3221 "parse.y"
11769 { ifndef_ripper((yyval.id) = tCMP); }
11770#line 11771 "parse.c"
11771 break;
11772
11773 case 155: /* op: "==" */
11774#line 3222 "parse.y"
11775 { ifndef_ripper((yyval.id) = tEQ); }
11776#line 11777 "parse.c"
11777 break;
11778
11779 case 156: /* op: "===" */
11780#line 3223 "parse.y"
11781 { ifndef_ripper((yyval.id) = tEQQ); }
11782#line 11783 "parse.c"
11783 break;
11784
11785 case 157: /* op: "=~" */
11786#line 3224 "parse.y"
11787 { ifndef_ripper((yyval.id) = tMATCH); }
11788#line 11789 "parse.c"
11789 break;
11790
11791 case 158: /* op: "!~" */
11792#line 3225 "parse.y"
11793 { ifndef_ripper((yyval.id) = tNMATCH); }
11794#line 11795 "parse.c"
11795 break;
11796
11797 case 159: /* op: '>' */
11798#line 3226 "parse.y"
11799 { ifndef_ripper((yyval.id) = '>'); }
11800#line 11801 "parse.c"
11801 break;
11802
11803 case 160: /* op: ">=" */
11804#line 3227 "parse.y"
11805 { ifndef_ripper((yyval.id) = tGEQ); }
11806#line 11807 "parse.c"
11807 break;
11808
11809 case 161: /* op: '<' */
11810#line 3228 "parse.y"
11811 { ifndef_ripper((yyval.id) = '<'); }
11812#line 11813 "parse.c"
11813 break;
11814
11815 case 162: /* op: "<=" */
11816#line 3229 "parse.y"
11817 { ifndef_ripper((yyval.id) = tLEQ); }
11818#line 11819 "parse.c"
11819 break;
11820
11821 case 163: /* op: "!=" */
11822#line 3230 "parse.y"
11823 { ifndef_ripper((yyval.id) = tNEQ); }
11824#line 11825 "parse.c"
11825 break;
11826
11827 case 164: /* op: "<<" */
11828#line 3231 "parse.y"
11829 { ifndef_ripper((yyval.id) = tLSHFT); }
11830#line 11831 "parse.c"
11831 break;
11832
11833 case 165: /* op: ">>" */
11834#line 3232 "parse.y"
11835 { ifndef_ripper((yyval.id) = tRSHFT); }
11836#line 11837 "parse.c"
11837 break;
11838
11839 case 166: /* op: '+' */
11840#line 3233 "parse.y"
11841 { ifndef_ripper((yyval.id) = '+'); }
11842#line 11843 "parse.c"
11843 break;
11844
11845 case 167: /* op: '-' */
11846#line 3234 "parse.y"
11847 { ifndef_ripper((yyval.id) = '-'); }
11848#line 11849 "parse.c"
11849 break;
11850
11851 case 168: /* op: '*' */
11852#line 3235 "parse.y"
11853 { ifndef_ripper((yyval.id) = '*'); }
11854#line 11855 "parse.c"
11855 break;
11856
11857 case 169: /* op: "*" */
11858#line 3236 "parse.y"
11859 { ifndef_ripper((yyval.id) = '*'); }
11860#line 11861 "parse.c"
11861 break;
11862
11863 case 170: /* op: '/' */
11864#line 3237 "parse.y"
11865 { ifndef_ripper((yyval.id) = '/'); }
11866#line 11867 "parse.c"
11867 break;
11868
11869 case 171: /* op: '%' */
11870#line 3238 "parse.y"
11871 { ifndef_ripper((yyval.id) = '%'); }
11872#line 11873 "parse.c"
11873 break;
11874
11875 case 172: /* op: "**" */
11876#line 3239 "parse.y"
11877 { ifndef_ripper((yyval.id) = tPOW); }
11878#line 11879 "parse.c"
11879 break;
11880
11881 case 173: /* op: "**arg" */
11882#line 3240 "parse.y"
11883 { ifndef_ripper((yyval.id) = tDSTAR); }
11884#line 11885 "parse.c"
11885 break;
11886
11887 case 174: /* op: '!' */
11888#line 3241 "parse.y"
11889 { ifndef_ripper((yyval.id) = '!'); }
11890#line 11891 "parse.c"
11891 break;
11892
11893 case 175: /* op: '~' */
11894#line 3242 "parse.y"
11895 { ifndef_ripper((yyval.id) = '~'); }
11896#line 11897 "parse.c"
11897 break;
11898
11899 case 176: /* op: "unary+" */
11900#line 3243 "parse.y"
11901 { ifndef_ripper((yyval.id) = tUPLUS); }
11902#line 11903 "parse.c"
11903 break;
11904
11905 case 177: /* op: "unary-" */
11906#line 3244 "parse.y"
11907 { ifndef_ripper((yyval.id) = tUMINUS); }
11908#line 11909 "parse.c"
11909 break;
11910
11911 case 178: /* op: "[]" */
11912#line 3245 "parse.y"
11913 { ifndef_ripper((yyval.id) = tAREF); }
11914#line 11915 "parse.c"
11915 break;
11916
11917 case 179: /* op: "[]=" */
11918#line 3246 "parse.y"
11919 { ifndef_ripper((yyval.id) = tASET); }
11920#line 11921 "parse.c"
11921 break;
11922
11923 case 180: /* op: '`' */
11924#line 3247 "parse.y"
11925 { ifndef_ripper((yyval.id) = '`'); }
11926#line 11927 "parse.c"
11927 break;
11928
11929 case 222: /* arg: lhs '=' lex_ctxt arg_rhs */
11930#line 3265 "parse.y"
11931 {
11932 /*%%%*/
11933 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11934 /*% %*/
11935 /*% ripper: assign!($1, $4) %*/
11936 }
11937#line 11938 "parse.c"
11938 break;
11939
11940 case 223: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
11941#line 3272 "parse.y"
11942 {
11943 /*%%%*/
11944 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11945 /*% %*/
11946 /*% ripper: opassign!($1, $2, $4) %*/
11947 }
11948#line 11949 "parse.c"
11949 break;
11950
11951 case 224: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
11952#line 3279 "parse.y"
11953 {
11954 /*%%%*/
11955 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
11956 /*% %*/
11957 /*% ripper: opassign!(aref_field!($1, $3), $5, $7) %*/
11958 }
11959#line 11960 "parse.c"
11960 break;
11961
11962 case 225: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11963#line 3286 "parse.y"
11964 {
11965 /*%%%*/
11966 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11967 /*% %*/
11968 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11969 }
11970#line 11971 "parse.c"
11971 break;
11972
11973 case 226: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
11974#line 3293 "parse.y"
11975 {
11976 /*%%%*/
11977 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11978 /*% %*/
11979 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11980 }
11981#line 11982 "parse.c"
11982 break;
11983
11984 case 227: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11985#line 3300 "parse.y"
11986 {
11987 /*%%%*/
11988 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11989 /*% %*/
11990 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11991 }
11992#line 11993 "parse.c"
11993 break;
11994
11995 case 228: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
11996#line 3307 "parse.y"
11997 {
11998 /*%%%*/
11999 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
12000 (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));
12001 /*% %*/
12002 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
12003 }
12004#line 12005 "parse.c"
12005 break;
12006
12007 case 229: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
12008#line 3315 "parse.y"
12009 {
12010 /*%%%*/
12011 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-3]));
12012 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
12013 /*% %*/
12014 /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/
12015 }
12016#line 12017 "parse.c"
12017 break;
12018
12019 case 230: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
12020#line 3323 "parse.y"
12021 {
12022 /*%%%*/
12023 rb_backref_error(p, (yyvsp[-3].node));
12024 (yyval.node) = NEW_ERROR(&(yyloc));
12025 /*% %*/
12026 /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/
12027 }
12028#line 12029 "parse.c"
12029 break;
12030
12031 case 231: /* arg: arg ".." arg */
12032#line 3331 "parse.y"
12033 {
12034 /*%%%*/
12035 value_expr((yyvsp[-2].node));
12036 value_expr((yyvsp[0].node));
12037 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12038 /*% %*/
12039 /*% ripper: dot2!($1, $3) %*/
12040 }
12041#line 12042 "parse.c"
12042 break;
12043
12044 case 232: /* arg: arg "..." arg */
12045#line 3340 "parse.y"
12046 {
12047 /*%%%*/
12048 value_expr((yyvsp[-2].node));
12049 value_expr((yyvsp[0].node));
12050 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12051 /*% %*/
12052 /*% ripper: dot3!($1, $3) %*/
12053 }
12054#line 12055 "parse.c"
12055 break;
12056
12057 case 233: /* arg: arg ".." */
12058#line 3349 "parse.y"
12059 {
12060 /*%%%*/
12061 value_expr((yyvsp[-1].node));
12062 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
12063 /*% %*/
12064 /*% ripper: dot2!($1, Qnil) %*/
12065 }
12066#line 12067 "parse.c"
12067 break;
12068
12069 case 234: /* arg: arg "..." */
12070#line 3357 "parse.y"
12071 {
12072 /*%%%*/
12073 value_expr((yyvsp[-1].node));
12074 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
12075 /*% %*/
12076 /*% ripper: dot3!($1, Qnil) %*/
12077 }
12078#line 12079 "parse.c"
12079 break;
12080
12081 case 235: /* arg: "(.." arg */
12082#line 3365 "parse.y"
12083 {
12084 /*%%%*/
12085 value_expr((yyvsp[0].node));
12086 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
12087 /*% %*/
12088 /*% ripper: dot2!(Qnil, $2) %*/
12089 }
12090#line 12091 "parse.c"
12091 break;
12092
12093 case 236: /* arg: "(..." arg */
12094#line 3373 "parse.y"
12095 {
12096 /*%%%*/
12097 value_expr((yyvsp[0].node));
12098 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
12099 /*% %*/
12100 /*% ripper: dot3!(Qnil, $2) %*/
12101 }
12102#line 12103 "parse.c"
12103 break;
12104
12105 case 237: /* arg: arg '+' arg */
12106#line 3381 "parse.y"
12107 {
12108 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12109 }
12110#line 12111 "parse.c"
12111 break;
12112
12113 case 238: /* arg: arg '-' arg */
12114#line 3385 "parse.y"
12115 {
12116 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12117 }
12118#line 12119 "parse.c"
12119 break;
12120
12121 case 239: /* arg: arg '*' arg */
12122#line 3389 "parse.y"
12123 {
12124 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12125 }
12126#line 12127 "parse.c"
12127 break;
12128
12129 case 240: /* arg: arg '/' arg */
12130#line 3393 "parse.y"
12131 {
12132 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12133 }
12134#line 12135 "parse.c"
12135 break;
12136
12137 case 241: /* arg: arg '%' arg */
12138#line 3397 "parse.y"
12139 {
12140 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12141 }
12142#line 12143 "parse.c"
12143 break;
12144
12145 case 242: /* arg: arg "**" arg */
12146#line 3401 "parse.y"
12147 {
12148 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12149 }
12150#line 12151 "parse.c"
12151 break;
12152
12153 case 243: /* arg: tUMINUS_NUM simple_numeric "**" arg */
12154#line 3405 "parse.y"
12155 {
12156 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
12157 }
12158#line 12159 "parse.c"
12159 break;
12160
12161 case 244: /* arg: "unary+" arg */
12162#line 3409 "parse.y"
12163 {
12164 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
12165 }
12166#line 12167 "parse.c"
12167 break;
12168
12169 case 245: /* arg: "unary-" arg */
12170#line 3413 "parse.y"
12171 {
12172 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
12173 }
12174#line 12175 "parse.c"
12175 break;
12176
12177 case 246: /* arg: arg '|' arg */
12178#line 3417 "parse.y"
12179 {
12180 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12181 }
12182#line 12183 "parse.c"
12183 break;
12184
12185 case 247: /* arg: arg '^' arg */
12186#line 3421 "parse.y"
12187 {
12188 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12189 }
12190#line 12191 "parse.c"
12191 break;
12192
12193 case 248: /* arg: arg '&' arg */
12194#line 3425 "parse.y"
12195 {
12196 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12197 }
12198#line 12199 "parse.c"
12199 break;
12200
12201 case 249: /* arg: arg "<=>" arg */
12202#line 3429 "parse.y"
12203 {
12204 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12205 }
12206#line 12207 "parse.c"
12207 break;
12208
12209 case 251: /* arg: arg "==" arg */
12210#line 3434 "parse.y"
12211 {
12212 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12213 }
12214#line 12215 "parse.c"
12215 break;
12216
12217 case 252: /* arg: arg "===" arg */
12218#line 3438 "parse.y"
12219 {
12220 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12221 }
12222#line 12223 "parse.c"
12223 break;
12224
12225 case 253: /* arg: arg "!=" arg */
12226#line 3442 "parse.y"
12227 {
12228 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12229 }
12230#line 12231 "parse.c"
12231 break;
12232
12233 case 254: /* arg: arg "=~" arg */
12234#line 3446 "parse.y"
12235 {
12236 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12237 }
12238#line 12239 "parse.c"
12239 break;
12240
12241 case 255: /* arg: arg "!~" arg */
12242#line 3450 "parse.y"
12243 {
12244 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12245 }
12246#line 12247 "parse.c"
12247 break;
12248
12249 case 256: /* arg: '!' arg */
12250#line 3454 "parse.y"
12251 {
12252 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
12253 }
12254#line 12255 "parse.c"
12255 break;
12256
12257 case 257: /* arg: '~' arg */
12258#line 3458 "parse.y"
12259 {
12260 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
12261 }
12262#line 12263 "parse.c"
12263 break;
12264
12265 case 258: /* arg: arg "<<" arg */
12266#line 3462 "parse.y"
12267 {
12268 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12269 }
12270#line 12271 "parse.c"
12271 break;
12272
12273 case 259: /* arg: arg ">>" arg */
12274#line 3466 "parse.y"
12275 {
12276 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12277 }
12278#line 12279 "parse.c"
12279 break;
12280
12281 case 260: /* arg: arg "&&" arg */
12282#line 3470 "parse.y"
12283 {
12284 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12285 }
12286#line 12287 "parse.c"
12287 break;
12288
12289 case 261: /* arg: arg "||" arg */
12290#line 3474 "parse.y"
12291 {
12292 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12293 }
12294#line 12295 "parse.c"
12295 break;
12296
12297 case 262: /* arg: "`defined?'" opt_nl begin_defined arg */
12298#line 3478 "parse.y"
12299 {
12300 p->ctxt.in_defined = (yyvsp[-1].ctxt).in_defined;
12301 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
12302 }
12303#line 12304 "parse.c"
12304 break;
12305
12306 case 263: /* arg: arg '?' arg opt_nl ':' arg */
12307#line 3483 "parse.y"
12308 {
12309 /*%%%*/
12310 value_expr((yyvsp[-5].node));
12311 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
12312 fixpos((yyval.node), (yyvsp[-5].node));
12313 /*% %*/
12314 /*% ripper: ifop!($1, $3, $6) %*/
12315 }
12316#line 12317 "parse.c"
12317 break;
12318
12319 case 264: /* arg: defn_head f_opt_paren_args '=' endless_arg */
12320#line 3492 "parse.y"
12321 {
12322 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
12323 restore_defun(p, (yyvsp[-3].node_def_temp));
12324 /*%%%*/
12325 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12326 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12327 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
12328 /*% %*/
12329 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
12330 /*% ripper: def!($head->nd_mid, $args, $bodystmt) %*/
12331 local_pop(p);
12332 }
12333#line 12334 "parse.c"
12334 break;
12335
12336 case 265: /* arg: defs_head f_opt_paren_args '=' endless_arg */
12337#line 3505 "parse.y"
12338 {
12339 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
12340 restore_defun(p, (yyvsp[-3].node_def_temp));
12341 /*%%%*/
12342 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12343 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12344 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
12345 /*% %*/
12346 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
12347 /*% ripper: defs!($head->nd_recv, $head->dot_or_colon, $head->nd_mid, $args, $bodystmt) %*/
12348 local_pop(p);
12349 }
12350#line 12351 "parse.c"
12351 break;
12352
12353 case 266: /* arg: primary */
12354#line 3518 "parse.y"
12355 {
12356 (yyval.node) = (yyvsp[0].node);
12357 }
12358#line 12359 "parse.c"
12359 break;
12360
12361 case 268: /* endless_arg: endless_arg "`rescue' modifier" after_rescue arg */
12362#line 3525 "parse.y"
12363 {
12364 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12365 /*%%%*/
12366 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
12367 /*% %*/
12368 /*% ripper: rescue_mod!($1, $4) %*/
12369 }
12370#line 12371 "parse.c"
12371 break;
12372
12373 case 269: /* endless_arg: "`not'" opt_nl endless_arg */
12374#line 3533 "parse.y"
12375 {
12376 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12377 }
12378#line 12379 "parse.c"
12379 break;
12380
12381 case 270: /* relop: '>' */
12382#line 3538 "parse.y"
12383 {(yyval.id) = '>';}
12384#line 12385 "parse.c"
12385 break;
12386
12387 case 271: /* relop: '<' */
12388#line 3539 "parse.y"
12389 {(yyval.id) = '<';}
12390#line 12391 "parse.c"
12391 break;
12392
12393 case 272: /* relop: ">=" */
12394#line 3540 "parse.y"
12395 {(yyval.id) = idGE;}
12396#line 12397 "parse.c"
12397 break;
12398
12399 case 273: /* relop: "<=" */
12400#line 3541 "parse.y"
12401 {(yyval.id) = idLE;}
12402#line 12403 "parse.c"
12403 break;
12404
12405 case 274: /* rel_expr: arg relop arg */
12406#line 3545 "parse.y"
12407 {
12408 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12409 }
12410#line 12411 "parse.c"
12411 break;
12412
12413 case 275: /* rel_expr: rel_expr relop arg */
12414#line 3549 "parse.y"
12415 {
12416 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
12417 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12418 }
12419#line 12420 "parse.c"
12420 break;
12421
12422 case 276: /* lex_ctxt: none */
12423#line 3556 "parse.y"
12424 {
12425 (yyval.ctxt) = p->ctxt;
12426 }
12427#line 12428 "parse.c"
12428 break;
12429
12430 case 277: /* begin_defined: lex_ctxt */
12431#line 3562 "parse.y"
12432 {
12433 p->ctxt.in_defined = 1;
12434 (yyval.ctxt) = (yyvsp[0].ctxt);
12435 }
12436#line 12437 "parse.c"
12437 break;
12438
12439 case 278: /* after_rescue: lex_ctxt */
12440#line 3569 "parse.y"
12441 {
12442 p->ctxt.in_rescue = after_rescue;
12443 (yyval.ctxt) = (yyvsp[0].ctxt);
12444 }
12445#line 12446 "parse.c"
12446 break;
12447
12448 case 279: /* arg_value: arg */
12449#line 3576 "parse.y"
12450 {
12451 value_expr((yyvsp[0].node));
12452 (yyval.node) = (yyvsp[0].node);
12453 }
12454#line 12455 "parse.c"
12455 break;
12456
12457 case 281: /* aref_args: args trailer */
12458#line 3584 "parse.y"
12459 {
12460 (yyval.node) = (yyvsp[-1].node);
12461 }
12462#line 12463 "parse.c"
12463 break;
12464
12465 case 282: /* aref_args: args ',' assocs trailer */
12466#line 3588 "parse.y"
12467 {
12468 /*%%%*/
12469 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
12470 /*% %*/
12471 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
12472 }
12473#line 12474 "parse.c"
12474 break;
12475
12476 case 283: /* aref_args: assocs trailer */
12477#line 3595 "parse.y"
12478 {
12479 /*%%%*/
12480 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
12481 /*% %*/
12482 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
12483 }
12484#line 12485 "parse.c"
12485 break;
12486
12487 case 284: /* arg_rhs: arg */
12488#line 3604 "parse.y"
12489 {
12490 value_expr((yyvsp[0].node));
12491 (yyval.node) = (yyvsp[0].node);
12492 }
12493#line 12494 "parse.c"
12494 break;
12495
12496 case 285: /* arg_rhs: arg "`rescue' modifier" after_rescue arg */
12497#line 3609 "parse.y"
12498 {
12499 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12500 /*%%%*/
12501 value_expr((yyvsp[-3].node));
12502 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
12503 /*% %*/
12504 /*% ripper: rescue_mod!($1, $4) %*/
12505 }
12506#line 12507 "parse.c"
12507 break;
12508
12509 case 286: /* paren_args: '(' opt_call_args rparen */
12510#line 3620 "parse.y"
12511 {
12512 /*%%%*/
12513 (yyval.node) = (yyvsp[-1].node);
12514 /*% %*/
12515 /*% ripper: arg_paren!($2) %*/
12516 }
12517#line 12518 "parse.c"
12518 break;
12519
12520 case 287: /* paren_args: '(' args ',' args_forward rparen */
12521#line 3627 "parse.y"
12522 {
12523 if (!check_forwarding_args(p)) {
12524 (yyval.node) = Qnone;
12525 }
12526 else {
12527 /*%%%*/
12528 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
12529 /*% %*/
12530 /*% ripper: arg_paren!(args_add!($2, $4)) %*/
12531 }
12532 }
12533#line 12534 "parse.c"
12534 break;
12535
12536 case 288: /* paren_args: '(' args_forward rparen */
12537#line 3639 "parse.y"
12538 {
12539 if (!check_forwarding_args(p)) {
12540 (yyval.node) = Qnone;
12541 }
12542 else {
12543 /*%%%*/
12544 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
12545 /*% %*/
12546 /*% ripper: arg_paren!($2) %*/
12547 }
12548 }
12549#line 12550 "parse.c"
12550 break;
12551
12552 case 293: /* opt_call_args: args ',' */
12553#line 3659 "parse.y"
12554 {
12555 (yyval.node) = (yyvsp[-1].node);
12556 }
12557#line 12558 "parse.c"
12558 break;
12559
12560 case 294: /* opt_call_args: args ',' assocs ',' */
12561#line 3663 "parse.y"
12562 {
12563 /*%%%*/
12564 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
12565 /*% %*/
12566 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
12567 }
12568#line 12569 "parse.c"
12569 break;
12570
12571 case 295: /* opt_call_args: assocs ',' */
12572#line 3670 "parse.y"
12573 {
12574 /*%%%*/
12575 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
12576 /*% %*/
12577 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
12578 }
12579#line 12580 "parse.c"
12580 break;
12581
12582 case 296: /* call_args: command */
12583#line 3679 "parse.y"
12584 {
12585 /*%%%*/
12586 value_expr((yyvsp[0].node));
12587 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12588 /*% %*/
12589 /*% ripper: args_add!(args_new!, $1) %*/
12590 }
12591#line 12592 "parse.c"
12592 break;
12593
12594 case 297: /* call_args: args opt_block_arg */
12595#line 3687 "parse.y"
12596 {
12597 /*%%%*/
12598 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node_block_pass));
12599 /*% %*/
12600 /*% ripper: args_add_block!($1, $2) %*/
12601 }
12602#line 12603 "parse.c"
12603 break;
12604
12605 case 298: /* call_args: assocs opt_block_arg */
12606#line 3694 "parse.y"
12607 {
12608 /*%%%*/
12609 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
12610 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
12611 /*% %*/
12612 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/
12613 }
12614#line 12615 "parse.c"
12615 break;
12616
12617 case 299: /* call_args: args ',' assocs opt_block_arg */
12618#line 3702 "parse.y"
12619 {
12620 /*%%%*/
12621 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
12622 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
12623 /*% %*/
12624 /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/
12625 }
12626#line 12627 "parse.c"
12627 break;
12628
12629 case 301: /* $@13: %empty */
12630#line 3713 "parse.y"
12631 {
12632 /* If call_args starts with a open paren '(' or '[',
12633 * look-ahead reading of the letters calls CMDARG_PUSH(0),
12634 * but the push must be done after CMDARG_PUSH(1).
12635 * So this code makes them consistent by first cancelling
12636 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
12637 * and finally redoing CMDARG_PUSH(0).
12638 */
12639 int lookahead = 0;
12640 switch (yychar) {
12641 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
12642 lookahead = 1;
12643 }
12644 if (lookahead) CMDARG_POP();
12645 CMDARG_PUSH(1);
12646 if (lookahead) CMDARG_PUSH(0);
12647 }
12648#line 12649 "parse.c"
12649 break;
12650
12651 case 302: /* command_args: $@13 call_args */
12652#line 3731 "parse.y"
12653 {
12654 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
12655 * but the push must be done after CMDARG_POP() in the parser.
12656 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
12657 * CMDARG_POP() to pop 1 pushed by command_args,
12658 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
12659 */
12660 int lookahead = 0;
12661 switch (yychar) {
12662 case tLBRACE_ARG:
12663 lookahead = 1;
12664 }
12665 if (lookahead) CMDARG_POP();
12666 CMDARG_POP();
12667 if (lookahead) CMDARG_PUSH(0);
12668 (yyval.node) = (yyvsp[0].node);
12669 }
12670#line 12671 "parse.c"
12671 break;
12672
12673 case 303: /* block_arg: "&" arg_value */
12674#line 3751 "parse.y"
12675 {
12676 /*%%%*/
12677 (yyval.node_block_pass) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc));
12678 /*% %*/
12679 /*% ripper: $2 %*/
12680 }
12681#line 12682 "parse.c"
12682 break;
12683
12684 case 304: /* block_arg: "&" */
12685#line 3758 "parse.y"
12686 {
12687 forwarding_arg_check(p, idFWD_BLOCK, 0, "block");
12688 /*%%%*/
12689 (yyval.node_block_pass) = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[0])), &(yyloc));
12690 /*% %*/
12691 /*% ripper: Qnil %*/
12692 }
12693#line 12694 "parse.c"
12694 break;
12695
12696 case 305: /* opt_block_arg: ',' block_arg */
12697#line 3768 "parse.y"
12698 {
12699 (yyval.node_block_pass) = (yyvsp[0].node_block_pass);
12700 }
12701#line 12702 "parse.c"
12702 break;
12703
12704 case 306: /* opt_block_arg: none */
12705#line 3772 "parse.y"
12706 {
12707 (yyval.node_block_pass) = 0;
12708 }
12709#line 12710 "parse.c"
12710 break;
12711
12712 case 307: /* args: arg_value */
12713#line 3779 "parse.y"
12714 {
12715 /*%%%*/
12716 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12717 /*% %*/
12718 /*% ripper: args_add!(args_new!, $1) %*/
12719 }
12720#line 12721 "parse.c"
12721 break;
12722
12723 case 308: /* args: arg_splat */
12724#line 3786 "parse.y"
12725 {
12726 /*%%%*/
12727 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
12728 /*% %*/
12729 /*% ripper: args_add_star!(args_new!, $arg_splat) %*/
12730 }
12731#line 12732 "parse.c"
12732 break;
12733
12734 case 309: /* args: args ',' arg_value */
12735#line 3793 "parse.y"
12736 {
12737 /*%%%*/
12738 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12739 /*% %*/
12740 /*% ripper: args_add!($1, $3) %*/
12741 }
12742#line 12743 "parse.c"
12743 break;
12744
12745 case 310: /* args: args ',' arg_splat */
12746#line 3800 "parse.y"
12747 {
12748 /*%%%*/
12749 (yyval.node) = rest_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12750 /*% %*/
12751 /*% ripper: args_add_star!($1, $3) %*/
12752 }
12753#line 12754 "parse.c"
12754 break;
12755
12756 case 311: /* arg_splat: "*" arg_value */
12757#line 3810 "parse.y"
12758 {
12759 (yyval.node) = (yyvsp[0].node);
12760 }
12761#line 12762 "parse.c"
12762 break;
12763
12764 case 312: /* arg_splat: "*" */
12765#line 3814 "parse.y"
12766 {
12767 forwarding_arg_check(p, idFWD_REST, idFWD_ALL, "rest");
12768 /*%%%*/
12769 (yyval.node) = NEW_LVAR(idFWD_REST, &(yylsp[0]));
12770 /*% %*/
12771 /*% ripper: Qnil %*/
12772 }
12773#line 12774 "parse.c"
12774 break;
12775
12776 case 315: /* mrhs: args ',' arg_value */
12777#line 3830 "parse.y"
12778 {
12779 /*%%%*/
12780 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12781 /*% %*/
12782 /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/
12783 }
12784#line 12785 "parse.c"
12785 break;
12786
12787 case 316: /* mrhs: args ',' "*" arg_value */
12788#line 3837 "parse.y"
12789 {
12790 /*%%%*/
12791 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
12792 /*% %*/
12793 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/
12794 }
12795#line 12796 "parse.c"
12796 break;
12797
12798 case 317: /* mrhs: "*" arg_value */
12799#line 3844 "parse.y"
12800 {
12801 /*%%%*/
12802 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
12803 /*% %*/
12804 /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/
12805 }
12806#line 12807 "parse.c"
12807 break;
12808
12809 case 328: /* primary: "method" */
12810#line 3863 "parse.y"
12811 {
12812 /*%%%*/
12813 (yyval.node) = (NODE *)NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
12814 /*% %*/
12815 /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/
12816 }
12817#line 12818 "parse.c"
12818 break;
12819
12820 case 329: /* $@14: %empty */
12821#line 3870 "parse.y"
12822 {
12823 CMDARG_PUSH(0);
12824 }
12825#line 12826 "parse.c"
12826 break;
12827
12828 case 330: /* primary: k_begin $@14 bodystmt k_end */
12829#line 3875 "parse.y"
12830 {
12831 CMDARG_POP();
12832 /*%%%*/
12833 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
12834 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
12835 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
12836 /*% %*/
12837 /*% ripper: begin!($3) %*/
12838 }
12839#line 12840 "parse.c"
12840 break;
12841
12842 case 331: /* $@15: %empty */
12843#line 3884 "parse.y"
12844 {SET_LEX_STATE(EXPR_ENDARG);}
12845#line 12846 "parse.c"
12846 break;
12847
12848 case 332: /* primary: "( arg" compstmt $@15 ')' */
12849#line 3885 "parse.y"
12850 {
12851 /*%%%*/
12852 if (nd_type_p((yyvsp[-2].node), NODE_SELF)) RNODE_SELF((yyvsp[-2].node))->nd_state = 0;
12853 (yyval.node) = (yyvsp[-2].node);
12854 /*% %*/
12855 /*% ripper: paren!($2) %*/
12856 }
12857#line 12858 "parse.c"
12858 break;
12859
12860 case 333: /* primary: "(" compstmt ')' */
12861#line 3893 "parse.y"
12862 {
12863 /*%%%*/
12864 if (nd_type_p((yyvsp[-1].node), NODE_SELF)) RNODE_SELF((yyvsp[-1].node))->nd_state = 0;
12865 (yyval.node) = NEW_BLOCK((yyvsp[-1].node), &(yyloc));
12866 /*% %*/
12867 /*% ripper: paren!($2) %*/
12868 }
12869#line 12870 "parse.c"
12870 break;
12871
12872 case 334: /* primary: primary_value "::" "constant" */
12873#line 3901 "parse.y"
12874 {
12875 /*%%%*/
12876 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
12877 /*% %*/
12878 /*% ripper: const_path_ref!($1, $3) %*/
12879 }
12880#line 12881 "parse.c"
12881 break;
12882
12883 case 335: /* primary: ":: at EXPR_BEG" "constant" */
12884#line 3908 "parse.y"
12885 {
12886 /*%%%*/
12887 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
12888 /*% %*/
12889 /*% ripper: top_const_ref!($2) %*/
12890 }
12891#line 12892 "parse.c"
12892 break;
12893
12894 case 336: /* primary: "[" aref_args ']' */
12895#line 3915 "parse.y"
12896 {
12897 /*%%%*/
12898 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12899 /*% %*/
12900 /*% ripper: array!($2) %*/
12901 }
12902#line 12903 "parse.c"
12903 break;
12904
12905 case 337: /* primary: "{" assoc_list '}' */
12906#line 3922 "parse.y"
12907 {
12908 /*%%%*/
12909 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
12910 RNODE_HASH((yyval.node))->nd_brace = TRUE;
12911 /*% %*/
12912 /*% ripper: hash!($2) %*/
12913 }
12914#line 12915 "parse.c"
12915 break;
12916
12917 case 338: /* primary: k_return */
12918#line 3930 "parse.y"
12919 {
12920 /*%%%*/
12921 (yyval.node) = NEW_RETURN(0, &(yyloc));
12922 /*% %*/
12923 /*% ripper: return0! %*/
12924 }
12925#line 12926 "parse.c"
12926 break;
12927
12928 case 339: /* primary: k_yield '(' call_args rparen */
12929#line 3937 "parse.y"
12930 {
12931 /*%%%*/
12932 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
12933 /*% %*/
12934 /*% ripper: yield!(paren!($3)) %*/
12935 }
12936#line 12937 "parse.c"
12937 break;
12938
12939 case 340: /* primary: k_yield '(' rparen */
12940#line 3944 "parse.y"
12941 {
12942 /*%%%*/
12943 (yyval.node) = NEW_YIELD(0, &(yyloc));
12944 /*% %*/
12945 /*% ripper: yield!(paren!(args_new!)) %*/
12946 }
12947#line 12948 "parse.c"
12948 break;
12949
12950 case 341: /* primary: k_yield */
12951#line 3951 "parse.y"
12952 {
12953 /*%%%*/
12954 (yyval.node) = NEW_YIELD(0, &(yyloc));
12955 /*% %*/
12956 /*% ripper: yield0! %*/
12957 }
12958#line 12959 "parse.c"
12959 break;
12960
12961 case 342: /* primary: "`defined?'" opt_nl '(' begin_defined expr rparen */
12962#line 3958 "parse.y"
12963 {
12964 p->ctxt.in_defined = (yyvsp[-2].ctxt).in_defined;
12965 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
12966 }
12967#line 12968 "parse.c"
12968 break;
12969
12970 case 343: /* primary: "`not'" '(' expr rparen */
12971#line 3963 "parse.y"
12972 {
12973 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
12974 }
12975#line 12976 "parse.c"
12976 break;
12977
12978 case 344: /* primary: "`not'" '(' rparen */
12979#line 3967 "parse.y"
12980 {
12981 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12982 }
12983#line 12984 "parse.c"
12984 break;
12985
12986 case 345: /* primary: fcall brace_block */
12987#line 3971 "parse.y"
12988 {
12989 /*%%%*/
12990 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-1].node_fcall), (yyvsp[0].node), &(yyloc));
12991 /*% %*/
12992 /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/
12993 }
12994#line 12995 "parse.c"
12995 break;
12996
12997 case 347: /* primary: method_call brace_block */
12998#line 3979 "parse.y"
12999 {
13000 /*%%%*/
13001 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
13002 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13003 /*% %*/
13004 /*% ripper: method_add_block!($1, $2) %*/
13005 }
13006#line 13007 "parse.c"
13007 break;
13008
13009 case 349: /* primary: k_if expr_value then compstmt if_tail k_end */
13010#line 3991 "parse.y"
13011 {
13012 /*%%%*/
13013 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
13014 fixpos((yyval.node), (yyvsp[-4].node));
13015 /*% %*/
13016 /*% ripper: if!($2, $4, $5) %*/
13017 }
13018#line 13019 "parse.c"
13019 break;
13020
13021 case 350: /* primary: k_unless expr_value then compstmt opt_else k_end */
13022#line 4002 "parse.y"
13023 {
13024 /*%%%*/
13025 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
13026 fixpos((yyval.node), (yyvsp[-4].node));
13027 /*% %*/
13028 /*% ripper: unless!($2, $4, $5) %*/
13029 }
13030#line 13031 "parse.c"
13031 break;
13032
13033 case 351: /* primary: k_while expr_value_do compstmt k_end */
13034#line 4012 "parse.y"
13035 {
13036 restore_block_exit(p, (yyvsp[-3].node_exits));
13037 /*%%%*/
13038 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
13039 fixpos((yyval.node), (yyvsp[-2].node));
13040 /*% %*/
13041 /*% ripper: while!($2, $3) %*/
13042 }
13043#line 13044 "parse.c"
13044 break;
13045
13046 case 352: /* primary: k_until expr_value_do compstmt k_end */
13047#line 4023 "parse.y"
13048 {
13049 restore_block_exit(p, (yyvsp[-3].node_exits));
13050 /*%%%*/
13051 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
13052 fixpos((yyval.node), (yyvsp[-2].node));
13053 /*% %*/
13054 /*% ripper: until!($2, $3) %*/
13055 }
13056#line 13057 "parse.c"
13057 break;
13058
13059 case 353: /* @16: %empty */
13060#line 4032 "parse.y"
13061 {
13062 (yyval.val) = p->case_labels;
13063 p->case_labels = Qnil;
13064 }
13065#line 13066 "parse.c"
13066 break;
13067
13068 case 354: /* primary: k_case expr_value opt_terms @16 case_body k_end */
13069#line 4038 "parse.y"
13070 {
13071 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
13072 p->case_labels = (yyvsp[-2].val);
13073 /*%%%*/
13074 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
13075 fixpos((yyval.node), (yyvsp[-4].node));
13076 /*% %*/
13077 /*% ripper: case!($2, $5) %*/
13078 }
13079#line 13080 "parse.c"
13080 break;
13081
13082 case 355: /* @17: %empty */
13083#line 4048 "parse.y"
13084 {
13085 (yyval.val) = p->case_labels;
13086 p->case_labels = 0;
13087 }
13088#line 13089 "parse.c"
13089 break;
13090
13091 case 356: /* primary: k_case opt_terms @17 case_body k_end */
13092#line 4054 "parse.y"
13093 {
13094 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
13095 p->case_labels = (yyvsp[-2].val);
13096 /*%%%*/
13097 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc));
13098 /*% %*/
13099 /*% ripper: case!(Qnil, $4) %*/
13100 }
13101#line 13102 "parse.c"
13102 break;
13103
13104 case 357: /* primary: k_case expr_value opt_terms p_case_body k_end */
13105#line 4065 "parse.y"
13106 {
13107 /*%%%*/
13108 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13109 /*% %*/
13110 /*% ripper: case!($2, $4) %*/
13111 }
13112#line 13113 "parse.c"
13113 break;
13114
13115 case 358: /* primary: k_for for_var "`in'" expr_value_do compstmt k_end */
13116#line 4074 "parse.y"
13117 {
13118 restore_block_exit(p, (yyvsp[-5].node_exits));
13119 /*%%%*/
13120 /*
13121 * for a, b, c in e
13122 * #=>
13123 * e.each{|*x| a, b, c = x}
13124 *
13125 * for a in e
13126 * #=>
13127 * e.each{|x| a, = x}
13128 */
13129 ID id = internal_id(p);
13130 rb_node_args_aux_t *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
13131 rb_node_args_t *args;
13132 NODE *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
13133 rb_ast_id_table_t *tbl = rb_ast_new_local_table(p->ast, 1);
13134 tbl->ids[0] = id; /* internal id */
13135
13136 switch (nd_type((yyvsp[-4].node))) {
13137 case NODE_LASGN:
13138 case NODE_DASGN: /* e.each {|internal_var| a = internal_var; ... } */
13139 set_nd_value(p, (yyvsp[-4].node), internal_var);
13140 id = 0;
13141 m->nd_plen = 1;
13142 m->nd_next = (yyvsp[-4].node);
13143 break;
13144 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
13145 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
13146 break;
13147 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
13148 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]));
13149 }
13150 /* {|*internal_id| <m> = internal_id; ... } */
13151 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
13152 scope = NEW_SCOPE2(tbl, args, (yyvsp[-1].node), &(yyloc));
13153 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
13154 fixpos((yyval.node), (yyvsp[-4].node));
13155 /*% %*/
13156 /*% ripper: for!($2, $4, $5) %*/
13157 }
13158#line 13159 "parse.c"
13159 break;
13160
13161 case 359: /* $@18: %empty */
13162#line 4116 "parse.y"
13163 {
13164 begin_definition("class", &(yylsp[-2]), &(yylsp[-1]));
13165 }
13166#line 13167 "parse.c"
13167 break;
13168
13169 case 360: /* primary: k_class cpath superclass $@18 bodystmt k_end */
13170#line 4121 "parse.y"
13171 {
13172 /*%%%*/
13173 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
13174 nd_set_line(RNODE_CLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
13175 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
13176 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
13177 /*% %*/
13178 /*% ripper: class!($cpath, $superclass, $bodystmt) %*/
13179 local_pop(p);
13180 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
13181 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
13182 }
13183#line 13184 "parse.c"
13184 break;
13185
13186 case 361: /* $@19: %empty */
13187#line 4134 "parse.y"
13188 {
13189 begin_definition("", &(yylsp[-2]), &(yylsp[-1]));
13190 }
13191#line 13192 "parse.c"
13192 break;
13193
13194 case 362: /* primary: k_class "<<" expr_value $@19 term bodystmt k_end */
13195#line 4140 "parse.y"
13196 {
13197 /*%%%*/
13198 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
13199 nd_set_line(RNODE_SCLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
13200 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
13201 fixpos((yyval.node), (yyvsp[-4].node));
13202 /*% %*/
13203 /*% ripper: sclass!($expr_value, $bodystmt) %*/
13204 local_pop(p);
13205 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
13206 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
13207 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
13208 }
13209#line 13210 "parse.c"
13210 break;
13211
13212 case 363: /* $@20: %empty */
13213#line 4154 "parse.y"
13214 {
13215 begin_definition("module", &(yylsp[-1]), &(yylsp[0]));
13216 }
13217#line 13218 "parse.c"
13218 break;
13219
13220 case 364: /* primary: k_module cpath $@20 bodystmt k_end */
13221#line 4159 "parse.y"
13222 {
13223 /*%%%*/
13224 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13225 nd_set_line(RNODE_MODULE((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
13226 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
13227 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
13228 /*% %*/
13229 /*% ripper: module!($cpath, $bodystmt) %*/
13230 local_pop(p);
13231 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
13232 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
13233 }
13234#line 13235 "parse.c"
13235 break;
13236
13237 case 365: /* $@21: %empty */
13238#line 4173 "parse.y"
13239 {
13240 /*%%%*/
13241 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13242 /*% %*/
13243 }
13244#line 13245 "parse.c"
13245 break;
13246
13247 case 366: /* primary: defn_head f_arglist $@21 bodystmt k_end */
13248#line 4180 "parse.y"
13249 {
13250 restore_defun(p, (yyvsp[-4].node_def_temp));
13251 /*%%%*/
13252 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
13253 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
13254 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[-1].node);
13255 /*% %*/
13256 /*% ripper: def!($head->nd_mid, $args, $bodystmt) %*/
13257 local_pop(p);
13258 }
13259#line 13260 "parse.c"
13260 break;
13261
13262 case 367: /* $@22: %empty */
13263#line 4192 "parse.y"
13264 {
13265 /*%%%*/
13266 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13267 /*% %*/
13268 }
13269#line 13270 "parse.c"
13270 break;
13271
13272 case 368: /* primary: defs_head f_arglist $@22 bodystmt k_end */
13273#line 4199 "parse.y"
13274 {
13275 restore_defun(p, (yyvsp[-4].node_def_temp));
13276 /*%%%*/
13277 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
13278 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
13279 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[-1].node);
13280 /*% %*/
13281 /*% ripper: defs!($head->nd_recv, $head->dot_or_colon, $head->nd_mid, $args, $bodystmt) %*/
13282 local_pop(p);
13283 }
13284#line 13285 "parse.c"
13285 break;
13286
13287 case 369: /* primary: "`break'" */
13288#line 4210 "parse.y"
13289 {
13290 (yyval.node) = add_block_exit(p, NEW_BREAK(0, &(yyloc)));
13291 /*% ripper: break!(args_new!) %*/
13292 }
13293#line 13294 "parse.c"
13294 break;
13295
13296 case 370: /* primary: "`next'" */
13297#line 4215 "parse.y"
13298 {
13299 (yyval.node) = add_block_exit(p, NEW_NEXT(0, &(yyloc)));
13300 /*% ripper: next!(args_new!) %*/
13301 }
13302#line 13303 "parse.c"
13303 break;
13304
13305 case 371: /* primary: "`redo'" */
13306#line 4220 "parse.y"
13307 {
13308 (yyval.node) = add_block_exit(p, NEW_REDO(&(yyloc)));
13309 /*% ripper: redo! %*/
13310 }
13311#line 13312 "parse.c"
13312 break;
13313
13314 case 372: /* primary: "`retry'" */
13315#line 4225 "parse.y"
13316 {
13317 if (!p->ctxt.in_defined) {
13318 switch (p->ctxt.in_rescue) {
13319 case before_rescue: yyerror1(&(yylsp[0]), "Invalid retry without rescue"); break;
13320 case after_rescue: /* ok */ break;
13321 case after_else: yyerror1(&(yylsp[0]), "Invalid retry after else"); break;
13322 case after_ensure: yyerror1(&(yylsp[0]), "Invalid retry after ensure"); break;
13323 }
13324 }
13325 /*%%%*/
13326 (yyval.node) = NEW_RETRY(&(yyloc));
13327 /*% %*/
13328 /*% ripper: retry! %*/
13329 }
13330#line 13331 "parse.c"
13331 break;
13332
13333 case 373: /* primary_value: primary */
13334#line 4242 "parse.y"
13335 {
13336 value_expr((yyvsp[0].node));
13337 (yyval.node) = (yyvsp[0].node);
13338 }
13339#line 13340 "parse.c"
13340 break;
13341
13342 case 374: /* k_begin: "`begin'" */
13343#line 4249 "parse.y"
13344 {
13345 token_info_push(p, "begin", &(yyloc));
13346 /*%%%*/
13347 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13348 /*% %*/
13349 }
13350#line 13351 "parse.c"
13351 break;
13352
13353 case 375: /* k_if: "`if'" */
13354#line 4258 "parse.y"
13355 {
13356 WARN_EOL("if");
13357 token_info_push(p, "if", &(yyloc));
13358 if (p->token_info && p->token_info->nonspc &&
13359 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
13360 const char *tok = p->lex.ptok - rb_strlen_lit("if");
13361 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
13362 beg += rb_strlen_lit("else");
13363 while (beg < tok && ISSPACE(*beg)) beg++;
13364 if (beg == tok) {
13365 p->token_info->nonspc = 0;
13366 }
13367 }
13368 /*%%%*/
13369 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13370 /*% %*/
13371 }
13372#line 13373 "parse.c"
13373 break;
13374
13375 case 376: /* k_unless: "`unless'" */
13376#line 4278 "parse.y"
13377 {
13378 token_info_push(p, "unless", &(yyloc));
13379 /*%%%*/
13380 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13381 /*% %*/
13382 }
13383#line 13384 "parse.c"
13384 break;
13385
13386 case 377: /* k_while: "`while'" allow_exits */
13387#line 4287 "parse.y"
13388 {
13389 (yyval.node_exits) = (yyvsp[0].node_exits);
13390 token_info_push(p, "while", &(yyloc));
13391 /*%%%*/
13392 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13393 /*% %*/
13394 }
13395#line 13396 "parse.c"
13396 break;
13397
13398 case 378: /* k_until: "`until'" allow_exits */
13399#line 4297 "parse.y"
13400 {
13401 (yyval.node_exits) = (yyvsp[0].node_exits);
13402 token_info_push(p, "until", &(yyloc));
13403 /*%%%*/
13404 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13405 /*% %*/
13406 }
13407#line 13408 "parse.c"
13408 break;
13409
13410 case 379: /* k_case: "`case'" */
13411#line 4307 "parse.y"
13412 {
13413 token_info_push(p, "case", &(yyloc));
13414 /*%%%*/
13415 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13416 /*% %*/
13417 }
13418#line 13419 "parse.c"
13419 break;
13420
13421 case 380: /* k_for: "`for'" allow_exits */
13422#line 4316 "parse.y"
13423 {
13424 (yyval.node_exits) = (yyvsp[0].node_exits);
13425 token_info_push(p, "for", &(yyloc));
13426 /*%%%*/
13427 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13428 /*% %*/
13429 }
13430#line 13431 "parse.c"
13431 break;
13432
13433 case 381: /* k_class: "`class'" */
13434#line 4326 "parse.y"
13435 {
13436 token_info_push(p, "class", &(yyloc));
13437 (yyval.ctxt) = p->ctxt;
13438 p->ctxt.in_rescue = before_rescue;
13439 /*%%%*/
13440 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13441 /*% %*/
13442 }
13443#line 13444 "parse.c"
13444 break;
13445
13446 case 382: /* k_module: "`module'" */
13447#line 4337 "parse.y"
13448 {
13449 token_info_push(p, "module", &(yyloc));
13450 (yyval.ctxt) = p->ctxt;
13451 p->ctxt.in_rescue = before_rescue;
13452 /*%%%*/
13453 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13454 /*% %*/
13455 }
13456#line 13457 "parse.c"
13457 break;
13458
13459 case 383: /* k_def: "`def'" */
13460#line 4348 "parse.y"
13461 {
13462 token_info_push(p, "def", &(yyloc));
13463 (yyval.node_def_temp) = NEW_DEF_TEMP(&(yyloc));
13464 p->ctxt.in_argdef = 1;
13465 }
13466#line 13467 "parse.c"
13467 break;
13468
13469 case 384: /* k_do: "`do'" */
13470#line 4356 "parse.y"
13471 {
13472 token_info_push(p, "do", &(yyloc));
13473 /*%%%*/
13474 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13475 /*% %*/
13476 }
13477#line 13478 "parse.c"
13478 break;
13479
13480 case 385: /* k_do_block: "`do' for block" */
13481#line 4365 "parse.y"
13482 {
13483 token_info_push(p, "do", &(yyloc));
13484 /*%%%*/
13485 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13486 /*% %*/
13487 }
13488#line 13489 "parse.c"
13489 break;
13490
13491 case 386: /* k_rescue: "`rescue'" */
13492#line 4374 "parse.y"
13493 {
13494 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
13495 (yyval.ctxt) = p->ctxt;
13496 p->ctxt.in_rescue = after_rescue;
13497 }
13498#line 13499 "parse.c"
13499 break;
13500
13501 case 387: /* k_ensure: "`ensure'" */
13502#line 4382 "parse.y"
13503 {
13504 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
13505 (yyval.ctxt) = p->ctxt;
13506 }
13507#line 13508 "parse.c"
13508 break;
13509
13510 case 388: /* k_when: "`when'" */
13511#line 4389 "parse.y"
13512 {
13513 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
13514 }
13515#line 13516 "parse.c"
13516 break;
13517
13518 case 389: /* k_else: "`else'" */
13519#line 4395 "parse.y"
13520 {
13521 token_info *ptinfo_beg = p->token_info;
13522 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
13523 token_info_warn(p, "else", p->token_info, same, &(yyloc));
13524 if (same) {
13525 token_info e;
13526 e.next = ptinfo_beg->next;
13527 e.token = "else";
13528 token_info_setup(&e, p->lex.pbeg, &(yyloc));
13529 if (!e.nonspc) *ptinfo_beg = e;
13530 }
13531 }
13532#line 13533 "parse.c"
13533 break;
13534
13535 case 390: /* k_elsif: "`elsif'" */
13536#line 4410 "parse.y"
13537 {
13538 WARN_EOL("elsif");
13539 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
13540 }
13541#line 13542 "parse.c"
13542 break;
13543
13544 case 391: /* k_end: "`end'" */
13545#line 4417 "parse.y"
13546 {
13547 token_info_pop(p, "end", &(yyloc));
13548 /*%%%*/
13549 pop_end_expect_token_locations(p);
13550 /*% %*/
13551 }
13552#line 13553 "parse.c"
13553 break;
13554
13555 case 392: /* k_end: "dummy end" */
13556#line 4424 "parse.y"
13557 {
13558 compile_error(p, "syntax error, unexpected end-of-input");
13559 }
13560#line 13561 "parse.c"
13561 break;
13562
13563 case 393: /* k_return: "`return'" */
13564#line 4430 "parse.y"
13565 {
13566 if (p->ctxt.in_class && !p->ctxt.in_def && !dyna_in_block(p))
13567 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
13568 }
13569#line 13570 "parse.c"
13570 break;
13571
13572 case 394: /* k_yield: "`yield'" */
13573#line 4437 "parse.y"
13574 {
13575 if (!p->ctxt.in_defined && !p->ctxt.in_def && !compile_for_eval)
13576 yyerror1(&(yylsp[0]), "Invalid yield");
13577 }
13578#line 13579 "parse.c"
13579 break;
13580
13581 case 401: /* if_tail: k_elsif expr_value then compstmt if_tail */
13582#line 4456 "parse.y"
13583 {
13584 /*%%%*/
13585 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13586 fixpos((yyval.node), (yyvsp[-3].node));
13587 /*% %*/
13588 /*% ripper: elsif!($2, $4, $5) %*/
13589 }
13590#line 13591 "parse.c"
13591 break;
13592
13593 case 403: /* opt_else: k_else compstmt */
13594#line 4467 "parse.y"
13595 {
13596 /*%%%*/
13597 (yyval.node) = (yyvsp[0].node);
13598 /*% %*/
13599 /*% ripper: else!($2) %*/
13600 }
13601#line 13602 "parse.c"
13602 break;
13603
13604 case 406: /* f_marg: f_norm_arg */
13605#line 4480 "parse.y"
13606 {
13607 /*%%%*/
13608 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
13609 mark_lvar_used(p, (yyval.node));
13610 /*% %*/
13611 /*% ripper: assignable(p, $1) %*/
13612 }
13613#line 13614 "parse.c"
13614 break;
13615
13616 case 407: /* f_marg: "(" f_margs rparen */
13617#line 4488 "parse.y"
13618 {
13619 /*%%%*/
13620 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
13621 /*% %*/
13622 /*% ripper: mlhs_paren!($2) %*/
13623 }
13624#line 13625 "parse.c"
13625 break;
13626
13627 case 408: /* f_marg_list: f_marg */
13628#line 4497 "parse.y"
13629 {
13630 /*%%%*/
13631 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13632 /*% %*/
13633 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
13634 }
13635#line 13636 "parse.c"
13636 break;
13637
13638 case 409: /* f_marg_list: f_marg_list ',' f_marg */
13639#line 4504 "parse.y"
13640 {
13641 /*%%%*/
13642 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
13643 /*% %*/
13644 /*% ripper: mlhs_add!($1, $3) %*/
13645 }
13646#line 13647 "parse.c"
13647 break;
13648
13649 case 410: /* f_margs: f_marg_list */
13650#line 4513 "parse.y"
13651 {
13652 /*%%%*/
13653 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
13654 /*% %*/
13655 /*% ripper: $1 %*/
13656 }
13657#line 13658 "parse.c"
13658 break;
13659
13660 case 411: /* f_margs: f_marg_list ',' f_rest_marg */
13661#line 4520 "parse.y"
13662 {
13663 /*%%%*/
13664 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13665 /*% %*/
13666 /*% ripper: mlhs_add_star!($1, $3) %*/
13667 }
13668#line 13669 "parse.c"
13669 break;
13670
13671 case 412: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
13672#line 4527 "parse.y"
13673 {
13674 /*%%%*/
13675 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
13676 /*% %*/
13677 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
13678 }
13679#line 13680 "parse.c"
13680 break;
13681
13682 case 413: /* f_margs: f_rest_marg */
13683#line 4534 "parse.y"
13684 {
13685 /*%%%*/
13686 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
13687 /*% %*/
13688 /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/
13689 }
13690#line 13691 "parse.c"
13691 break;
13692
13693 case 414: /* f_margs: f_rest_marg ',' f_marg_list */
13694#line 4541 "parse.y"
13695 {
13696 /*%%%*/
13697 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
13698 /*% %*/
13699 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/
13700 }
13701#line 13702 "parse.c"
13702 break;
13703
13704 case 415: /* f_rest_marg: "*" f_norm_arg */
13705#line 4550 "parse.y"
13706 {
13707 /*%%%*/
13708 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
13709 mark_lvar_used(p, (yyval.node));
13710 /*% %*/
13711 /*% ripper: assignable(p, $2) %*/
13712 }
13713#line 13714 "parse.c"
13714 break;
13715
13716 case 416: /* f_rest_marg: "*" */
13717#line 4558 "parse.y"
13718 {
13719 /*%%%*/
13720 (yyval.node) = NODE_SPECIAL_NO_NAME_REST;
13721 /*% %*/
13722 /*% ripper: Qnil %*/
13723 }
13724#line 13725 "parse.c"
13725 break;
13726
13727 case 418: /* f_any_kwrest: f_no_kwarg */
13728#line 4567 "parse.y"
13729 {(yyval.id) = ID2VAL(idNil);}
13730#line 13731 "parse.c"
13731 break;
13732
13733 case 419: /* $@23: %empty */
13734#line 4570 "parse.y"
13735 {p->ctxt.in_argdef = 0;}
13736#line 13737 "parse.c"
13737 break;
13738
13739 case 421: /* block_args_tail: f_block_kwarg ',' f_kwrest opt_f_block_arg */
13740#line 4573 "parse.y"
13741 {
13742 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
13743 }
13744#line 13745 "parse.c"
13745 break;
13746
13747 case 422: /* block_args_tail: f_block_kwarg opt_f_block_arg */
13748#line 4577 "parse.y"
13749 {
13750 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), Qnone, (yyvsp[0].id), &(yylsp[-1]));
13751 }
13752#line 13753 "parse.c"
13753 break;
13754
13755 case 423: /* block_args_tail: f_any_kwrest opt_f_block_arg */
13756#line 4581 "parse.y"
13757 {
13758 (yyval.node_args) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
13759 }
13760#line 13761 "parse.c"
13761 break;
13762
13763 case 424: /* block_args_tail: f_block_arg */
13764#line 4585 "parse.y"
13765 {
13766 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
13767 }
13768#line 13769 "parse.c"
13769 break;
13770
13771 case 425: /* opt_block_args_tail: ',' block_args_tail */
13772#line 4591 "parse.y"
13773 {
13774 (yyval.node_args) = (yyvsp[0].node_args);
13775 }
13776#line 13777 "parse.c"
13777 break;
13778
13779 case 426: /* opt_block_args_tail: %empty */
13780#line 4595 "parse.y"
13781 {
13782 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
13783 }
13784#line 13785 "parse.c"
13785 break;
13786
13787 case 427: /* excessed_comma: ',' */
13788#line 4601 "parse.y"
13789 {
13790 /* magic number for rest_id in iseq_set_arguments() */
13791 /*%%%*/
13792 (yyval.id) = NODE_SPECIAL_EXCESSIVE_COMMA;
13793 /*% %*/
13794 /*% ripper: excessed_comma! %*/
13795 }
13796#line 13797 "parse.c"
13797 break;
13798
13799 case 428: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail */
13800#line 4611 "parse.y"
13801 {
13802 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
13803 }
13804#line 13805 "parse.c"
13805 break;
13806
13807 case 429: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
13808#line 4615 "parse.y"
13809 {
13810 (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));
13811 }
13812#line 13813 "parse.c"
13813 break;
13814
13815 case 430: /* block_param: f_arg ',' f_block_optarg opt_block_args_tail */
13816#line 4619 "parse.y"
13817 {
13818 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13819 }
13820#line 13821 "parse.c"
13821 break;
13822
13823 case 431: /* block_param: f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail */
13824#line 4623 "parse.y"
13825 {
13826 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), Qnone, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
13827 }
13828#line 13829 "parse.c"
13829 break;
13830
13831 case 432: /* block_param: f_arg ',' f_rest_arg opt_block_args_tail */
13832#line 4627 "parse.y"
13833 {
13834 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
13835 }
13836#line 13837 "parse.c"
13837 break;
13838
13839 case 433: /* block_param: f_arg excessed_comma */
13840#line 4631 "parse.y"
13841 {
13842 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
13843 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), Qnone, (yyvsp[0].id), Qnone, (yyval.node_args), &(yyloc));
13844 }
13845#line 13846 "parse.c"
13846 break;
13847
13848 case 434: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail */
13849#line 4636 "parse.y"
13850 {
13851 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), Qnone, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
13852 }
13853#line 13854 "parse.c"
13854 break;
13855
13856 case 435: /* block_param: f_arg opt_block_args_tail */
13857#line 4640 "parse.y"
13858 {
13859 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13860 }
13861#line 13862 "parse.c"
13862 break;
13863
13864 case 436: /* block_param: f_block_optarg ',' f_rest_arg opt_block_args_tail */
13865#line 4644 "parse.y"
13866 {
13867 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
13868 }
13869#line 13870 "parse.c"
13870 break;
13871
13872 case 437: /* block_param: f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
13873#line 4648 "parse.y"
13874 {
13875 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-5].node_opt_arg), (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
13876 }
13877#line 13878 "parse.c"
13878 break;
13879
13880 case 438: /* block_param: f_block_optarg opt_block_args_tail */
13881#line 4652 "parse.y"
13882 {
13883 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13884 }
13885#line 13886 "parse.c"
13886 break;
13887
13888 case 439: /* block_param: f_block_optarg ',' f_arg opt_block_args_tail */
13889#line 4656 "parse.y"
13890 {
13891 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), Qnone, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
13892 }
13893#line 13894 "parse.c"
13894 break;
13895
13896 case 440: /* block_param: f_rest_arg opt_block_args_tail */
13897#line 4660 "parse.y"
13898 {
13899 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
13900 }
13901#line 13902 "parse.c"
13902 break;
13903
13904 case 441: /* block_param: f_rest_arg ',' f_arg opt_block_args_tail */
13905#line 4664 "parse.y"
13906 {
13907 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
13908 }
13909#line 13910 "parse.c"
13910 break;
13911
13912 case 442: /* block_param: block_args_tail */
13913#line 4668 "parse.y"
13914 {
13915 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13916 }
13917#line 13918 "parse.c"
13918 break;
13919
13920 case 444: /* opt_block_param: block_param_def */
13921#line 4675 "parse.y"
13922 {
13923 p->command_start = TRUE;
13924 }
13925#line 13926 "parse.c"
13926 break;
13927
13928 case 445: /* block_param_def: '|' opt_bv_decl '|' */
13929#line 4681 "parse.y"
13930 {
13931 p->cur_arg = 0;
13932 p->max_numparam = ORDINAL_PARAM;
13933 p->ctxt.in_argdef = 0;
13934 /*%%%*/
13935 (yyval.node_args) = 0;
13936 /*% %*/
13937 /*% ripper: params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil) %*/
13938 /*% ripper: block_var!($$, $2) %*/
13939 }
13940#line 13941 "parse.c"
13941 break;
13942
13943 case 446: /* block_param_def: '|' block_param opt_bv_decl '|' */
13944#line 4692 "parse.y"
13945 {
13946 p->cur_arg = 0;
13947 p->max_numparam = ORDINAL_PARAM;
13948 p->ctxt.in_argdef = 0;
13949 /*%%%*/
13950 (yyval.node_args) = (yyvsp[-2].node_args);
13951 /*% %*/
13952 /*% ripper: block_var!($2, $3) %*/
13953 }
13954#line 13955 "parse.c"
13955 break;
13956
13957 case 447: /* opt_bv_decl: opt_nl */
13958#line 4705 "parse.y"
13959 {
13960 (yyval.node) = 0;
13961 }
13962#line 13963 "parse.c"
13963 break;
13964
13965 case 448: /* opt_bv_decl: opt_nl ';' bv_decls opt_nl */
13966#line 4709 "parse.y"
13967 {
13968 /*%%%*/
13969 (yyval.node) = 0;
13970 /*% %*/
13971 /*% ripper: $3 %*/
13972 }
13973#line 13974 "parse.c"
13974 break;
13975
13976 case 451: /* bvar: "local variable or method" */
13977#line 4724 "parse.y"
13978 {
13979 new_bv(p, get_id((yyvsp[0].id)));
13980 /*% ripper: get_value($1) %*/
13981 }
13982#line 13983 "parse.c"
13983 break;
13984
13985 case 452: /* bvar: f_bad_arg */
13986#line 4729 "parse.y"
13987 {
13988 (yyval.node) = 0;
13989 }
13990#line 13991 "parse.c"
13991 break;
13992
13993 case 453: /* max_numparam: %empty */
13994#line 4734 "parse.y"
13995 {
13996 (yyval.num) = p->max_numparam;
13997 p->max_numparam = 0;
13998 }
13999#line 14000 "parse.c"
14000 break;
14001
14002 case 454: /* numparam: %empty */
14003#line 4740 "parse.y"
14004 {
14005 (yyval.node) = numparam_push(p);
14006 }
14007#line 14008 "parse.c"
14008 break;
14009
14010 case 455: /* @24: %empty */
14011#line 4746 "parse.y"
14012 {
14013 token_info_push(p, "->", &(yylsp[0]));
14014 (yyvsp[0].vars) = dyna_push(p);
14015 (yyval.num) = p->lex.lpar_beg;
14016 p->lex.lpar_beg = p->lex.paren_nest;
14017 }
14018#line 14019 "parse.c"
14019 break;
14020
14021 case 456: /* $@25: %empty */
14022#line 4754 "parse.y"
14023 {
14024 CMDARG_PUSH(0);
14025 }
14026#line 14027 "parse.c"
14027 break;
14028
14029 case 457: /* lambda: "->" @24 max_numparam numparam allow_exits f_larglist $@25 lambda_body */
14030#line 4758 "parse.y"
14031 {
14032 int max_numparam = p->max_numparam;
14033 p->lex.lpar_beg = (yyvsp[-6].num);
14034 p->max_numparam = (yyvsp[-5].num);
14035 restore_block_exit(p, (yyvsp[-3].node_exits));
14036 CMDARG_POP();
14037 (yyvsp[-2].node_args) = args_with_numbered(p, (yyvsp[-2].node_args), max_numparam);
14038 /*%%%*/
14039 {
14040 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
14041 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node_args), (yyvsp[0].node), &loc);
14042 nd_set_line(RNODE_LAMBDA((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14043 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
14044 nd_set_first_loc((yyval.node), (yylsp[-7]).beg_pos);
14045 }
14046 /*% %*/
14047 /*% ripper: lambda!($args, $body) %*/
14048 numparam_pop(p, (yyvsp[-4].node));
14049 dyna_pop(p, (yyvsp[-7].vars));
14050 }
14051#line 14052 "parse.c"
14052 break;
14053
14054 case 458: /* f_larglist: '(' f_args opt_bv_decl ')' */
14055#line 4781 "parse.y"
14056 {
14057 p->ctxt.in_argdef = 0;
14058 /*%%%*/
14059 (yyval.node_args) = (yyvsp[-2].node_args);
14060 p->max_numparam = ORDINAL_PARAM;
14061 /*% %*/
14062 /*% ripper: paren!($2) %*/
14063 }
14064#line 14065 "parse.c"
14065 break;
14066
14067 case 459: /* f_larglist: f_args */
14068#line 4790 "parse.y"
14069 {
14070 p->ctxt.in_argdef = 0;
14071 /*%%%*/
14072 if (!args_info_empty_p(&(yyvsp[0].node_args)->nd_ainfo))
14073 p->max_numparam = ORDINAL_PARAM;
14074 /*% %*/
14075 (yyval.node_args) = (yyvsp[0].node_args);
14076 }
14077#line 14078 "parse.c"
14078 break;
14079
14080 case 460: /* lambda_body: tLAMBEG compstmt '}' */
14081#line 4801 "parse.y"
14082 {
14083 token_info_pop(p, "}", &(yylsp[0]));
14084 (yyval.node) = (yyvsp[-1].node);
14085 }
14086#line 14087 "parse.c"
14087 break;
14088
14089 case 461: /* $@26: %empty */
14090#line 4806 "parse.y"
14091 {
14092 /*%%%*/
14093 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14094 /*% %*/
14095 }
14096#line 14097 "parse.c"
14097 break;
14098
14099 case 462: /* lambda_body: "`do' for lambda" $@26 bodystmt k_end */
14100#line 4812 "parse.y"
14101 {
14102 (yyval.node) = (yyvsp[-1].node);
14103 }
14104#line 14105 "parse.c"
14105 break;
14106
14107 case 463: /* do_block: k_do_block do_body k_end */
14108#line 4818 "parse.y"
14109 {
14110 (yyval.node) = (yyvsp[-1].node);
14111 /*%%%*/
14112 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
14113 /*% %*/
14114 }
14115#line 14116 "parse.c"
14116 break;
14117
14118 case 464: /* block_call: command do_block */
14119#line 4827 "parse.y"
14120 {
14121 /*%%%*/
14122 if (nd_type_p((yyvsp[-1].node), NODE_YIELD)) {
14123 compile_error(p, "block given to yield");
14124 }
14125 else {
14126 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
14127 }
14128 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14129 fixpos((yyval.node), (yyvsp[-1].node));
14130 /*% %*/
14131 /*% ripper: method_add_block!($1, $2) %*/
14132 }
14133#line 14134 "parse.c"
14134 break;
14135
14136 case 465: /* block_call: block_call call_op2 operation2 opt_paren_args */
14137#line 4841 "parse.y"
14138 {
14139 /*%%%*/
14140 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14141 /*% %*/
14142 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
14143 }
14144#line 14145 "parse.c"
14145 break;
14146
14147 case 466: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
14148#line 4848 "parse.y"
14149 {
14150 /*%%%*/
14151 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
14152 /*% %*/
14153 /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/
14154 }
14155#line 14156 "parse.c"
14156 break;
14157
14158 case 467: /* block_call: block_call call_op2 operation2 command_args do_block */
14159#line 4855 "parse.y"
14160 {
14161 /*%%%*/
14162 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
14163 /*% %*/
14164 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
14165 }
14166#line 14167 "parse.c"
14167 break;
14168
14169 case 468: /* method_call: fcall paren_args */
14170#line 4864 "parse.y"
14171 {
14172 /*%%%*/
14173 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
14174 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
14175 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
14176 /*% %*/
14177 /*% ripper: method_add_arg!(fcall!($1), $2) %*/
14178 }
14179#line 14180 "parse.c"
14180 break;
14181
14182 case 469: /* method_call: primary_value call_op operation2 opt_paren_args */
14183#line 4873 "parse.y"
14184 {
14185 /*%%%*/
14186 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14187 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14188 /*% %*/
14189 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
14190 }
14191#line 14192 "parse.c"
14192 break;
14193
14194 case 470: /* method_call: primary_value "::" operation2 paren_args */
14195#line 4881 "parse.y"
14196 {
14197 /*%%%*/
14198 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14199 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14200 /*% %*/
14201 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
14202 }
14203#line 14204 "parse.c"
14204 break;
14205
14206 case 471: /* method_call: primary_value "::" operation3 */
14207#line 4889 "parse.y"
14208 {
14209 /*%%%*/
14210 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), (yyvsp[0].id), Qnull, &(yylsp[0]), &(yyloc));
14211 /*% %*/
14212 /*% ripper: call!($1, $2, $3) %*/
14213 }
14214#line 14215 "parse.c"
14215 break;
14216
14217 case 472: /* method_call: primary_value call_op paren_args */
14218#line 4896 "parse.y"
14219 {
14220 /*%%%*/
14221 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14222 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14223 /*% %*/
14224 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
14225 }
14226#line 14227 "parse.c"
14227 break;
14228
14229 case 473: /* method_call: primary_value "::" paren_args */
14230#line 4904 "parse.y"
14231 {
14232 /*%%%*/
14233 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14234 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14235 /*% %*/
14236 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
14237 }
14238#line 14239 "parse.c"
14239 break;
14240
14241 case 474: /* method_call: "`super'" paren_args */
14242#line 4912 "parse.y"
14243 {
14244 /*%%%*/
14245 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
14246 /*% %*/
14247 /*% ripper: super!($2) %*/
14248 }
14249#line 14250 "parse.c"
14250 break;
14251
14252 case 475: /* method_call: "`super'" */
14253#line 4919 "parse.y"
14254 {
14255 /*%%%*/
14256 (yyval.node) = NEW_ZSUPER(&(yyloc));
14257 /*% %*/
14258 /*% ripper: zsuper! %*/
14259 }
14260#line 14261 "parse.c"
14261 break;
14262
14263 case 476: /* method_call: primary_value '[' opt_call_args rbracket */
14264#line 4926 "parse.y"
14265 {
14266 /*%%%*/
14267 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
14268 fixpos((yyval.node), (yyvsp[-3].node));
14269 /*% %*/
14270 /*% ripper: aref!($1, $3) %*/
14271 }
14272#line 14273 "parse.c"
14273 break;
14274
14275 case 477: /* brace_block: '{' brace_body '}' */
14276#line 4936 "parse.y"
14277 {
14278 (yyval.node) = (yyvsp[-1].node);
14279 /*%%%*/
14280 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
14281 /*% %*/
14282 }
14283#line 14284 "parse.c"
14284 break;
14285
14286 case 478: /* brace_block: k_do do_body k_end */
14287#line 4943 "parse.y"
14288 {
14289 (yyval.node) = (yyvsp[-1].node);
14290 /*%%%*/
14291 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
14292 /*% %*/
14293 }
14294#line 14295 "parse.c"
14295 break;
14296
14297 case 479: /* @27: %empty */
14298#line 4951 "parse.y"
14299 {(yyval.vars) = dyna_push(p);}
14300#line 14301 "parse.c"
14301 break;
14302
14303 case 480: /* brace_body: @27 max_numparam numparam allow_exits opt_block_param compstmt */
14304#line 4954 "parse.y"
14305 {
14306 int max_numparam = p->max_numparam;
14307 p->max_numparam = (yyvsp[-4].num);
14308 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam);
14309 /*%%%*/
14310 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
14311 /*% %*/
14312 /*% ripper: brace_block!($args, $compstmt) %*/
14313 restore_block_exit(p, (yyvsp[-2].node_exits));
14314 numparam_pop(p, (yyvsp[-3].node));
14315 dyna_pop(p, (yyvsp[-5].vars));
14316 }
14317#line 14318 "parse.c"
14318 break;
14319
14320 case 481: /* @28: %empty */
14321#line 4968 "parse.y"
14322 {
14323 (yyval.vars) = dyna_push(p);
14324 CMDARG_PUSH(0);
14325 }
14326#line 14327 "parse.c"
14327 break;
14328
14329 case 482: /* do_body: @28 max_numparam numparam allow_exits opt_block_param bodystmt */
14330#line 4974 "parse.y"
14331 {
14332 int max_numparam = p->max_numparam;
14333 p->max_numparam = (yyvsp[-4].num);
14334 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam);
14335 /*%%%*/
14336 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
14337 /*% %*/
14338 /*% ripper: do_block!($args, $bodystmt) %*/
14339 CMDARG_POP();
14340 restore_block_exit(p, (yyvsp[-2].node_exits));
14341 numparam_pop(p, (yyvsp[-3].node));
14342 dyna_pop(p, (yyvsp[-5].vars));
14343 }
14344#line 14345 "parse.c"
14345 break;
14346
14347 case 483: /* case_args: arg_value */
14348#line 4990 "parse.y"
14349 {
14350 /*%%%*/
14351 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
14352 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14353 /*% %*/
14354 /*% ripper: args_add!(args_new!, $1) %*/
14355 }
14356#line 14357 "parse.c"
14357 break;
14358
14359 case 484: /* case_args: "*" arg_value */
14360#line 4998 "parse.y"
14361 {
14362 /*%%%*/
14363 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
14364 /*% %*/
14365 /*% ripper: args_add_star!(args_new!, $2) %*/
14366 }
14367#line 14368 "parse.c"
14368 break;
14369
14370 case 485: /* case_args: case_args ',' arg_value */
14371#line 5005 "parse.y"
14372 {
14373 /*%%%*/
14374 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
14375 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14376 /*% %*/
14377 /*% ripper: args_add!($1, $3) %*/
14378 }
14379#line 14380 "parse.c"
14380 break;
14381
14382 case 486: /* case_args: case_args ',' "*" arg_value */
14383#line 5013 "parse.y"
14384 {
14385 /*%%%*/
14386 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
14387 /*% %*/
14388 /*% ripper: args_add_star!($1, $4) %*/
14389 }
14390#line 14391 "parse.c"
14391 break;
14392
14393 case 487: /* case_body: k_when case_args then compstmt cases */
14394#line 5024 "parse.y"
14395 {
14396 /*%%%*/
14397 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14398 fixpos((yyval.node), (yyvsp[-3].node));
14399 /*% %*/
14400 /*% ripper: when!($2, $4, $5) %*/
14401 }
14402#line 14403 "parse.c"
14403 break;
14404
14405 case 490: /* p_pvtbl: %empty */
14406#line 5037 "parse.y"
14407 {(yyval.tbl) = p->pvtbl; p->pvtbl = st_init_numtable();}
14408#line 14409 "parse.c"
14409 break;
14410
14411 case 491: /* p_pktbl: %empty */
14412#line 5038 "parse.y"
14413 {(yyval.tbl) = p->pktbl; p->pktbl = 0;}
14414#line 14415 "parse.c"
14415 break;
14416
14417 case 492: /* p_in_kwarg: %empty */
14418#line 5040 "parse.y"
14419 {
14420 (yyval.ctxt) = p->ctxt;
14421 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
14422 p->command_start = FALSE;
14423 p->ctxt.in_kwarg = 1;
14424 }
14425#line 14426 "parse.c"
14426 break;
14427
14428 case 493: /* $@29: %empty */
14429#line 5051 "parse.y"
14430 {
14431 pop_pktbl(p, (yyvsp[-2].tbl));
14432 pop_pvtbl(p, (yyvsp[-3].tbl));
14433 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
14434 }
14435#line 14436 "parse.c"
14436 break;
14437
14438 case 494: /* p_case_body: "`in'" p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@29 compstmt p_cases */
14439#line 5058 "parse.y"
14440 {
14441 /*%%%*/
14442 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14443 /*% %*/
14444 /*% ripper: in!($expr, $compstmt, $cases) %*/
14445 }
14446#line 14447 "parse.c"
14447 break;
14448
14449 case 498: /* p_top_expr: p_top_expr_body "`if' modifier" expr_value */
14450#line 5072 "parse.y"
14451 {
14452 /*%%%*/
14453 (yyval.node) = new_if(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
14454 fixpos((yyval.node), (yyvsp[0].node));
14455 /*% %*/
14456 /*% ripper: if_mod!($3, $1) %*/
14457 }
14458#line 14459 "parse.c"
14459 break;
14460
14461 case 499: /* p_top_expr: p_top_expr_body "`unless' modifier" expr_value */
14462#line 5080 "parse.y"
14463 {
14464 /*%%%*/
14465 (yyval.node) = new_unless(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
14466 fixpos((yyval.node), (yyvsp[0].node));
14467 /*% %*/
14468 /*% ripper: unless_mod!($3, $1) %*/
14469 }
14470#line 14471 "parse.c"
14471 break;
14472
14473 case 501: /* p_top_expr_body: p_expr ',' */
14474#line 5091 "parse.y"
14475 {
14476 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, Qnone, Qnone, &(yyloc));
14477 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-1].node)), (yyval.node), &(yyloc));
14478 }
14479#line 14480 "parse.c"
14480 break;
14481
14482 case 502: /* p_top_expr_body: p_expr ',' p_args */
14483#line 5096 "parse.y"
14484 {
14485 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-2].node)), (yyvsp[0].node), &(yyloc));
14486 /*%%%*/
14487 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
14488 /*%
14489 %*/
14490 }
14491#line 14492 "parse.c"
14492 break;
14493
14494 case 503: /* p_top_expr_body: p_find */
14495#line 5104 "parse.y"
14496 {
14497 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
14498 }
14499#line 14500 "parse.c"
14500 break;
14501
14502 case 504: /* p_top_expr_body: p_args_tail */
14503#line 5108 "parse.y"
14504 {
14505 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
14506 }
14507#line 14508 "parse.c"
14508 break;
14509
14510 case 505: /* p_top_expr_body: p_kwargs */
14511#line 5112 "parse.y"
14512 {
14513 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
14514 }
14515#line 14516 "parse.c"
14516 break;
14517
14518 case 507: /* p_as: p_expr "=>" p_variable */
14519#line 5121 "parse.y"
14520 {
14521 /*%%%*/
14522 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
14523 n = list_append(p, n, (yyvsp[0].node));
14524 (yyval.node) = new_hash(p, n, &(yyloc));
14525 /*% %*/
14526 /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/
14527 }
14528#line 14529 "parse.c"
14529 break;
14530
14531 case 509: /* p_alt: p_alt '|' p_expr_basic */
14532#line 5133 "parse.y"
14533 {
14534 /*%%%*/
14535 (yyval.node) = NEW_OR((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14536 /*% %*/
14537 /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/
14538 }
14539#line 14540 "parse.c"
14540 break;
14541
14542 case 511: /* p_lparen: '(' p_pktbl */
14543#line 5142 "parse.y"
14544 { (yyval.tbl) = (yyvsp[0].tbl);}
14545#line 14546 "parse.c"
14546 break;
14547
14548 case 512: /* p_lbracket: '[' p_pktbl */
14549#line 5143 "parse.y"
14550 { (yyval.tbl) = (yyvsp[0].tbl);}
14551#line 14552 "parse.c"
14552 break;
14553
14554 case 515: /* p_expr_basic: p_const p_lparen p_args rparen */
14555#line 5148 "parse.y"
14556 {
14557 pop_pktbl(p, (yyvsp[-2].tbl));
14558 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
14559 /*%%%*/
14560 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14561 /*%
14562 %*/
14563 }
14564#line 14565 "parse.c"
14565 break;
14566
14567 case 516: /* p_expr_basic: p_const p_lparen p_find rparen */
14568#line 5157 "parse.y"
14569 {
14570 pop_pktbl(p, (yyvsp[-2].tbl));
14571 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14572 /*%%%*/
14573 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14574 /*%
14575 %*/
14576 }
14577#line 14578 "parse.c"
14578 break;
14579
14580 case 517: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
14581#line 5166 "parse.y"
14582 {
14583 pop_pktbl(p, (yyvsp[-2].tbl));
14584 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14585 /*%%%*/
14586 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14587 /*%
14588 %*/
14589 }
14590#line 14591 "parse.c"
14591 break;
14592
14593 case 518: /* p_expr_basic: p_const '(' rparen */
14594#line 5175 "parse.y"
14595 {
14596 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, Qnone, Qnone, &(yyloc));
14597 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
14598 }
14599#line 14600 "parse.c"
14600 break;
14601
14602 case 519: /* p_expr_basic: p_const p_lbracket p_args rbracket */
14603#line 5180 "parse.y"
14604 {
14605 pop_pktbl(p, (yyvsp[-2].tbl));
14606 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
14607 /*%%%*/
14608 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14609 /*%
14610 %*/
14611 }
14612#line 14613 "parse.c"
14613 break;
14614
14615 case 520: /* p_expr_basic: p_const p_lbracket p_find rbracket */
14616#line 5189 "parse.y"
14617 {
14618 pop_pktbl(p, (yyvsp[-2].tbl));
14619 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14620 /*%%%*/
14621 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14622 /*%
14623 %*/
14624 }
14625#line 14626 "parse.c"
14626 break;
14627
14628 case 521: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
14629#line 5198 "parse.y"
14630 {
14631 pop_pktbl(p, (yyvsp[-2].tbl));
14632 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14633 /*%%%*/
14634 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14635 /*%
14636 %*/
14637 }
14638#line 14639 "parse.c"
14639 break;
14640
14641 case 522: /* p_expr_basic: p_const '[' rbracket */
14642#line 5207 "parse.y"
14643 {
14644 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, Qnone, Qnone, &(yyloc));
14645 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
14646 }
14647#line 14648 "parse.c"
14648 break;
14649
14650 case 523: /* p_expr_basic: "[" p_args rbracket */
14651#line 5212 "parse.y"
14652 {
14653 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[-1].node), &(yyloc));
14654 }
14655#line 14656 "parse.c"
14656 break;
14657
14658 case 524: /* p_expr_basic: "[" p_find rbracket */
14659#line 5216 "parse.y"
14660 {
14661 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
14662 }
14663#line 14664 "parse.c"
14664 break;
14665
14666 case 525: /* p_expr_basic: "[" rbracket */
14667#line 5220 "parse.y"
14668 {
14669 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, Qnone, Qnone, &(yyloc));
14670 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyval.node), &(yyloc));
14671 }
14672#line 14673 "parse.c"
14673 break;
14674
14675 case 526: /* $@30: %empty */
14676#line 5225 "parse.y"
14677 {
14678 p->ctxt.in_kwarg = 0;
14679 }
14680#line 14681 "parse.c"
14681 break;
14682
14683 case 527: /* p_expr_basic: "{" p_pktbl lex_ctxt $@30 p_kwargs rbrace */
14684#line 5229 "parse.y"
14685 {
14686 pop_pktbl(p, (yyvsp[-4].tbl));
14687 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
14688 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
14689 }
14690#line 14691 "parse.c"
14691 break;
14692
14693 case 528: /* p_expr_basic: "{" rbrace */
14694#line 5235 "parse.y"
14695 {
14696 (yyval.node) = new_hash_pattern_tail(p, Qnone, 0, &(yyloc));
14697 (yyval.node) = new_hash_pattern(p, Qnone, (yyval.node), &(yyloc));
14698 }
14699#line 14700 "parse.c"
14700 break;
14701
14702 case 529: /* p_expr_basic: "(" p_pktbl p_expr rparen */
14703#line 5240 "parse.y"
14704 {
14705 pop_pktbl(p, (yyvsp[-2].tbl));
14706 (yyval.node) = (yyvsp[-1].node);
14707 }
14708#line 14709 "parse.c"
14709 break;
14710
14711 case 530: /* p_args: p_expr */
14712#line 5247 "parse.y"
14713 {
14714 /*%%%*/
14715 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
14716 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, Qnone, Qnone, &(yyloc));
14717 /*%
14718 $$ = new_array_pattern_tail(p, rb_ary_new_from_args(1, get_value($1)), 0, Qnone, Qnone, &@$);
14719 %*/
14720 }
14721#line 14722 "parse.c"
14722 break;
14723
14724 case 531: /* p_args: p_args_head */
14725#line 5256 "parse.y"
14726 {
14727 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, Qnone, Qnone, &(yyloc));
14728 }
14729#line 14730 "parse.c"
14730 break;
14731
14732 case 532: /* p_args: p_args_head p_arg */
14733#line 5260 "parse.y"
14734 {
14735 /*%%%*/
14736 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, Qnone, Qnone, &(yyloc));
14737 /*%
14738 VALUE pre_args = rb_ary_concat($1, get_value($2));
14739 $$ = new_array_pattern_tail(p, pre_args, 0, Qnone, Qnone, &@$);
14740 %*/
14741 }
14742#line 14743 "parse.c"
14743 break;
14744
14745 case 533: /* p_args: p_args_head p_rest */
14746#line 5269 "parse.y"
14747 {
14748 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, (yyvsp[0].node), Qnone, &(yyloc));
14749 }
14750#line 14751 "parse.c"
14751 break;
14752
14753 case 534: /* p_args: p_args_head p_rest ',' p_args_post */
14754#line 5273 "parse.y"
14755 {
14756 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14757 }
14758#line 14759 "parse.c"
14759 break;
14760
14761 case 536: /* p_args_head: p_arg ',' */
14762#line 5280 "parse.y"
14763 {
14764 (yyval.node) = (yyvsp[-1].node);
14765 }
14766#line 14767 "parse.c"
14767 break;
14768
14769 case 537: /* p_args_head: p_args_head p_arg ',' */
14770#line 5284 "parse.y"
14771 {
14772 /*%%%*/
14773 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
14774 /*% %*/
14775 /*% ripper: rb_ary_concat($1, get_value($2)) %*/
14776 }
14777#line 14778 "parse.c"
14778 break;
14779
14780 case 538: /* p_args_tail: p_rest */
14781#line 5293 "parse.y"
14782 {
14783 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[0].node), Qnone, &(yyloc));
14784 }
14785#line 14786 "parse.c"
14786 break;
14787
14788 case 539: /* p_args_tail: p_rest ',' p_args_post */
14789#line 5297 "parse.y"
14790 {
14791 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14792 }
14793#line 14794 "parse.c"
14794 break;
14795
14796 case 540: /* p_find: p_rest ',' p_args_post ',' p_rest */
14797#line 5303 "parse.y"
14798 {
14799 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14800 }
14801#line 14802 "parse.c"
14802 break;
14803
14804 case 541: /* p_rest: "*" "local variable or method" */
14805#line 5310 "parse.y"
14806 {
14807 /*%%%*/
14808 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
14809 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14810 /*% %*/
14811 /*% ripper: assignable(p, var_field(p, $2)) %*/
14812 }
14813#line 14814 "parse.c"
14814 break;
14815
14816 case 542: /* p_rest: "*" */
14817#line 5318 "parse.y"
14818 {
14819 /*%%%*/
14820 (yyval.node) = 0;
14821 /*% %*/
14822 /*% ripper: var_field(p, Qnil) %*/
14823 }
14824#line 14825 "parse.c"
14825 break;
14826
14827 case 544: /* p_args_post: p_args_post ',' p_arg */
14828#line 5328 "parse.y"
14829 {
14830 /*%%%*/
14831 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
14832 /*% %*/
14833 /*% ripper: rb_ary_concat($1, get_value($3)) %*/
14834 }
14835#line 14836 "parse.c"
14836 break;
14837
14838 case 545: /* p_arg: p_expr */
14839#line 5337 "parse.y"
14840 {
14841 /*%%%*/
14842 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14843 /*% %*/
14844 /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/
14845 }
14846#line 14847 "parse.c"
14847 break;
14848
14849 case 546: /* p_kwargs: p_kwarg ',' p_any_kwrest */
14850#line 5346 "parse.y"
14851 {
14852 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
14853 }
14854#line 14855 "parse.c"
14855 break;
14856
14857 case 547: /* p_kwargs: p_kwarg */
14858#line 5350 "parse.y"
14859 {
14860 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
14861 }
14862#line 14863 "parse.c"
14863 break;
14864
14865 case 548: /* p_kwargs: p_kwarg ',' */
14866#line 5354 "parse.y"
14867 {
14868 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
14869 }
14870#line 14871 "parse.c"
14871 break;
14872
14873 case 549: /* p_kwargs: p_any_kwrest */
14874#line 5358 "parse.y"
14875 {
14876 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), (yyvsp[0].id), &(yyloc));
14877 }
14878#line 14879 "parse.c"
14879 break;
14880
14881 case 551: /* p_kwarg: p_kwarg ',' p_kw */
14882#line 5366 "parse.y"
14883 {
14884 /*%%%*/
14885 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
14886 /*% %*/
14887 /*% ripper: rb_ary_push($1, $3) %*/
14888 }
14889#line 14890 "parse.c"
14890 break;
14891
14892 case 552: /* p_kw: p_kw_label p_expr */
14893#line 5375 "parse.y"
14894 {
14895 error_duplicate_pattern_key(p, get_id((yyvsp[-1].id)), &(yylsp[-1]));
14896 /*%%%*/
14897 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
14898 /*% %*/
14899 /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/
14900 }
14901#line 14902 "parse.c"
14902 break;
14903
14904 case 553: /* p_kw: p_kw_label */
14905#line 5383 "parse.y"
14906 {
14907 error_duplicate_pattern_key(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14908 if ((yyvsp[0].id) && !is_local_id(get_id((yyvsp[0].id)))) {
14909 yyerror1(&(yylsp[0]), "key must be valid as local variables");
14910 }
14911 error_duplicate_pattern_variable(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14912 /*%%%*/
14913 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
14914 /*% %*/
14915 /*% ripper: rb_ary_new_from_args(2, get_value(assignable(p, $1)), Qnil) %*/
14916 }
14917#line 14918 "parse.c"
14918 break;
14919
14920 case 555: /* p_kw_label: "string literal" string_contents tLABEL_END */
14921#line 5398 "parse.y"
14922 {
14923 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
14924 /*%%%*/
14925 if (!(yyvsp[-1].node) || nd_type_p((yyvsp[-1].node), NODE_STR)) {
14926 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
14927 (yyval.id) = SYM2ID(RNODE_LIT(node)->nd_lit);
14928 }
14929 /*%
14930 if (ripper_is_node_yylval(p, $2) && RNODE_RIPPER($2)->nd_cval) {
14931 VALUE label = RNODE_RIPPER($2)->nd_cval;
14932 VALUE rval = RNODE_RIPPER($2)->nd_rval;
14933 $$ = ripper_new_yylval(p, rb_intern_str(label), rval, label);
14934 RNODE($$)->nd_loc = loc;
14935 }
14936 %*/
14937 else {
14938 yyerror1(&loc, "symbol literal with interpolation is not allowed");
14939 (yyval.id) = 0;
14940 }
14941 }
14942#line 14943 "parse.c"
14943 break;
14944
14945 case 556: /* p_kwrest: kwrest_mark "local variable or method" */
14946#line 5421 "parse.y"
14947 {
14948 (yyval.id) = (yyvsp[0].id);
14949 }
14950#line 14951 "parse.c"
14951 break;
14952
14953 case 557: /* p_kwrest: kwrest_mark */
14954#line 5425 "parse.y"
14955 {
14956 (yyval.id) = 0;
14957 }
14958#line 14959 "parse.c"
14959 break;
14960
14961 case 558: /* p_kwnorest: kwrest_mark "`nil'" */
14962#line 5431 "parse.y"
14963 {
14964 (yyval.id) = 0;
14965 }
14966#line 14967 "parse.c"
14967 break;
14968
14969 case 560: /* p_any_kwrest: p_kwnorest */
14970#line 5437 "parse.y"
14971 {(yyval.id) = ID2VAL(idNil);}
14972#line 14973 "parse.c"
14973 break;
14974
14975 case 562: /* p_value: p_primitive ".." p_primitive */
14976#line 5442 "parse.y"
14977 {
14978 /*%%%*/
14979 value_expr((yyvsp[-2].node));
14980 value_expr((yyvsp[0].node));
14981 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14982 /*% %*/
14983 /*% ripper: dot2!($1, $3) %*/
14984 }
14985#line 14986 "parse.c"
14986 break;
14987
14988 case 563: /* p_value: p_primitive "..." p_primitive */
14989#line 5451 "parse.y"
14990 {
14991 /*%%%*/
14992 value_expr((yyvsp[-2].node));
14993 value_expr((yyvsp[0].node));
14994 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14995 /*% %*/
14996 /*% ripper: dot3!($1, $3) %*/
14997 }
14998#line 14999 "parse.c"
14999 break;
15000
15001 case 564: /* p_value: p_primitive ".." */
15002#line 5460 "parse.y"
15003 {
15004 /*%%%*/
15005 value_expr((yyvsp[-1].node));
15006 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15007 /*% %*/
15008 /*% ripper: dot2!($1, Qnil) %*/
15009 }
15010#line 15011 "parse.c"
15011 break;
15012
15013 case 565: /* p_value: p_primitive "..." */
15014#line 5468 "parse.y"
15015 {
15016 /*%%%*/
15017 value_expr((yyvsp[-1].node));
15018 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15019 /*% %*/
15020 /*% ripper: dot3!($1, Qnil) %*/
15021 }
15022#line 15023 "parse.c"
15023 break;
15024
15025 case 569: /* p_value: "(.." p_primitive */
15026#line 5479 "parse.y"
15027 {
15028 /*%%%*/
15029 value_expr((yyvsp[0].node));
15030 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15031 /*% %*/
15032 /*% ripper: dot2!(Qnil, $2) %*/
15033 }
15034#line 15035 "parse.c"
15035 break;
15036
15037 case 570: /* p_value: "(..." p_primitive */
15038#line 5487 "parse.y"
15039 {
15040 /*%%%*/
15041 value_expr((yyvsp[0].node));
15042 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15043 /*% %*/
15044 /*% ripper: dot3!(Qnil, $2) %*/
15045 }
15046#line 15047 "parse.c"
15047 break;
15048
15049 case 579: /* p_primitive: keyword_variable */
15050#line 5505 "parse.y"
15051 {
15052 /*%%%*/
15053 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
15054 /*% %*/
15055 /*% ripper: var_ref!($1) %*/
15056 }
15057#line 15058 "parse.c"
15058 break;
15059
15060 case 581: /* p_variable: "local variable or method" */
15061#line 5515 "parse.y"
15062 {
15063 /*%%%*/
15064 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15065 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15066 /*% %*/
15067 /*% ripper: assignable(p, var_field(p, $1)) %*/
15068 }
15069#line 15070 "parse.c"
15070 break;
15071
15072 case 582: /* p_var_ref: '^' "local variable or method" */
15073#line 5525 "parse.y"
15074 {
15075 /*%%%*/
15076 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
15077 if (!(nd_type_p(n, NODE_LVAR) || nd_type_p(n, NODE_DVAR))) {
15078 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
15079 }
15080 (yyval.node) = n;
15081 /*% %*/
15082 /*% ripper: var_ref!($2) %*/
15083 }
15084#line 15085 "parse.c"
15085 break;
15086
15087 case 583: /* p_var_ref: '^' nonlocal_var */
15088#line 5536 "parse.y"
15089 {
15090 /*%%%*/
15091 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
15092 /*% %*/
15093 /*% ripper: var_ref!($2) %*/
15094 }
15095#line 15096 "parse.c"
15096 break;
15097
15098 case 584: /* p_expr_ref: '^' "(" expr_value rparen */
15099#line 5545 "parse.y"
15100 {
15101 /*%%%*/
15102 (yyval.node) = NEW_BLOCK((yyvsp[-1].node), &(yyloc));
15103 /*% %*/
15104 /*% ripper: begin!($3) %*/
15105 }
15106#line 15107 "parse.c"
15107 break;
15108
15109 case 585: /* p_const: ":: at EXPR_BEG" cname */
15110#line 5554 "parse.y"
15111 {
15112 /*%%%*/
15113 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
15114 /*% %*/
15115 /*% ripper: top_const_ref!($2) %*/
15116 }
15117#line 15118 "parse.c"
15118 break;
15119
15120 case 586: /* p_const: p_const "::" cname */
15121#line 5561 "parse.y"
15122 {
15123 /*%%%*/
15124 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
15125 /*% %*/
15126 /*% ripper: const_path_ref!($1, $3) %*/
15127 }
15128#line 15129 "parse.c"
15129 break;
15130
15131 case 587: /* p_const: "constant" */
15132#line 5568 "parse.y"
15133 {
15134 /*%%%*/
15135 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
15136 /*% %*/
15137 /*% ripper: var_ref!($1) %*/
15138 }
15139#line 15140 "parse.c"
15140 break;
15141
15142 case 588: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
15143#line 5579 "parse.y"
15144 {
15145 /*%%%*/
15146 NODE *body = (yyvsp[-1].node);
15147 if ((yyvsp[-3].node)) {
15148 NODE *err = NEW_ERRINFO(&(yylsp[-3]));
15149 err = node_assign(p, (yyvsp[-3].node), err, NO_LEX_CTXT, &(yylsp[-3]));
15150 body = block_append(p, err, body);
15151 }
15152 (yyval.node) = NEW_RESBODY((yyvsp[-4].node), body, (yyvsp[0].node), &(yyloc));
15153 if ((yyvsp[-4].node)) {
15154 fixpos((yyval.node), (yyvsp[-4].node));
15155 }
15156 else if ((yyvsp[-3].node)) {
15157 fixpos((yyval.node), (yyvsp[-3].node));
15158 }
15159 else {
15160 fixpos((yyval.node), (yyvsp[-1].node));
15161 }
15162 /*% %*/
15163 /*% ripper: rescue!($2, $3, $5, $6) %*/
15164 }
15165#line 15166 "parse.c"
15166 break;
15167
15168 case 590: /* exc_list: arg_value */
15169#line 5604 "parse.y"
15170 {
15171 /*%%%*/
15172 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
15173 /*% %*/
15174 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15175 }
15176#line 15177 "parse.c"
15177 break;
15178
15179 case 591: /* exc_list: mrhs */
15180#line 5611 "parse.y"
15181 {
15182 /*%%%*/
15183 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
15184 /*% %*/
15185 /*% ripper: $1 %*/
15186 }
15187#line 15188 "parse.c"
15188 break;
15189
15190 case 593: /* exc_var: "=>" lhs */
15191#line 5621 "parse.y"
15192 {
15193 (yyval.node) = (yyvsp[0].node);
15194 }
15195#line 15196 "parse.c"
15196 break;
15197
15198 case 595: /* opt_ensure: k_ensure compstmt */
15199#line 5628 "parse.y"
15200 {
15201 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
15202 /*%%%*/
15203 (yyval.node) = (yyvsp[0].node);
15204 /*% %*/
15205 /*% ripper: ensure!($2) %*/
15206 }
15207#line 15208 "parse.c"
15208 break;
15209
15210 case 599: /* strings: string */
15211#line 5643 "parse.y"
15212 {
15213 /*%%%*/
15214 NODE *node = (yyvsp[0].node);
15215 if (!node) {
15216 node = NEW_STR(STR_NEW0(), &(yyloc));
15217 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(node)->nd_lit);
15218 }
15219 else {
15220 node = evstr2dstr(p, node);
15221 }
15222 (yyval.node) = node;
15223 /*% %*/
15224 /*% ripper: $1 %*/
15225 }
15226#line 15227 "parse.c"
15227 break;
15228
15229 case 602: /* string: string string1 */
15230#line 5662 "parse.y"
15231 {
15232 /*%%%*/
15233 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15234 /*% %*/
15235 /*% ripper: string_concat!($1, $2) %*/
15236 }
15237#line 15238 "parse.c"
15238 break;
15239
15240 case 603: /* string1: "string literal" string_contents "terminator" */
15241#line 5671 "parse.y"
15242 {
15243 /*%%%*/
15244 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
15245 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
15246 /*% %*/
15247 /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/
15248 }
15249#line 15250 "parse.c"
15250 break;
15251
15252 case 604: /* xstring: "backtick literal" xstring_contents "terminator" */
15253#line 5681 "parse.y"
15254 {
15255 /*%%%*/
15256 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
15257 /*% %*/
15258 /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/
15259 }
15260#line 15261 "parse.c"
15261 break;
15262
15263 case 605: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
15264#line 5690 "parse.y"
15265 {
15266 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
15267 }
15268#line 15269 "parse.c"
15269 break;
15270
15271 case 606: /* words_sep: ' ' */
15272#line 5695 "parse.y"
15273 {}
15274#line 15275 "parse.c"
15275 break;
15276
15277 case 608: /* words: "word list" words_sep word_list "terminator" */
15278#line 5700 "parse.y"
15279 {
15280 /*%%%*/
15281 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15282 /*% %*/
15283 /*% ripper: array!($3) %*/
15284 }
15285#line 15286 "parse.c"
15286 break;
15287
15288 case 609: /* word_list: %empty */
15289#line 5709 "parse.y"
15290 {
15291 /*%%%*/
15292 (yyval.node) = 0;
15293 /*% %*/
15294 /*% ripper: words_new! %*/
15295 }
15296#line 15297 "parse.c"
15297 break;
15298
15299 case 610: /* word_list: word_list word words_sep */
15300#line 5716 "parse.y"
15301 {
15302 /*%%%*/
15303 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
15304 /*% %*/
15305 /*% ripper: words_add!($1, $2) %*/
15306 }
15307#line 15308 "parse.c"
15308 break;
15309
15310 case 612: /* word: word string_content */
15311#line 5727 "parse.y"
15312 {
15313 /*%%%*/
15314 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15315 /*% %*/
15316 /*% ripper: word_add!($1, $2) %*/
15317 }
15318#line 15319 "parse.c"
15319 break;
15320
15321 case 613: /* symbols: "symbol list" words_sep symbol_list "terminator" */
15322#line 5736 "parse.y"
15323 {
15324 /*%%%*/
15325 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15326 /*% %*/
15327 /*% ripper: array!($3) %*/
15328 }
15329#line 15330 "parse.c"
15330 break;
15331
15332 case 614: /* symbol_list: %empty */
15333#line 5745 "parse.y"
15334 {
15335 /*%%%*/
15336 (yyval.node) = 0;
15337 /*% %*/
15338 /*% ripper: symbols_new! %*/
15339 }
15340#line 15341 "parse.c"
15341 break;
15342
15343 case 615: /* symbol_list: symbol_list word words_sep */
15344#line 5752 "parse.y"
15345 {
15346 /*%%%*/
15347 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
15348 /*% %*/
15349 /*% ripper: symbols_add!($1, $2) %*/
15350 }
15351#line 15352 "parse.c"
15352 break;
15353
15354 case 616: /* qwords: "verbatim word list" words_sep qword_list "terminator" */
15355#line 5761 "parse.y"
15356 {
15357 /*%%%*/
15358 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15359 /*% %*/
15360 /*% ripper: array!($3) %*/
15361 }
15362#line 15363 "parse.c"
15363 break;
15364
15365 case 617: /* qsymbols: "verbatim symbol list" words_sep qsym_list "terminator" */
15366#line 5770 "parse.y"
15367 {
15368 /*%%%*/
15369 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15370 /*% %*/
15371 /*% ripper: array!($3) %*/
15372 }
15373#line 15374 "parse.c"
15374 break;
15375
15376 case 618: /* qword_list: %empty */
15377#line 5779 "parse.y"
15378 {
15379 /*%%%*/
15380 (yyval.node) = 0;
15381 /*% %*/
15382 /*% ripper: qwords_new! %*/
15383 }
15384#line 15385 "parse.c"
15385 break;
15386
15387 case 619: /* qword_list: qword_list "literal content" words_sep */
15388#line 5786 "parse.y"
15389 {
15390 /*%%%*/
15391 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
15392 /*% %*/
15393 /*% ripper: qwords_add!($1, $2) %*/
15394 }
15395#line 15396 "parse.c"
15396 break;
15397
15398 case 620: /* qsym_list: %empty */
15399#line 5795 "parse.y"
15400 {
15401 /*%%%*/
15402 (yyval.node) = 0;
15403 /*% %*/
15404 /*% ripper: qsymbols_new! %*/
15405 }
15406#line 15407 "parse.c"
15407 break;
15408
15409 case 621: /* qsym_list: qsym_list "literal content" words_sep */
15410#line 5802 "parse.y"
15411 {
15412 /*%%%*/
15413 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
15414 /*% %*/
15415 /*% ripper: qsymbols_add!($1, $2) %*/
15416 }
15417#line 15418 "parse.c"
15418 break;
15419
15420 case 622: /* string_contents: %empty */
15421#line 5811 "parse.y"
15422 {
15423 /*%%%*/
15424 (yyval.node) = 0;
15425 /*% %*/
15426 /*% ripper: string_content! %*/
15427 /*%%%*/
15428 /*%
15429 $$ = ripper_new_yylval(p, 0, $$, 0);
15430 %*/
15431 }
15432#line 15433 "parse.c"
15433 break;
15434
15435 case 623: /* string_contents: string_contents string_content */
15436#line 5822 "parse.y"
15437 {
15438 /*%%%*/
15439 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15440 /*% %*/
15441 /*% ripper: string_add!($1, $2) %*/
15442 /*%%%*/
15443 /*%
15444 if (ripper_is_node_yylval(p, $1) && ripper_is_node_yylval(p, $2) &&
15445 !RNODE_RIPPER($1)->nd_cval) {
15446 RNODE_RIPPER($1)->nd_cval = RNODE_RIPPER($2)->nd_cval;
15447 RNODE_RIPPER($1)->nd_rval = add_mark_object(p, $$);
15448 $$ = $1;
15449 }
15450 %*/
15451 }
15452#line 15453 "parse.c"
15453 break;
15454
15455 case 624: /* xstring_contents: %empty */
15456#line 5840 "parse.y"
15457 {
15458 /*%%%*/
15459 (yyval.node) = 0;
15460 /*% %*/
15461 /*% ripper: xstring_new! %*/
15462 }
15463#line 15464 "parse.c"
15464 break;
15465
15466 case 625: /* xstring_contents: xstring_contents string_content */
15467#line 5847 "parse.y"
15468 {
15469 /*%%%*/
15470 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15471 /*% %*/
15472 /*% ripper: xstring_add!($1, $2) %*/
15473 }
15474#line 15475 "parse.c"
15475 break;
15476
15477 case 626: /* regexp_contents: %empty */
15478#line 5856 "parse.y"
15479 {
15480 /*%%%*/
15481 (yyval.node) = 0;
15482 /*% %*/
15483 /*% ripper: regexp_new! %*/
15484 /*%%%*/
15485 /*%
15486 $$ = ripper_new_yylval(p, 0, $$, 0);
15487 %*/
15488 }
15489#line 15490 "parse.c"
15490 break;
15491
15492 case 627: /* regexp_contents: regexp_contents string_content */
15493#line 5867 "parse.y"
15494 {
15495 /*%%%*/
15496 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
15497 if (!head) {
15498 (yyval.node) = tail;
15499 }
15500 else if (!tail) {
15501 (yyval.node) = head;
15502 }
15503 else {
15504 switch (nd_type(head)) {
15505 case NODE_STR:
15506 head = str2dstr(p, head);
15507 break;
15508 case NODE_DSTR:
15509 break;
15510 default:
15511 head = list_append(p, NEW_DSTR(Qnil, &(yyloc)), head);
15512 break;
15513 }
15514 (yyval.node) = list_append(p, head, tail);
15515 }
15516 /*%
15517 VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
15518 if (ripper_is_node_yylval(p, n1)) {
15519 s1 = RNODE_RIPPER(n1)->nd_cval;
15520 n1 = RNODE_RIPPER(n1)->nd_rval;
15521 }
15522 if (ripper_is_node_yylval(p, n2)) {
15523 s2 = RNODE_RIPPER(n2)->nd_cval;
15524 n2 = RNODE_RIPPER(n2)->nd_rval;
15525 }
15526 $$ = dispatch2(regexp_add, n1, n2);
15527 if (!s1 && s2) {
15528 $$ = ripper_new_yylval(p, 0, $$, s2);
15529 }
15530 %*/
15531 }
15532#line 15533 "parse.c"
15533 break;
15534
15535 case 629: /* @31: %empty */
15536#line 5910 "parse.y"
15537 {
15538 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
15539 (yyval.strterm) = p->lex.strterm;
15540 p->lex.strterm = 0;
15541 SET_LEX_STATE(EXPR_BEG);
15542 }
15543#line 15544 "parse.c"
15544 break;
15545
15546 case 630: /* string_content: tSTRING_DVAR @31 string_dvar */
15547#line 5917 "parse.y"
15548 {
15549 p->lex.strterm = (yyvsp[-1].strterm);
15550 /*%%%*/
15551 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
15552 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
15553 /*% %*/
15554 /*% ripper: string_dvar!($3) %*/
15555 }
15556#line 15557 "parse.c"
15557 break;
15558
15559 case 631: /* @32: %empty */
15560#line 5926 "parse.y"
15561 {
15562 CMDARG_PUSH(0);
15563 COND_PUSH(0);
15564 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
15565 (yyvsp[0].strterm) = p->lex.strterm;
15566 p->lex.strterm = 0;
15567 (yyval.num) = p->lex.state;
15568 SET_LEX_STATE(EXPR_BEG);
15569 }
15570#line 15571 "parse.c"
15571 break;
15572
15573 case 632: /* @33: %empty */
15574#line 5935 "parse.y"
15575 {
15576 (yyval.num) = p->lex.brace_nest;
15577 p->lex.brace_nest = 0;
15578 }
15579#line 15580 "parse.c"
15580 break;
15581
15582 case 633: /* @34: %empty */
15583#line 5939 "parse.y"
15584 {
15585 (yyval.num) = p->heredoc_indent;
15586 p->heredoc_indent = 0;
15587 }
15588#line 15589 "parse.c"
15589 break;
15590
15591 case 634: /* string_content: tSTRING_DBEG @32 @33 @34 compstmt string_dend */
15592#line 5944 "parse.y"
15593 {
15594 COND_POP();
15595 CMDARG_POP();
15596 p->lex.strterm = (yyvsp[-5].strterm);
15597 SET_LEX_STATE((yyvsp[-4].num));
15598 p->lex.brace_nest = (yyvsp[-3].num);
15599 p->heredoc_indent = (yyvsp[-2].num);
15600 p->heredoc_line_indent = -1;
15601 /*%%%*/
15602 if ((yyvsp[-1].node)) nd_unset_fl_newline((yyvsp[-1].node));
15603 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
15604 /*% %*/
15605 /*% ripper: string_embexpr!($compstmt) %*/
15606 }
15607#line 15608 "parse.c"
15608 break;
15609
15610 case 637: /* string_dvar: nonlocal_var */
15611#line 5965 "parse.y"
15612 {
15613 /*%%%*/
15614 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
15615 /*% %*/
15616 /*% ripper: var_ref!($1) %*/
15617 }
15618#line 15619 "parse.c"
15619 break;
15620
15621 case 641: /* ssym: "symbol literal" sym */
15622#line 5979 "parse.y"
15623 {
15624 SET_LEX_STATE(EXPR_END);
15625 /*%%%*/
15626 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
15627 /*% %*/
15628 /*% ripper: symbol_literal!(symbol!($2)) %*/
15629 }
15630#line 15631 "parse.c"
15631 break;
15632
15633 case 644: /* dsym: "symbol literal" string_contents "terminator" */
15634#line 5993 "parse.y"
15635 {
15636 SET_LEX_STATE(EXPR_END);
15637 /*%%%*/
15638 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
15639 /*% %*/
15640 /*% ripper: dyna_symbol!($2) %*/
15641 }
15642#line 15643 "parse.c"
15643 break;
15644
15645 case 646: /* numeric: tUMINUS_NUM simple_numeric */
15646#line 6004 "parse.y"
15647 {
15648 /*%%%*/
15649 (yyval.node) = (yyvsp[0].node);
15650 RB_OBJ_WRITE(p->ast, &RNODE_LIT((yyval.node))->nd_lit, negate_lit(p, RNODE_LIT((yyval.node))->nd_lit));
15651 /*% %*/
15652 /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
15653 }
15654#line 15655 "parse.c"
15655 break;
15656
15657 case 657: /* keyword_variable: "`nil'" */
15658#line 6029 "parse.y"
15659 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
15660#line 15661 "parse.c"
15661 break;
15662
15663 case 658: /* keyword_variable: "`self'" */
15664#line 6030 "parse.y"
15665 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
15666#line 15667 "parse.c"
15667 break;
15668
15669 case 659: /* keyword_variable: "`true'" */
15670#line 6031 "parse.y"
15671 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
15672#line 15673 "parse.c"
15673 break;
15674
15675 case 660: /* keyword_variable: "`false'" */
15676#line 6032 "parse.y"
15677 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
15678#line 15679 "parse.c"
15679 break;
15680
15681 case 661: /* keyword_variable: "`__FILE__'" */
15682#line 6033 "parse.y"
15683 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
15684#line 15685 "parse.c"
15685 break;
15686
15687 case 662: /* keyword_variable: "`__LINE__'" */
15688#line 6034 "parse.y"
15689 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
15690#line 15691 "parse.c"
15691 break;
15692
15693 case 663: /* keyword_variable: "`__ENCODING__'" */
15694#line 6035 "parse.y"
15695 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
15696#line 15697 "parse.c"
15697 break;
15698
15699 case 664: /* var_ref: user_variable */
15700#line 6039 "parse.y"
15701 {
15702 /*%%%*/
15703 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
15704 /*%
15705 if (id_is_var(p, get_id($1))) {
15706 $$ = dispatch1(var_ref, $1);
15707 }
15708 else {
15709 $$ = dispatch1(vcall, $1);
15710 }
15711 %*/
15712 }
15713#line 15714 "parse.c"
15714 break;
15715
15716 case 665: /* var_ref: keyword_variable */
15717#line 6052 "parse.y"
15718 {
15719 /*%%%*/
15720 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_ERROR(&(yyloc));
15721 /*% %*/
15722 /*% ripper: var_ref!($1) %*/
15723 }
15724#line 15725 "parse.c"
15725 break;
15726
15727 case 666: /* var_lhs: user_variable */
15728#line 6061 "parse.y"
15729 {
15730 /*%%%*/
15731 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15732 /*% %*/
15733 /*% ripper: assignable(p, var_field(p, $1)) %*/
15734 }
15735#line 15736 "parse.c"
15736 break;
15737
15738 case 667: /* var_lhs: keyword_variable */
15739#line 6068 "parse.y"
15740 {
15741 /*%%%*/
15742 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15743 /*% %*/
15744 /*% ripper: assignable(p, var_field(p, $1)) %*/
15745 }
15746#line 15747 "parse.c"
15747 break;
15748
15749 case 670: /* $@35: %empty */
15750#line 6081 "parse.y"
15751 {
15752 SET_LEX_STATE(EXPR_BEG);
15753 p->command_start = TRUE;
15754 }
15755#line 15756 "parse.c"
15756 break;
15757
15758 case 671: /* superclass: '<' $@35 expr_value term */
15759#line 6086 "parse.y"
15760 {
15761 (yyval.node) = (yyvsp[-1].node);
15762 }
15763#line 15764 "parse.c"
15764 break;
15765
15766 case 672: /* superclass: %empty */
15767#line 6090 "parse.y"
15768 {
15769 /*%%%*/
15770 (yyval.node) = 0;
15771 /*% %*/
15772 /*% ripper: Qnil %*/
15773 }
15774#line 15775 "parse.c"
15775 break;
15776
15777 case 674: /* f_opt_paren_args: none */
15778#line 6100 "parse.y"
15779 {
15780 p->ctxt.in_argdef = 0;
15781 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[-1]));
15782 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node_args), &(yylsp[-1]));
15783 }
15784#line 15785 "parse.c"
15785 break;
15786
15787 case 675: /* f_paren_args: '(' f_args rparen */
15788#line 6108 "parse.y"
15789 {
15790 /*%%%*/
15791 (yyval.node_args) = (yyvsp[-1].node_args);
15792 /*% %*/
15793 /*% ripper: paren!($2) %*/
15794 SET_LEX_STATE(EXPR_BEG);
15795 p->command_start = TRUE;
15796 p->ctxt.in_argdef = 0;
15797 }
15798#line 15799 "parse.c"
15799 break;
15800
15801 case 677: /* @36: %empty */
15802#line 6120 "parse.y"
15803 {
15804 (yyval.ctxt) = p->ctxt;
15805 p->ctxt.in_kwarg = 1;
15806 p->ctxt.in_argdef = 1;
15807 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
15808 }
15809#line 15810 "parse.c"
15810 break;
15811
15812 case 678: /* f_arglist: @36 f_args term */
15813#line 6127 "parse.y"
15814 {
15815 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
15816 p->ctxt.in_argdef = 0;
15817 (yyval.node_args) = (yyvsp[-1].node_args);
15818 SET_LEX_STATE(EXPR_BEG);
15819 p->command_start = TRUE;
15820 }
15821#line 15822 "parse.c"
15822 break;
15823
15824 case 679: /* args_tail: f_kwarg ',' f_kwrest opt_f_block_arg */
15825#line 6137 "parse.y"
15826 {
15827 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
15828 }
15829#line 15830 "parse.c"
15830 break;
15831
15832 case 680: /* args_tail: f_kwarg opt_f_block_arg */
15833#line 6141 "parse.y"
15834 {
15835 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), Qnone, (yyvsp[0].id), &(yylsp[-1]));
15836 }
15837#line 15838 "parse.c"
15838 break;
15839
15840 case 681: /* args_tail: f_any_kwrest opt_f_block_arg */
15841#line 6145 "parse.y"
15842 {
15843 (yyval.node_args) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
15844 }
15845#line 15846 "parse.c"
15846 break;
15847
15848 case 682: /* args_tail: f_block_arg */
15849#line 6149 "parse.y"
15850 {
15851 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
15852 }
15853#line 15854 "parse.c"
15854 break;
15855
15856 case 683: /* args_tail: args_forward */
15857#line 6153 "parse.y"
15858 {
15859 add_forwarding_args(p);
15860 (yyval.node_args) = new_args_tail(p, Qnone, (yyvsp[0].id), arg_FWD_BLOCK, &(yylsp[0]));
15861 /*%%%*/
15862 (yyval.node_args)->nd_ainfo.forwarding = 1;
15863 /*% %*/
15864 }
15865#line 15866 "parse.c"
15866 break;
15867
15868 case 684: /* opt_args_tail: ',' args_tail */
15869#line 6163 "parse.y"
15870 {
15871 (yyval.node_args) = (yyvsp[0].node_args);
15872 }
15873#line 15874 "parse.c"
15874 break;
15875
15876 case 685: /* opt_args_tail: %empty */
15877#line 6167 "parse.y"
15878 {
15879 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
15880 }
15881#line 15882 "parse.c"
15882 break;
15883
15884 case 686: /* f_args: f_arg ',' f_optarg ',' f_rest_arg opt_args_tail */
15885#line 6173 "parse.y"
15886 {
15887 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
15888 }
15889#line 15890 "parse.c"
15890 break;
15891
15892 case 687: /* f_args: f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15893#line 6177 "parse.y"
15894 {
15895 (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));
15896 }
15897#line 15898 "parse.c"
15898 break;
15899
15900 case 688: /* f_args: f_arg ',' f_optarg opt_args_tail */
15901#line 6181 "parse.y"
15902 {
15903 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15904 }
15905#line 15906 "parse.c"
15906 break;
15907
15908 case 689: /* f_args: f_arg ',' f_optarg ',' f_arg opt_args_tail */
15909#line 6185 "parse.y"
15910 {
15911 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), (yyvsp[-3].node_opt_arg), Qnone, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
15912 }
15913#line 15914 "parse.c"
15914 break;
15915
15916 case 690: /* f_args: f_arg ',' f_rest_arg opt_args_tail */
15917#line 6189 "parse.y"
15918 {
15919 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
15920 }
15921#line 15922 "parse.c"
15922 break;
15923
15924 case 691: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail */
15925#line 6193 "parse.y"
15926 {
15927 (yyval.node_args) = new_args(p, (yyvsp[-5].node_args_aux), Qnone, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
15928 }
15929#line 15930 "parse.c"
15930 break;
15931
15932 case 692: /* f_args: f_arg opt_args_tail */
15933#line 6197 "parse.y"
15934 {
15935 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15936 }
15937#line 15938 "parse.c"
15938 break;
15939
15940 case 693: /* f_args: f_optarg ',' f_rest_arg opt_args_tail */
15941#line 6201 "parse.y"
15942 {
15943 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
15944 }
15945#line 15946 "parse.c"
15946 break;
15947
15948 case 694: /* f_args: f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15949#line 6205 "parse.y"
15950 {
15951 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-5].node_opt_arg), (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
15952 }
15953#line 15954 "parse.c"
15954 break;
15955
15956 case 695: /* f_args: f_optarg opt_args_tail */
15957#line 6209 "parse.y"
15958 {
15959 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15960 }
15961#line 15962 "parse.c"
15962 break;
15963
15964 case 696: /* f_args: f_optarg ',' f_arg opt_args_tail */
15965#line 6213 "parse.y"
15966 {
15967 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), Qnone, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
15968 }
15969#line 15970 "parse.c"
15970 break;
15971
15972 case 697: /* f_args: f_rest_arg opt_args_tail */
15973#line 6217 "parse.y"
15974 {
15975 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
15976 }
15977#line 15978 "parse.c"
15978 break;
15979
15980 case 698: /* f_args: f_rest_arg ',' f_arg opt_args_tail */
15981#line 6221 "parse.y"
15982 {
15983 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
15984 }
15985#line 15986 "parse.c"
15986 break;
15987
15988 case 699: /* f_args: args_tail */
15989#line 6225 "parse.y"
15990 {
15991 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15992 }
15993#line 15994 "parse.c"
15994 break;
15995
15996 case 700: /* f_args: %empty */
15997#line 6229 "parse.y"
15998 {
15999 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
16000 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node_args), &(yylsp[0]));
16001 }
16002#line 16003 "parse.c"
16003 break;
16004
16005 case 701: /* args_forward: "(..." */
16006#line 6236 "parse.y"
16007 {
16008 /*%%%*/
16009#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
16010 (yyval.id) = 0;
16011#else
16012 (yyval.id) = idFWD_KWREST;
16013#endif
16014 /*% %*/
16015 /*% ripper: args_forward! %*/
16016 }
16017#line 16018 "parse.c"
16018 break;
16019
16020 case 702: /* f_bad_arg: "constant" */
16021#line 6249 "parse.y"
16022 {
16023 static const char mesg[] = "formal argument cannot be a constant";
16024 /*%%%*/
16025 yyerror1(&(yylsp[0]), mesg);
16026 (yyval.id) = 0;
16027 /*% %*/
16028 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16029 }
16030#line 16031 "parse.c"
16031 break;
16032
16033 case 703: /* f_bad_arg: "instance variable" */
16034#line 6258 "parse.y"
16035 {
16036 static const char mesg[] = "formal argument cannot be an instance variable";
16037 /*%%%*/
16038 yyerror1(&(yylsp[0]), mesg);
16039 (yyval.id) = 0;
16040 /*% %*/
16041 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16042 }
16043#line 16044 "parse.c"
16044 break;
16045
16046 case 704: /* f_bad_arg: "global variable" */
16047#line 6267 "parse.y"
16048 {
16049 static const char mesg[] = "formal argument cannot be a global variable";
16050 /*%%%*/
16051 yyerror1(&(yylsp[0]), mesg);
16052 (yyval.id) = 0;
16053 /*% %*/
16054 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16055 }
16056#line 16057 "parse.c"
16057 break;
16058
16059 case 705: /* f_bad_arg: "class variable" */
16060#line 6276 "parse.y"
16061 {
16062 static const char mesg[] = "formal argument cannot be a class variable";
16063 /*%%%*/
16064 yyerror1(&(yylsp[0]), mesg);
16065 (yyval.id) = 0;
16066 /*% %*/
16067 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16068 }
16069#line 16070 "parse.c"
16070 break;
16071
16072 case 707: /* f_norm_arg: "local variable or method" */
16073#line 6288 "parse.y"
16074 {
16075 formal_argument(p, (yyvsp[0].id));
16076 p->max_numparam = ORDINAL_PARAM;
16077 (yyval.id) = (yyvsp[0].id);
16078 }
16079#line 16080 "parse.c"
16080 break;
16081
16082 case 708: /* f_arg_asgn: f_norm_arg */
16083#line 6296 "parse.y"
16084 {
16085 ID id = get_id((yyvsp[0].id));
16086 arg_var(p, id);
16087 p->cur_arg = id;
16088 (yyval.id) = (yyvsp[0].id);
16089 }
16090#line 16091 "parse.c"
16091 break;
16092
16093 case 709: /* f_arg_item: f_arg_asgn */
16094#line 6305 "parse.y"
16095 {
16096 p->cur_arg = 0;
16097 /*%%%*/
16098 (yyval.node_args_aux) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
16099 /*% %*/
16100 /*% ripper: get_value($1) %*/
16101 }
16102#line 16103 "parse.c"
16103 break;
16104
16105 case 710: /* f_arg_item: "(" f_margs rparen */
16106#line 6313 "parse.y"
16107 {
16108 /*%%%*/
16109 ID tid = internal_id(p);
16110 YYLTYPE loc;
16111 loc.beg_pos = (yylsp[-1]).beg_pos;
16112 loc.end_pos = (yylsp[-1]).beg_pos;
16113 arg_var(p, tid);
16114 if (dyna_in_block(p)) {
16115 (yyvsp[-1].node_masgn)->nd_value = NEW_DVAR(tid, &loc);
16116 }
16117 else {
16118 (yyvsp[-1].node_masgn)->nd_value = NEW_LVAR(tid, &loc);
16119 }
16120 (yyval.node_args_aux) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
16121 (yyval.node_args_aux)->nd_next = (NODE *)(yyvsp[-1].node_masgn);
16122 /*% %*/
16123 /*% ripper: mlhs_paren!($2) %*/
16124 }
16125#line 16126 "parse.c"
16126 break;
16127
16128 case 712: /* f_arg: f_arg ',' f_arg_item */
16129#line 6336 "parse.y"
16130 {
16131 /*%%%*/
16132 (yyval.node_args_aux) = (yyvsp[-2].node_args_aux);
16133 (yyval.node_args_aux)->nd_plen++;
16134 (yyval.node_args_aux)->nd_next = block_append(p, (yyval.node_args_aux)->nd_next, (yyvsp[0].node_args_aux)->nd_next);
16135 rb_discard_node(p, (NODE *)(yyvsp[0].node_args_aux));
16136 /*% %*/
16137 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16138 }
16139#line 16140 "parse.c"
16140 break;
16141
16142 case 713: /* f_label: "label" */
16143#line 6349 "parse.y"
16144 {
16145 arg_var(p, formal_argument(p, (yyvsp[0].id)));
16146 p->cur_arg = get_id((yyvsp[0].id));
16147 p->max_numparam = ORDINAL_PARAM;
16148 p->ctxt.in_argdef = 0;
16149 (yyval.id) = (yyvsp[0].id);
16150 }
16151#line 16152 "parse.c"
16152 break;
16153
16154 case 714: /* f_kw: f_label arg_value */
16155#line 6359 "parse.y"
16156 {
16157 p->cur_arg = 0;
16158 p->ctxt.in_argdef = 1;
16159 /*%%%*/
16160 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16161 /*% %*/
16162 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
16163 }
16164#line 16165 "parse.c"
16165 break;
16166
16167 case 715: /* f_kw: f_label */
16168#line 6368 "parse.y"
16169 {
16170 p->cur_arg = 0;
16171 p->ctxt.in_argdef = 1;
16172 /*%%%*/
16173 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
16174 /*% %*/
16175 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
16176 }
16177#line 16178 "parse.c"
16178 break;
16179
16180 case 716: /* f_block_kw: f_label primary_value */
16181#line 6379 "parse.y"
16182 {
16183 p->ctxt.in_argdef = 1;
16184 /*%%%*/
16185 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16186 /*% %*/
16187 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
16188 }
16189#line 16190 "parse.c"
16190 break;
16191
16192 case 717: /* f_block_kw: f_label */
16193#line 6387 "parse.y"
16194 {
16195 p->ctxt.in_argdef = 1;
16196 /*%%%*/
16197 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
16198 /*% %*/
16199 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
16200 }
16201#line 16202 "parse.c"
16202 break;
16203
16204 case 718: /* f_block_kwarg: f_block_kw */
16205#line 6397 "parse.y"
16206 {
16207 /*%%%*/
16208 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
16209 /*% %*/
16210 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16211 }
16212#line 16213 "parse.c"
16213 break;
16214
16215 case 719: /* f_block_kwarg: f_block_kwarg ',' f_block_kw */
16216#line 6404 "parse.y"
16217 {
16218 /*%%%*/
16219 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
16220 /*% %*/
16221 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16222 }
16223#line 16224 "parse.c"
16224 break;
16225
16226 case 720: /* f_kwarg: f_kw */
16227#line 6414 "parse.y"
16228 {
16229 /*%%%*/
16230 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
16231 /*% %*/
16232 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16233 }
16234#line 16235 "parse.c"
16235 break;
16236
16237 case 721: /* f_kwarg: f_kwarg ',' f_kw */
16238#line 6421 "parse.y"
16239 {
16240 /*%%%*/
16241 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
16242 /*% %*/
16243 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16244 }
16245#line 16246 "parse.c"
16246 break;
16247
16248 case 724: /* f_no_kwarg: p_kwnorest */
16249#line 6434 "parse.y"
16250 {
16251 /*%%%*/
16252 /*% %*/
16253 /*% ripper: nokw_param!(Qnil) %*/
16254 }
16255#line 16256 "parse.c"
16256 break;
16257
16258 case 725: /* f_kwrest: kwrest_mark "local variable or method" */
16259#line 6442 "parse.y"
16260 {
16261 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
16262 /*%%%*/
16263 (yyval.id) = (yyvsp[0].id);
16264 /*% %*/
16265 /*% ripper: kwrest_param!($2) %*/
16266 }
16267#line 16268 "parse.c"
16268 break;
16269
16270 case 726: /* f_kwrest: kwrest_mark */
16271#line 6450 "parse.y"
16272 {
16273 arg_var(p, idFWD_KWREST);
16274 /*%%%*/
16275 (yyval.id) = idFWD_KWREST;
16276 /*% %*/
16277 /*% ripper: kwrest_param!(Qnil) %*/
16278 }
16279#line 16280 "parse.c"
16280 break;
16281
16282 case 727: /* f_opt: f_arg_asgn f_eq arg_value */
16283#line 6460 "parse.y"
16284 {
16285 p->cur_arg = 0;
16286 p->ctxt.in_argdef = 1;
16287 /*%%%*/
16288 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16289 /*% %*/
16290 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
16291 }
16292#line 16293 "parse.c"
16293 break;
16294
16295 case 728: /* f_block_opt: f_arg_asgn f_eq primary_value */
16296#line 6471 "parse.y"
16297 {
16298 p->cur_arg = 0;
16299 p->ctxt.in_argdef = 1;
16300 /*%%%*/
16301 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16302 /*% %*/
16303 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
16304 }
16305#line 16306 "parse.c"
16306 break;
16307
16308 case 729: /* f_block_optarg: f_block_opt */
16309#line 6482 "parse.y"
16310 {
16311 /*%%%*/
16312 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
16313 /*% %*/
16314 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16315 }
16316#line 16317 "parse.c"
16317 break;
16318
16319 case 730: /* f_block_optarg: f_block_optarg ',' f_block_opt */
16320#line 6489 "parse.y"
16321 {
16322 /*%%%*/
16323 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
16324 /*% %*/
16325 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16326 }
16327#line 16328 "parse.c"
16328 break;
16329
16330 case 731: /* f_optarg: f_opt */
16331#line 6498 "parse.y"
16332 {
16333 /*%%%*/
16334 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
16335 /*% %*/
16336 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16337 }
16338#line 16339 "parse.c"
16339 break;
16340
16341 case 732: /* f_optarg: f_optarg ',' f_opt */
16342#line 6505 "parse.y"
16343 {
16344 /*%%%*/
16345 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
16346 /*% %*/
16347 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16348 }
16349#line 16350 "parse.c"
16350 break;
16351
16352 case 735: /* f_rest_arg: restarg_mark "local variable or method" */
16353#line 6518 "parse.y"
16354 {
16355 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
16356 /*%%%*/
16357 (yyval.id) = (yyvsp[0].id);
16358 /*% %*/
16359 /*% ripper: rest_param!($2) %*/
16360 }
16361#line 16362 "parse.c"
16362 break;
16363
16364 case 736: /* f_rest_arg: restarg_mark */
16365#line 6526 "parse.y"
16366 {
16367 arg_var(p, idFWD_REST);
16368 /*%%%*/
16369 (yyval.id) = idFWD_REST;
16370 /*% %*/
16371 /*% ripper: rest_param!(Qnil) %*/
16372 }
16373#line 16374 "parse.c"
16374 break;
16375
16376 case 739: /* f_block_arg: blkarg_mark "local variable or method" */
16377#line 6540 "parse.y"
16378 {
16379 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
16380 /*%%%*/
16381 (yyval.id) = (yyvsp[0].id);
16382 /*% %*/
16383 /*% ripper: blockarg!($2) %*/
16384 }
16385#line 16386 "parse.c"
16386 break;
16387
16388 case 740: /* f_block_arg: blkarg_mark */
16389#line 6548 "parse.y"
16390 {
16391 arg_var(p, idFWD_BLOCK);
16392 /*%%%*/
16393 (yyval.id) = idFWD_BLOCK;
16394 /*% %*/
16395 /*% ripper: blockarg!(Qnil) %*/
16396 }
16397#line 16398 "parse.c"
16398 break;
16399
16400 case 741: /* opt_f_block_arg: ',' f_block_arg */
16401#line 6558 "parse.y"
16402 {
16403 (yyval.id) = (yyvsp[0].id);
16404 }
16405#line 16406 "parse.c"
16406 break;
16407
16408 case 742: /* opt_f_block_arg: none */
16409#line 6562 "parse.y"
16410 {
16411 (yyval.id) = Qnull;
16412 }
16413#line 16414 "parse.c"
16414 break;
16415
16416 case 743: /* singleton: var_ref */
16417#line 6568 "parse.y"
16418 {
16419 value_expr((yyvsp[0].node));
16420 (yyval.node) = (yyvsp[0].node);
16421 }
16422#line 16423 "parse.c"
16423 break;
16424
16425 case 744: /* $@37: %empty */
16426#line 6572 "parse.y"
16427 {SET_LEX_STATE(EXPR_BEG);}
16428#line 16429 "parse.c"
16429 break;
16430
16431 case 745: /* singleton: '(' $@37 expr rparen */
16432#line 6573 "parse.y"
16433 {
16434 /*%%%*/
16435 NODE *expr = last_expr_node((yyvsp[-1].node));
16436 switch (nd_type(expr)) {
16437 case NODE_STR:
16438 case NODE_DSTR:
16439 case NODE_XSTR:
16440 case NODE_DXSTR:
16441 case NODE_DREGX:
16442 case NODE_LIT:
16443 case NODE_DSYM:
16444 case NODE_LIST:
16445 case NODE_ZLIST:
16446 yyerror1(&expr->nd_loc, "can't define singleton method for literals");
16447 break;
16448 default:
16449 value_expr((yyvsp[-1].node));
16450 break;
16451 }
16452 (yyval.node) = (yyvsp[-1].node);
16453 /*% %*/
16454 /*% ripper: paren!($3) %*/
16455 }
16456#line 16457 "parse.c"
16457 break;
16458
16459 case 747: /* assoc_list: assocs trailer */
16460#line 6600 "parse.y"
16461 {
16462 /*%%%*/
16463 (yyval.node) = (yyvsp[-1].node);
16464 /*% %*/
16465 /*% ripper: assoclist_from_args!($1) %*/
16466 }
16467#line 16468 "parse.c"
16468 break;
16469
16470 case 749: /* assocs: assocs ',' assoc */
16471#line 6611 "parse.y"
16472 {
16473 /*%%%*/
16474 NODE *assocs = (yyvsp[-2].node);
16475 NODE *tail = (yyvsp[0].node);
16476 if (!assocs) {
16477 assocs = tail;
16478 }
16479 else if (tail) {
16480 if (RNODE_LIST(assocs)->nd_head &&
16481 !RNODE_LIST(tail)->nd_head && nd_type_p(RNODE_LIST(tail)->nd_next, NODE_LIST) &&
16482 nd_type_p(RNODE_LIST(RNODE_LIST(tail)->nd_next)->nd_head, NODE_HASH)) {
16483 /* DSTAR */
16484 tail = RNODE_HASH(RNODE_LIST(RNODE_LIST(tail)->nd_next)->nd_head)->nd_head;
16485 }
16486 assocs = list_concat(assocs, tail);
16487 }
16488 (yyval.node) = assocs;
16489 /*% %*/
16490 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16491 }
16492#line 16493 "parse.c"
16493 break;
16494
16495 case 750: /* assoc: arg_value "=>" arg_value */
16496#line 6634 "parse.y"
16497 {
16498 /*%%%*/
16499 if (nd_type_p((yyvsp[-2].node), NODE_STR)) {
16500 nd_set_type((yyvsp[-2].node), NODE_LIT);
16501 RB_OBJ_WRITE(p->ast, &RNODE_LIT((yyvsp[-2].node))->nd_lit, rb_fstring(RNODE_LIT((yyvsp[-2].node))->nd_lit));
16502 }
16503 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
16504 /*% %*/
16505 /*% ripper: assoc_new!($1, $3) %*/
16506 }
16507#line 16508 "parse.c"
16508 break;
16509
16510 case 751: /* assoc: "label" arg_value */
16511#line 6645 "parse.y"
16512 {
16513 /*%%%*/
16514 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
16515 /*% %*/
16516 /*% ripper: assoc_new!($1, $2) %*/
16517 }
16518#line 16519 "parse.c"
16519 break;
16520
16521 case 752: /* assoc: "label" */
16522#line 6652 "parse.y"
16523 {
16524 /*%%%*/
16525 NODE *val = gettable(p, (yyvsp[0].id), &(yyloc));
16526 if (!val) val = NEW_ERROR(&(yyloc));
16527 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yylsp[0])), &(yyloc)), val);
16528 /*% %*/
16529 /*% ripper: assoc_new!($1, Qnil) %*/
16530 }
16531#line 16532 "parse.c"
16532 break;
16533
16534 case 753: /* assoc: "string literal" string_contents tLABEL_END arg_value */
16535#line 6661 "parse.y"
16536 {
16537 /*%%%*/
16538 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
16539 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
16540 /*% %*/
16541 /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/
16542 }
16543#line 16544 "parse.c"
16544 break;
16545
16546 case 754: /* assoc: "**arg" arg_value */
16547#line 6669 "parse.y"
16548 {
16549 /*%%%*/
16550 if (nd_type_p((yyvsp[0].node), NODE_HASH) &&
16551 !(RNODE_HASH((yyvsp[0].node))->nd_head && RNODE_LIST(RNODE_HASH((yyvsp[0].node))->nd_head)->as.nd_alen)) {
16552 static VALUE empty_hash;
16553 if (!empty_hash) {
16554 empty_hash = rb_obj_freeze(rb_hash_new());
16555 rb_gc_register_mark_object(empty_hash);
16556 }
16557 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), NEW_LIT(empty_hash, &(yyloc)));
16558 }
16559 else
16560 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
16561 /*% %*/
16562 /*% ripper: assoc_splat!($2) %*/
16563 }
16564#line 16565 "parse.c"
16565 break;
16566
16567 case 755: /* assoc: "**arg" */
16568#line 6686 "parse.y"
16569 {
16570 forwarding_arg_check(p, idFWD_KWREST, idFWD_ALL, "keyword rest");
16571 /*%%%*/
16572 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)),
16573 NEW_LVAR(idFWD_KWREST, &(yyloc)));
16574 /*% %*/
16575 /*% ripper: assoc_splat!(Qnil) %*/
16576 }
16577#line 16578 "parse.c"
16578 break;
16579
16580 case 779: /* term: ';' */
16581#line 6743 "parse.y"
16582 {yyerrok;token_flush(p);}
16583#line 16584 "parse.c"
16584 break;
16585
16586 case 780: /* term: '\n' */
16587#line 6745 "parse.y"
16588 {
16589 (yyloc).end_pos = (yyloc).beg_pos;
16590 token_flush(p);
16591 }
16592#line 16593 "parse.c"
16593 break;
16594
16595 case 782: /* terms: terms ';' */
16596#line 6752 "parse.y"
16597 {yyerrok;}
16598#line 16599 "parse.c"
16599 break;
16600
16601 case 783: /* none: %empty */
16602#line 6756 "parse.y"
16603 {
16604 (yyval.node) = Qnull;
16605 }
16606#line 16607 "parse.c"
16607 break;
16608
16609
16610#line 16611 "parse.c"
16611
16612 default: break;
16613 }
16614 /* User semantic actions sometimes alter yychar, and that requires
16615 that yytoken be updated with the new translation. We take the
16616 approach of translating immediately before every use of yytoken.
16617 One alternative is translating here after every semantic action,
16618 but that translation would be missed if the semantic action invokes
16619 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
16620 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
16621 incorrect destructor might then be invoked immediately. In the
16622 case of YYERROR or YYBACKUP, subsequent parser actions might lead
16623 to an incorrect destructor call or verbose syntax error message
16624 before the lookahead is translated. */
16625 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc, p);
16626
16627 YYPOPSTACK (yylen);
16628 yylen = 0;
16629
16630 *++yyvsp = yyval;
16631 *++yylsp = yyloc;
16632
16633 /* Now 'shift' the result of the reduction. Determine what state
16634 that goes to, based on the state we popped back to and the rule
16635 number reduced by. */
16636 {
16637 const int yylhs = yyr1[yyn] - YYNTOKENS;
16638 const int yyi = yypgoto[yylhs] + *yyssp;
16639 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
16640 ? yytable[yyi]
16641 : yydefgoto[yylhs]);
16642 }
16643
16644 goto yynewstate;
16645
16646
16647/*--------------------------------------.
16648| yyerrlab -- here on detecting error. |
16649`--------------------------------------*/
16650yyerrlab:
16651 /* Make sure we have latest lookahead translation. See comments at
16652 user semantic actions for why this is necessary. */
16653 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
16654 /* If not already recovering from an error, report this error. */
16655 if (!yyerrstatus)
16656 {
16657 ++yynerrs;
16658 {
16659 yypcontext_t yyctx
16660 = {yyssp, yytoken, &yylloc};
16661 char const *yymsgp = YY_("syntax error");
16662 int yysyntax_error_status;
16663 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
16664 if (yysyntax_error_status == 0)
16665 yymsgp = yymsg;
16666 else if (yysyntax_error_status == -1)
16667 {
16668 if (yymsg != yymsgbuf)
16669 YYSTACK_FREE (yymsg);
16670 yymsg = YY_CAST (char *,
16671 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
16672 if (yymsg)
16673 {
16674 yysyntax_error_status
16675 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
16676 yymsgp = yymsg;
16677 }
16678 else
16679 {
16680 yymsg = yymsgbuf;
16681 yymsg_alloc = sizeof yymsgbuf;
16682 yysyntax_error_status = YYENOMEM;
16683 }
16684 }
16685 yyerror (&yylloc, p, yymsgp);
16686 if (yysyntax_error_status == YYENOMEM)
16687 YYNOMEM;
16688 }
16689 }
16690
16691 yyerror_range[1] = yylloc;
16692 if (yyerrstatus == 3)
16693 {
16694 /* If just tried and failed to reuse lookahead token after an
16695 error, discard it. */
16696
16697 if (yychar <= END_OF_INPUT)
16698 {
16699 /* Return failure if at end of input. */
16700 if (yychar == END_OF_INPUT)
16701 YYABORT;
16702 }
16703 else
16704 {
16705 yydestruct ("Error: discarding",
16706 yytoken, &yylval, &yylloc, p);
16707 yychar = YYEMPTY;
16708 }
16709 }
16710
16711 /* Else will try to reuse lookahead token after shifting the error
16712 token. */
16713 goto yyerrlab1;
16714
16715
16716/*---------------------------------------------------.
16717| yyerrorlab -- error raised explicitly by YYERROR. |
16718`---------------------------------------------------*/
16719yyerrorlab:
16720 /* Pacify compilers when the user code never invokes YYERROR and the
16721 label yyerrorlab therefore never appears in user code. */
16722 if (0)
16723 YYERROR;
16724 ++yynerrs;
16725
16726 /* Do not reclaim the symbols of the rule whose action triggered
16727 this YYERROR. */
16728 YYPOPSTACK (yylen);
16729 yylen = 0;
16730 YY_STACK_PRINT (yyss, yyssp, p);
16731 yystate = *yyssp;
16732 goto yyerrlab1;
16733
16734
16735/*-------------------------------------------------------------.
16736| yyerrlab1 -- common code for both syntax error and YYERROR. |
16737`-------------------------------------------------------------*/
16738yyerrlab1:
16739 yyerrstatus = 3; /* Each real token shifted decrements this. */
16740
16741 /* Pop stack until we find a state that shifts the error token. */
16742 for (;;)
16743 {
16744 yyn = yypact[yystate];
16745 if (!yypact_value_is_default (yyn))
16746 {
16747 yyn += YYSYMBOL_YYerror;
16748 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
16749 {
16750 yyn = yytable[yyn];
16751 if (0 < yyn)
16752 break;
16753 }
16754 }
16755
16756 /* Pop the current state because it cannot handle the error token. */
16757 if (yyssp == yyss)
16758 YYABORT;
16759
16760 yyerror_range[1] = *yylsp;
16761 yydestruct ("Error: popping",
16762 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
16763 YYPOPSTACK (1);
16764 yystate = *yyssp;
16765 YY_STACK_PRINT (yyss, yyssp, p);
16766 }
16767
16768 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
16769 *++yyvsp = yylval;
16770 YY_IGNORE_MAYBE_UNINITIALIZED_END
16771
16772 yyerror_range[2] = yylloc;
16773 ++yylsp;
16774 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
16775
16776 /* Shift the error token. */
16777 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp, p);
16778
16779 yystate = yyn;
16780 goto yynewstate;
16781
16782
16783/*-------------------------------------.
16784| yyacceptlab -- YYACCEPT comes here. |
16785`-------------------------------------*/
16786yyacceptlab:
16787 yyresult = 0;
16788 goto yyreturnlab;
16789
16790
16791/*-----------------------------------.
16792| yyabortlab -- YYABORT comes here. |
16793`-----------------------------------*/
16794yyabortlab:
16795 yyresult = 1;
16796 goto yyreturnlab;
16797
16798
16799/*-----------------------------------------------------------.
16800| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
16801`-----------------------------------------------------------*/
16802yyexhaustedlab:
16803 yyerror (&yylloc, p, YY_("memory exhausted"));
16804 yyresult = 2;
16805 goto yyreturnlab;
16806
16807
16808/*----------------------------------------------------------.
16809| yyreturnlab -- parsing is finished, clean up and return. |
16810`----------------------------------------------------------*/
16811yyreturnlab:
16812 if (yychar != YYEMPTY)
16813 {
16814 /* Make sure we have latest lookahead translation. See comments at
16815 user semantic actions for why this is necessary. */
16816 yytoken = YYTRANSLATE (yychar);
16817 yydestruct ("Cleanup: discarding lookahead",
16818 yytoken, &yylval, &yylloc, p);
16819 }
16820 /* Do not reclaim the symbols of the rule whose action triggered
16821 this YYABORT or YYACCEPT. */
16822 YYPOPSTACK (yylen);
16823 YY_STACK_PRINT (yyss, yyssp, p);
16824 while (yyssp != yyss)
16825 {
16826 yydestruct ("Cleanup: popping",
16827 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
16828 YYPOPSTACK (1);
16829 }
16830#ifndef yyoverflow
16831 if (yyss != yyssa)
16832 YYSTACK_FREE (yyss);
16833#endif
16834 if (yymsg != yymsgbuf)
16835 YYSTACK_FREE (yymsg);
16836 return yyresult;
16837}
16838
16839#line 6760 "parse.y"
16840
16841# undef p
16842# undef yylex
16843# undef yylval
16844# define yylval (*p->lval)
16845
16846static int regx_options(struct parser_params*);
16847static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
16848static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
16849static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
16850static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
16851
16852#ifndef RIPPER
16853# define set_yylval_node(x) { \
16854 YYLTYPE _cur_loc; \
16855 rb_parser_set_location(p, &_cur_loc); \
16856 yylval.node = (x); \
16857}
16858# define set_yylval_str(x) \
16859do { \
16860 set_yylval_node(NEW_STR(x, &_cur_loc)); \
16861 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16862} while(0)
16863# define set_yylval_literal(x) \
16864do { \
16865 set_yylval_node(NEW_LIT(x, &_cur_loc)); \
16866 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16867} while(0)
16868# define set_yylval_num(x) (yylval.num = (x))
16869# define set_yylval_id(x) (yylval.id = (x))
16870# define set_yylval_name(x) (yylval.id = (x))
16871# define yylval_id() (yylval.id)
16872#else
16873static inline VALUE
16874ripper_yylval_id(struct parser_params *p, ID x)
16875{
16876 return ripper_new_yylval(p, x, ID2SYM(x), 0);
16877}
16878# define set_yylval_str(x) (yylval.val = add_mark_object(p, (x)))
16879# define set_yylval_num(x) (yylval.val = ripper_new_yylval(p, (x), 0, 0))
16880# define set_yylval_id(x) (void)(x)
16881# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(p, x))
16882# define set_yylval_literal(x) add_mark_object(p, (x))
16883# define set_yylval_node(x) (yylval.val = ripper_new_yylval(p, 0, 0, STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)))
16884# define yylval_id() yylval.id
16885# define _cur_loc NULL_LOC /* dummy */
16886#endif
16887
16888#define set_yylval_noname() set_yylval_id(keyword_nil)
16889#define has_delayed_token(p) (!NIL_P(p->delayed.token))
16890
16891#ifndef RIPPER
16892#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
16893#define dispatch_scan_event(p, t) parser_dispatch_scan_event(p, t, __LINE__)
16894
16895static bool
16896parser_has_token(struct parser_params *p)
16897{
16898 const char *const pcur = p->lex.pcur;
16899 const char *const ptok = p->lex.ptok;
16900 if (p->keep_tokens && (pcur < ptok)) {
16901 rb_bug("lex.pcur < lex.ptok. (line: %d) %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF"",
16902 p->ruby_sourceline, ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur);
16903 }
16904 return pcur > ptok;
16905}
16906
16907static VALUE
16908code_loc_to_ary(struct parser_params *p, const rb_code_location_t *loc)
16909{
16910 VALUE ary = rb_ary_new_from_args(4,
16911 INT2NUM(loc->beg_pos.lineno), INT2NUM(loc->beg_pos.column),
16912 INT2NUM(loc->end_pos.lineno), INT2NUM(loc->end_pos.column));
16913 rb_obj_freeze(ary);
16914
16915 return ary;
16916}
16917
16918static void
16919parser_append_tokens(struct parser_params *p, VALUE str, enum yytokentype t, int line)
16920{
16921 VALUE ary;
16922 int token_id;
16923
16924 ary = rb_ary_new2(4);
16925 token_id = p->token_id;
16926 rb_ary_push(ary, INT2FIX(token_id));
16927 rb_ary_push(ary, ID2SYM(parser_token2id(p, t)));
16928 rb_ary_push(ary, str);
16929 rb_ary_push(ary, code_loc_to_ary(p, p->yylloc));
16930 rb_obj_freeze(ary);
16931 rb_ary_push(p->tokens, ary);
16932 p->token_id++;
16933
16934 if (p->debug) {
16935 rb_parser_printf(p, "Append tokens (line: %d) %"PRIsVALUE"\n", line, ary);
16936 }
16937}
16938
16939static void
16940parser_dispatch_scan_event(struct parser_params *p, enum yytokentype t, int line)
16941{
16942 debug_token_line(p, "parser_dispatch_scan_event", line);
16943
16944 if (!parser_has_token(p)) return;
16945
16946 RUBY_SET_YYLLOC(*p->yylloc);
16947
16948 if (p->keep_tokens) {
16949 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16950 parser_append_tokens(p, str, t, line);
16951 }
16952
16953 token_flush(p);
16954}
16955
16956#define dispatch_delayed_token(p, t) parser_dispatch_delayed_token(p, t, __LINE__)
16957static void
16958parser_dispatch_delayed_token(struct parser_params *p, enum yytokentype t, int line)
16959{
16960 debug_token_line(p, "parser_dispatch_delayed_token", line);
16961
16962 if (!has_delayed_token(p)) return;
16963
16964 RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(*p->yylloc);
16965
16966 if (p->keep_tokens) {
16967 parser_append_tokens(p, p->delayed.token, t, line);
16968 }
16969
16970 p->delayed.token = Qnil;
16971}
16972#else
16973#define literal_flush(p, ptr) ((void)(ptr))
16974
16975#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &RNODE_RIPPER(yylval.node)->nd_rval : &yylval.val))
16976
16977static int
16978ripper_has_scan_event(struct parser_params *p)
16979{
16980 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
16981 return p->lex.pcur > p->lex.ptok;
16982}
16983
16984static VALUE
16985ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
16986{
16987 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16988 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
16989 RUBY_SET_YYLLOC(*p->yylloc);
16990 token_flush(p);
16991 return rval;
16992}
16993
16994static void
16995ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
16996{
16997 if (!ripper_has_scan_event(p)) return;
16998 add_mark_object(p, yylval_rval = ripper_scan_event_val(p, t));
16999}
17000#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
17001
17002static void
17003ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
17004{
17005 /* save and adjust the location to delayed token for callbacks */
17006 int saved_line = p->ruby_sourceline;
17007 const char *saved_tokp = p->lex.ptok;
17008
17009 if (!has_delayed_token(p)) return;
17010 p->ruby_sourceline = p->delayed.beg_line;
17011 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
17012 add_mark_object(p, yylval_rval = ripper_dispatch1(p, ripper_token2eventid(t), p->delayed.token));
17013 p->delayed.token = Qnil;
17014 p->ruby_sourceline = saved_line;
17015 p->lex.ptok = saved_tokp;
17016}
17017#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
17018#endif /* RIPPER */
17019
17020static inline int
17021is_identchar(struct parser_params *p, const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
17022{
17023 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
17024}
17025
17026static inline int
17027parser_is_identchar(struct parser_params *p)
17028{
17029 return !(p)->eofp && is_identchar(p, p->lex.pcur-1, p->lex.pend, p->enc);
17030}
17031
17032static inline int
17033parser_isascii(struct parser_params *p)
17034{
17035 return ISASCII(*(p->lex.pcur-1));
17036}
17037
17038static void
17039token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
17040{
17041 int column = 1, nonspc = 0, i;
17042 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
17043 if (*ptr == '\t') {
17044 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
17045 }
17046 column++;
17047 if (*ptr != ' ' && *ptr != '\t') {
17048 nonspc = 1;
17049 }
17050 }
17051
17052 ptinfo->beg = loc->beg_pos;
17053 ptinfo->indent = column;
17054 ptinfo->nonspc = nonspc;
17055}
17056
17057static void
17058token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17059{
17060 token_info *ptinfo;
17061
17062 if (!p->token_info_enabled) return;
17063 ptinfo = ALLOC(token_info);
17064 ptinfo->token = token;
17065 ptinfo->next = p->token_info;
17066 token_info_setup(ptinfo, p->lex.pbeg, loc);
17067
17068 p->token_info = ptinfo;
17069}
17070
17071static void
17072token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17073{
17074 token_info *ptinfo_beg = p->token_info;
17075
17076 if (!ptinfo_beg) return;
17077 p->token_info = ptinfo_beg->next;
17078
17079 /* indentation check of matched keywords (begin..end, if..end, etc.) */
17080 token_info_warn(p, token, ptinfo_beg, 1, loc);
17081 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17082}
17083
17084static void
17085token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
17086{
17087 token_info *ptinfo_beg = p->token_info;
17088
17089 if (!ptinfo_beg) return;
17090 p->token_info = ptinfo_beg->next;
17091
17092 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
17093 ptinfo_beg->beg.column != beg_pos.column ||
17094 strcmp(ptinfo_beg->token, token)) {
17095 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
17096 beg_pos.lineno, beg_pos.column, token,
17097 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
17098 ptinfo_beg->token);
17099 }
17100
17101 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17102}
17103
17104static void
17105token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
17106{
17107 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
17108 if (!p->token_info_enabled) return;
17109 if (!ptinfo_beg) return;
17110 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
17111 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
17112 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
17113 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
17114 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
17115 rb_warn3L(ptinfo_end->beg.lineno,
17116 "mismatched indentations at '%s' with '%s' at %d",
17117 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
17118}
17119
17120static int
17121parser_precise_mbclen(struct parser_params *p, const char *ptr)
17122{
17123 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
17124 if (!MBCLEN_CHARFOUND_P(len)) {
17125 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
17126 return -1;
17127 }
17128 return len;
17129}
17130
17131#ifndef RIPPER
17132static void ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str);
17133
17134static inline void
17135parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
17136{
17137 VALUE str;
17138 int lineno = p->ruby_sourceline;
17139 if (!yylloc) {
17140 return;
17141 }
17142 else if (yylloc->beg_pos.lineno == lineno) {
17143 str = p->lex.lastline;
17144 }
17145 else {
17146 return;
17147 }
17148 ruby_show_error_line(p, p->error_buffer, yylloc, lineno, str);
17149}
17150
17151static int
17152parser_yyerror(struct parser_params *p, const rb_code_location_t *yylloc, const char *msg)
17153{
17154#if 0
17155 YYLTYPE current;
17156
17157 if (!yylloc) {
17158 yylloc = RUBY_SET_YYLLOC(current);
17159 }
17160 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
17161 p->ruby_sourceline != yylloc->end_pos.lineno)) {
17162 yylloc = 0;
17163 }
17164#endif
17165 parser_compile_error(p, yylloc, "%s", msg);
17166 parser_show_error_line(p, yylloc);
17167 return 0;
17168}
17169
17170static int
17171parser_yyerror0(struct parser_params *p, const char *msg)
17172{
17173 YYLTYPE current;
17174 return parser_yyerror(p, RUBY_SET_YYLLOC(current), msg);
17175}
17176
17177static void
17178ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str)
17179{
17180 VALUE mesg;
17181 const int max_line_margin = 30;
17182 const char *ptr, *ptr_end, *pt, *pb;
17183 const char *pre = "", *post = "", *pend;
17184 const char *code = "", *caret = "";
17185 const char *lim;
17186 const char *const pbeg = RSTRING_PTR(str);
17187 char *buf;
17188 long len;
17189 int i;
17190
17191 if (!yylloc) return;
17192 pend = RSTRING_END(str);
17193 if (pend > pbeg && pend[-1] == '\n') {
17194 if (--pend > pbeg && pend[-1] == '\r') --pend;
17195 }
17196
17197 pt = pend;
17198 if (lineno == yylloc->end_pos.lineno &&
17199 (pend - pbeg) > yylloc->end_pos.column) {
17200 pt = pbeg + yylloc->end_pos.column;
17201 }
17202
17203 ptr = ptr_end = pt;
17204 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
17205 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
17206
17207 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
17208 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
17209
17210 len = ptr_end - ptr;
17211 if (len > 4) {
17212 if (ptr > pbeg) {
17213 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_enc_get(str));
17214 if (ptr > pbeg) pre = "...";
17215 }
17216 if (ptr_end < pend) {
17217 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_enc_get(str));
17218 if (ptr_end < pend) post = "...";
17219 }
17220 }
17221 pb = pbeg;
17222 if (lineno == yylloc->beg_pos.lineno) {
17223 pb += yylloc->beg_pos.column;
17224 if (pb > pt) pb = pt;
17225 }
17226 if (pb < ptr) pb = ptr;
17227 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
17228 return;
17229 }
17230 if (RTEST(errbuf)) {
17231 mesg = rb_attr_get(errbuf, idMesg);
17232 if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
17233 rb_str_cat_cstr(mesg, "\n");
17234 }
17235 else {
17236 mesg = rb_enc_str_new(0, 0, rb_enc_get(str));
17237 }
17238 if (!errbuf && rb_stderr_tty_p()) {
17239#define CSI_BEGIN "\033["
17240#define CSI_SGR "m"
17241 rb_str_catf(mesg,
17242 CSI_BEGIN""CSI_SGR"%s" /* pre */
17243 CSI_BEGIN"1"CSI_SGR"%.*s"
17244 CSI_BEGIN"1;4"CSI_SGR"%.*s"
17245 CSI_BEGIN";1"CSI_SGR"%.*s"
17246 CSI_BEGIN""CSI_SGR"%s" /* post */
17247 "\n",
17248 pre,
17249 (int)(pb - ptr), ptr,
17250 (int)(pt - pb), pb,
17251 (int)(ptr_end - pt), pt,
17252 post);
17253 }
17254 else {
17255 char *p2;
17256
17257 len = ptr_end - ptr;
17258 lim = pt < pend ? pt : pend;
17259 i = (int)(lim - ptr);
17260 buf = ALLOCA_N(char, i+2);
17261 code = ptr;
17262 caret = p2 = buf;
17263 if (ptr <= pb) {
17264 while (ptr < pb) {
17265 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
17266 }
17267 *p2++ = '^';
17268 ptr++;
17269 }
17270 if (lim > ptr) {
17271 memset(p2, '~', (lim - ptr));
17272 p2 += (lim - ptr);
17273 }
17274 *p2 = '\0';
17275 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
17276 pre, (int)len, code, post,
17277 pre, caret);
17278 }
17279 if (!errbuf) rb_write_error_str(mesg);
17280}
17281#else
17282static int
17283parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
17284{
17285 const char *pcur = 0, *ptok = 0;
17286 if (p->ruby_sourceline == yylloc->beg_pos.lineno &&
17287 p->ruby_sourceline == yylloc->end_pos.lineno) {
17288 pcur = p->lex.pcur;
17289 ptok = p->lex.ptok;
17290 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
17291 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
17292 }
17293 parser_yyerror0(p, msg);
17294 if (pcur) {
17295 p->lex.ptok = ptok;
17296 p->lex.pcur = pcur;
17297 }
17298 return 0;
17299}
17300
17301static int
17302parser_yyerror0(struct parser_params *p, const char *msg)
17303{
17304 dispatch1(parse_error, STR_NEW2(msg));
17305 ripper_error(p);
17306 return 0;
17307}
17308
17309static inline void
17310parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
17311{
17312}
17313#endif /* !RIPPER */
17314
17315#ifndef RIPPER
17316static int
17317vtable_size(const struct vtable *tbl)
17318{
17319 if (!DVARS_TERMINAL_P(tbl)) {
17320 return tbl->pos;
17321 }
17322 else {
17323 return 0;
17324 }
17325}
17326#endif
17327
17328static struct vtable *
17329vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
17330{
17331 struct vtable *tbl = ALLOC(struct vtable);
17332 tbl->pos = 0;
17333 tbl->capa = 8;
17334 tbl->tbl = ALLOC_N(ID, tbl->capa);
17335 tbl->prev = prev;
17336#ifndef RIPPER
17337 if (p->debug) {
17338 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
17339 }
17340#endif
17341 return tbl;
17342}
17343#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
17344
17345static void
17346vtable_free_gen(struct parser_params *p, int line, const char *name,
17347 struct vtable *tbl)
17348{
17349#ifndef RIPPER
17350 if (p->debug) {
17351 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
17352 }
17353#endif
17354 if (!DVARS_TERMINAL_P(tbl)) {
17355 if (tbl->tbl) {
17356 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
17357 }
17358 ruby_sized_xfree(tbl, sizeof(*tbl));
17359 }
17360}
17361#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
17362
17363static void
17364vtable_add_gen(struct parser_params *p, int line, const char *name,
17365 struct vtable *tbl, ID id)
17366{
17367#ifndef RIPPER
17368 if (p->debug) {
17369 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
17370 line, name, (void *)tbl, rb_id2name(id));
17371 }
17372#endif
17373 if (DVARS_TERMINAL_P(tbl)) {
17374 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
17375 return;
17376 }
17377 if (tbl->pos == tbl->capa) {
17378 tbl->capa = tbl->capa * 2;
17379 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
17380 }
17381 tbl->tbl[tbl->pos++] = id;
17382}
17383#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
17384
17385#ifndef RIPPER
17386static void
17387vtable_pop_gen(struct parser_params *p, int line, const char *name,
17388 struct vtable *tbl, int n)
17389{
17390 if (p->debug) {
17391 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
17392 line, name, (void *)tbl, n);
17393 }
17394 if (tbl->pos < n) {
17395 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
17396 return;
17397 }
17398 tbl->pos -= n;
17399}
17400#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
17401#endif
17402
17403static int
17404vtable_included(const struct vtable * tbl, ID id)
17405{
17406 int i;
17407
17408 if (!DVARS_TERMINAL_P(tbl)) {
17409 for (i = 0; i < tbl->pos; i++) {
17410 if (tbl->tbl[i] == id) {
17411 return i+1;
17412 }
17413 }
17414 }
17415 return 0;
17416}
17417
17418static void parser_prepare(struct parser_params *p);
17419
17420#ifndef RIPPER
17421static NODE *parser_append_options(struct parser_params *p, NODE *node);
17422
17423static int
17424e_option_supplied(struct parser_params *p)
17425{
17426 return strcmp(p->ruby_sourcefile, "-e") == 0;
17427}
17428
17429static VALUE
17430yycompile0(VALUE arg)
17431{
17432 int n;
17433 NODE *tree;
17434 struct parser_params *p = (struct parser_params *)arg;
17435 int cov = FALSE;
17436
17437 if (!compile_for_eval && !NIL_P(p->ruby_sourcefile_string)) {
17438 if (p->debug_lines && p->ruby_sourceline > 0) {
17439 VALUE str = rb_default_rs;
17440 n = p->ruby_sourceline;
17441 do {
17442 rb_ary_push(p->debug_lines, str);
17443 } while (--n);
17444 }
17445
17446 if (!e_option_supplied(p)) {
17447 cov = TRUE;
17448 }
17449 }
17450
17451 if (p->debug_lines) {
17452 RB_OBJ_WRITE(p->ast, &p->ast->body.script_lines, p->debug_lines);
17453 }
17454
17455 parser_prepare(p);
17456#define RUBY_DTRACE_PARSE_HOOK(name) \
17457 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
17458 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
17459 }
17460 RUBY_DTRACE_PARSE_HOOK(BEGIN);
17461 n = yyparse(p);
17462 RUBY_DTRACE_PARSE_HOOK(END);
17463 p->debug_lines = 0;
17464
17465 p->lex.strterm = 0;
17466 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
17467 if (n || p->error_p) {
17468 VALUE mesg = p->error_buffer;
17469 if (!mesg) {
17470 mesg = syntax_error_new();
17471 }
17472 if (!p->error_tolerant) {
17473 rb_set_errinfo(mesg);
17474 return FALSE;
17475 }
17476 }
17477 tree = p->eval_tree;
17478 if (!tree) {
17479 tree = NEW_NIL(&NULL_LOC);
17480 }
17481 else {
17482 VALUE tokens = p->tokens;
17483 NODE *prelude;
17484 NODE *body = parser_append_options(p, RNODE_SCOPE(tree)->nd_body);
17485 prelude = block_append(p, p->eval_tree_begin, body);
17486 RNODE_SCOPE(tree)->nd_body = prelude;
17487 p->ast->body.frozen_string_literal = p->frozen_string_literal;
17488 p->ast->body.coverage_enabled = cov;
17489 if (p->keep_tokens) {
17490 rb_obj_freeze(tokens);
17491 rb_ast_set_tokens(p->ast, tokens);
17492 }
17493 }
17494 p->ast->body.root = tree;
17495 if (!p->ast->body.script_lines) p->ast->body.script_lines = INT2FIX(p->line_count);
17496 return TRUE;
17497}
17498
17499static rb_ast_t *
17500yycompile(struct parser_params *p, VALUE fname, int line)
17501{
17502 rb_ast_t *ast;
17503 if (NIL_P(fname)) {
17504 p->ruby_sourcefile_string = Qnil;
17505 p->ruby_sourcefile = "(none)";
17506 }
17507 else {
17508 p->ruby_sourcefile_string = rb_fstring(fname);
17509 p->ruby_sourcefile = StringValueCStr(fname);
17510 }
17511 p->ruby_sourceline = line - 1;
17512
17513 p->lvtbl = NULL;
17514
17515 p->ast = ast = rb_ast_new();
17516 compile_callback(yycompile0, (VALUE)p);
17517 p->ast = 0;
17518
17519 while (p->lvtbl) {
17520 local_pop(p);
17521 }
17522
17523 return ast;
17524}
17525#endif /* !RIPPER */
17526
17527static rb_encoding *
17528must_be_ascii_compatible(struct parser_params *p, VALUE s)
17529{
17530 rb_encoding *enc = rb_enc_get(s);
17531 if (!rb_enc_asciicompat(enc)) {
17532 rb_raise(rb_eArgError, "invalid source encoding");
17533 }
17534 return enc;
17535}
17536
17537static VALUE
17538lex_get_str(struct parser_params *p, VALUE s)
17539{
17540 char *beg, *end, *start;
17541 long len;
17542
17543 beg = RSTRING_PTR(s);
17544 len = RSTRING_LEN(s);
17545 start = beg;
17546 if (p->lex.gets_.ptr) {
17547 if (len == p->lex.gets_.ptr) return Qnil;
17548 beg += p->lex.gets_.ptr;
17549 len -= p->lex.gets_.ptr;
17550 }
17551 end = memchr(beg, '\n', len);
17552 if (end) len = ++end - beg;
17553 p->lex.gets_.ptr += len;
17554 return rb_str_subseq(s, beg - start, len);
17555}
17556
17557static VALUE
17558lex_getline(struct parser_params *p)
17559{
17560 VALUE line = (*p->lex.gets)(p, p->lex.input);
17561 if (NIL_P(line)) return line;
17562 must_be_ascii_compatible(p, line);
17563 if (RB_OBJ_FROZEN(line)) line = rb_str_dup(line); // needed for RubyVM::AST.of because script_lines in iseq is deep-frozen
17564 p->line_count++;
17565 return line;
17566}
17567
17568#ifndef RIPPER
17569static rb_ast_t*
17570parser_compile_string(rb_parser_t *p, VALUE fname, VALUE s, int line)
17571{
17572 p->lex.gets = lex_get_str;
17573 p->lex.gets_.ptr = 0;
17574 p->lex.input = rb_str_new_frozen(s);
17575 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
17576
17577 return yycompile(p, fname, line);
17578}
17579
17580rb_ast_t*
17581rb_ruby_parser_compile_string_path(rb_parser_t *p, VALUE f, VALUE s, int line)
17582{
17583 must_be_ascii_compatible(p, s);
17584 return parser_compile_string(p, f, s, line);
17585}
17586
17587rb_ast_t*
17588rb_ruby_parser_compile_string(rb_parser_t *p, const char *f, VALUE s, int line)
17589{
17590 return rb_ruby_parser_compile_string_path(p, rb_filesystem_str_new_cstr(f), s, line);
17591}
17592
17593static VALUE
17594lex_io_gets(struct parser_params *p, VALUE io)
17595{
17596 return rb_io_gets_internal(io);
17597}
17598
17599rb_ast_t*
17600rb_ruby_parser_compile_file_path(rb_parser_t *p, VALUE fname, VALUE file, int start)
17601{
17602 p->lex.gets = lex_io_gets;
17603 p->lex.input = file;
17604 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
17605
17606 return yycompile(p, fname, start);
17607}
17608
17609static VALUE
17610lex_generic_gets(struct parser_params *p, VALUE input)
17611{
17612 return (*p->lex.gets_.call)(input, p->line_count);
17613}
17614
17615rb_ast_t*
17616rb_ruby_parser_compile_generic(rb_parser_t *p, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
17617{
17618 p->lex.gets = lex_generic_gets;
17619 p->lex.gets_.call = lex_gets;
17620 p->lex.input = input;
17621 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
17622
17623 return yycompile(p, fname, start);
17624}
17625#endif /* !RIPPER */
17626
17627#define STR_FUNC_ESCAPE 0x01
17628#define STR_FUNC_EXPAND 0x02
17629#define STR_FUNC_REGEXP 0x04
17630#define STR_FUNC_QWORDS 0x08
17631#define STR_FUNC_SYMBOL 0x10
17632#define STR_FUNC_INDENT 0x20
17633#define STR_FUNC_LABEL 0x40
17634#define STR_FUNC_LIST 0x4000
17635#define STR_FUNC_TERM 0x8000
17636
17637enum string_type {
17638 str_label = STR_FUNC_LABEL,
17639 str_squote = (0),
17640 str_dquote = (STR_FUNC_EXPAND),
17641 str_xquote = (STR_FUNC_EXPAND),
17642 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
17643 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
17644 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
17645 str_ssym = (STR_FUNC_SYMBOL),
17646 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
17647};
17648
17649static VALUE
17650parser_str_new(struct parser_params *p, const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
17651{
17652 VALUE str;
17653
17654 str = rb_enc_str_new(ptr, len, enc);
17655 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
17656 if (is_ascii_string(str)) {
17657 }
17658 else if (rb_is_usascii_enc((void *)enc0) && enc != rb_utf8_encoding()) {
17659 rb_enc_associate(str, rb_ascii8bit_encoding());
17660 }
17661 }
17662
17663 return str;
17664}
17665
17666static int
17667strterm_is_heredoc(rb_strterm_t *strterm)
17668{
17669 return strterm->flags & STRTERM_HEREDOC;
17670}
17671
17672static rb_strterm_t *
17673new_strterm(struct parser_params *p, int func, int term, int paren)
17674{
17675 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
17676 strterm->u.literal.func = func;
17677 strterm->u.literal.term = term;
17678 strterm->u.literal.paren = paren;
17679 return strterm;
17680}
17681
17682static rb_strterm_t *
17683new_heredoc(struct parser_params *p)
17684{
17685 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
17686 strterm->flags |= STRTERM_HEREDOC;
17687 return strterm;
17688}
17689
17690#define peek(p,c) peek_n(p, (c), 0)
17691#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
17692#define peekc(p) peekc_n(p, 0)
17693#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
17694
17695static void
17696add_delayed_token(struct parser_params *p, const char *tok, const char *end, int line)
17697{
17698#ifndef RIPPER
17699 debug_token_line(p, "add_delayed_token", line);
17700#endif
17701
17702 if (tok < end) {
17703 if (has_delayed_token(p)) {
17704 bool next_line = end_with_newline_p(p, p->delayed.token);
17705 int end_line = (next_line ? 1 : 0) + p->delayed.end_line;
17706 int end_col = (next_line ? 0 : p->delayed.end_col);
17707 if (end_line != p->ruby_sourceline || end_col != tok - p->lex.pbeg) {
17708 dispatch_delayed_token(p, tSTRING_CONTENT);
17709 }
17710 }
17711 if (!has_delayed_token(p)) {
17712 p->delayed.token = rb_str_buf_new(end - tok);
17713 rb_enc_associate(p->delayed.token, p->enc);
17714 p->delayed.beg_line = p->ruby_sourceline;
17715 p->delayed.beg_col = rb_long2int(tok - p->lex.pbeg);
17716 }
17717 rb_str_buf_cat(p->delayed.token, tok, end - tok);
17718 p->delayed.end_line = p->ruby_sourceline;
17719 p->delayed.end_col = rb_long2int(end - p->lex.pbeg);
17720 p->lex.ptok = end;
17721 }
17722}
17723
17724static void
17725set_lastline(struct parser_params *p, VALUE v)
17726{
17727 p->lex.pbeg = p->lex.pcur = RSTRING_PTR(v);
17728 p->lex.pend = p->lex.pcur + RSTRING_LEN(v);
17729 p->lex.lastline = v;
17730}
17731
17732static int
17733nextline(struct parser_params *p, int set_encoding)
17734{
17735 VALUE v = p->lex.nextline;
17736 p->lex.nextline = 0;
17737 if (!v) {
17738 if (p->eofp)
17739 return -1;
17740
17741 if (!lex_eol_ptr_p(p, p->lex.pbeg) && *(p->lex.pend-1) != '\n') {
17742 goto end_of_input;
17743 }
17744
17745 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
17746 end_of_input:
17747 p->eofp = 1;
17748 lex_goto_eol(p);
17749 return -1;
17750 }
17751#ifndef RIPPER
17752 if (p->debug_lines) {
17753 if (set_encoding) rb_enc_associate(v, p->enc);
17754 rb_ary_push(p->debug_lines, v);
17755 }
17756#endif
17757 p->cr_seen = FALSE;
17758 }
17759 else if (NIL_P(v)) {
17760 /* after here-document without terminator */
17761 goto end_of_input;
17762 }
17763 add_delayed_token(p, p->lex.ptok, p->lex.pend, __LINE__);
17764 if (p->heredoc_end > 0) {
17765 p->ruby_sourceline = p->heredoc_end;
17766 p->heredoc_end = 0;
17767 }
17768 p->ruby_sourceline++;
17769 set_lastline(p, v);
17770 token_flush(p);
17771 return 0;
17772}
17773
17774static int
17775parser_cr(struct parser_params *p, int c)
17776{
17777 if (peek(p, '\n')) {
17778 p->lex.pcur++;
17779 c = '\n';
17780 }
17781 return c;
17782}
17783
17784static inline int
17785nextc0(struct parser_params *p, int set_encoding)
17786{
17787 int c;
17788
17789 if (UNLIKELY(lex_eol_p(p) || p->eofp || RTEST(p->lex.nextline))) {
17790 if (nextline(p, set_encoding)) return -1;
17791 }
17792 c = (unsigned char)*p->lex.pcur++;
17793 if (UNLIKELY(c == '\r')) {
17794 c = parser_cr(p, c);
17795 }
17796
17797 return c;
17798}
17799#define nextc(p) nextc0(p, TRUE)
17800
17801static void
17802pushback(struct parser_params *p, int c)
17803{
17804 if (c == -1) return;
17805 p->eofp = 0;
17806 p->lex.pcur--;
17807 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
17808 p->lex.pcur--;
17809 }
17810}
17811
17812#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
17813
17814#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
17815#define tok(p) (p)->tokenbuf
17816#define toklen(p) (p)->tokidx
17817
17818static int
17819looking_at_eol_p(struct parser_params *p)
17820{
17821 const char *ptr = p->lex.pcur;
17822 while (!lex_eol_ptr_p(p, ptr)) {
17823 int c = (unsigned char)*ptr++;
17824 int eol = (c == '\n' || c == '#');
17825 if (eol || !ISSPACE(c)) {
17826 return eol;
17827 }
17828 }
17829 return TRUE;
17830}
17831
17832static char*
17833newtok(struct parser_params *p)
17834{
17835 p->tokidx = 0;
17836 if (!p->tokenbuf) {
17837 p->toksiz = 60;
17838 p->tokenbuf = ALLOC_N(char, 60);
17839 }
17840 if (p->toksiz > 4096) {
17841 p->toksiz = 60;
17842 REALLOC_N(p->tokenbuf, char, 60);
17843 }
17844 return p->tokenbuf;
17845}
17846
17847static char *
17848tokspace(struct parser_params *p, int n)
17849{
17850 p->tokidx += n;
17851
17852 if (p->tokidx >= p->toksiz) {
17853 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
17854 REALLOC_N(p->tokenbuf, char, p->toksiz);
17855 }
17856 return &p->tokenbuf[p->tokidx-n];
17857}
17858
17859static void
17860tokadd(struct parser_params *p, int c)
17861{
17862 p->tokenbuf[p->tokidx++] = (char)c;
17863 if (p->tokidx >= p->toksiz) {
17864 p->toksiz *= 2;
17865 REALLOC_N(p->tokenbuf, char, p->toksiz);
17866 }
17867}
17868
17869static int
17870tok_hex(struct parser_params *p, size_t *numlen)
17871{
17872 int c;
17873
17874 c = (int)ruby_scan_hex(p->lex.pcur, 2, numlen);
17875 if (!*numlen) {
17876 yyerror0("invalid hex escape");
17877 dispatch_scan_event(p, tSTRING_CONTENT);
17878 return 0;
17879 }
17880 p->lex.pcur += *numlen;
17881 return c;
17882}
17883
17884#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
17885
17886static int
17887escaped_control_code(int c)
17888{
17889 int c2 = 0;
17890 switch (c) {
17891 case ' ':
17892 c2 = 's';
17893 break;
17894 case '\n':
17895 c2 = 'n';
17896 break;
17897 case '\t':
17898 c2 = 't';
17899 break;
17900 case '\v':
17901 c2 = 'v';
17902 break;
17903 case '\r':
17904 c2 = 'r';
17905 break;
17906 case '\f':
17907 c2 = 'f';
17908 break;
17909 }
17910 return c2;
17911}
17912
17913#define WARN_SPACE_CHAR(c, prefix) \
17914 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
17915
17916static int
17917tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
17918 int regexp_literal, int wide)
17919{
17920 size_t numlen;
17921 int codepoint = (int)ruby_scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
17922 p->lex.pcur += numlen;
17923 if (p->lex.strterm == NULL ||
17924 strterm_is_heredoc(p->lex.strterm) ||
17925 (p->lex.strterm->u.literal.func != str_regexp)) {
17926 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
17927 literal_flush(p, p->lex.pcur);
17928 yyerror0("invalid Unicode escape");
17929 return wide && numlen > 0;
17930 }
17931 if (codepoint > 0x10ffff) {
17932 literal_flush(p, p->lex.pcur);
17933 yyerror0("invalid Unicode codepoint (too large)");
17934 return wide;
17935 }
17936 if ((codepoint & 0xfffff800) == 0xd800) {
17937 literal_flush(p, p->lex.pcur);
17938 yyerror0("invalid Unicode codepoint");
17939 return wide;
17940 }
17941 }
17942 if (regexp_literal) {
17943 tokcopy(p, (int)numlen);
17944 }
17945 else if (codepoint >= 0x80) {
17946 rb_encoding *utf8 = rb_utf8_encoding();
17947 if (*encp && utf8 != *encp) {
17948 YYLTYPE loc = RUBY_INIT_YYLLOC();
17949 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
17950 parser_show_error_line(p, &loc);
17951 return wide;
17952 }
17953 *encp = utf8;
17954 tokaddmbc(p, codepoint, *encp);
17955 }
17956 else {
17957 tokadd(p, codepoint);
17958 }
17959 return TRUE;
17960}
17961
17962static int tokadd_mbchar(struct parser_params *p, int c);
17963
17964static int
17965tokskip_mbchar(struct parser_params *p)
17966{
17967 int len = parser_precise_mbclen(p, p->lex.pcur-1);
17968 if (len > 0) {
17969 p->lex.pcur += len - 1;
17970 }
17971 return len;
17972}
17973
17974/* return value is for ?\u3042 */
17975static void
17976tokadd_utf8(struct parser_params *p, rb_encoding **encp,
17977 int term, int symbol_literal, int regexp_literal)
17978{
17979 /*
17980 * If `term` is not -1, then we allow multiple codepoints in \u{}
17981 * upto `term` byte, otherwise we're parsing a character literal.
17982 * And then add the codepoints to the current token.
17983 */
17984 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
17985
17986 const int open_brace = '{', close_brace = '}';
17987
17988 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
17989
17990 if (peek(p, open_brace)) { /* handle \u{...} form */
17991 if (regexp_literal && p->lex.strterm->u.literal.func == str_regexp) {
17992 /*
17993 * Skip parsing validation code and copy bytes as-is until term or
17994 * closing brace, in order to correctly handle extended regexps where
17995 * invalid unicode escapes are allowed in comments. The regexp parser
17996 * does its own validation and will catch any issues.
17997 */
17998 tokadd(p, open_brace);
17999 while (!lex_eol_ptr_p(p, ++p->lex.pcur)) {
18000 int c = peekc(p);
18001 if (c == close_brace) {
18002 tokadd(p, c);
18003 ++p->lex.pcur;
18004 break;
18005 }
18006 else if (c == term) {
18007 break;
18008 }
18009 if (c == '\\' && !lex_eol_n_p(p, 1)) {
18010 tokadd(p, c);
18011 c = *++p->lex.pcur;
18012 }
18013 tokadd_mbchar(p, c);
18014 }
18015 }
18016 else {
18017 const char *second = NULL;
18018 int c, last = nextc(p);
18019 if (lex_eol_p(p)) goto unterminated;
18020 while (ISSPACE(c = peekc(p)) && !lex_eol_ptr_p(p, ++p->lex.pcur));
18021 while (c != close_brace) {
18022 if (c == term) goto unterminated;
18023 if (second == multiple_codepoints)
18024 second = p->lex.pcur;
18025 if (regexp_literal) tokadd(p, last);
18026 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
18027 break;
18028 }
18029 while (ISSPACE(c = peekc(p))) {
18030 if (lex_eol_ptr_p(p, ++p->lex.pcur)) goto unterminated;
18031 last = c;
18032 }
18033 if (term == -1 && !second)
18034 second = multiple_codepoints;
18035 }
18036
18037 if (c != close_brace) {
18038 unterminated:
18039 token_flush(p);
18040 yyerror0("unterminated Unicode escape");
18041 return;
18042 }
18043 if (second && second != multiple_codepoints) {
18044 const char *pcur = p->lex.pcur;
18045 p->lex.pcur = second;
18046 dispatch_scan_event(p, tSTRING_CONTENT);
18047 token_flush(p);
18048 p->lex.pcur = pcur;
18049 yyerror0(multiple_codepoints);
18050 token_flush(p);
18051 }
18052
18053 if (regexp_literal) tokadd(p, close_brace);
18054 nextc(p);
18055 }
18056 }
18057 else { /* handle \uxxxx form */
18058 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
18059 token_flush(p);
18060 return;
18061 }
18062 }
18063}
18064
18065#define ESCAPE_CONTROL 1
18066#define ESCAPE_META 2
18067
18068static int
18069read_escape(struct parser_params *p, int flags)
18070{
18071 int c;
18072 size_t numlen;
18073
18074 switch (c = nextc(p)) {
18075 case '\\': /* Backslash */
18076 return c;
18077
18078 case 'n': /* newline */
18079 return '\n';
18080
18081 case 't': /* horizontal tab */
18082 return '\t';
18083
18084 case 'r': /* carriage-return */
18085 return '\r';
18086
18087 case 'f': /* form-feed */
18088 return '\f';
18089
18090 case 'v': /* vertical tab */
18091 return '\13';
18092
18093 case 'a': /* alarm(bell) */
18094 return '\007';
18095
18096 case 'e': /* escape */
18097 return 033;
18098
18099 case '0': case '1': case '2': case '3': /* octal constant */
18100 case '4': case '5': case '6': case '7':
18101 pushback(p, c);
18102 c = (int)ruby_scan_oct(p->lex.pcur, 3, &numlen);
18103 p->lex.pcur += numlen;
18104 return c;
18105
18106 case 'x': /* hex constant */
18107 c = tok_hex(p, &numlen);
18108 if (numlen == 0) return 0;
18109 return c;
18110
18111 case 'b': /* backspace */
18112 return '\010';
18113
18114 case 's': /* space */
18115 return ' ';
18116
18117 case 'M':
18118 if (flags & ESCAPE_META) goto eof;
18119 if ((c = nextc(p)) != '-') {
18120 goto eof;
18121 }
18122 if ((c = nextc(p)) == '\\') {
18123 switch (peekc(p)) {
18124 case 'u': case 'U':
18125 nextc(p);
18126 goto eof;
18127 }
18128 return read_escape(p, flags|ESCAPE_META) | 0x80;
18129 }
18130 else if (c == -1 || !ISASCII(c)) goto eof;
18131 else {
18132 int c2 = escaped_control_code(c);
18133 if (c2) {
18134 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
18135 WARN_SPACE_CHAR(c2, "\\M-");
18136 }
18137 else {
18138 WARN_SPACE_CHAR(c2, "\\C-\\M-");
18139 }
18140 }
18141 else if (ISCNTRL(c)) goto eof;
18142 return ((c & 0xff) | 0x80);
18143 }
18144
18145 case 'C':
18146 if ((c = nextc(p)) != '-') {
18147 goto eof;
18148 }
18149 case 'c':
18150 if (flags & ESCAPE_CONTROL) goto eof;
18151 if ((c = nextc(p))== '\\') {
18152 switch (peekc(p)) {
18153 case 'u': case 'U':
18154 nextc(p);
18155 goto eof;
18156 }
18157 c = read_escape(p, flags|ESCAPE_CONTROL);
18158 }
18159 else if (c == '?')
18160 return 0177;
18161 else if (c == -1) goto eof;
18162 else if (!ISASCII(c)) {
18163 tokskip_mbchar(p);
18164 goto eof;
18165 }
18166 else {
18167 int c2 = escaped_control_code(c);
18168 if (c2) {
18169 if (ISCNTRL(c)) {
18170 if (flags & ESCAPE_META) {
18171 WARN_SPACE_CHAR(c2, "\\M-");
18172 }
18173 else {
18174 WARN_SPACE_CHAR(c2, "");
18175 }
18176 }
18177 else {
18178 if (flags & ESCAPE_META) {
18179 WARN_SPACE_CHAR(c2, "\\M-\\C-");
18180 }
18181 else {
18182 WARN_SPACE_CHAR(c2, "\\C-");
18183 }
18184 }
18185 }
18186 else if (ISCNTRL(c)) goto eof;
18187 }
18188 return c & 0x9f;
18189
18190 eof:
18191 case -1:
18192 yyerror0("Invalid escape character syntax");
18193 dispatch_scan_event(p, tSTRING_CONTENT);
18194 return '\0';
18195
18196 default:
18197 return c;
18198 }
18199}
18200
18201static void
18202tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
18203{
18204 int len = rb_enc_codelen(c, enc);
18205 rb_enc_mbcput(c, tokspace(p, len), enc);
18206}
18207
18208static int
18209tokadd_escape(struct parser_params *p)
18210{
18211 int c;
18212 size_t numlen;
18213
18214 switch (c = nextc(p)) {
18215 case '\n':
18216 return 0; /* just ignore */
18217
18218 case '0': case '1': case '2': case '3': /* octal constant */
18219 case '4': case '5': case '6': case '7':
18220 {
18221 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
18222 if (numlen == 0) goto eof;
18223 p->lex.pcur += numlen;
18224 tokcopy(p, (int)numlen + 1);
18225 }
18226 return 0;
18227
18228 case 'x': /* hex constant */
18229 {
18230 tok_hex(p, &numlen);
18231 if (numlen == 0) return -1;
18232 tokcopy(p, (int)numlen + 2);
18233 }
18234 return 0;
18235
18236 eof:
18237 case -1:
18238 yyerror0("Invalid escape character syntax");
18239 token_flush(p);
18240 return -1;
18241
18242 default:
18243 tokadd(p, '\\');
18244 tokadd(p, c);
18245 }
18246 return 0;
18247}
18248
18249static int
18250regx_options(struct parser_params *p)
18251{
18252 int kcode = 0;
18253 int kopt = 0;
18254 int options = 0;
18255 int c, opt, kc;
18256
18257 newtok(p);
18258 while (c = nextc(p), ISALPHA(c)) {
18259 if (c == 'o') {
18260 options |= RE_OPTION_ONCE;
18261 }
18262 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
18263 if (kc >= 0) {
18264 if (kc != rb_ascii8bit_encindex()) kcode = c;
18265 kopt = opt;
18266 }
18267 else {
18268 options |= opt;
18269 }
18270 }
18271 else {
18272 tokadd(p, c);
18273 }
18274 }
18275 options |= kopt;
18276 pushback(p, c);
18277 if (toklen(p)) {
18278 YYLTYPE loc = RUBY_INIT_YYLLOC();
18279 tokfix(p);
18280 compile_error(p, "unknown regexp option%s - %*s",
18281 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
18282 parser_show_error_line(p, &loc);
18283 }
18284 return options | RE_OPTION_ENCODING(kcode);
18285}
18286
18287static int
18288tokadd_mbchar(struct parser_params *p, int c)
18289{
18290 int len = parser_precise_mbclen(p, p->lex.pcur-1);
18291 if (len < 0) return -1;
18292 tokadd(p, c);
18293 p->lex.pcur += --len;
18294 if (len > 0) tokcopy(p, len);
18295 return c;
18296}
18297
18298static inline int
18299simple_re_meta(int c)
18300{
18301 switch (c) {
18302 case '$': case '*': case '+': case '.':
18303 case '?': case '^': case '|':
18304 case ')': case ']': case '}': case '>':
18305 return TRUE;
18306 default:
18307 return FALSE;
18308 }
18309}
18310
18311static int
18312parser_update_heredoc_indent(struct parser_params *p, int c)
18313{
18314 if (p->heredoc_line_indent == -1) {
18315 if (c == '\n') p->heredoc_line_indent = 0;
18316 }
18317 else {
18318 if (c == ' ') {
18319 p->heredoc_line_indent++;
18320 return TRUE;
18321 }
18322 else if (c == '\t') {
18323 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
18324 p->heredoc_line_indent = w * TAB_WIDTH;
18325 return TRUE;
18326 }
18327 else if (c != '\n') {
18328 if (p->heredoc_indent > p->heredoc_line_indent) {
18329 p->heredoc_indent = p->heredoc_line_indent;
18330 }
18331 p->heredoc_line_indent = -1;
18332 }
18333 }
18334 return FALSE;
18335}
18336
18337static void
18338parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
18339{
18340 YYLTYPE loc = RUBY_INIT_YYLLOC();
18341 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
18342 compile_error(p, "%s mixed within %s source", n1, n2);
18343 parser_show_error_line(p, &loc);
18344}
18345
18346static void
18347parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
18348{
18349 const char *pos = p->lex.pcur;
18350 p->lex.pcur = beg;
18351 parser_mixed_error(p, enc1, enc2);
18352 p->lex.pcur = pos;
18353}
18354
18355static inline char
18356nibble_char_upper(unsigned int c)
18357{
18358 c &= 0xf;
18359 return c + (c < 10 ? '0' : 'A' - 10);
18360}
18361
18362static int
18363tokadd_string(struct parser_params *p,
18364 int func, int term, int paren, long *nest,
18365 rb_encoding **encp, rb_encoding **enc)
18366{
18367 int c;
18368 bool erred = false;
18369#ifdef RIPPER
18370 const int heredoc_end = (p->heredoc_end ? p->heredoc_end + 1 : 0);
18371 int top_of_line = FALSE;
18372#endif
18373
18374#define mixed_error(enc1, enc2) \
18375 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
18376#define mixed_escape(beg, enc1, enc2) \
18377 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
18378
18379 while ((c = nextc(p)) != -1) {
18380 if (p->heredoc_indent > 0) {
18381 parser_update_heredoc_indent(p, c);
18382 }
18383#ifdef RIPPER
18384 if (top_of_line && heredoc_end == p->ruby_sourceline) {
18385 pushback(p, c);
18386 break;
18387 }
18388#endif
18389
18390 if (paren && c == paren) {
18391 ++*nest;
18392 }
18393 else if (c == term) {
18394 if (!nest || !*nest) {
18395 pushback(p, c);
18396 break;
18397 }
18398 --*nest;
18399 }
18400 else if ((func & STR_FUNC_EXPAND) && c == '#' && !lex_eol_p(p)) {
18401 unsigned char c2 = *p->lex.pcur;
18402 if (c2 == '$' || c2 == '@' || c2 == '{') {
18403 pushback(p, c);
18404 break;
18405 }
18406 }
18407 else if (c == '\\') {
18408 c = nextc(p);
18409 switch (c) {
18410 case '\n':
18411 if (func & STR_FUNC_QWORDS) break;
18412 if (func & STR_FUNC_EXPAND) {
18413 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
18414 continue;
18415 if (c == term) {
18416 c = '\\';
18417 goto terminate;
18418 }
18419 }
18420 tokadd(p, '\\');
18421 break;
18422
18423 case '\\':
18424 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
18425 break;
18426
18427 case 'u':
18428 if ((func & STR_FUNC_EXPAND) == 0) {
18429 tokadd(p, '\\');
18430 break;
18431 }
18432 tokadd_utf8(p, enc, term,
18433 func & STR_FUNC_SYMBOL,
18434 func & STR_FUNC_REGEXP);
18435 continue;
18436
18437 default:
18438 if (c == -1) return -1;
18439 if (!ISASCII(c)) {
18440 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
18441 goto non_ascii;
18442 }
18443 if (func & STR_FUNC_REGEXP) {
18444 switch (c) {
18445 case 'c':
18446 case 'C':
18447 case 'M': {
18448 pushback(p, c);
18449 c = read_escape(p, 0);
18450
18451 char *t = tokspace(p, rb_strlen_lit("\\x00"));
18452 *t++ = '\\';
18453 *t++ = 'x';
18454 *t++ = nibble_char_upper(c >> 4);
18455 *t++ = nibble_char_upper(c);
18456 continue;
18457 }
18458 }
18459
18460 if (c == term && !simple_re_meta(c)) {
18461 tokadd(p, c);
18462 continue;
18463 }
18464 pushback(p, c);
18465 if ((c = tokadd_escape(p)) < 0)
18466 return -1;
18467 if (*enc && *enc != *encp) {
18468 mixed_escape(p->lex.ptok+2, *enc, *encp);
18469 }
18470 continue;
18471 }
18472 else if (func & STR_FUNC_EXPAND) {
18473 pushback(p, c);
18474 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
18475 c = read_escape(p, 0);
18476 }
18477 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
18478 /* ignore backslashed spaces in %w */
18479 }
18480 else if (c != term && !(paren && c == paren)) {
18481 tokadd(p, '\\');
18482 pushback(p, c);
18483 continue;
18484 }
18485 }
18486 }
18487 else if (!parser_isascii(p)) {
18488 non_ascii:
18489 if (!*enc) {
18490 *enc = *encp;
18491 }
18492 else if (*enc != *encp) {
18493 mixed_error(*enc, *encp);
18494 continue;
18495 }
18496 if (tokadd_mbchar(p, c) == -1) return -1;
18497 continue;
18498 }
18499 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
18500 pushback(p, c);
18501 break;
18502 }
18503 if (c & 0x80) {
18504 if (!*enc) {
18505 *enc = *encp;
18506 }
18507 else if (*enc != *encp) {
18508 mixed_error(*enc, *encp);
18509 continue;
18510 }
18511 }
18512 tokadd(p, c);
18513#ifdef RIPPER
18514 top_of_line = (c == '\n');
18515#endif
18516 }
18517 terminate:
18518 if (*enc) *encp = *enc;
18519 return c;
18520}
18521
18522#define NEW_STRTERM(func, term, paren) new_strterm(p, func, term, paren)
18523
18524#ifdef RIPPER
18525static void
18526flush_string_content(struct parser_params *p, rb_encoding *enc)
18527{
18528 VALUE content = yylval.val;
18529 if (!ripper_is_node_yylval(p, content))
18530 content = ripper_new_yylval(p, 0, 0, content);
18531 if (has_delayed_token(p)) {
18532 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
18533 if (len > 0) {
18534 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
18535 }
18536 dispatch_delayed_token(p, tSTRING_CONTENT);
18537 p->lex.ptok = p->lex.pcur;
18538 RNODE_RIPPER(content)->nd_rval = yylval.val;
18539 }
18540 dispatch_scan_event(p, tSTRING_CONTENT);
18541 if (yylval.val != content)
18542 RNODE_RIPPER(content)->nd_rval = yylval.val;
18543 yylval.val = content;
18544}
18545#else
18546static void
18547flush_string_content(struct parser_params *p, rb_encoding *enc)
18548{
18549 if (has_delayed_token(p)) {
18550 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
18551 if (len > 0) {
18552 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
18553 p->delayed.end_line = p->ruby_sourceline;
18554 p->delayed.end_col = rb_long2int(p->lex.pcur - p->lex.pbeg);
18555 }
18556 dispatch_delayed_token(p, tSTRING_CONTENT);
18557 p->lex.ptok = p->lex.pcur;
18558 }
18559 dispatch_scan_event(p, tSTRING_CONTENT);
18560}
18561#endif
18562
18563RUBY_FUNC_EXPORTED const uint_least32_t ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
18564/* this can be shared with ripper, since it's independent from struct
18565 * parser_params. */
18566#ifndef RIPPER
18567#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
18568#define SPECIAL_PUNCT(idx) ( \
18569 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
18570 BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
18571 BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
18572 BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
18573 BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
18574 BIT('0', idx))
18575const uint_least32_t ruby_global_name_punct_bits[] = {
18576 SPECIAL_PUNCT(0),
18577 SPECIAL_PUNCT(1),
18578 SPECIAL_PUNCT(2),
18579};
18580#undef BIT
18581#undef SPECIAL_PUNCT
18582#endif
18583
18584static enum yytokentype
18585parser_peek_variable_name(struct parser_params *p)
18586{
18587 int c;
18588 const char *ptr = p->lex.pcur;
18589
18590 if (lex_eol_ptr_n_p(p, ptr, 1)) return 0;
18591 c = *ptr++;
18592 switch (c) {
18593 case '$':
18594 if ((c = *ptr) == '-') {
18595 if (lex_eol_ptr_p(p, ++ptr)) return 0;
18596 c = *ptr;
18597 }
18598 else if (is_global_name_punct(c) || ISDIGIT(c)) {
18599 return tSTRING_DVAR;
18600 }
18601 break;
18602 case '@':
18603 if ((c = *ptr) == '@') {
18604 if (lex_eol_ptr_p(p, ++ptr)) return 0;
18605 c = *ptr;
18606 }
18607 break;
18608 case '{':
18609 p->lex.pcur = ptr;
18610 p->command_start = TRUE;
18611 return tSTRING_DBEG;
18612 default:
18613 return 0;
18614 }
18615 if (!ISASCII(c) || c == '_' || ISALPHA(c))
18616 return tSTRING_DVAR;
18617 return 0;
18618}
18619
18620#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
18621#define IS_END() IS_lex_state(EXPR_END_ANY)
18622#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
18623#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
18624#define IS_LABEL_POSSIBLE() (\
18625 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
18626 IS_ARG())
18627#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
18628#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
18629
18630static inline enum yytokentype
18631parser_string_term(struct parser_params *p, int func)
18632{
18633 xfree(p->lex.strterm);
18634 p->lex.strterm = 0;
18635 if (func & STR_FUNC_REGEXP) {
18636 set_yylval_num(regx_options(p));
18637 dispatch_scan_event(p, tREGEXP_END);
18638 SET_LEX_STATE(EXPR_END);
18639 return tREGEXP_END;
18640 }
18641 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
18642 nextc(p);
18643 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
18644 return tLABEL_END;
18645 }
18646 SET_LEX_STATE(EXPR_END);
18647 return tSTRING_END;
18648}
18649
18650static enum yytokentype
18651parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
18652{
18653 int func = quote->func;
18654 int term = quote->term;
18655 int paren = quote->paren;
18656 int c, space = 0;
18657 rb_encoding *enc = p->enc;
18658 rb_encoding *base_enc = 0;
18659 VALUE lit;
18660
18661 if (func & STR_FUNC_TERM) {
18662 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
18663 SET_LEX_STATE(EXPR_END);
18664 xfree(p->lex.strterm);
18665 p->lex.strterm = 0;
18666 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
18667 }
18668 c = nextc(p);
18669 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
18670 while (c != '\n' && ISSPACE(c = nextc(p)));
18671 space = 1;
18672 }
18673 if (func & STR_FUNC_LIST) {
18674 quote->func &= ~STR_FUNC_LIST;
18675 space = 1;
18676 }
18677 if (c == term && !quote->nest) {
18678 if (func & STR_FUNC_QWORDS) {
18679 quote->func |= STR_FUNC_TERM;
18680 pushback(p, c); /* dispatch the term at tSTRING_END */
18681 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
18682 return ' ';
18683 }
18684 return parser_string_term(p, func);
18685 }
18686 if (space) {
18687 if (!ISSPACE(c)) pushback(p, c);
18688 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
18689 return ' ';
18690 }
18691 newtok(p);
18692 if ((func & STR_FUNC_EXPAND) && c == '#') {
18693 enum yytokentype t = parser_peek_variable_name(p);
18694 if (t) return t;
18695 tokadd(p, '#');
18696 c = nextc(p);
18697 }
18698 pushback(p, c);
18699 if (tokadd_string(p, func, term, paren, &quote->nest,
18700 &enc, &base_enc) == -1) {
18701 if (p->eofp) {
18702#ifndef RIPPER
18703# define unterminated_literal(mesg) yyerror0(mesg)
18704#else
18705# define unterminated_literal(mesg) compile_error(p, mesg)
18706#endif
18707 literal_flush(p, p->lex.pcur);
18708 if (func & STR_FUNC_QWORDS) {
18709 /* no content to add, bailing out here */
18710 unterminated_literal("unterminated list meets end of file");
18711 xfree(p->lex.strterm);
18712 p->lex.strterm = 0;
18713 return tSTRING_END;
18714 }
18715 if (func & STR_FUNC_REGEXP) {
18716 unterminated_literal("unterminated regexp meets end of file");
18717 }
18718 else {
18719 unterminated_literal("unterminated string meets end of file");
18720 }
18721 quote->func |= STR_FUNC_TERM;
18722 }
18723 }
18724
18725 tokfix(p);
18726 lit = STR_NEW3(tok(p), toklen(p), enc, func);
18727 set_yylval_str(lit);
18728 flush_string_content(p, enc);
18729
18730 return tSTRING_CONTENT;
18731}
18732
18733static enum yytokentype
18734heredoc_identifier(struct parser_params *p)
18735{
18736 /*
18737 * term_len is length of `<<"END"` except `END`,
18738 * in this case term_len is 4 (<, <, " and ").
18739 */
18740 long len, offset = p->lex.pcur - p->lex.pbeg;
18741 int c = nextc(p), term, func = 0, quote = 0;
18742 enum yytokentype token = tSTRING_BEG;
18743 int indent = 0;
18744
18745 if (c == '-') {
18746 c = nextc(p);
18747 func = STR_FUNC_INDENT;
18748 offset++;
18749 }
18750 else if (c == '~') {
18751 c = nextc(p);
18752 func = STR_FUNC_INDENT;
18753 offset++;
18754 indent = INT_MAX;
18755 }
18756 switch (c) {
18757 case '\'':
18758 func |= str_squote; goto quoted;
18759 case '"':
18760 func |= str_dquote; goto quoted;
18761 case '`':
18762 token = tXSTRING_BEG;
18763 func |= str_xquote; goto quoted;
18764
18765 quoted:
18766 quote++;
18767 offset++;
18768 term = c;
18769 len = 0;
18770 while ((c = nextc(p)) != term) {
18771 if (c == -1 || c == '\r' || c == '\n') {
18772 yyerror0("unterminated here document identifier");
18773 return -1;
18774 }
18775 }
18776 break;
18777
18778 default:
18779 if (!parser_is_identchar(p)) {
18780 pushback(p, c);
18781 if (func & STR_FUNC_INDENT) {
18782 pushback(p, indent > 0 ? '~' : '-');
18783 }
18784 return 0;
18785 }
18786 func |= str_dquote;
18787 do {
18788 int n = parser_precise_mbclen(p, p->lex.pcur-1);
18789 if (n < 0) return 0;
18790 p->lex.pcur += --n;
18791 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
18792 pushback(p, c);
18793 break;
18794 }
18795
18796 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
18797 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
18798 yyerror0("too long here document identifier");
18799 dispatch_scan_event(p, tHEREDOC_BEG);
18800 lex_goto_eol(p);
18801
18802 p->lex.strterm = new_heredoc(p);
18803 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
18804 here->offset = offset;
18805 here->sourceline = p->ruby_sourceline;
18806 here->length = (unsigned)len;
18807 here->quote = quote;
18808 here->func = func;
18809 here->lastline = p->lex.lastline;
18810 rb_ast_add_mark_object(p->ast, p->lex.lastline);
18811
18812 token_flush(p);
18813 p->heredoc_indent = indent;
18814 p->heredoc_line_indent = 0;
18815 return token;
18816}
18817
18818static void
18819heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
18820{
18821 VALUE line;
18822 rb_strterm_t *term = p->lex.strterm;
18823
18824 p->lex.strterm = 0;
18825 line = here->lastline;
18826 p->lex.lastline = line;
18827 p->lex.pbeg = RSTRING_PTR(line);
18828 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
18829 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
18830 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
18831 p->heredoc_end = p->ruby_sourceline;
18832 p->ruby_sourceline = (int)here->sourceline;
18833 if (p->eofp) p->lex.nextline = Qnil;
18834 p->eofp = 0;
18835 xfree(term);
18836 rb_ast_delete_mark_object(p->ast, line);
18837}
18838
18839static int
18840dedent_string(struct parser_params *p, VALUE string, int width)
18841{
18842 char *str;
18843 long len;
18844 int i, col = 0;
18845
18846 RSTRING_GETMEM(string, str, len);
18847 for (i = 0; i < len && col < width; i++) {
18848 if (str[i] == ' ') {
18849 col++;
18850 }
18851 else if (str[i] == '\t') {
18852 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
18853 if (n > width) break;
18854 col = n;
18855 }
18856 else {
18857 break;
18858 }
18859 }
18860 if (!i) return 0;
18861 rb_str_modify(string);
18862 str = RSTRING_PTR(string);
18863 if (RSTRING_LEN(string) != len)
18864 rb_fatal("literal string changed: %+"PRIsVALUE, string);
18865 MEMMOVE(str, str + i, char, len - i);
18866 rb_str_set_len(string, len - i);
18867 return i;
18868}
18869
18870#ifndef RIPPER
18871static NODE *
18872heredoc_dedent(struct parser_params *p, NODE *root)
18873{
18874 NODE *node, *str_node, *prev_node;
18875 int indent = p->heredoc_indent;
18876 VALUE prev_lit = 0;
18877
18878 if (indent <= 0) return root;
18879 p->heredoc_indent = 0;
18880 if (!root) return root;
18881
18882 prev_node = node = str_node = root;
18883 if (nd_type_p(root, NODE_LIST)) str_node = RNODE_LIST(root)->nd_head;
18884
18885 while (str_node) {
18886 VALUE lit = RNODE_LIT(str_node)->nd_lit;
18887 if (nd_fl_newline(str_node)) {
18888 dedent_string(p, lit, indent);
18889 }
18890 if (!prev_lit) {
18891 prev_lit = lit;
18892 }
18893 else if (!literal_concat0(p, prev_lit, lit)) {
18894 return 0;
18895 }
18896 else {
18897 NODE *end = RNODE_LIST(node)->as.nd_end;
18898 node = RNODE_LIST(prev_node)->nd_next = RNODE_LIST(node)->nd_next;
18899 if (!node) {
18900 if (nd_type_p(prev_node, NODE_DSTR))
18901 nd_set_type(prev_node, NODE_STR);
18902 break;
18903 }
18904 RNODE_LIST(node)->as.nd_end = end;
18905 goto next_str;
18906 }
18907
18908 str_node = 0;
18909 while ((nd_type_p(node, NODE_LIST) || nd_type_p(node, NODE_DSTR)) && (node = RNODE_LIST(prev_node = node)->nd_next) != 0) {
18910 next_str:
18911 if (!nd_type_p(node, NODE_LIST)) break;
18912 if ((str_node = RNODE_LIST(node)->nd_head) != 0) {
18913 enum node_type type = nd_type(str_node);
18914 if (type == NODE_STR || type == NODE_DSTR) break;
18915 prev_lit = 0;
18916 str_node = 0;
18917 }
18918 }
18919 }
18920 return root;
18921}
18922#else /* RIPPER */
18923static VALUE
18924heredoc_dedent(struct parser_params *p, VALUE array)
18925{
18926 int indent = p->heredoc_indent;
18927
18928 if (indent <= 0) return array;
18929 p->heredoc_indent = 0;
18930 dispatch2(heredoc_dedent, array, INT2NUM(indent));
18931 return array;
18932}
18933#endif
18934
18935static int
18936whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
18937{
18938 const char *beg = p->lex.pbeg;
18939 const char *ptr = p->lex.pend;
18940
18941 if (ptr - beg < len) return FALSE;
18942 if (ptr > beg && ptr[-1] == '\n') {
18943 if (--ptr > beg && ptr[-1] == '\r') --ptr;
18944 if (ptr - beg < len) return FALSE;
18945 }
18946 if (strncmp(eos, ptr -= len, len)) return FALSE;
18947 if (indent) {
18948 while (beg < ptr && ISSPACE(*beg)) beg++;
18949 }
18950 return beg == ptr;
18951}
18952
18953static int
18954word_match_p(struct parser_params *p, const char *word, long len)
18955{
18956 if (strncmp(p->lex.pcur, word, len)) return 0;
18957 if (lex_eol_n_p(p, len)) return 1;
18958 int c = (unsigned char)p->lex.pcur[len];
18959 if (ISSPACE(c)) return 1;
18960 switch (c) {
18961 case '\0': case '\004': case '\032': return 1;
18962 }
18963 return 0;
18964}
18965
18966#define NUM_SUFFIX_R (1<<0)
18967#define NUM_SUFFIX_I (1<<1)
18968#define NUM_SUFFIX_ALL 3
18969
18970static int
18971number_literal_suffix(struct parser_params *p, int mask)
18972{
18973 int c, result = 0;
18974 const char *lastp = p->lex.pcur;
18975
18976 while ((c = nextc(p)) != -1) {
18977 if ((mask & NUM_SUFFIX_I) && c == 'i') {
18978 result |= (mask & NUM_SUFFIX_I);
18979 mask &= ~NUM_SUFFIX_I;
18980 /* r after i, rational of complex is disallowed */
18981 mask &= ~NUM_SUFFIX_R;
18982 continue;
18983 }
18984 if ((mask & NUM_SUFFIX_R) && c == 'r') {
18985 result |= (mask & NUM_SUFFIX_R);
18986 mask &= ~NUM_SUFFIX_R;
18987 continue;
18988 }
18989 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
18990 p->lex.pcur = lastp;
18991 literal_flush(p, p->lex.pcur);
18992 return 0;
18993 }
18994 pushback(p, c);
18995 break;
18996 }
18997 return result;
18998}
18999
19000static enum yytokentype
19001set_number_literal(struct parser_params *p, VALUE v,
19002 enum yytokentype type, int suffix)
19003{
19004 if (suffix & NUM_SUFFIX_I) {
19005 v = rb_complex_raw(INT2FIX(0), v);
19006 type = tIMAGINARY;
19007 }
19008 set_yylval_literal(v);
19009 SET_LEX_STATE(EXPR_END);
19010 return type;
19011}
19012
19013static enum yytokentype
19014set_integer_literal(struct parser_params *p, VALUE v, int suffix)
19015{
19016 enum yytokentype type = tINTEGER;
19017 if (suffix & NUM_SUFFIX_R) {
19018 v = rb_rational_raw1(v);
19019 type = tRATIONAL;
19020 }
19021 return set_number_literal(p, v, type, suffix);
19022}
19023
19024#ifdef RIPPER
19025static void
19026dispatch_heredoc_end(struct parser_params *p)
19027{
19028 VALUE str;
19029 if (has_delayed_token(p))
19030 dispatch_delayed_token(p, tSTRING_CONTENT);
19031 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
19032 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
19033 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
19034 lex_goto_eol(p);
19035 token_flush(p);
19036}
19037
19038#else
19039#define dispatch_heredoc_end(p) parser_dispatch_heredoc_end(p, __LINE__)
19040static void
19041parser_dispatch_heredoc_end(struct parser_params *p, int line)
19042{
19043 if (has_delayed_token(p))
19044 dispatch_delayed_token(p, tSTRING_CONTENT);
19045
19046 if (p->keep_tokens) {
19047 VALUE str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
19048 RUBY_SET_YYLLOC_OF_HEREDOC_END(*p->yylloc);
19049 parser_append_tokens(p, str, tHEREDOC_END, line);
19050 }
19051
19052 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
19053 lex_goto_eol(p);
19054 token_flush(p);
19055}
19056#endif
19057
19058static enum yytokentype
19059here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
19060{
19061 int c, func, indent = 0;
19062 const char *eos, *ptr, *ptr_end;
19063 long len;
19064 VALUE str = 0;
19065 rb_encoding *enc = p->enc;
19066 rb_encoding *base_enc = 0;
19067 int bol;
19068
19069 eos = RSTRING_PTR(here->lastline) + here->offset;
19070 len = here->length;
19071 indent = (func = here->func) & STR_FUNC_INDENT;
19072
19073 if ((c = nextc(p)) == -1) {
19074 error:
19075#ifdef RIPPER
19076 if (!has_delayed_token(p)) {
19077 dispatch_scan_event(p, tSTRING_CONTENT);
19078 }
19079 else {
19080 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
19081 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
19082 int cr = ENC_CODERANGE_UNKNOWN;
19083 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
19084 if (cr != ENC_CODERANGE_7BIT &&
19085 rb_is_usascii_enc(p->enc) &&
19086 enc != rb_utf8_encoding()) {
19087 enc = rb_ascii8bit_encoding();
19088 }
19089 }
19090 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
19091 }
19092 dispatch_delayed_token(p, tSTRING_CONTENT);
19093 }
19094 lex_goto_eol(p);
19095#endif
19096 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19097 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
19098 (int)len, eos);
19099 token_flush(p);
19100 SET_LEX_STATE(EXPR_END);
19101 return tSTRING_END;
19102 }
19103 bol = was_bol(p);
19104 if (!bol) {
19105 /* not beginning of line, cannot be the terminator */
19106 }
19107 else if (p->heredoc_line_indent == -1) {
19108 /* `heredoc_line_indent == -1` means
19109 * - "after an interpolation in the same line", or
19110 * - "in a continuing line"
19111 */
19112 p->heredoc_line_indent = 0;
19113 }
19114 else if (whole_match_p(p, eos, len, indent)) {
19115 dispatch_heredoc_end(p);
19116 restore:
19117 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19118 token_flush(p);
19119 SET_LEX_STATE(EXPR_END);
19120 return tSTRING_END;
19121 }
19122
19123 if (!(func & STR_FUNC_EXPAND)) {
19124 do {
19125 ptr = RSTRING_PTR(p->lex.lastline);
19126 ptr_end = p->lex.pend;
19127 if (ptr_end > ptr) {
19128 switch (ptr_end[-1]) {
19129 case '\n':
19130 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
19131 ptr_end++;
19132 break;
19133 }
19134 case '\r':
19135 --ptr_end;
19136 }
19137 }
19138
19139 if (p->heredoc_indent > 0) {
19140 long i = 0;
19141 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
19142 i++;
19143 p->heredoc_line_indent = 0;
19144 }
19145
19146 if (str)
19147 rb_str_cat(str, ptr, ptr_end - ptr);
19148 else
19149 str = STR_NEW(ptr, ptr_end - ptr);
19150 if (!lex_eol_ptr_p(p, ptr_end)) rb_str_cat(str, "\n", 1);
19151 lex_goto_eol(p);
19152 if (p->heredoc_indent > 0) {
19153 goto flush_str;
19154 }
19155 if (nextc(p) == -1) {
19156 if (str) {
19157 str = 0;
19158 }
19159 goto error;
19160 }
19161 } while (!whole_match_p(p, eos, len, indent));
19162 }
19163 else {
19164 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
19165 newtok(p);
19166 if (c == '#') {
19167 enum yytokentype t = parser_peek_variable_name(p);
19168 if (p->heredoc_line_indent != -1) {
19169 if (p->heredoc_indent > p->heredoc_line_indent) {
19170 p->heredoc_indent = p->heredoc_line_indent;
19171 }
19172 p->heredoc_line_indent = -1;
19173 }
19174 if (t) return t;
19175 tokadd(p, '#');
19176 c = nextc(p);
19177 }
19178 do {
19179 pushback(p, c);
19180 enc = p->enc;
19181 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
19182 if (p->eofp) goto error;
19183 goto restore;
19184 }
19185 if (c != '\n') {
19186 if (c == '\\') p->heredoc_line_indent = -1;
19187 flush:
19188 str = STR_NEW3(tok(p), toklen(p), enc, func);
19189 flush_str:
19190 set_yylval_str(str);
19191#ifndef RIPPER
19192 if (bol) nd_set_fl_newline(yylval.node);
19193#endif
19194 flush_string_content(p, enc);
19195 return tSTRING_CONTENT;
19196 }
19197 tokadd(p, nextc(p));
19198 if (p->heredoc_indent > 0) {
19199 lex_goto_eol(p);
19200 goto flush;
19201 }
19202 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
19203 if ((c = nextc(p)) == -1) goto error;
19204 } while (!whole_match_p(p, eos, len, indent));
19205 str = STR_NEW3(tok(p), toklen(p), enc, func);
19206 }
19207 dispatch_heredoc_end(p);
19208#ifdef RIPPER
19209 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
19210 yylval.val, str);
19211#endif
19212 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19213 token_flush(p);
19214 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
19215 set_yylval_str(str);
19216#ifndef RIPPER
19217 if (bol) nd_set_fl_newline(yylval.node);
19218#endif
19219 return tSTRING_CONTENT;
19220}
19221
19222#include "lex.c"
19223
19224static int
19225arg_ambiguous(struct parser_params *p, char c)
19226{
19227#ifndef RIPPER
19228 if (c == '/') {
19229 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
19230 }
19231 else {
19232 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
19233 }
19234#else
19235 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
19236#endif
19237 return TRUE;
19238}
19239
19240static ID
19241#ifndef RIPPER
19242formal_argument(struct parser_params *p, ID lhs)
19243#else
19244formal_argument(struct parser_params *p, VALUE lhs)
19245#endif
19246{
19247 ID id = get_id(lhs);
19248
19249 switch (id_type(id)) {
19250 case ID_LOCAL:
19251 break;
19252#ifndef RIPPER
19253# define ERR(mesg) yyerror0(mesg)
19254#else
19255# define ERR(mesg) (dispatch2(param_error, WARN_S(mesg), lhs), ripper_error(p))
19256#endif
19257 case ID_CONST:
19258 ERR("formal argument cannot be a constant");
19259 return 0;
19260 case ID_INSTANCE:
19261 ERR("formal argument cannot be an instance variable");
19262 return 0;
19263 case ID_GLOBAL:
19264 ERR("formal argument cannot be a global variable");
19265 return 0;
19266 case ID_CLASS:
19267 ERR("formal argument cannot be a class variable");
19268 return 0;
19269 default:
19270 ERR("formal argument must be local variable");
19271 return 0;
19272#undef ERR
19273 }
19274 shadowing_lvar(p, id);
19275 return lhs;
19276}
19277
19278static int
19279lvar_defined(struct parser_params *p, ID id)
19280{
19281 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
19282}
19283
19284/* emacsen -*- hack */
19285static long
19286parser_encode_length(struct parser_params *p, const char *name, long len)
19287{
19288 long nlen;
19289
19290 if (len > 5 && name[nlen = len - 5] == '-') {
19291 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
19292 return nlen;
19293 }
19294 if (len > 4 && name[nlen = len - 4] == '-') {
19295 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
19296 return nlen;
19297 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
19298 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
19299 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
19300 return nlen;
19301 }
19302 return len;
19303}
19304
19305static void
19306parser_set_encode(struct parser_params *p, const char *name)
19307{
19308 int idx = rb_enc_find_index(name);
19309 rb_encoding *enc;
19310 VALUE excargs[3];
19311
19312 if (idx < 0) {
19313 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
19314 error:
19315 excargs[0] = rb_eArgError;
19316 excargs[2] = rb_make_backtrace();
19317 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
19318 rb_exc_raise(rb_make_exception(3, excargs));
19319 }
19320 enc = rb_enc_from_index(idx);
19321 if (!rb_enc_asciicompat(enc)) {
19322 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
19323 goto error;
19324 }
19325 p->enc = enc;
19326#ifndef RIPPER
19327 if (p->debug_lines) {
19328 VALUE lines = p->debug_lines;
19329 long i, n = RARRAY_LEN(lines);
19330 for (i = 0; i < n; ++i) {
19331 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
19332 }
19333 }
19334#endif
19335}
19336
19337static int
19338comment_at_top(struct parser_params *p)
19339{
19340 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
19341 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
19342 while (ptr < ptr_end) {
19343 if (!ISSPACE(*ptr)) return 0;
19344 ptr++;
19345 }
19346 return 1;
19347}
19348
19349typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
19350typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
19351
19352static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
19353
19354static void
19355magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
19356{
19357 if (!comment_at_top(p)) {
19358 return;
19359 }
19360 parser_set_encode(p, val);
19361}
19362
19363static int
19364parser_get_bool(struct parser_params *p, const char *name, const char *val)
19365{
19366 switch (*val) {
19367 case 't': case 'T':
19368 if (STRCASECMP(val, "true") == 0) {
19369 return TRUE;
19370 }
19371 break;
19372 case 'f': case 'F':
19373 if (STRCASECMP(val, "false") == 0) {
19374 return FALSE;
19375 }
19376 break;
19377 }
19378 return parser_invalid_pragma_value(p, name, val);
19379}
19380
19381static int
19382parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
19383{
19384 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
19385 return -1;
19386}
19387
19388static void
19389parser_set_token_info(struct parser_params *p, const char *name, const char *val)
19390{
19391 int b = parser_get_bool(p, name, val);
19392 if (b >= 0) p->token_info_enabled = b;
19393}
19394
19395static void
19396parser_set_frozen_string_literal(struct parser_params *p, const char *name, const char *val)
19397{
19398 int b;
19399
19400 if (p->token_seen) {
19401 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
19402 return;
19403 }
19404
19405 b = parser_get_bool(p, name, val);
19406 if (b < 0) return;
19407
19408 p->frozen_string_literal = b;
19409}
19410
19411static void
19412parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
19413{
19414 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
19415 if (*s == ' ' || *s == '\t') continue;
19416 if (*s == '#') break;
19417 rb_warning1("`%s' is ignored unless in comment-only line", WARN_S(name));
19418 return;
19419 }
19420
19421 switch (*val) {
19422 case 'n': case 'N':
19423 if (STRCASECMP(val, "none") == 0) {
19424 p->ctxt.shareable_constant_value = shareable_none;
19425 return;
19426 }
19427 break;
19428 case 'l': case 'L':
19429 if (STRCASECMP(val, "literal") == 0) {
19430 p->ctxt.shareable_constant_value = shareable_literal;
19431 return;
19432 }
19433 break;
19434 case 'e': case 'E':
19435 if (STRCASECMP(val, "experimental_copy") == 0) {
19436 p->ctxt.shareable_constant_value = shareable_copy;
19437 return;
19438 }
19439 if (STRCASECMP(val, "experimental_everything") == 0) {
19440 p->ctxt.shareable_constant_value = shareable_everything;
19441 return;
19442 }
19443 break;
19444 }
19445 parser_invalid_pragma_value(p, name, val);
19446}
19447
19448# if WARN_PAST_SCOPE
19449static void
19450parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
19451{
19452 int b = parser_get_bool(p, name, val);
19453 if (b >= 0) p->past_scope_enabled = b;
19454}
19455# endif
19456
19458 const char *name;
19459 rb_magic_comment_setter_t func;
19460 rb_magic_comment_length_t length;
19461};
19462
19463static const struct magic_comment magic_comments[] = {
19464 {"coding", magic_comment_encoding, parser_encode_length},
19465 {"encoding", magic_comment_encoding, parser_encode_length},
19466 {"frozen_string_literal", parser_set_frozen_string_literal},
19467 {"shareable_constant_value", parser_set_shareable_constant_value},
19468 {"warn_indent", parser_set_token_info},
19469# if WARN_PAST_SCOPE
19470 {"warn_past_scope", parser_set_past_scope},
19471# endif
19472};
19473
19474static const char *
19475magic_comment_marker(const char *str, long len)
19476{
19477 long i = 2;
19478
19479 while (i < len) {
19480 switch (str[i]) {
19481 case '-':
19482 if (str[i-1] == '*' && str[i-2] == '-') {
19483 return str + i + 1;
19484 }
19485 i += 2;
19486 break;
19487 case '*':
19488 if (i + 1 >= len) return 0;
19489 if (str[i+1] != '-') {
19490 i += 4;
19491 }
19492 else if (str[i-1] != '-') {
19493 i += 2;
19494 }
19495 else {
19496 return str + i + 2;
19497 }
19498 break;
19499 default:
19500 i += 3;
19501 break;
19502 }
19503 }
19504 return 0;
19505}
19506
19507static int
19508parser_magic_comment(struct parser_params *p, const char *str, long len)
19509{
19510 int indicator = 0;
19511 VALUE name = 0, val = 0;
19512 const char *beg, *end, *vbeg, *vend;
19513#define str_copy(_s, _p, _n) ((_s) \
19514 ? (void)(rb_str_resize((_s), (_n)), \
19515 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
19516 : (void)((_s) = STR_NEW((_p), (_n))))
19517
19518 if (len <= 7) return FALSE;
19519 if (!!(beg = magic_comment_marker(str, len))) {
19520 if (!(end = magic_comment_marker(beg, str + len - beg)))
19521 return FALSE;
19522 indicator = TRUE;
19523 str = beg;
19524 len = end - beg - 3;
19525 }
19526
19527 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
19528 while (len > 0) {
19529 const struct magic_comment *mc = magic_comments;
19530 char *s;
19531 int i;
19532 long n = 0;
19533
19534 for (; len > 0 && *str; str++, --len) {
19535 switch (*str) {
19536 case '\'': case '"': case ':': case ';':
19537 continue;
19538 }
19539 if (!ISSPACE(*str)) break;
19540 }
19541 for (beg = str; len > 0; str++, --len) {
19542 switch (*str) {
19543 case '\'': case '"': case ':': case ';':
19544 break;
19545 default:
19546 if (ISSPACE(*str)) break;
19547 continue;
19548 }
19549 break;
19550 }
19551 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
19552 if (!len) break;
19553 if (*str != ':') {
19554 if (!indicator) return FALSE;
19555 continue;
19556 }
19557
19558 do str++; while (--len > 0 && ISSPACE(*str));
19559 if (!len) break;
19560 if (*str == '"') {
19561 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
19562 if (*str == '\\') {
19563 --len;
19564 ++str;
19565 }
19566 }
19567 vend = str;
19568 if (len) {
19569 --len;
19570 ++str;
19571 }
19572 }
19573 else {
19574 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
19575 vend = str;
19576 }
19577 if (indicator) {
19578 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
19579 }
19580 else {
19581 while (len > 0 && (ISSPACE(*str))) --len, str++;
19582 if (len) return FALSE;
19583 }
19584
19585 n = end - beg;
19586 str_copy(name, beg, n);
19587 s = RSTRING_PTR(name);
19588 for (i = 0; i < n; ++i) {
19589 if (s[i] == '-') s[i] = '_';
19590 }
19591 do {
19592 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
19593 n = vend - vbeg;
19594 if (mc->length) {
19595 n = (*mc->length)(p, vbeg, n);
19596 }
19597 str_copy(val, vbeg, n);
19598 (*mc->func)(p, mc->name, RSTRING_PTR(val));
19599 break;
19600 }
19601 } while (++mc < magic_comments + numberof(magic_comments));
19602#ifdef RIPPER
19603 str_copy(val, vbeg, vend - vbeg);
19604 dispatch2(magic_comment, name, val);
19605#endif
19606 }
19607
19608 return TRUE;
19609}
19610
19611static void
19612set_file_encoding(struct parser_params *p, const char *str, const char *send)
19613{
19614 int sep = 0;
19615 const char *beg = str;
19616 VALUE s;
19617
19618 for (;;) {
19619 if (send - str <= 6) return;
19620 switch (str[6]) {
19621 case 'C': case 'c': str += 6; continue;
19622 case 'O': case 'o': str += 5; continue;
19623 case 'D': case 'd': str += 4; continue;
19624 case 'I': case 'i': str += 3; continue;
19625 case 'N': case 'n': str += 2; continue;
19626 case 'G': case 'g': str += 1; continue;
19627 case '=': case ':':
19628 sep = 1;
19629 str += 6;
19630 break;
19631 default:
19632 str += 6;
19633 if (ISSPACE(*str)) break;
19634 continue;
19635 }
19636 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
19637 sep = 0;
19638 }
19639 for (;;) {
19640 do {
19641 if (++str >= send) return;
19642 } while (ISSPACE(*str));
19643 if (sep) break;
19644 if (*str != '=' && *str != ':') return;
19645 sep = 1;
19646 str++;
19647 }
19648 beg = str;
19649 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
19650 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
19651 parser_set_encode(p, RSTRING_PTR(s));
19652 rb_str_resize(s, 0);
19653}
19654
19655static void
19656parser_prepare(struct parser_params *p)
19657{
19658 int c = nextc0(p, FALSE);
19659 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
19660 switch (c) {
19661 case '#':
19662 if (peek(p, '!')) p->has_shebang = 1;
19663 break;
19664 case 0xef: /* UTF-8 BOM marker */
19665 if (!lex_eol_n_p(p, 2) &&
19666 (unsigned char)p->lex.pcur[0] == 0xbb &&
19667 (unsigned char)p->lex.pcur[1] == 0xbf) {
19668 p->enc = rb_utf8_encoding();
19669 p->lex.pcur += 2;
19670#ifndef RIPPER
19671 if (p->debug_lines) {
19672 rb_enc_associate(p->lex.lastline, p->enc);
19673 }
19674#endif
19675 p->lex.pbeg = p->lex.pcur;
19676 token_flush(p);
19677 return;
19678 }
19679 break;
19680 case EOF:
19681 return;
19682 }
19683 pushback(p, c);
19684 p->enc = rb_enc_get(p->lex.lastline);
19685}
19686
19687#ifndef RIPPER
19688#define ambiguous_operator(tok, op, syn) ( \
19689 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
19690 rb_warning0("even though it seems like "syn""))
19691#else
19692#define ambiguous_operator(tok, op, syn) \
19693 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
19694#endif
19695#define warn_balanced(tok, op, syn) ((void) \
19696 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
19697 space_seen && !ISSPACE(c) && \
19698 (ambiguous_operator(tok, op, syn), 0)), \
19699 (enum yytokentype)(tok))
19700
19701static VALUE
19702parse_rational(struct parser_params *p, char *str, int len, int seen_point)
19703{
19704 VALUE v;
19705 char *point = &str[seen_point];
19706 size_t fraclen = len-seen_point-1;
19707 memmove(point, point+1, fraclen+1);
19708 v = rb_cstr_to_inum(str, 10, FALSE);
19709 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
19710}
19711
19712static enum yytokentype
19713no_digits(struct parser_params *p)
19714{
19715 yyerror0("numeric literal without digits");
19716 if (peek(p, '_')) nextc(p);
19717 /* dummy 0, for tUMINUS_NUM at numeric */
19718 return set_integer_literal(p, INT2FIX(0), 0);
19719}
19720
19721static enum yytokentype
19722parse_numeric(struct parser_params *p, int c)
19723{
19724 int is_float, seen_point, seen_e, nondigit;
19725 int suffix;
19726
19727 is_float = seen_point = seen_e = nondigit = 0;
19728 SET_LEX_STATE(EXPR_END);
19729 newtok(p);
19730 if (c == '-' || c == '+') {
19731 tokadd(p, c);
19732 c = nextc(p);
19733 }
19734 if (c == '0') {
19735 int start = toklen(p);
19736 c = nextc(p);
19737 if (c == 'x' || c == 'X') {
19738 /* hexadecimal */
19739 c = nextc(p);
19740 if (c != -1 && ISXDIGIT(c)) {
19741 do {
19742 if (c == '_') {
19743 if (nondigit) break;
19744 nondigit = c;
19745 continue;
19746 }
19747 if (!ISXDIGIT(c)) break;
19748 nondigit = 0;
19749 tokadd(p, c);
19750 } while ((c = nextc(p)) != -1);
19751 }
19752 pushback(p, c);
19753 tokfix(p);
19754 if (toklen(p) == start) {
19755 return no_digits(p);
19756 }
19757 else if (nondigit) goto trailing_uc;
19758 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19759 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
19760 }
19761 if (c == 'b' || c == 'B') {
19762 /* binary */
19763 c = nextc(p);
19764 if (c == '0' || c == '1') {
19765 do {
19766 if (c == '_') {
19767 if (nondigit) break;
19768 nondigit = c;
19769 continue;
19770 }
19771 if (c != '0' && c != '1') break;
19772 nondigit = 0;
19773 tokadd(p, c);
19774 } while ((c = nextc(p)) != -1);
19775 }
19776 pushback(p, c);
19777 tokfix(p);
19778 if (toklen(p) == start) {
19779 return no_digits(p);
19780 }
19781 else if (nondigit) goto trailing_uc;
19782 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19783 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
19784 }
19785 if (c == 'd' || c == 'D') {
19786 /* decimal */
19787 c = nextc(p);
19788 if (c != -1 && ISDIGIT(c)) {
19789 do {
19790 if (c == '_') {
19791 if (nondigit) break;
19792 nondigit = c;
19793 continue;
19794 }
19795 if (!ISDIGIT(c)) break;
19796 nondigit = 0;
19797 tokadd(p, c);
19798 } while ((c = nextc(p)) != -1);
19799 }
19800 pushback(p, c);
19801 tokfix(p);
19802 if (toklen(p) == start) {
19803 return no_digits(p);
19804 }
19805 else if (nondigit) goto trailing_uc;
19806 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19807 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
19808 }
19809 if (c == '_') {
19810 /* 0_0 */
19811 goto octal_number;
19812 }
19813 if (c == 'o' || c == 'O') {
19814 /* prefixed octal */
19815 c = nextc(p);
19816 if (c == -1 || c == '_' || !ISDIGIT(c)) {
19817 return no_digits(p);
19818 }
19819 }
19820 if (c >= '0' && c <= '7') {
19821 /* octal */
19822 octal_number:
19823 do {
19824 if (c == '_') {
19825 if (nondigit) break;
19826 nondigit = c;
19827 continue;
19828 }
19829 if (c < '0' || c > '9') break;
19830 if (c > '7') goto invalid_octal;
19831 nondigit = 0;
19832 tokadd(p, c);
19833 } while ((c = nextc(p)) != -1);
19834 if (toklen(p) > start) {
19835 pushback(p, c);
19836 tokfix(p);
19837 if (nondigit) goto trailing_uc;
19838 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19839 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
19840 }
19841 if (nondigit) {
19842 pushback(p, c);
19843 goto trailing_uc;
19844 }
19845 }
19846 if (c > '7' && c <= '9') {
19847 invalid_octal:
19848 yyerror0("Invalid octal digit");
19849 }
19850 else if (c == '.' || c == 'e' || c == 'E') {
19851 tokadd(p, '0');
19852 }
19853 else {
19854 pushback(p, c);
19855 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19856 return set_integer_literal(p, INT2FIX(0), suffix);
19857 }
19858 }
19859
19860 for (;;) {
19861 switch (c) {
19862 case '0': case '1': case '2': case '3': case '4':
19863 case '5': case '6': case '7': case '8': case '9':
19864 nondigit = 0;
19865 tokadd(p, c);
19866 break;
19867
19868 case '.':
19869 if (nondigit) goto trailing_uc;
19870 if (seen_point || seen_e) {
19871 goto decode_num;
19872 }
19873 else {
19874 int c0 = nextc(p);
19875 if (c0 == -1 || !ISDIGIT(c0)) {
19876 pushback(p, c0);
19877 goto decode_num;
19878 }
19879 c = c0;
19880 }
19881 seen_point = toklen(p);
19882 tokadd(p, '.');
19883 tokadd(p, c);
19884 is_float++;
19885 nondigit = 0;
19886 break;
19887
19888 case 'e':
19889 case 'E':
19890 if (nondigit) {
19891 pushback(p, c);
19892 c = nondigit;
19893 goto decode_num;
19894 }
19895 if (seen_e) {
19896 goto decode_num;
19897 }
19898 nondigit = c;
19899 c = nextc(p);
19900 if (c != '-' && c != '+' && !ISDIGIT(c)) {
19901 pushback(p, c);
19902 c = nondigit;
19903 nondigit = 0;
19904 goto decode_num;
19905 }
19906 tokadd(p, nondigit);
19907 seen_e++;
19908 is_float++;
19909 tokadd(p, c);
19910 nondigit = (c == '-' || c == '+') ? c : 0;
19911 break;
19912
19913 case '_': /* `_' in number just ignored */
19914 if (nondigit) goto decode_num;
19915 nondigit = c;
19916 break;
19917
19918 default:
19919 goto decode_num;
19920 }
19921 c = nextc(p);
19922 }
19923
19924 decode_num:
19925 pushback(p, c);
19926 if (nondigit) {
19927 trailing_uc:
19928 literal_flush(p, p->lex.pcur - 1);
19929 YYLTYPE loc = RUBY_INIT_YYLLOC();
19930 compile_error(p, "trailing `%c' in number", nondigit);
19931 parser_show_error_line(p, &loc);
19932 }
19933 tokfix(p);
19934 if (is_float) {
19935 enum yytokentype type = tFLOAT;
19936 VALUE v;
19937
19938 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
19939 if (suffix & NUM_SUFFIX_R) {
19940 type = tRATIONAL;
19941 v = parse_rational(p, tok(p), toklen(p), seen_point);
19942 }
19943 else {
19944 double d = strtod(tok(p), 0);
19945 if (errno == ERANGE) {
19946 rb_warning1("Float %s out of range", WARN_S(tok(p)));
19947 errno = 0;
19948 }
19949 v = DBL2NUM(d);
19950 }
19951 return set_number_literal(p, v, type, suffix);
19952 }
19953 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19954 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
19955}
19956
19957static enum yytokentype
19958parse_qmark(struct parser_params *p, int space_seen)
19959{
19960 rb_encoding *enc;
19961 register int c;
19962 VALUE lit;
19963
19964 if (IS_END()) {
19965 SET_LEX_STATE(EXPR_VALUE);
19966 return '?';
19967 }
19968 c = nextc(p);
19969 if (c == -1) {
19970 compile_error(p, "incomplete character syntax");
19971 return 0;
19972 }
19973 if (rb_enc_isspace(c, p->enc)) {
19974 if (!IS_ARG()) {
19975 int c2 = escaped_control_code(c);
19976 if (c2) {
19977 WARN_SPACE_CHAR(c2, "?");
19978 }
19979 }
19980 ternary:
19981 pushback(p, c);
19982 SET_LEX_STATE(EXPR_VALUE);
19983 return '?';
19984 }
19985 newtok(p);
19986 enc = p->enc;
19987 if (!parser_isascii(p)) {
19988 if (tokadd_mbchar(p, c) == -1) return 0;
19989 }
19990 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
19991 !lex_eol_p(p) && is_identchar(p, p->lex.pcur, p->lex.pend, p->enc)) {
19992 if (space_seen) {
19993 const char *start = p->lex.pcur - 1, *ptr = start;
19994 do {
19995 int n = parser_precise_mbclen(p, ptr);
19996 if (n < 0) return -1;
19997 ptr += n;
19998 } while (!lex_eol_ptr_p(p, ptr) && is_identchar(p, ptr, p->lex.pend, p->enc));
19999 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
20000 " a conditional operator, put a space after `?'",
20001 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
20002 }
20003 goto ternary;
20004 }
20005 else if (c == '\\') {
20006 if (peek(p, 'u')) {
20007 nextc(p);
20008 enc = rb_utf8_encoding();
20009 tokadd_utf8(p, &enc, -1, 0, 0);
20010 }
20011 else if (!ISASCII(c = peekc(p))) {
20012 nextc(p);
20013 if (tokadd_mbchar(p, c) == -1) return 0;
20014 }
20015 else {
20016 c = read_escape(p, 0);
20017 tokadd(p, c);
20018 }
20019 }
20020 else {
20021 tokadd(p, c);
20022 }
20023 tokfix(p);
20024 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
20025 set_yylval_str(lit);
20026 SET_LEX_STATE(EXPR_END);
20027 return tCHAR;
20028}
20029
20030static enum yytokentype
20031parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
20032{
20033 register int c;
20034 const char *ptok = p->lex.pcur;
20035
20036 if (IS_BEG()) {
20037 int term;
20038 int paren;
20039
20040 c = nextc(p);
20041 quotation:
20042 if (c == -1) goto unterminated;
20043 if (!ISALNUM(c)) {
20044 term = c;
20045 if (!ISASCII(c)) goto unknown;
20046 c = 'Q';
20047 }
20048 else {
20049 term = nextc(p);
20050 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
20051 unknown:
20052 pushback(p, term);
20053 c = parser_precise_mbclen(p, p->lex.pcur);
20054 if (c < 0) return 0;
20055 p->lex.pcur += c;
20056 yyerror0("unknown type of %string");
20057 return 0;
20058 }
20059 }
20060 if (term == -1) {
20061 unterminated:
20062 compile_error(p, "unterminated quoted string meets end of file");
20063 return 0;
20064 }
20065 paren = term;
20066 if (term == '(') term = ')';
20067 else if (term == '[') term = ']';
20068 else if (term == '{') term = '}';
20069 else if (term == '<') term = '>';
20070 else paren = 0;
20071
20072 p->lex.ptok = ptok-1;
20073 switch (c) {
20074 case 'Q':
20075 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
20076 return tSTRING_BEG;
20077
20078 case 'q':
20079 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
20080 return tSTRING_BEG;
20081
20082 case 'W':
20083 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20084 return tWORDS_BEG;
20085
20086 case 'w':
20087 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20088 return tQWORDS_BEG;
20089
20090 case 'I':
20091 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20092 return tSYMBOLS_BEG;
20093
20094 case 'i':
20095 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20096 return tQSYMBOLS_BEG;
20097
20098 case 'x':
20099 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
20100 return tXSTRING_BEG;
20101
20102 case 'r':
20103 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
20104 return tREGEXP_BEG;
20105
20106 case 's':
20107 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
20108 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
20109 return tSYMBEG;
20110
20111 default:
20112 yyerror0("unknown type of %string");
20113 return 0;
20114 }
20115 }
20116 if ((c = nextc(p)) == '=') {
20117 set_yylval_id('%');
20118 SET_LEX_STATE(EXPR_BEG);
20119 return tOP_ASGN;
20120 }
20121 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
20122 goto quotation;
20123 }
20124 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20125 pushback(p, c);
20126 return warn_balanced('%', "%%", "string literal");
20127}
20128
20129static int
20130tokadd_ident(struct parser_params *p, int c)
20131{
20132 do {
20133 if (tokadd_mbchar(p, c) == -1) return -1;
20134 c = nextc(p);
20135 } while (parser_is_identchar(p));
20136 pushback(p, c);
20137 return 0;
20138}
20139
20140static ID
20141tokenize_ident(struct parser_params *p)
20142{
20143 ID ident = TOK_INTERN();
20144
20145 set_yylval_name(ident);
20146
20147 return ident;
20148}
20149
20150static int
20151parse_numvar(struct parser_params *p)
20152{
20153 size_t len;
20154 int overflow;
20155 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
20156 const unsigned long nth_ref_max =
20158 /* NTH_REF is left-shifted to be ORed with back-ref flag and
20159 * turned into a Fixnum, in compile.c */
20160
20161 if (overflow || n > nth_ref_max) {
20162 /* compile_error()? */
20163 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
20164 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
20165 }
20166 else {
20167 return (int)n;
20168 }
20169}
20170
20171static enum yytokentype
20172parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
20173{
20174 const char *ptr = p->lex.pcur;
20175 register int c;
20176
20177 SET_LEX_STATE(EXPR_END);
20178 p->lex.ptok = ptr - 1; /* from '$' */
20179 newtok(p);
20180 c = nextc(p);
20181 switch (c) {
20182 case '_': /* $_: last read line string */
20183 c = nextc(p);
20184 if (parser_is_identchar(p)) {
20185 tokadd(p, '$');
20186 tokadd(p, '_');
20187 break;
20188 }
20189 pushback(p, c);
20190 c = '_';
20191 /* fall through */
20192 case '~': /* $~: match-data */
20193 case '*': /* $*: argv */
20194 case '$': /* $$: pid */
20195 case '?': /* $?: last status */
20196 case '!': /* $!: error string */
20197 case '@': /* $@: error position */
20198 case '/': /* $/: input record separator */
20199 case '\\': /* $\: output record separator */
20200 case ';': /* $;: field separator */
20201 case ',': /* $,: output field separator */
20202 case '.': /* $.: last read line number */
20203 case '=': /* $=: ignorecase */
20204 case ':': /* $:: load path */
20205 case '<': /* $<: reading filename */
20206 case '>': /* $>: default output handle */
20207 case '\"': /* $": already loaded files */
20208 tokadd(p, '$');
20209 tokadd(p, c);
20210 goto gvar;
20211
20212 case '-':
20213 tokadd(p, '$');
20214 tokadd(p, c);
20215 c = nextc(p);
20216 if (parser_is_identchar(p)) {
20217 if (tokadd_mbchar(p, c) == -1) return 0;
20218 }
20219 else {
20220 pushback(p, c);
20221 pushback(p, '-');
20222 return '$';
20223 }
20224 gvar:
20225 set_yylval_name(TOK_INTERN());
20226 return tGVAR;
20227
20228 case '&': /* $&: last match */
20229 case '`': /* $`: string before last match */
20230 case '\'': /* $': string after last match */
20231 case '+': /* $+: string matches last paren. */
20232 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
20233 tokadd(p, '$');
20234 tokadd(p, c);
20235 goto gvar;
20236 }
20237 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
20238 return tBACK_REF;
20239
20240 case '1': case '2': case '3':
20241 case '4': case '5': case '6':
20242 case '7': case '8': case '9':
20243 tokadd(p, '$');
20244 do {
20245 tokadd(p, c);
20246 c = nextc(p);
20247 } while (c != -1 && ISDIGIT(c));
20248 pushback(p, c);
20249 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
20250 tokfix(p);
20251 c = parse_numvar(p);
20252 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
20253 return tNTH_REF;
20254
20255 default:
20256 if (!parser_is_identchar(p)) {
20257 YYLTYPE loc = RUBY_INIT_YYLLOC();
20258 if (c == -1 || ISSPACE(c)) {
20259 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
20260 }
20261 else {
20262 pushback(p, c);
20263 compile_error(p, "`$%c' is not allowed as a global variable name", c);
20264 }
20265 parser_show_error_line(p, &loc);
20266 set_yylval_noname();
20267 return tGVAR;
20268 }
20269 /* fall through */
20270 case '0':
20271 tokadd(p, '$');
20272 }
20273
20274 if (tokadd_ident(p, c)) return 0;
20275 SET_LEX_STATE(EXPR_END);
20276 if (VALID_SYMNAME_P(tok(p), toklen(p), p->enc, ID_GLOBAL)) {
20277 tokenize_ident(p);
20278 }
20279 else {
20280 compile_error(p, "`%.*s' is not allowed as a global variable name", toklen(p), tok(p));
20281 set_yylval_noname();
20282 }
20283 return tGVAR;
20284}
20285
20286#ifndef RIPPER
20287static bool
20288parser_numbered_param(struct parser_params *p, int n)
20289{
20290 if (n < 0) return false;
20291
20292 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
20293 return false;
20294 }
20295 if (p->max_numparam == ORDINAL_PARAM) {
20296 compile_error(p, "ordinary parameter is defined");
20297 return false;
20298 }
20299 struct vtable *args = p->lvtbl->args;
20300 if (p->max_numparam < n) {
20301 p->max_numparam = n;
20302 }
20303 while (n > args->pos) {
20304 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
20305 }
20306 return true;
20307}
20308#endif
20309
20310static enum yytokentype
20311parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
20312{
20313 const char *ptr = p->lex.pcur;
20314 enum yytokentype result = tIVAR;
20315 register int c = nextc(p);
20316 YYLTYPE loc;
20317
20318 p->lex.ptok = ptr - 1; /* from '@' */
20319 newtok(p);
20320 tokadd(p, '@');
20321 if (c == '@') {
20322 result = tCVAR;
20323 tokadd(p, '@');
20324 c = nextc(p);
20325 }
20326 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
20327 if (c == -1 || !parser_is_identchar(p)) {
20328 pushback(p, c);
20329 RUBY_SET_YYLLOC(loc);
20330 if (result == tIVAR) {
20331 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
20332 }
20333 else {
20334 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
20335 }
20336 parser_show_error_line(p, &loc);
20337 set_yylval_noname();
20338 SET_LEX_STATE(EXPR_END);
20339 return result;
20340 }
20341 else if (ISDIGIT(c)) {
20342 pushback(p, c);
20343 RUBY_SET_YYLLOC(loc);
20344 if (result == tIVAR) {
20345 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
20346 }
20347 else {
20348 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
20349 }
20350 parser_show_error_line(p, &loc);
20351 set_yylval_noname();
20352 SET_LEX_STATE(EXPR_END);
20353 return result;
20354 }
20355
20356 if (tokadd_ident(p, c)) return 0;
20357 tokenize_ident(p);
20358 return result;
20359}
20360
20361static enum yytokentype
20362parse_ident(struct parser_params *p, int c, int cmd_state)
20363{
20364 enum yytokentype result;
20365 int mb = ENC_CODERANGE_7BIT;
20366 const enum lex_state_e last_state = p->lex.state;
20367 ID ident;
20368 int enforce_keyword_end = 0;
20369
20370 do {
20371 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
20372 if (tokadd_mbchar(p, c) == -1) return 0;
20373 c = nextc(p);
20374 } while (parser_is_identchar(p));
20375 if ((c == '!' || c == '?') && !peek(p, '=')) {
20376 result = tFID;
20377 tokadd(p, c);
20378 }
20379 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
20380 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
20381 result = tIDENTIFIER;
20382 tokadd(p, c);
20383 }
20384 else {
20385 result = tCONSTANT; /* assume provisionally */
20386 pushback(p, c);
20387 }
20388 tokfix(p);
20389
20390 if (IS_LABEL_POSSIBLE()) {
20391 if (IS_LABEL_SUFFIX(0)) {
20392 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
20393 nextc(p);
20394 set_yylval_name(TOK_INTERN());
20395 return tLABEL;
20396 }
20397 }
20398
20399#ifndef RIPPER
20400 if (!NIL_P(peek_end_expect_token_locations(p))) {
20401 VALUE end_loc;
20402 int lineno, column;
20403 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
20404
20405 end_loc = peek_end_expect_token_locations(p);
20406 lineno = NUM2INT(rb_ary_entry(end_loc, 0));
20407 column = NUM2INT(rb_ary_entry(end_loc, 1));
20408
20409 if (p->debug) {
20410 rb_parser_printf(p, "enforce_keyword_end check. current: (%d, %d), peek: (%d, %d)\n",
20411 p->ruby_sourceline, beg_pos, lineno, column);
20412 }
20413
20414 if ((p->ruby_sourceline > lineno) && (beg_pos <= column)) {
20415 const struct kwtable *kw;
20416
20417 if ((IS_lex_state(EXPR_DOT)) && (kw = rb_reserved_word(tok(p), toklen(p))) && (kw && kw->id[0] == keyword_end)) {
20418 if (p->debug) rb_parser_printf(p, "enforce_keyword_end is enabled\n");
20419 enforce_keyword_end = 1;
20420 }
20421 }
20422 }
20423#endif
20424
20425 if (mb == ENC_CODERANGE_7BIT && (!IS_lex_state(EXPR_DOT) || enforce_keyword_end)) {
20426 const struct kwtable *kw;
20427
20428 /* See if it is a reserved word. */
20429 kw = rb_reserved_word(tok(p), toklen(p));
20430 if (kw) {
20431 enum lex_state_e state = p->lex.state;
20432 if (IS_lex_state_for(state, EXPR_FNAME)) {
20433 SET_LEX_STATE(EXPR_ENDFN);
20434 set_yylval_name(rb_intern2(tok(p), toklen(p)));
20435 return kw->id[0];
20436 }
20437 SET_LEX_STATE(kw->state);
20438 if (IS_lex_state(EXPR_BEG)) {
20439 p->command_start = TRUE;
20440 }
20441 if (kw->id[0] == keyword_do) {
20442 if (lambda_beginning_p()) {
20443 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
20444 return keyword_do_LAMBDA;
20445 }
20446 if (COND_P()) return keyword_do_cond;
20447 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
20448 return keyword_do_block;
20449 return keyword_do;
20450 }
20451 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED | EXPR_CLASS)))
20452 return kw->id[0];
20453 else {
20454 if (kw->id[0] != kw->id[1])
20455 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
20456 return kw->id[1];
20457 }
20458 }
20459 }
20460
20461 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
20462 if (cmd_state) {
20463 SET_LEX_STATE(EXPR_CMDARG);
20464 }
20465 else {
20466 SET_LEX_STATE(EXPR_ARG);
20467 }
20468 }
20469 else if (p->lex.state == EXPR_FNAME) {
20470 SET_LEX_STATE(EXPR_ENDFN);
20471 }
20472 else {
20473 SET_LEX_STATE(EXPR_END);
20474 }
20475
20476 ident = tokenize_ident(p);
20477 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
20478 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
20479 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
20480 (lvar_defined(p, ident) || NUMPARAM_ID_P(ident))) {
20481 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
20482 }
20483 return result;
20484}
20485
20486static void
20487warn_cr(struct parser_params *p)
20488{
20489 if (!p->cr_seen) {
20490 p->cr_seen = TRUE;
20491 /* carried over with p->lex.nextline for nextc() */
20492 rb_warn0("encountered \\r in middle of line, treated as a mere space");
20493 }
20494}
20495
20496static enum yytokentype
20497parser_yylex(struct parser_params *p)
20498{
20499 register int c;
20500 int space_seen = 0;
20501 int cmd_state;
20502 int label;
20503 enum lex_state_e last_state;
20504 int fallthru = FALSE;
20505 int token_seen = p->token_seen;
20506
20507 if (p->lex.strterm) {
20508 if (strterm_is_heredoc(p->lex.strterm)) {
20509 token_flush(p);
20510 return here_document(p, &p->lex.strterm->u.heredoc);
20511 }
20512 else {
20513 token_flush(p);
20514 return parse_string(p, &p->lex.strterm->u.literal);
20515 }
20516 }
20517 cmd_state = p->command_start;
20518 p->command_start = FALSE;
20519 p->token_seen = TRUE;
20520#ifndef RIPPER
20521 token_flush(p);
20522#endif
20523 retry:
20524 last_state = p->lex.state;
20525 switch (c = nextc(p)) {
20526 case '\0': /* NUL */
20527 case '\004': /* ^D */
20528 case '\032': /* ^Z */
20529 case -1: /* end of script. */
20530 p->eofp = 1;
20531#ifndef RIPPER
20532 if (!NIL_P(p->end_expect_token_locations) && RARRAY_LEN(p->end_expect_token_locations) > 0) {
20533 pop_end_expect_token_locations(p);
20534 RUBY_SET_YYLLOC_OF_DUMMY_END(*p->yylloc);
20535 return tDUMNY_END;
20536 }
20537#endif
20538 /* Set location for end-of-input because dispatch_scan_event is not called. */
20539 RUBY_SET_YYLLOC(*p->yylloc);
20540 return END_OF_INPUT;
20541
20542 /* white spaces */
20543 case '\r':
20544 warn_cr(p);
20545 /* fall through */
20546 case ' ': case '\t': case '\f':
20547 case '\13': /* '\v' */
20548 space_seen = 1;
20549 while ((c = nextc(p))) {
20550 switch (c) {
20551 case '\r':
20552 warn_cr(p);
20553 /* fall through */
20554 case ' ': case '\t': case '\f':
20555 case '\13': /* '\v' */
20556 break;
20557 default:
20558 goto outofloop;
20559 }
20560 }
20561 outofloop:
20562 pushback(p, c);
20563 dispatch_scan_event(p, tSP);
20564#ifndef RIPPER
20565 token_flush(p);
20566#endif
20567 goto retry;
20568
20569 case '#': /* it's a comment */
20570 p->token_seen = token_seen;
20571 /* no magic_comment in shebang line */
20572 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
20573 if (comment_at_top(p)) {
20574 set_file_encoding(p, p->lex.pcur, p->lex.pend);
20575 }
20576 }
20577 lex_goto_eol(p);
20578 dispatch_scan_event(p, tCOMMENT);
20579 fallthru = TRUE;
20580 /* fall through */
20581 case '\n':
20582 p->token_seen = token_seen;
20583 VALUE prevline = p->lex.lastline;
20584 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
20585 !IS_lex_state(EXPR_LABELED));
20586 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
20587 if (!fallthru) {
20588 dispatch_scan_event(p, tIGNORED_NL);
20589 }
20590 fallthru = FALSE;
20591 if (!c && p->ctxt.in_kwarg) {
20592 goto normal_newline;
20593 }
20594 goto retry;
20595 }
20596 while (1) {
20597 switch (c = nextc(p)) {
20598 case ' ': case '\t': case '\f': case '\r':
20599 case '\13': /* '\v' */
20600 space_seen = 1;
20601 break;
20602 case '#':
20603 pushback(p, c);
20604 if (space_seen) {
20605 dispatch_scan_event(p, tSP);
20606 token_flush(p);
20607 }
20608 goto retry;
20609 case '&':
20610 case '.': {
20611 dispatch_delayed_token(p, tIGNORED_NL);
20612 if (peek(p, '.') == (c == '&')) {
20613 pushback(p, c);
20614 dispatch_scan_event(p, tSP);
20615 goto retry;
20616 }
20617 }
20618 default:
20619 p->ruby_sourceline--;
20620 p->lex.nextline = p->lex.lastline;
20621 set_lastline(p, prevline);
20622 case -1: /* EOF no decrement*/
20623 lex_goto_eol(p);
20624 if (c != -1) {
20625 token_flush(p);
20626 RUBY_SET_YYLLOC(*p->yylloc);
20627 }
20628 goto normal_newline;
20629 }
20630 }
20631 normal_newline:
20632 p->command_start = TRUE;
20633 SET_LEX_STATE(EXPR_BEG);
20634 return '\n';
20635
20636 case '*':
20637 if ((c = nextc(p)) == '*') {
20638 if ((c = nextc(p)) == '=') {
20639 set_yylval_id(idPow);
20640 SET_LEX_STATE(EXPR_BEG);
20641 return tOP_ASGN;
20642 }
20643 pushback(p, c);
20644 if (IS_SPCARG(c)) {
20645 rb_warning0("`**' interpreted as argument prefix");
20646 c = tDSTAR;
20647 }
20648 else if (IS_BEG()) {
20649 c = tDSTAR;
20650 }
20651 else {
20652 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
20653 }
20654 }
20655 else {
20656 if (c == '=') {
20657 set_yylval_id('*');
20658 SET_LEX_STATE(EXPR_BEG);
20659 return tOP_ASGN;
20660 }
20661 pushback(p, c);
20662 if (IS_SPCARG(c)) {
20663 rb_warning0("`*' interpreted as argument prefix");
20664 c = tSTAR;
20665 }
20666 else if (IS_BEG()) {
20667 c = tSTAR;
20668 }
20669 else {
20670 c = warn_balanced('*', "*", "argument prefix");
20671 }
20672 }
20673 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20674 return c;
20675
20676 case '!':
20677 c = nextc(p);
20678 if (IS_AFTER_OPERATOR()) {
20679 SET_LEX_STATE(EXPR_ARG);
20680 if (c == '@') {
20681 return '!';
20682 }
20683 }
20684 else {
20685 SET_LEX_STATE(EXPR_BEG);
20686 }
20687 if (c == '=') {
20688 return tNEQ;
20689 }
20690 if (c == '~') {
20691 return tNMATCH;
20692 }
20693 pushback(p, c);
20694 return '!';
20695
20696 case '=':
20697 if (was_bol(p)) {
20698 /* skip embedded rd document */
20699 if (word_match_p(p, "begin", 5)) {
20700 int first_p = TRUE;
20701
20702 lex_goto_eol(p);
20703 dispatch_scan_event(p, tEMBDOC_BEG);
20704 for (;;) {
20705 lex_goto_eol(p);
20706 if (!first_p) {
20707 dispatch_scan_event(p, tEMBDOC);
20708 }
20709 first_p = FALSE;
20710 c = nextc(p);
20711 if (c == -1) {
20712 compile_error(p, "embedded document meets end of file");
20713 return END_OF_INPUT;
20714 }
20715 if (c == '=' && word_match_p(p, "end", 3)) {
20716 break;
20717 }
20718 pushback(p, c);
20719 }
20720 lex_goto_eol(p);
20721 dispatch_scan_event(p, tEMBDOC_END);
20722 goto retry;
20723 }
20724 }
20725
20726 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20727 if ((c = nextc(p)) == '=') {
20728 if ((c = nextc(p)) == '=') {
20729 return tEQQ;
20730 }
20731 pushback(p, c);
20732 return tEQ;
20733 }
20734 if (c == '~') {
20735 return tMATCH;
20736 }
20737 else if (c == '>') {
20738 return tASSOC;
20739 }
20740 pushback(p, c);
20741 return '=';
20742
20743 case '<':
20744 c = nextc(p);
20745 if (c == '<' &&
20746 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
20747 !IS_END() &&
20748 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
20749 enum yytokentype token = heredoc_identifier(p);
20750 if (token) return token < 0 ? 0 : token;
20751 }
20752 if (IS_AFTER_OPERATOR()) {
20753 SET_LEX_STATE(EXPR_ARG);
20754 }
20755 else {
20756 if (IS_lex_state(EXPR_CLASS))
20757 p->command_start = TRUE;
20758 SET_LEX_STATE(EXPR_BEG);
20759 }
20760 if (c == '=') {
20761 if ((c = nextc(p)) == '>') {
20762 return tCMP;
20763 }
20764 pushback(p, c);
20765 return tLEQ;
20766 }
20767 if (c == '<') {
20768 if ((c = nextc(p)) == '=') {
20769 set_yylval_id(idLTLT);
20770 SET_LEX_STATE(EXPR_BEG);
20771 return tOP_ASGN;
20772 }
20773 pushback(p, c);
20774 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
20775 }
20776 pushback(p, c);
20777 return '<';
20778
20779 case '>':
20780 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20781 if ((c = nextc(p)) == '=') {
20782 return tGEQ;
20783 }
20784 if (c == '>') {
20785 if ((c = nextc(p)) == '=') {
20786 set_yylval_id(idGTGT);
20787 SET_LEX_STATE(EXPR_BEG);
20788 return tOP_ASGN;
20789 }
20790 pushback(p, c);
20791 return tRSHFT;
20792 }
20793 pushback(p, c);
20794 return '>';
20795
20796 case '"':
20797 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
20798 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
20799 p->lex.ptok = p->lex.pcur-1;
20800 return tSTRING_BEG;
20801
20802 case '`':
20803 if (IS_lex_state(EXPR_FNAME)) {
20804 SET_LEX_STATE(EXPR_ENDFN);
20805 return c;
20806 }
20807 if (IS_lex_state(EXPR_DOT)) {
20808 if (cmd_state)
20809 SET_LEX_STATE(EXPR_CMDARG);
20810 else
20811 SET_LEX_STATE(EXPR_ARG);
20812 return c;
20813 }
20814 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
20815 return tXSTRING_BEG;
20816
20817 case '\'':
20818 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
20819 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
20820 p->lex.ptok = p->lex.pcur-1;
20821 return tSTRING_BEG;
20822
20823 case '?':
20824 return parse_qmark(p, space_seen);
20825
20826 case '&':
20827 if ((c = nextc(p)) == '&') {
20828 SET_LEX_STATE(EXPR_BEG);
20829 if ((c = nextc(p)) == '=') {
20830 set_yylval_id(idANDOP);
20831 SET_LEX_STATE(EXPR_BEG);
20832 return tOP_ASGN;
20833 }
20834 pushback(p, c);
20835 return tANDOP;
20836 }
20837 else if (c == '=') {
20838 set_yylval_id('&');
20839 SET_LEX_STATE(EXPR_BEG);
20840 return tOP_ASGN;
20841 }
20842 else if (c == '.') {
20843 set_yylval_id(idANDDOT);
20844 SET_LEX_STATE(EXPR_DOT);
20845 return tANDDOT;
20846 }
20847 pushback(p, c);
20848 if (IS_SPCARG(c)) {
20849 if ((c != ':') ||
20850 (c = peekc_n(p, 1)) == -1 ||
20851 !(c == '\'' || c == '"' ||
20852 is_identchar(p, (p->lex.pcur+1), p->lex.pend, p->enc))) {
20853 rb_warning0("`&' interpreted as argument prefix");
20854 }
20855 c = tAMPER;
20856 }
20857 else if (IS_BEG()) {
20858 c = tAMPER;
20859 }
20860 else {
20861 c = warn_balanced('&', "&", "argument prefix");
20862 }
20863 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20864 return c;
20865
20866 case '|':
20867 if ((c = nextc(p)) == '|') {
20868 SET_LEX_STATE(EXPR_BEG);
20869 if ((c = nextc(p)) == '=') {
20870 set_yylval_id(idOROP);
20871 SET_LEX_STATE(EXPR_BEG);
20872 return tOP_ASGN;
20873 }
20874 pushback(p, c);
20875 if (IS_lex_state_for(last_state, EXPR_BEG)) {
20876 c = '|';
20877 pushback(p, '|');
20878 return c;
20879 }
20880 return tOROP;
20881 }
20882 if (c == '=') {
20883 set_yylval_id('|');
20884 SET_LEX_STATE(EXPR_BEG);
20885 return tOP_ASGN;
20886 }
20887 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
20888 pushback(p, c);
20889 return '|';
20890
20891 case '+':
20892 c = nextc(p);
20893 if (IS_AFTER_OPERATOR()) {
20894 SET_LEX_STATE(EXPR_ARG);
20895 if (c == '@') {
20896 return tUPLUS;
20897 }
20898 pushback(p, c);
20899 return '+';
20900 }
20901 if (c == '=') {
20902 set_yylval_id('+');
20903 SET_LEX_STATE(EXPR_BEG);
20904 return tOP_ASGN;
20905 }
20906 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
20907 SET_LEX_STATE(EXPR_BEG);
20908 pushback(p, c);
20909 if (c != -1 && ISDIGIT(c)) {
20910 return parse_numeric(p, '+');
20911 }
20912 return tUPLUS;
20913 }
20914 SET_LEX_STATE(EXPR_BEG);
20915 pushback(p, c);
20916 return warn_balanced('+', "+", "unary operator");
20917
20918 case '-':
20919 c = nextc(p);
20920 if (IS_AFTER_OPERATOR()) {
20921 SET_LEX_STATE(EXPR_ARG);
20922 if (c == '@') {
20923 return tUMINUS;
20924 }
20925 pushback(p, c);
20926 return '-';
20927 }
20928 if (c == '=') {
20929 set_yylval_id('-');
20930 SET_LEX_STATE(EXPR_BEG);
20931 return tOP_ASGN;
20932 }
20933 if (c == '>') {
20934 SET_LEX_STATE(EXPR_ENDFN);
20935 return tLAMBDA;
20936 }
20937 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
20938 SET_LEX_STATE(EXPR_BEG);
20939 pushback(p, c);
20940 if (c != -1 && ISDIGIT(c)) {
20941 return tUMINUS_NUM;
20942 }
20943 return tUMINUS;
20944 }
20945 SET_LEX_STATE(EXPR_BEG);
20946 pushback(p, c);
20947 return warn_balanced('-', "-", "unary operator");
20948
20949 case '.': {
20950 int is_beg = IS_BEG();
20951 SET_LEX_STATE(EXPR_BEG);
20952 if ((c = nextc(p)) == '.') {
20953 if ((c = nextc(p)) == '.') {
20954 if (p->ctxt.in_argdef) {
20955 SET_LEX_STATE(EXPR_ENDARG);
20956 return tBDOT3;
20957 }
20958 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
20959 rb_warn0("... at EOL, should be parenthesized?");
20960 }
20961 else if (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest) {
20962 if (IS_lex_state_for(last_state, EXPR_LABEL))
20963 return tDOT3;
20964 }
20965 return is_beg ? tBDOT3 : tDOT3;
20966 }
20967 pushback(p, c);
20968 return is_beg ? tBDOT2 : tDOT2;
20969 }
20970 pushback(p, c);
20971 if (c != -1 && ISDIGIT(c)) {
20972 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
20973 parse_numeric(p, '.');
20974 if (ISDIGIT(prev)) {
20975 yyerror0("unexpected fraction part after numeric literal");
20976 }
20977 else {
20978 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
20979 }
20980 SET_LEX_STATE(EXPR_END);
20981 p->lex.ptok = p->lex.pcur;
20982 goto retry;
20983 }
20984 set_yylval_id('.');
20985 SET_LEX_STATE(EXPR_DOT);
20986 return '.';
20987 }
20988
20989 case '0': case '1': case '2': case '3': case '4':
20990 case '5': case '6': case '7': case '8': case '9':
20991 return parse_numeric(p, c);
20992
20993 case ')':
20994 COND_POP();
20995 CMDARG_POP();
20996 SET_LEX_STATE(EXPR_ENDFN);
20997 p->lex.paren_nest--;
20998 return c;
20999
21000 case ']':
21001 COND_POP();
21002 CMDARG_POP();
21003 SET_LEX_STATE(EXPR_END);
21004 p->lex.paren_nest--;
21005 return c;
21006
21007 case '}':
21008 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
21009 if (!p->lex.brace_nest--) return tSTRING_DEND;
21010 COND_POP();
21011 CMDARG_POP();
21012 SET_LEX_STATE(EXPR_END);
21013 p->lex.paren_nest--;
21014 return c;
21015
21016 case ':':
21017 c = nextc(p);
21018 if (c == ':') {
21019 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
21020 SET_LEX_STATE(EXPR_BEG);
21021 return tCOLON3;
21022 }
21023 set_yylval_id(idCOLON2);
21024 SET_LEX_STATE(EXPR_DOT);
21025 return tCOLON2;
21026 }
21027 if (IS_END() || ISSPACE(c) || c == '#') {
21028 pushback(p, c);
21029 c = warn_balanced(':', ":", "symbol literal");
21030 SET_LEX_STATE(EXPR_BEG);
21031 return c;
21032 }
21033 switch (c) {
21034 case '\'':
21035 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
21036 break;
21037 case '"':
21038 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
21039 break;
21040 default:
21041 pushback(p, c);
21042 break;
21043 }
21044 SET_LEX_STATE(EXPR_FNAME);
21045 return tSYMBEG;
21046
21047 case '/':
21048 if (IS_BEG()) {
21049 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21050 return tREGEXP_BEG;
21051 }
21052 if ((c = nextc(p)) == '=') {
21053 set_yylval_id('/');
21054 SET_LEX_STATE(EXPR_BEG);
21055 return tOP_ASGN;
21056 }
21057 pushback(p, c);
21058 if (IS_SPCARG(c)) {
21059 arg_ambiguous(p, '/');
21060 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21061 return tREGEXP_BEG;
21062 }
21063 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21064 return warn_balanced('/', "/", "regexp literal");
21065
21066 case '^':
21067 if ((c = nextc(p)) == '=') {
21068 set_yylval_id('^');
21069 SET_LEX_STATE(EXPR_BEG);
21070 return tOP_ASGN;
21071 }
21072 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21073 pushback(p, c);
21074 return '^';
21075
21076 case ';':
21077 SET_LEX_STATE(EXPR_BEG);
21078 p->command_start = TRUE;
21079 return ';';
21080
21081 case ',':
21082 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21083 return ',';
21084
21085 case '~':
21086 if (IS_AFTER_OPERATOR()) {
21087 if ((c = nextc(p)) != '@') {
21088 pushback(p, c);
21089 }
21090 SET_LEX_STATE(EXPR_ARG);
21091 }
21092 else {
21093 SET_LEX_STATE(EXPR_BEG);
21094 }
21095 return '~';
21096
21097 case '(':
21098 if (IS_BEG()) {
21099 c = tLPAREN;
21100 }
21101 else if (!space_seen) {
21102 /* foo( ... ) => method call, no ambiguity */
21103 }
21104 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
21105 c = tLPAREN_ARG;
21106 }
21107 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
21108 rb_warning0("parentheses after method name is interpreted as "
21109 "an argument list, not a decomposed argument");
21110 }
21111 p->lex.paren_nest++;
21112 COND_PUSH(0);
21113 CMDARG_PUSH(0);
21114 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21115 return c;
21116
21117 case '[':
21118 p->lex.paren_nest++;
21119 if (IS_AFTER_OPERATOR()) {
21120 if ((c = nextc(p)) == ']') {
21121 p->lex.paren_nest--;
21122 SET_LEX_STATE(EXPR_ARG);
21123 if ((c = nextc(p)) == '=') {
21124 return tASET;
21125 }
21126 pushback(p, c);
21127 return tAREF;
21128 }
21129 pushback(p, c);
21130 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
21131 return '[';
21132 }
21133 else if (IS_BEG()) {
21134 c = tLBRACK;
21135 }
21136 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
21137 c = tLBRACK;
21138 }
21139 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21140 COND_PUSH(0);
21141 CMDARG_PUSH(0);
21142 return c;
21143
21144 case '{':
21145 ++p->lex.brace_nest;
21146 if (lambda_beginning_p())
21147 c = tLAMBEG;
21148 else if (IS_lex_state(EXPR_LABELED))
21149 c = tLBRACE; /* hash */
21150 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
21151 c = '{'; /* block (primary) */
21152 else if (IS_lex_state(EXPR_ENDARG))
21153 c = tLBRACE_ARG; /* block (expr) */
21154 else
21155 c = tLBRACE; /* hash */
21156 if (c != tLBRACE) {
21157 p->command_start = TRUE;
21158 SET_LEX_STATE(EXPR_BEG);
21159 }
21160 else {
21161 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21162 }
21163 ++p->lex.paren_nest; /* after lambda_beginning_p() */
21164 COND_PUSH(0);
21165 CMDARG_PUSH(0);
21166 return c;
21167
21168 case '\\':
21169 c = nextc(p);
21170 if (c == '\n') {
21171 space_seen = 1;
21172 dispatch_scan_event(p, tSP);
21173 goto retry; /* skip \\n */
21174 }
21175 if (c == ' ') return tSP;
21176 if (ISSPACE(c)) return c;
21177 pushback(p, c);
21178 return '\\';
21179
21180 case '%':
21181 return parse_percent(p, space_seen, last_state);
21182
21183 case '$':
21184 return parse_gvar(p, last_state);
21185
21186 case '@':
21187 return parse_atmark(p, last_state);
21188
21189 case '_':
21190 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
21191 p->ruby__end__seen = 1;
21192 p->eofp = 1;
21193#ifdef RIPPER
21194 lex_goto_eol(p);
21195 dispatch_scan_event(p, k__END__);
21196#endif
21197 return END_OF_INPUT;
21198 }
21199 newtok(p);
21200 break;
21201
21202 default:
21203 if (!parser_is_identchar(p)) {
21204 compile_error(p, "Invalid char `\\x%02X' in expression", c);
21205 token_flush(p);
21206 goto retry;
21207 }
21208
21209 newtok(p);
21210 break;
21211 }
21212
21213 return parse_ident(p, c, cmd_state);
21214}
21215
21216static enum yytokentype
21217yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
21218{
21219 enum yytokentype t;
21220
21221 p->lval = lval;
21222 lval->val = Qundef;
21223 p->yylloc = yylloc;
21224
21225 t = parser_yylex(p);
21226
21227 if (has_delayed_token(p))
21228 dispatch_delayed_token(p, t);
21229 else if (t != END_OF_INPUT)
21230 dispatch_scan_event(p, t);
21231
21232 return t;
21233}
21234
21235#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
21236
21237static NODE*
21238node_new_internal(struct parser_params *p, enum node_type type, size_t size, size_t alignment)
21239{
21240 NODE *n = rb_ast_newnode(p->ast, type, size, alignment);
21241
21242 rb_node_init(n, type);
21243 return n;
21244}
21245
21246static NODE *
21247nd_set_loc(NODE *nd, const YYLTYPE *loc)
21248{
21249 nd->nd_loc = *loc;
21250 nd_set_line(nd, loc->beg_pos.lineno);
21251 return nd;
21252}
21253
21254static NODE*
21255node_newnode(struct parser_params *p, enum node_type type, size_t size, size_t alignment, const rb_code_location_t *loc)
21256{
21257 NODE *n = node_new_internal(p, type, size, alignment);
21258
21259 nd_set_loc(n, loc);
21260 nd_set_node_id(n, parser_get_node_id(p));
21261 return n;
21262}
21263
21264#define NODE_NEWNODE(node_type, type, loc) (type *)(node_newnode(p, node_type, sizeof(type), RUBY_ALIGNOF(type), loc))
21265
21266#ifndef RIPPER
21267
21268static rb_node_scope_t *
21269rb_node_scope_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
21270{
21271 rb_ast_id_table_t *nd_tbl;
21272 nd_tbl = local_tbl(p);
21273 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
21274 n->nd_tbl = nd_tbl;
21275 n->nd_body = nd_body;
21276 n->nd_args = nd_args;
21277
21278 return n;
21279}
21280
21281static rb_node_scope_t *
21282rb_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)
21283{
21284 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
21285 n->nd_tbl = nd_tbl;
21286 n->nd_body = nd_body;
21287 n->nd_args = nd_args;
21288
21289 return n;
21290}
21291
21292static rb_node_defn_t *
21293rb_node_defn_new(struct parser_params *p, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
21294{
21295 rb_node_defn_t *n = NODE_NEWNODE(NODE_DEFN, rb_node_defn_t, loc);
21296 n->nd_mid = nd_mid;
21297 n->nd_defn = nd_defn;
21298
21299 return n;
21300}
21301
21302static rb_node_defs_t *
21303rb_node_defs_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
21304{
21305 rb_node_defs_t *n = NODE_NEWNODE(NODE_DEFS, rb_node_defs_t, loc);
21306 n->nd_recv = nd_recv;
21307 n->nd_mid = nd_mid;
21308 n->nd_defn = nd_defn;
21309
21310 return n;
21311}
21312
21313static rb_node_block_t *
21314rb_node_block_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21315{
21316 rb_node_block_t *n = NODE_NEWNODE(NODE_BLOCK, rb_node_block_t, loc);
21317 n->nd_head = nd_head;
21318 n->nd_end = (NODE *)n;
21319 n->nd_next = 0;
21320
21321 return n;
21322}
21323
21324static rb_node_for_t *
21325rb_node_for_new(struct parser_params *p, NODE *nd_iter, NODE *nd_body, const YYLTYPE *loc)
21326{
21327 rb_node_for_t *n = NODE_NEWNODE(NODE_FOR, rb_node_for_t, loc);
21328 n->nd_body = nd_body;
21329 n->nd_iter = nd_iter;
21330
21331 return n;
21332}
21333
21334static rb_node_for_masgn_t *
21335rb_node_for_masgn_new(struct parser_params *p, NODE *nd_var, const YYLTYPE *loc)
21336{
21337 rb_node_for_masgn_t *n = NODE_NEWNODE(NODE_FOR_MASGN, rb_node_for_masgn_t, loc);
21338 n->nd_var = nd_var;
21339
21340 return n;
21341}
21342
21343static rb_node_retry_t *
21344rb_node_retry_new(struct parser_params *p, const YYLTYPE *loc)
21345{
21346 rb_node_retry_t *n = NODE_NEWNODE(NODE_RETRY, rb_node_retry_t, loc);
21347
21348 return n;
21349}
21350
21351static rb_node_begin_t *
21352rb_node_begin_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
21353{
21354 rb_node_begin_t *n = NODE_NEWNODE(NODE_BEGIN, rb_node_begin_t, loc);
21355 n->nd_body = nd_body;
21356
21357 return n;
21358}
21359
21360static rb_node_rescue_t *
21361rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *nd_else, const YYLTYPE *loc)
21362{
21363 rb_node_rescue_t *n = NODE_NEWNODE(NODE_RESCUE, rb_node_rescue_t, loc);
21364 n->nd_head = nd_head;
21365 n->nd_resq = nd_resq;
21366 n->nd_else = nd_else;
21367
21368 return n;
21369}
21370
21371static rb_node_resbody_t *
21372rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_body, NODE *nd_head, const YYLTYPE *loc)
21373{
21374 rb_node_resbody_t *n = NODE_NEWNODE(NODE_RESBODY, rb_node_resbody_t, loc);
21375 n->nd_head = nd_head;
21376 n->nd_body = nd_body;
21377 n->nd_args = nd_args;
21378
21379 return n;
21380}
21381
21382static rb_node_ensure_t *
21383rb_node_ensure_new(struct parser_params *p, NODE *nd_head, NODE *nd_ensr, const YYLTYPE *loc)
21384{
21385 rb_node_ensure_t *n = NODE_NEWNODE(NODE_ENSURE, rb_node_ensure_t, loc);
21386 n->nd_head = nd_head;
21387 n->nd_resq = 0;
21388 n->nd_ensr = nd_ensr;
21389
21390 return n;
21391}
21392
21393static rb_node_and_t *
21394rb_node_and_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
21395{
21396 rb_node_and_t *n = NODE_NEWNODE(NODE_AND, rb_node_and_t, loc);
21397 n->nd_1st = nd_1st;
21398 n->nd_2nd = nd_2nd;
21399
21400 return n;
21401}
21402
21403static rb_node_or_t *
21404rb_node_or_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
21405{
21406 rb_node_or_t *n = NODE_NEWNODE(NODE_OR, rb_node_or_t, loc);
21407 n->nd_1st = nd_1st;
21408 n->nd_2nd = nd_2nd;
21409
21410 return n;
21411}
21412
21413static rb_node_return_t *
21414rb_node_return_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc)
21415{
21416 rb_node_return_t *n = NODE_NEWNODE(NODE_RETURN, rb_node_return_t, loc);
21417 n->nd_stts = nd_stts;
21418 return n;
21419}
21420
21421static rb_node_yield_t *
21422rb_node_yield_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21423{
21424 rb_node_yield_t *n = NODE_NEWNODE(NODE_YIELD, rb_node_yield_t, loc);
21425 n->nd_head = nd_head;
21426
21427 return n;
21428}
21429
21430static rb_node_if_t *
21431rb_node_if_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc)
21432{
21433 rb_node_if_t *n = NODE_NEWNODE(NODE_IF, rb_node_if_t, loc);
21434 n->nd_cond = nd_cond;
21435 n->nd_body = nd_body;
21436 n->nd_else = nd_else;
21437
21438 return n;
21439}
21440
21441static rb_node_unless_t *
21442rb_node_unless_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc)
21443{
21444 rb_node_unless_t *n = NODE_NEWNODE(NODE_UNLESS, rb_node_unless_t, loc);
21445 n->nd_cond = nd_cond;
21446 n->nd_body = nd_body;
21447 n->nd_else = nd_else;
21448
21449 return n;
21450}
21451
21452static rb_node_class_t *
21453rb_node_class_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, NODE *nd_super, const YYLTYPE *loc)
21454{
21455 /* Keep the order of node creation */
21456 NODE *scope = NEW_SCOPE(0, nd_body, loc);
21457 rb_node_class_t *n = NODE_NEWNODE(NODE_CLASS, rb_node_class_t, loc);
21458 n->nd_cpath = nd_cpath;
21459 n->nd_body = scope;
21460 n->nd_super = nd_super;
21461
21462 return n;
21463}
21464
21465static rb_node_sclass_t *
21466rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const YYLTYPE *loc)
21467{
21468 /* Keep the order of node creation */
21469 NODE *scope = NEW_SCOPE(0, nd_body, loc);
21470 rb_node_sclass_t *n = NODE_NEWNODE(NODE_SCLASS, rb_node_sclass_t, loc);
21471 n->nd_recv = nd_recv;
21472 n->nd_body = scope;
21473
21474 return n;
21475}
21476
21477static rb_node_module_t *
21478rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc)
21479{
21480 /* Keep the order of node creation */
21481 NODE *scope = NEW_SCOPE(0, nd_body, loc);
21482 rb_node_module_t *n = NODE_NEWNODE(NODE_MODULE, rb_node_module_t, loc);
21483 n->nd_cpath = nd_cpath;
21484 n->nd_body = scope;
21485
21486 return n;
21487}
21488
21489static rb_node_iter_t *
21490rb_node_iter_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
21491{
21492 /* Keep the order of node creation */
21493 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
21494 rb_node_iter_t *n = NODE_NEWNODE(NODE_ITER, rb_node_iter_t, loc);
21495 n->nd_body = scope;
21496 n->nd_iter = 0;
21497
21498 return n;
21499}
21500
21501static rb_node_lambda_t *
21502rb_node_lambda_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
21503{
21504 /* Keep the order of node creation */
21505 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
21506 rb_node_lambda_t *n = NODE_NEWNODE(NODE_LAMBDA, rb_node_lambda_t, loc);
21507 n->nd_body = scope;
21508
21509 return n;
21510}
21511
21512static rb_node_case_t *
21513rb_node_case_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
21514{
21515 rb_node_case_t *n = NODE_NEWNODE(NODE_CASE, rb_node_case_t, loc);
21516 n->nd_head = nd_head;
21517 n->nd_body = nd_body;
21518
21519 return n;
21520}
21521
21522static rb_node_case2_t *
21523rb_node_case2_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
21524{
21525 rb_node_case2_t *n = NODE_NEWNODE(NODE_CASE2, rb_node_case2_t, loc);
21526 n->nd_head = 0;
21527 n->nd_body = nd_body;
21528
21529 return n;
21530}
21531
21532static rb_node_case3_t *
21533rb_node_case3_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
21534{
21535 rb_node_case3_t *n = NODE_NEWNODE(NODE_CASE3, rb_node_case3_t, loc);
21536 n->nd_head = nd_head;
21537 n->nd_body = nd_body;
21538
21539 return n;
21540}
21541
21542static rb_node_when_t *
21543rb_node_when_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
21544{
21545 rb_node_when_t *n = NODE_NEWNODE(NODE_WHEN, rb_node_when_t, loc);
21546 n->nd_head = nd_head;
21547 n->nd_body = nd_body;
21548 n->nd_next = nd_next;
21549
21550 return n;
21551}
21552
21553static rb_node_in_t *
21554rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
21555{
21556 rb_node_in_t *n = NODE_NEWNODE(NODE_IN, rb_node_in_t, loc);
21557 n->nd_head = nd_head;
21558 n->nd_body = nd_body;
21559 n->nd_next = nd_next;
21560
21561 return n;
21562}
21563
21564static rb_node_while_t *
21565rb_node_while_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc)
21566{
21567 rb_node_while_t *n = NODE_NEWNODE(NODE_WHILE, rb_node_while_t, loc);
21568 n->nd_cond = nd_cond;
21569 n->nd_body = nd_body;
21570 n->nd_state = nd_state;
21571
21572 return n;
21573}
21574
21575static rb_node_until_t *
21576rb_node_until_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc)
21577{
21578 rb_node_until_t *n = NODE_NEWNODE(NODE_UNTIL, rb_node_until_t, loc);
21579 n->nd_cond = nd_cond;
21580 n->nd_body = nd_body;
21581 n->nd_state = nd_state;
21582
21583 return n;
21584}
21585
21586static rb_node_colon2_t *
21587rb_node_colon2_new(struct parser_params *p, NODE *nd_head, ID nd_mid, const YYLTYPE *loc)
21588{
21589 rb_node_colon2_t *n = NODE_NEWNODE(NODE_COLON2, rb_node_colon2_t, loc);
21590 n->nd_head = nd_head;
21591 n->nd_mid = nd_mid;
21592
21593 return n;
21594}
21595
21596static rb_node_colon3_t *
21597rb_node_colon3_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
21598{
21599 rb_node_colon3_t *n = NODE_NEWNODE(NODE_COLON3, rb_node_colon3_t, loc);
21600 n->nd_mid = nd_mid;
21601
21602 return n;
21603}
21604
21605static rb_node_dot2_t *
21606rb_node_dot2_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
21607{
21608 rb_node_dot2_t *n = NODE_NEWNODE(NODE_DOT2, rb_node_dot2_t, loc);
21609 n->nd_beg = nd_beg;
21610 n->nd_end = nd_end;
21611
21612 return n;
21613}
21614
21615static rb_node_dot3_t *
21616rb_node_dot3_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
21617{
21618 rb_node_dot3_t *n = NODE_NEWNODE(NODE_DOT3, rb_node_dot3_t, loc);
21619 n->nd_beg = nd_beg;
21620 n->nd_end = nd_end;
21621
21622 return n;
21623}
21624
21625static rb_node_self_t *
21626rb_node_self_new(struct parser_params *p, const YYLTYPE *loc)
21627{
21628 rb_node_self_t *n = NODE_NEWNODE(NODE_SELF, rb_node_self_t, loc);
21629 n->nd_state = 1;
21630
21631 return n;
21632}
21633
21634static rb_node_nil_t *
21635rb_node_nil_new(struct parser_params *p, const YYLTYPE *loc)
21636{
21637 rb_node_nil_t *n = NODE_NEWNODE(NODE_NIL, rb_node_nil_t, loc);
21638
21639 return n;
21640}
21641
21642static rb_node_true_t *
21643rb_node_true_new(struct parser_params *p, const YYLTYPE *loc)
21644{
21645 rb_node_true_t *n = NODE_NEWNODE(NODE_TRUE, rb_node_true_t, loc);
21646
21647 return n;
21648}
21649
21650static rb_node_false_t *
21651rb_node_false_new(struct parser_params *p, const YYLTYPE *loc)
21652{
21653 rb_node_false_t *n = NODE_NEWNODE(NODE_FALSE, rb_node_false_t, loc);
21654
21655 return n;
21656}
21657
21658static rb_node_super_t *
21659rb_node_super_new(struct parser_params *p, NODE *nd_args, const YYLTYPE *loc)
21660{
21661 rb_node_super_t *n = NODE_NEWNODE(NODE_SUPER, rb_node_super_t, loc);
21662 n->nd_args = nd_args;
21663
21664 return n;
21665}
21666
21667static rb_node_zsuper_t *
21668rb_node_zsuper_new(struct parser_params *p, const YYLTYPE *loc)
21669{
21670 rb_node_zsuper_t *n = NODE_NEWNODE(NODE_ZSUPER, rb_node_zsuper_t, loc);
21671
21672 return n;
21673}
21674
21675static rb_node_match2_t *
21676rb_node_match2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
21677{
21678 rb_node_match2_t *n = NODE_NEWNODE(NODE_MATCH2, rb_node_match2_t, loc);
21679 n->nd_recv = nd_recv;
21680 n->nd_value = nd_value;
21681 n->nd_args = 0;
21682
21683 return n;
21684}
21685
21686static rb_node_match3_t *
21687rb_node_match3_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
21688{
21689 rb_node_match3_t *n = NODE_NEWNODE(NODE_MATCH3, rb_node_match3_t, loc);
21690 n->nd_recv = nd_recv;
21691 n->nd_value = nd_value;
21692
21693 return n;
21694}
21695
21696/* TODO: Use union for NODE_LIST2 */
21697static rb_node_list_t *
21698rb_node_list_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21699{
21700 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
21701 n->nd_head = nd_head;
21702 n->as.nd_alen = 1;
21703 n->nd_next = 0;
21704
21705 return n;
21706}
21707
21708static rb_node_list_t *
21709rb_node_list_new2(struct parser_params *p, NODE *nd_head, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21710{
21711 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
21712 n->nd_head = nd_head;
21713 n->as.nd_alen = nd_alen;
21714 n->nd_next = nd_next;
21715
21716 return n;
21717}
21718
21719static rb_node_zlist_t *
21720rb_node_zlist_new(struct parser_params *p, const YYLTYPE *loc)
21721{
21722 rb_node_zlist_t *n = NODE_NEWNODE(NODE_ZLIST, rb_node_zlist_t, loc);
21723
21724 return n;
21725}
21726
21727static rb_node_hash_t *
21728rb_node_hash_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21729{
21730 rb_node_hash_t *n = NODE_NEWNODE(NODE_HASH, rb_node_hash_t, loc);
21731 n->nd_head = nd_head;
21732 n->nd_brace = 0;
21733
21734 return n;
21735}
21736
21737static rb_node_masgn_t *
21738rb_node_masgn_new(struct parser_params *p, NODE *nd_head, NODE *nd_args, const YYLTYPE *loc)
21739{
21740 rb_node_masgn_t *n = NODE_NEWNODE(NODE_MASGN, rb_node_masgn_t, loc);
21741 n->nd_head = nd_head;
21742 n->nd_value = 0;
21743 n->nd_args = nd_args;
21744
21745 return n;
21746}
21747
21748static rb_node_gasgn_t *
21749rb_node_gasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21750{
21751 rb_node_gasgn_t *n = NODE_NEWNODE(NODE_GASGN, rb_node_gasgn_t, loc);
21752 n->nd_vid = nd_vid;
21753 n->nd_value = nd_value;
21754
21755 return n;
21756}
21757
21758static rb_node_lasgn_t *
21759rb_node_lasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21760{
21761 rb_node_lasgn_t *n = NODE_NEWNODE(NODE_LASGN, rb_node_lasgn_t, loc);
21762 n->nd_vid = nd_vid;
21763 n->nd_value = nd_value;
21764
21765 return n;
21766}
21767
21768static rb_node_dasgn_t *
21769rb_node_dasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21770{
21771 rb_node_dasgn_t *n = NODE_NEWNODE(NODE_DASGN, rb_node_dasgn_t, loc);
21772 n->nd_vid = nd_vid;
21773 n->nd_value = nd_value;
21774
21775 return n;
21776}
21777
21778static rb_node_iasgn_t *
21779rb_node_iasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21780{
21781 rb_node_iasgn_t *n = NODE_NEWNODE(NODE_IASGN, rb_node_iasgn_t, loc);
21782 n->nd_vid = nd_vid;
21783 n->nd_value = nd_value;
21784
21785 return n;
21786}
21787
21788static rb_node_cvasgn_t *
21789rb_node_cvasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21790{
21791 rb_node_cvasgn_t *n = NODE_NEWNODE(NODE_CVASGN, rb_node_cvasgn_t, loc);
21792 n->nd_vid = nd_vid;
21793 n->nd_value = nd_value;
21794
21795 return n;
21796}
21797
21798static rb_node_op_asgn1_t *
21799rb_node_op_asgn1_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *index, NODE *rvalue, const YYLTYPE *loc)
21800{
21801 rb_node_op_asgn1_t *n = NODE_NEWNODE(NODE_OP_ASGN1, rb_node_op_asgn1_t, loc);
21802 n->nd_recv = nd_recv;
21803 n->nd_mid = nd_mid;
21804 n->nd_index = index;
21805 n->nd_rvalue = rvalue;
21806
21807 return n;
21808}
21809
21810static rb_node_op_asgn2_t *
21811rb_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)
21812{
21813 rb_node_op_asgn2_t *n = NODE_NEWNODE(NODE_OP_ASGN2, rb_node_op_asgn2_t, loc);
21814 n->nd_recv = nd_recv;
21815 n->nd_value = nd_value;
21816 n->nd_vid = nd_vid;
21817 n->nd_mid = nd_mid;
21818 n->nd_aid = nd_aid;
21819
21820 return n;
21821}
21822
21823static rb_node_op_asgn_or_t *
21824rb_node_op_asgn_or_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
21825{
21826 rb_node_op_asgn_or_t *n = NODE_NEWNODE(NODE_OP_ASGN_OR, rb_node_op_asgn_or_t, loc);
21827 n->nd_head = nd_head;
21828 n->nd_value = nd_value;
21829
21830 return n;
21831}
21832
21833static rb_node_op_asgn_and_t *
21834rb_node_op_asgn_and_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
21835{
21836 rb_node_op_asgn_and_t *n = NODE_NEWNODE(NODE_OP_ASGN_AND, rb_node_op_asgn_and_t, loc);
21837 n->nd_head = nd_head;
21838 n->nd_value = nd_value;
21839
21840 return n;
21841}
21842
21843static rb_node_gvar_t *
21844rb_node_gvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21845{
21846 rb_node_gvar_t *n = NODE_NEWNODE(NODE_GVAR, rb_node_gvar_t, loc);
21847 n->nd_vid = nd_vid;
21848
21849 return n;
21850}
21851
21852static rb_node_lvar_t *
21853rb_node_lvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21854{
21855 rb_node_lvar_t *n = NODE_NEWNODE(NODE_LVAR, rb_node_lvar_t, loc);
21856 n->nd_vid = nd_vid;
21857
21858 return n;
21859}
21860
21861static rb_node_dvar_t *
21862rb_node_dvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21863{
21864 rb_node_dvar_t *n = NODE_NEWNODE(NODE_DVAR, rb_node_dvar_t, loc);
21865 n->nd_vid = nd_vid;
21866
21867 return n;
21868}
21869
21870static rb_node_ivar_t *
21871rb_node_ivar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21872{
21873 rb_node_ivar_t *n = NODE_NEWNODE(NODE_IVAR, rb_node_ivar_t, loc);
21874 n->nd_vid = nd_vid;
21875
21876 return n;
21877}
21878
21879static rb_node_const_t *
21880rb_node_const_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21881{
21882 rb_node_const_t *n = NODE_NEWNODE(NODE_CONST, rb_node_const_t, loc);
21883 n->nd_vid = nd_vid;
21884
21885 return n;
21886}
21887
21888static rb_node_cvar_t *
21889rb_node_cvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21890{
21891 rb_node_cvar_t *n = NODE_NEWNODE(NODE_CVAR, rb_node_cvar_t, loc);
21892 n->nd_vid = nd_vid;
21893
21894 return n;
21895}
21896
21897static rb_node_nth_ref_t *
21898rb_node_nth_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
21899{
21900 rb_node_nth_ref_t *n = NODE_NEWNODE(NODE_NTH_REF, rb_node_nth_ref_t, loc);
21901 n->nd_nth = nd_nth;
21902
21903 return n;
21904}
21905
21906static rb_node_back_ref_t *
21907rb_node_back_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
21908{
21909 rb_node_back_ref_t *n = NODE_NEWNODE(NODE_BACK_REF, rb_node_back_ref_t, loc);
21910 n->nd_nth = nd_nth;
21911
21912 return n;
21913}
21914
21915static rb_node_lit_t *
21916rb_node_lit_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21917{
21918 rb_node_lit_t *n = NODE_NEWNODE(NODE_LIT, rb_node_lit_t, loc);
21919 n->nd_lit = nd_lit;
21920
21921 return n;
21922}
21923
21924static rb_node_str_t *
21925rb_node_str_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21926{
21927 rb_node_str_t *n = NODE_NEWNODE(NODE_STR, rb_node_str_t, loc);
21928 n->nd_lit = nd_lit;
21929
21930 return n;
21931}
21932
21933/* TODO; Use union for NODE_DSTR2 */
21934static rb_node_dstr_t *
21935rb_node_dstr_new0(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21936{
21937 rb_node_dstr_t *n = NODE_NEWNODE(NODE_DSTR, rb_node_dstr_t, loc);
21938 n->nd_lit = nd_lit;
21939 n->as.nd_alen = nd_alen;
21940 n->nd_next = (rb_node_list_t *)nd_next;
21941
21942 return n;
21943}
21944
21945static rb_node_dstr_t *
21946rb_node_dstr_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21947{
21948 return rb_node_dstr_new0(p, nd_lit, 1, 0, loc);
21949}
21950
21951static rb_node_xstr_t *
21952rb_node_xstr_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21953{
21954 rb_node_xstr_t *n = NODE_NEWNODE(NODE_XSTR, rb_node_xstr_t, loc);
21955 n->nd_lit = nd_lit;
21956
21957 return n;
21958}
21959
21960static rb_node_dxstr_t *
21961rb_node_dxstr_new(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21962{
21963 rb_node_dxstr_t *n = NODE_NEWNODE(NODE_DXSTR, rb_node_dxstr_t, loc);
21964 n->nd_lit = nd_lit;
21965 n->nd_alen = nd_alen;
21966 n->nd_next = (rb_node_list_t *)nd_next;
21967
21968 return n;
21969}
21970
21971static rb_node_dsym_t *
21972rb_node_dsym_new(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21973{
21974 rb_node_dsym_t *n = NODE_NEWNODE(NODE_DSYM, rb_node_dsym_t, loc);
21975 n->nd_lit = nd_lit;
21976 n->nd_alen = nd_alen;
21977 n->nd_next = (rb_node_list_t *)nd_next;
21978
21979 return n;
21980}
21981
21982static rb_node_evstr_t *
21983rb_node_evstr_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
21984{
21985 rb_node_evstr_t *n = NODE_NEWNODE(NODE_EVSTR, rb_node_evstr_t, loc);
21986 n->nd_body = nd_body;
21987
21988 return n;
21989}
21990
21991static rb_node_call_t *
21992rb_node_call_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
21993{
21994 rb_node_call_t *n = NODE_NEWNODE(NODE_CALL, rb_node_call_t, loc);
21995 n->nd_recv = nd_recv;
21996 n->nd_mid = nd_mid;
21997 n->nd_args = nd_args;
21998
21999 return n;
22000}
22001
22002static rb_node_opcall_t *
22003rb_node_opcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22004{
22005 rb_node_opcall_t *n = NODE_NEWNODE(NODE_OPCALL, rb_node_opcall_t, loc);
22006 n->nd_recv = nd_recv;
22007 n->nd_mid = nd_mid;
22008 n->nd_args = nd_args;
22009
22010 return n;
22011}
22012
22013static rb_node_fcall_t *
22014rb_node_fcall_new(struct parser_params *p, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22015{
22016 rb_node_fcall_t *n = NODE_NEWNODE(NODE_FCALL, rb_node_fcall_t, loc);
22017 n->nd_mid = nd_mid;
22018 n->nd_args = nd_args;
22019
22020 return n;
22021}
22022
22023static rb_node_qcall_t *
22024rb_node_qcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22025{
22026 rb_node_qcall_t *n = NODE_NEWNODE(NODE_QCALL, rb_node_qcall_t, loc);
22027 n->nd_recv = nd_recv;
22028 n->nd_mid = nd_mid;
22029 n->nd_args = nd_args;
22030
22031 return n;
22032}
22033
22034static rb_node_vcall_t *
22035rb_node_vcall_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
22036{
22037 rb_node_vcall_t *n = NODE_NEWNODE(NODE_VCALL, rb_node_vcall_t, loc);
22038 n->nd_mid = nd_mid;
22039
22040 return n;
22041}
22042
22043static rb_node_once_t *
22044rb_node_once_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22045{
22046 rb_node_once_t *n = NODE_NEWNODE(NODE_ONCE, rb_node_once_t, loc);
22047 n->nd_body = nd_body;
22048
22049 return n;
22050}
22051
22052static rb_node_args_t *
22053rb_node_args_new(struct parser_params *p, const YYLTYPE *loc)
22054{
22055 rb_node_args_t *n = NODE_NEWNODE(NODE_ARGS, rb_node_args_t, loc);
22056 MEMZERO(&n->nd_ainfo, struct rb_args_info, 1);
22057
22058 return n;
22059}
22060
22061static rb_node_args_aux_t *
22062rb_node_args_aux_new(struct parser_params *p, ID nd_pid, long nd_plen, const YYLTYPE *loc)
22063{
22064 rb_node_args_aux_t *n = NODE_NEWNODE(NODE_ARGS_AUX, rb_node_args_aux_t, loc);
22065 n->nd_pid = nd_pid;
22066 n->nd_plen = nd_plen;
22067 n->nd_next = 0;
22068
22069 return n;
22070}
22071
22072static rb_node_opt_arg_t *
22073rb_node_opt_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22074{
22075 rb_node_opt_arg_t *n = NODE_NEWNODE(NODE_OPT_ARG, rb_node_opt_arg_t, loc);
22076 n->nd_body = nd_body;
22077 n->nd_next = 0;
22078
22079 return n;
22080}
22081
22082static rb_node_kw_arg_t *
22083rb_node_kw_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22084{
22085 rb_node_kw_arg_t *n = NODE_NEWNODE(NODE_KW_ARG, rb_node_kw_arg_t, loc);
22086 n->nd_body = nd_body;
22087 n->nd_next = 0;
22088
22089 return n;
22090}
22091
22092static rb_node_postarg_t *
22093rb_node_postarg_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
22094{
22095 rb_node_postarg_t *n = NODE_NEWNODE(NODE_POSTARG, rb_node_postarg_t, loc);
22096 n->nd_1st = nd_1st;
22097 n->nd_2nd = nd_2nd;
22098
22099 return n;
22100}
22101
22102static rb_node_argscat_t *
22103rb_node_argscat_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22104{
22105 rb_node_argscat_t *n = NODE_NEWNODE(NODE_ARGSCAT, rb_node_argscat_t, loc);
22106 n->nd_head = nd_head;
22107 n->nd_body = nd_body;
22108
22109 return n;
22110}
22111
22112static rb_node_argspush_t *
22113rb_node_argspush_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22114{
22115 rb_node_argspush_t *n = NODE_NEWNODE(NODE_ARGSPUSH, rb_node_argspush_t, loc);
22116 n->nd_head = nd_head;
22117 n->nd_body = nd_body;
22118
22119 return n;
22120}
22121
22122static rb_node_splat_t *
22123rb_node_splat_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22124{
22125 rb_node_splat_t *n = NODE_NEWNODE(NODE_SPLAT, rb_node_splat_t, loc);
22126 n->nd_head = nd_head;
22127
22128 return n;
22129}
22130
22131static rb_node_block_pass_t *
22132rb_node_block_pass_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22133{
22134 rb_node_block_pass_t *n = NODE_NEWNODE(NODE_BLOCK_PASS, rb_node_block_pass_t, loc);
22135 n->nd_head = 0;
22136 n->nd_body = nd_body;
22137
22138 return n;
22139}
22140
22141static rb_node_alias_t *
22142rb_node_alias_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
22143{
22144 rb_node_alias_t *n = NODE_NEWNODE(NODE_ALIAS, rb_node_alias_t, loc);
22145 n->nd_1st = nd_1st;
22146 n->nd_2nd = nd_2nd;
22147
22148 return n;
22149}
22150
22151static rb_node_valias_t *
22152rb_node_valias_new(struct parser_params *p, ID nd_alias, ID nd_orig, const YYLTYPE *loc)
22153{
22154 rb_node_valias_t *n = NODE_NEWNODE(NODE_VALIAS, rb_node_valias_t, loc);
22155 n->nd_alias = nd_alias;
22156 n->nd_orig = nd_orig;
22157
22158 return n;
22159}
22160
22161static rb_node_undef_t *
22162rb_node_undef_new(struct parser_params *p, NODE *nd_undef, const YYLTYPE *loc)
22163{
22164 rb_node_undef_t *n = NODE_NEWNODE(NODE_UNDEF, rb_node_undef_t, loc);
22165 n->nd_undef = nd_undef;
22166
22167 return n;
22168}
22169
22170static rb_node_errinfo_t *
22171rb_node_errinfo_new(struct parser_params *p, const YYLTYPE *loc)
22172{
22173 rb_node_errinfo_t *n = NODE_NEWNODE(NODE_ERRINFO, rb_node_errinfo_t, loc);
22174
22175 return n;
22176}
22177
22178static rb_node_defined_t *
22179rb_node_defined_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22180{
22181 rb_node_defined_t *n = NODE_NEWNODE(NODE_DEFINED, rb_node_defined_t, loc);
22182 n->nd_head = nd_head;
22183
22184 return n;
22185}
22186
22187static rb_node_postexe_t *
22188rb_node_postexe_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22189{
22190 rb_node_postexe_t *n = NODE_NEWNODE(NODE_POSTEXE, rb_node_postexe_t, loc);
22191 n->nd_body = nd_body;
22192
22193 return n;
22194}
22195
22196static rb_node_attrasgn_t *
22197rb_node_attrasgn_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22198{
22199 rb_node_attrasgn_t *n = NODE_NEWNODE(NODE_ATTRASGN, rb_node_attrasgn_t, loc);
22200 n->nd_recv = nd_recv;
22201 n->nd_mid = nd_mid;
22202 n->nd_args = nd_args;
22203
22204 return n;
22205}
22206
22207static rb_node_aryptn_t *
22208rb_node_aryptn_new(struct parser_params *p, NODE *pre_args, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
22209{
22210 rb_node_aryptn_t *n = NODE_NEWNODE(NODE_ARYPTN, rb_node_aryptn_t, loc);
22211 n->nd_pconst = 0;
22212 n->pre_args = pre_args;
22213 n->rest_arg = rest_arg;
22214 n->post_args = post_args;
22215
22216 return n;
22217}
22218
22219static rb_node_hshptn_t *
22220rb_node_hshptn_new(struct parser_params *p, NODE *nd_pconst, NODE *nd_pkwargs, NODE *nd_pkwrestarg, const YYLTYPE *loc)
22221{
22222 rb_node_hshptn_t *n = NODE_NEWNODE(NODE_HSHPTN, rb_node_hshptn_t, loc);
22223 n->nd_pconst = nd_pconst;
22224 n->nd_pkwargs = nd_pkwargs;
22225 n->nd_pkwrestarg = nd_pkwrestarg;
22226
22227 return n;
22228}
22229
22230static rb_node_fndptn_t *
22231rb_node_fndptn_new(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
22232{
22233 rb_node_fndptn_t *n = NODE_NEWNODE(NODE_FNDPTN, rb_node_fndptn_t, loc);
22234 n->nd_pconst = 0;
22235 n->pre_rest_arg = pre_rest_arg;
22236 n->args = args;
22237 n->post_rest_arg = post_rest_arg;
22238
22239 return n;
22240}
22241
22242static rb_node_cdecl_t *
22243rb_node_cdecl_new(struct parser_params *p, ID nd_vid, NODE *nd_value, NODE *nd_else, const YYLTYPE *loc)
22244{
22245 rb_node_cdecl_t *n = NODE_NEWNODE(NODE_CDECL, rb_node_cdecl_t, loc);
22246 n->nd_vid = nd_vid;
22247 n->nd_value = nd_value;
22248 n->nd_else = nd_else;
22249
22250 return n;
22251}
22252
22253static rb_node_op_cdecl_t *
22254rb_node_op_cdecl_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, ID nd_aid, const YYLTYPE *loc)
22255{
22256 rb_node_op_cdecl_t *n = NODE_NEWNODE(NODE_OP_CDECL, rb_node_op_cdecl_t, loc);
22257 n->nd_head = nd_head;
22258 n->nd_value = nd_value;
22259 n->nd_aid = nd_aid;
22260
22261 return n;
22262}
22263
22264static rb_node_error_t *
22265rb_node_error_new(struct parser_params *p, const YYLTYPE *loc)
22266{
22267 rb_node_error_t *n = NODE_NEWNODE(NODE_ERROR, rb_node_error_t, loc);
22268
22269 return n;
22270}
22271
22272#else
22273
22274static rb_node_ripper_t *
22275rb_node_ripper_new(struct parser_params *p, ID nd_vid, VALUE nd_rval, VALUE nd_cval, const YYLTYPE *loc)
22276{
22277 rb_node_ripper_t *n = NODE_NEWNODE(NODE_RIPPER, rb_node_ripper_t, loc);
22278 n->nd_vid = nd_vid;
22279 n->nd_rval = nd_rval;
22280 n->nd_cval = nd_cval;
22281
22282 return n;
22283}
22284
22285static rb_node_ripper_values_t *
22286rb_node_ripper_values_new(struct parser_params *p, VALUE nd_val1, VALUE nd_val2, VALUE nd_val3, const YYLTYPE *loc)
22287{
22288 rb_node_ripper_values_t *n = NODE_NEWNODE(NODE_RIPPER_VALUES, rb_node_ripper_values_t, loc);
22289 n->nd_val1 = nd_val1;
22290 n->nd_val2 = nd_val2;
22291 n->nd_val3 = nd_val3;
22292
22293 return n;
22294}
22295
22296#endif
22297
22298static rb_node_break_t *
22299rb_node_break_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc)
22300{
22301 rb_node_break_t *n = NODE_NEWNODE(NODE_BREAK, rb_node_break_t, loc);
22302 n->nd_stts = nd_stts;
22303 n->nd_chain = 0;
22304
22305 return n;
22306}
22307
22308static rb_node_next_t *
22309rb_node_next_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc)
22310{
22311 rb_node_next_t *n = NODE_NEWNODE(NODE_NEXT, rb_node_next_t, loc);
22312 n->nd_stts = nd_stts;
22313 n->nd_chain = 0;
22314
22315 return n;
22316}
22317
22318static rb_node_redo_t *
22319rb_node_redo_new(struct parser_params *p, const YYLTYPE *loc)
22320{
22321 rb_node_redo_t *n = NODE_NEWNODE(NODE_REDO, rb_node_redo_t, loc);
22322 n->nd_chain = 0;
22323
22324 return n;
22325}
22326
22327static rb_node_def_temp_t *
22328rb_node_def_temp_new(struct parser_params *p, const YYLTYPE *loc)
22329{
22330 rb_node_def_temp_t *n = NODE_NEWNODE((enum node_type)NODE_DEF_TEMP, rb_node_def_temp_t, loc);
22331 n->save.cur_arg = p->cur_arg;
22332 n->save.numparam_save = 0;
22333 n->save.max_numparam = 0;
22334 n->save.ctxt = p->ctxt;
22335#ifdef RIPPER
22336 n->nd_recv = Qnil;
22337 n->nd_mid = Qnil;
22338 n->dot_or_colon = Qnil;
22339#else
22340 n->nd_def = 0;
22341 n->nd_mid = 0;
22342#endif
22343
22344 return n;
22345}
22346
22347static rb_node_def_temp_t *
22348def_head_save(struct parser_params *p, rb_node_def_temp_t *n)
22349{
22350 n->save.numparam_save = numparam_push(p);
22351 n->save.max_numparam = p->max_numparam;
22352 return n;
22353}
22354
22355#ifndef RIPPER
22356static enum node_type
22357nodetype(NODE *node) /* for debug */
22358{
22359 return (enum node_type)nd_type(node);
22360}
22361
22362static int
22363nodeline(NODE *node)
22364{
22365 return nd_line(node);
22366}
22367
22368static NODE*
22369newline_node(NODE *node)
22370{
22371 if (node) {
22372 node = remove_begin(node);
22373 nd_set_fl_newline(node);
22374 }
22375 return node;
22376}
22377
22378static void
22379fixpos(NODE *node, NODE *orig)
22380{
22381 if (!node) return;
22382 if (!orig) return;
22383 nd_set_line(node, nd_line(orig));
22384}
22385
22386static void
22387parser_warning(struct parser_params *p, NODE *node, const char *mesg)
22388{
22389 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
22390}
22391
22392static void
22393parser_warn(struct parser_params *p, NODE *node, const char *mesg)
22394{
22395 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
22396}
22397
22398static NODE*
22399block_append(struct parser_params *p, NODE *head, NODE *tail)
22400{
22401 NODE *end, *h = head, *nd;
22402
22403 if (tail == 0) return head;
22404
22405 if (h == 0) return tail;
22406 switch (nd_type(h)) {
22407 default:
22408 h = end = NEW_BLOCK(head, &head->nd_loc);
22409 head = end;
22410 break;
22411 case NODE_BLOCK:
22412 end = RNODE_BLOCK(h)->nd_end;
22413 break;
22414 }
22415
22416 nd = RNODE_BLOCK(end)->nd_head;
22417 switch (nd_type(nd)) {
22418 case NODE_RETURN:
22419 case NODE_BREAK:
22420 case NODE_NEXT:
22421 case NODE_REDO:
22422 case NODE_RETRY:
22423 if (RTEST(ruby_verbose)) {
22424 parser_warning(p, tail, "statement not reached");
22425 }
22426 break;
22427
22428 default:
22429 break;
22430 }
22431
22432 if (!nd_type_p(tail, NODE_BLOCK)) {
22433 tail = NEW_BLOCK(tail, &tail->nd_loc);
22434 }
22435 RNODE_BLOCK(end)->nd_next = tail;
22436 RNODE_BLOCK(h)->nd_end = RNODE_BLOCK(tail)->nd_end;
22437 nd_set_last_loc(head, nd_last_loc(tail));
22438 return head;
22439}
22440
22441/* append item to the list */
22442static NODE*
22443list_append(struct parser_params *p, NODE *list, NODE *item)
22444{
22445 NODE *last;
22446
22447 if (list == 0) return NEW_LIST(item, &item->nd_loc);
22448 if (RNODE_LIST(list)->nd_next) {
22449 last = RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end;
22450 }
22451 else {
22452 last = list;
22453 }
22454
22455 RNODE_LIST(list)->as.nd_alen += 1;
22456 RNODE_LIST(last)->nd_next = NEW_LIST(item, &item->nd_loc);
22457 RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end = RNODE_LIST(last)->nd_next;
22458
22459 nd_set_last_loc(list, nd_last_loc(item));
22460
22461 return list;
22462}
22463
22464/* concat two lists */
22465static NODE*
22466list_concat(NODE *head, NODE *tail)
22467{
22468 NODE *last;
22469
22470 if (RNODE_LIST(head)->nd_next) {
22471 last = RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end;
22472 }
22473 else {
22474 last = head;
22475 }
22476
22477 RNODE_LIST(head)->as.nd_alen += RNODE_LIST(tail)->as.nd_alen;
22478 RNODE_LIST(last)->nd_next = tail;
22479 if (RNODE_LIST(tail)->nd_next) {
22480 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = RNODE_LIST(RNODE_LIST(tail)->nd_next)->as.nd_end;
22481 }
22482 else {
22483 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = tail;
22484 }
22485
22486 nd_set_last_loc(head, nd_last_loc(tail));
22487
22488 return head;
22489}
22490
22491static int
22492literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
22493{
22494 if (NIL_P(tail)) return 1;
22495 if (!rb_enc_compatible(head, tail)) {
22496 compile_error(p, "string literal encodings differ (%s / %s)",
22497 rb_enc_name(rb_enc_get(head)),
22498 rb_enc_name(rb_enc_get(tail)));
22499 rb_str_resize(head, 0);
22500 rb_str_resize(tail, 0);
22501 return 0;
22502 }
22503 rb_str_buf_append(head, tail);
22504 return 1;
22505}
22506
22507static VALUE
22508string_literal_head(struct parser_params *p, enum node_type htype, NODE *head)
22509{
22510 if (htype != NODE_DSTR) return Qfalse;
22511 if (RNODE_DSTR(head)->nd_next) {
22512 head = RNODE_LIST(RNODE_LIST(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_head;
22513 if (!head || !nd_type_p(head, NODE_STR)) return Qfalse;
22514 }
22515 const VALUE lit = RNODE_DSTR(head)->nd_lit;
22516 ASSUME(lit != Qfalse);
22517 return lit;
22518}
22519
22520/* concat two string literals */
22521static NODE *
22522literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
22523{
22524 enum node_type htype;
22525 VALUE lit;
22526
22527 if (!head) return tail;
22528 if (!tail) return head;
22529
22530 htype = nd_type(head);
22531 if (htype == NODE_EVSTR) {
22532 head = new_dstr(p, head, loc);
22533 htype = NODE_DSTR;
22534 }
22535 if (p->heredoc_indent > 0) {
22536 switch (htype) {
22537 case NODE_STR:
22538 head = str2dstr(p, head);
22539 case NODE_DSTR:
22540 return list_append(p, head, tail);
22541 default:
22542 break;
22543 }
22544 }
22545 switch (nd_type(tail)) {
22546 case NODE_STR:
22547 if ((lit = string_literal_head(p, htype, head)) != Qfalse) {
22548 htype = NODE_STR;
22549 }
22550 else {
22551 lit = RNODE_DSTR(head)->nd_lit;
22552 }
22553 if (htype == NODE_STR) {
22554 if (!literal_concat0(p, lit, RNODE_STR(tail)->nd_lit)) {
22555 error:
22556 rb_discard_node(p, head);
22557 rb_discard_node(p, tail);
22558 return 0;
22559 }
22560 rb_discard_node(p, tail);
22561 }
22562 else {
22563 list_append(p, head, tail);
22564 }
22565 break;
22566
22567 case NODE_DSTR:
22568 if (htype == NODE_STR) {
22569 if (!literal_concat0(p, RNODE_STR(head)->nd_lit, RNODE_DSTR(tail)->nd_lit))
22570 goto error;
22571 RNODE_DSTR(tail)->nd_lit = RNODE_STR(head)->nd_lit;
22572 rb_discard_node(p, head);
22573 head = tail;
22574 }
22575 else if (NIL_P(RNODE_DSTR(tail)->nd_lit)) {
22576 append:
22577 RNODE_DSTR(head)->as.nd_alen += RNODE_DSTR(tail)->as.nd_alen - 1;
22578 if (!RNODE_DSTR(head)->nd_next) {
22579 RNODE_DSTR(head)->nd_next = RNODE_DSTR(tail)->nd_next;
22580 }
22581 else if (RNODE_DSTR(tail)->nd_next) {
22582 RNODE_DSTR(RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_next = RNODE_DSTR(tail)->nd_next;
22583 RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end = RNODE_DSTR(RNODE_DSTR(tail)->nd_next)->as.nd_end;
22584 }
22585 rb_discard_node(p, tail);
22586 }
22587 else if ((lit = string_literal_head(p, htype, head)) != Qfalse) {
22588 if (!literal_concat0(p, lit, RNODE_DSTR(tail)->nd_lit))
22589 goto error;
22590 RNODE_DSTR(tail)->nd_lit = Qnil;
22591 goto append;
22592 }
22593 else {
22594 list_concat(head, NEW_LIST2(NEW_STR(RNODE_DSTR(tail)->nd_lit, loc), RNODE_DSTR(tail)->as.nd_alen, (NODE *)RNODE_DSTR(tail)->nd_next, loc));
22595 }
22596 break;
22597
22598 case NODE_EVSTR:
22599 if (htype == NODE_STR) {
22600 head = str2dstr(p, head);
22601 RNODE_DSTR(head)->as.nd_alen = 1;
22602 }
22603 list_append(p, head, tail);
22604 break;
22605 }
22606 return head;
22607}
22608
22609static void
22610nd_copy_flag(NODE *new_node, NODE *old_node)
22611{
22612 if (nd_fl_newline(old_node)) nd_set_fl_newline(new_node);
22613 nd_set_line(new_node, nd_line(old_node));
22614 new_node->nd_loc = old_node->nd_loc;
22615 new_node->node_id = old_node->node_id;
22616}
22617
22618static NODE *
22619str2dstr(struct parser_params *p, NODE *node)
22620{
22621 NODE *new_node = (NODE *)NODE_NEW_INTERNAL(NODE_DSTR, rb_node_dstr_t);
22622 nd_copy_flag(new_node, node);
22623 RNODE_DSTR(new_node)->nd_lit = RNODE_STR(node)->nd_lit;
22624 RNODE_DSTR(new_node)->as.nd_alen = 0;
22625 RNODE_DSTR(new_node)->nd_next = 0;
22626 RNODE_STR(node)->nd_lit = 0;
22627
22628 return new_node;
22629}
22630
22631static NODE *
22632evstr2dstr(struct parser_params *p, NODE *node)
22633{
22634 if (nd_type_p(node, NODE_EVSTR)) {
22635 node = new_dstr(p, node, &node->nd_loc);
22636 }
22637 return node;
22638}
22639
22640static NODE *
22641new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22642{
22643 NODE *head = node;
22644
22645 if (node) {
22646 switch (nd_type(node)) {
22647 case NODE_STR:
22648 return str2dstr(p, node);
22649 case NODE_DSTR:
22650 break;
22651 case NODE_EVSTR:
22652 return node;
22653 }
22654 }
22655 return NEW_EVSTR(head, loc);
22656}
22657
22658static NODE *
22659new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22660{
22661 VALUE lit = STR_NEW0();
22662 NODE *dstr = NEW_DSTR(lit, loc);
22663 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
22664 return list_append(p, dstr, node);
22665}
22666
22667static NODE *
22668call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
22669 const YYLTYPE *op_loc, const YYLTYPE *loc)
22670{
22671 NODE *expr;
22672 value_expr(recv);
22673 value_expr(arg1);
22674 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
22675 nd_set_line(expr, op_loc->beg_pos.lineno);
22676 return expr;
22677}
22678
22679static NODE *
22680call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
22681{
22682 NODE *opcall;
22683 value_expr(recv);
22684 opcall = NEW_OPCALL(recv, id, 0, loc);
22685 nd_set_line(opcall, op_loc->beg_pos.lineno);
22686 return opcall;
22687}
22688
22689static NODE *
22690new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
22691{
22692 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
22693 nd_set_line(qcall, op_loc->beg_pos.lineno);
22694 return qcall;
22695}
22696
22697static NODE*
22698new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
22699{
22700 NODE *ret;
22701 if (block) block_dup_check(p, args, block);
22702 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
22703 if (block) ret = method_add_block(p, ret, block, loc);
22704 fixpos(ret, recv);
22705 return ret;
22706}
22707
22708#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? RNODE_ONCE(node)->nd_body : node)
22709
22710static NODE*
22711last_expr_once_body(NODE *node)
22712{
22713 if (!node) return 0;
22714 return nd_once_body(node);
22715}
22716
22717static NODE*
22718match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
22719{
22720 NODE *n;
22721 int line = op_loc->beg_pos.lineno;
22722
22723 value_expr(node1);
22724 value_expr(node2);
22725
22726 if ((n = last_expr_once_body(node1)) != 0) {
22727 switch (nd_type(n)) {
22728 case NODE_DREGX:
22729 {
22730 NODE *match = NEW_MATCH2(node1, node2, loc);
22731 nd_set_line(match, line);
22732 return match;
22733 }
22734
22735 case NODE_LIT:
22736 if (RB_TYPE_P(RNODE_LIT(n)->nd_lit, T_REGEXP)) {
22737 const VALUE lit = RNODE_LIT(n)->nd_lit;
22738 NODE *match = NEW_MATCH2(node1, node2, loc);
22739 RNODE_MATCH2(match)->nd_args = reg_named_capture_assign(p, lit, loc);
22740 nd_set_line(match, line);
22741 return match;
22742 }
22743 }
22744 }
22745
22746 if ((n = last_expr_once_body(node2)) != 0) {
22747 NODE *match3;
22748
22749 switch (nd_type(n)) {
22750 case NODE_LIT:
22751 if (!RB_TYPE_P(RNODE_LIT(n)->nd_lit, T_REGEXP)) break;
22752 /* fallthru */
22753 case NODE_DREGX:
22754 match3 = NEW_MATCH3(node2, node1, loc);
22755 return match3;
22756 }
22757 }
22758
22759 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
22760 nd_set_line(n, line);
22761 return n;
22762}
22763
22764# if WARN_PAST_SCOPE
22765static int
22766past_dvar_p(struct parser_params *p, ID id)
22767{
22768 struct vtable *past = p->lvtbl->past;
22769 while (past) {
22770 if (vtable_included(past, id)) return 1;
22771 past = past->prev;
22772 }
22773 return 0;
22774}
22775# endif
22776
22777static int
22778numparam_nested_p(struct parser_params *p)
22779{
22780 struct local_vars *local = p->lvtbl;
22781 NODE *outer = local->numparam.outer;
22782 NODE *inner = local->numparam.inner;
22783 if (outer || inner) {
22784 NODE *used = outer ? outer : inner;
22785 compile_error(p, "numbered parameter is already used in\n"
22786 "%s:%d: %s block here",
22787 p->ruby_sourcefile, nd_line(used),
22788 outer ? "outer" : "inner");
22789 parser_show_error_line(p, &used->nd_loc);
22790 return 1;
22791 }
22792 return 0;
22793}
22794
22795static NODE*
22796gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
22797{
22798 ID *vidp = NULL;
22799 NODE *node;
22800 switch (id) {
22801 case keyword_self:
22802 return NEW_SELF(loc);
22803 case keyword_nil:
22804 return NEW_NIL(loc);
22805 case keyword_true:
22806 return NEW_TRUE(loc);
22807 case keyword_false:
22808 return NEW_FALSE(loc);
22809 case keyword__FILE__:
22810 {
22811 VALUE file = p->ruby_sourcefile_string;
22812 if (NIL_P(file))
22813 file = rb_str_new(0, 0);
22814 else
22815 file = rb_str_dup(file);
22816 node = NEW_STR(file, loc);
22817 RB_OBJ_WRITTEN(p->ast, Qnil, file);
22818 }
22819 return node;
22820 case keyword__LINE__:
22821 return NEW_LIT(INT2FIX(loc->beg_pos.lineno), loc);
22822 case keyword__ENCODING__:
22823 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
22824 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit);
22825 return node;
22826
22827 }
22828 switch (id_type(id)) {
22829 case ID_LOCAL:
22830 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
22831 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
22832 if (id == p->cur_arg) {
22833 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
22834 return 0;
22835 }
22836 if (vidp) *vidp |= LVAR_USED;
22837 node = NEW_DVAR(id, loc);
22838 return node;
22839 }
22840 if (local_id_ref(p, id, &vidp)) {
22841 if (id == p->cur_arg) {
22842 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
22843 return 0;
22844 }
22845 if (vidp) *vidp |= LVAR_USED;
22846 node = NEW_LVAR(id, loc);
22847 return node;
22848 }
22849 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
22850 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
22851 if (numparam_nested_p(p)) return 0;
22852 node = NEW_DVAR(id, loc);
22853 struct local_vars *local = p->lvtbl;
22854 if (!local->numparam.current) local->numparam.current = node;
22855 return node;
22856 }
22857# if WARN_PAST_SCOPE
22858 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
22859 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
22860 }
22861# endif
22862 /* method call without arguments */
22863 if (dyna_in_block(p) && id == rb_intern("it")
22864 && !(DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev))
22865 && p->max_numparam != ORDINAL_PARAM) {
22866 rb_warn0("`it` calls without arguments will refer to the first block param in Ruby 3.4; use it() or self.it");
22867 }
22868 return NEW_VCALL(id, loc);
22869 case ID_GLOBAL:
22870 return NEW_GVAR(id, loc);
22871 case ID_INSTANCE:
22872 return NEW_IVAR(id, loc);
22873 case ID_CONST:
22874 return NEW_CONST(id, loc);
22875 case ID_CLASS:
22876 return NEW_CVAR(id, loc);
22877 }
22878 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
22879 return 0;
22880}
22881
22882static rb_node_opt_arg_t *
22883opt_arg_append(rb_node_opt_arg_t *opt_list, rb_node_opt_arg_t *opt)
22884{
22885 rb_node_opt_arg_t *opts = opt_list;
22886 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
22887
22888 while (opts->nd_next) {
22889 opts = opts->nd_next;
22890 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
22891 }
22892 opts->nd_next = opt;
22893
22894 return opt_list;
22895}
22896
22897static rb_node_kw_arg_t *
22898kwd_append(rb_node_kw_arg_t *kwlist, rb_node_kw_arg_t *kw)
22899{
22900 if (kwlist) {
22901 /* Assume rb_node_kw_arg_t and rb_node_opt_arg_t has same structure */
22902 opt_arg_append(RNODE_OPT_ARG(kwlist), RNODE_OPT_ARG(kw));
22903 }
22904 return kwlist;
22905}
22906
22907static NODE *
22908new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
22909{
22910 NODE *n = expr;
22911 while (n) {
22912 if (nd_type_p(n, NODE_BEGIN)) {
22913 n = RNODE_BEGIN(n)->nd_body;
22914 }
22915 else if (nd_type_p(n, NODE_BLOCK) && RNODE_BLOCK(n)->nd_end == n) {
22916 n = RNODE_BLOCK(n)->nd_head;
22917 }
22918 else {
22919 break;
22920 }
22921 }
22922 return NEW_DEFINED(n, loc);
22923}
22924
22925static NODE*
22926symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
22927{
22928 enum node_type type = nd_type(symbol);
22929 switch (type) {
22930 case NODE_DSTR:
22931 nd_set_type(symbol, NODE_DSYM);
22932 break;
22933 case NODE_STR:
22934 nd_set_type(symbol, NODE_LIT);
22935 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(symbol)->nd_lit = rb_str_intern(RNODE_LIT(symbol)->nd_lit));
22936 break;
22937 default:
22938 compile_error(p, "unexpected node as symbol: %s", parser_node_name(type));
22939 }
22940 return list_append(p, symbols, symbol);
22941}
22942
22943static NODE *
22944new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
22945{
22946 struct RNode_LIST *list;
22947 NODE *prev;
22948 VALUE lit;
22949
22950 if (!node) {
22951 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
22952 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit);
22953 return node;
22954 }
22955 switch (nd_type(node)) {
22956 case NODE_STR:
22957 {
22958 VALUE src = RNODE_STR(node)->nd_lit;
22959 nd_set_type(node, NODE_LIT);
22960 nd_set_loc(node, loc);
22961 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit = reg_compile(p, src, options));
22962 }
22963 break;
22964 default:
22965 lit = STR_NEW0();
22966 node = NEW_DSTR0(lit, 1, NEW_LIST(node, loc), loc);
22967 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
22968 /* fall through */
22969 case NODE_DSTR:
22970 nd_set_type(node, NODE_DREGX);
22971 nd_set_loc(node, loc);
22972 RNODE_DREGX(node)->nd_cflag = options & RE_OPTION_MASK;
22973 if (!NIL_P(RNODE_DREGX(node)->nd_lit)) reg_fragment_check(p, RNODE_DREGX(node)->nd_lit, options);
22974 for (list = RNODE_DREGX(prev = node)->nd_next; list; list = RNODE_LIST(list->nd_next)) {
22975 NODE *frag = list->nd_head;
22976 enum node_type type = nd_type(frag);
22977 if (type == NODE_STR || (type == NODE_DSTR && !RNODE_DSTR(frag)->nd_next)) {
22978 VALUE tail = RNODE_STR(frag)->nd_lit;
22979 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(RNODE_DREGX(prev)->nd_lit)) {
22980 VALUE lit = prev == node ? RNODE_DREGX(prev)->nd_lit : RNODE_LIT(RNODE_LIST(prev)->nd_head)->nd_lit;
22981 if (!literal_concat0(p, lit, tail)) {
22982 return NEW_NIL(loc); /* dummy node on error */
22983 }
22984 rb_str_resize(tail, 0);
22985 RNODE_LIST(prev)->nd_next = list->nd_next;
22986 rb_discard_node(p, list->nd_head);
22987 rb_discard_node(p, (NODE *)list);
22988 list = RNODE_LIST(prev);
22989 }
22990 else {
22991 prev = (NODE *)list;
22992 }
22993 }
22994 else {
22995 prev = 0;
22996 }
22997 }
22998 if (!RNODE_DREGX(node)->nd_next) {
22999 VALUE src = RNODE_DREGX(node)->nd_lit;
23000 VALUE re = reg_compile(p, src, options);
23001 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_DREGX(node)->nd_lit = re);
23002 }
23003 if (options & RE_OPTION_ONCE) {
23004 node = NEW_ONCE(node, loc);
23005 }
23006 break;
23007 }
23008 return node;
23009}
23010
23011static rb_node_kw_arg_t *
23012new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
23013{
23014 if (!k) return 0;
23015 return NEW_KW_ARG((k), loc);
23016}
23017
23018static NODE *
23019new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23020{
23021 if (!node) {
23022 VALUE lit = STR_NEW0();
23023 NODE *xstr = NEW_XSTR(lit, loc);
23024 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
23025 return xstr;
23026 }
23027 switch (nd_type(node)) {
23028 case NODE_STR:
23029 nd_set_type(node, NODE_XSTR);
23030 nd_set_loc(node, loc);
23031 break;
23032 case NODE_DSTR:
23033 nd_set_type(node, NODE_DXSTR);
23034 nd_set_loc(node, loc);
23035 break;
23036 default:
23037 node = NEW_DXSTR(Qnil, 1, NEW_LIST(node, loc), loc);
23038 break;
23039 }
23040 return node;
23041}
23042
23043static void
23044check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
23045{
23046 VALUE lit;
23047
23048 if (!arg || !p->case_labels) return;
23049
23050 lit = rb_node_case_when_optimizable_literal(arg);
23051 if (UNDEF_P(lit)) return;
23052 if (nd_type_p(arg, NODE_STR)) {
23053 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(arg)->nd_lit = lit);
23054 }
23055
23056 if (NIL_P(p->case_labels)) {
23057 p->case_labels = rb_obj_hide(rb_hash_new());
23058 }
23059 else {
23060 VALUE line = rb_hash_lookup(p->case_labels, lit);
23061 if (!NIL_P(line)) {
23062 rb_warning1("duplicated `when' clause with line %d is ignored",
23063 WARN_IVAL(line));
23064 return;
23065 }
23066 }
23067 rb_hash_aset(p->case_labels, lit, INT2NUM(p->ruby_sourceline));
23068}
23069
23070#else /* !RIPPER */
23071static int
23072id_is_var(struct parser_params *p, ID id)
23073{
23074 if (is_notop_id(id)) {
23075 switch (id & ID_SCOPE_MASK) {
23076 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
23077 return 1;
23078 case ID_LOCAL:
23079 if (dyna_in_block(p)) {
23080 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
23081 }
23082 if (local_id(p, id)) return 1;
23083 /* method call without arguments */
23084 return 0;
23085 }
23086 }
23087 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
23088 return 0;
23089}
23090
23091static VALUE
23092new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
23093{
23094 VALUE src = 0, err = 0;
23095 int options = 0;
23096 if (ripper_is_node_yylval(p, re)) {
23097 src = RNODE_RIPPER(re)->nd_cval;
23098 re = RNODE_RIPPER(re)->nd_rval;
23099 }
23100 if (ripper_is_node_yylval(p, opt)) {
23101 options = (int)RNODE_RIPPER(opt)->nd_vid;
23102 opt = RNODE_RIPPER(opt)->nd_rval;
23103 }
23104 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
23105 compile_error(p, "%"PRIsVALUE, err);
23106 }
23107 return dispatch2(regexp_literal, re, opt);
23108}
23109#endif /* !RIPPER */
23110
23111static inline enum lex_state_e
23112parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
23113{
23114 if (p->debug) {
23115 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
23116 }
23117 return p->lex.state = ls;
23118}
23119
23120#ifndef RIPPER
23121static const char rb_parser_lex_state_names[][8] = {
23122 "BEG", "END", "ENDARG", "ENDFN", "ARG",
23123 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
23124 "LABEL", "LABELED","FITEM",
23125};
23126
23127static VALUE
23128append_lex_state_name(struct parser_params *p, enum lex_state_e state, VALUE buf)
23129{
23130 int i, sep = 0;
23131 unsigned int mask = 1;
23132 static const char none[] = "NONE";
23133
23134 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
23135 if ((unsigned)state & mask) {
23136 if (sep) {
23137 rb_str_cat(buf, "|", 1);
23138 }
23139 sep = 1;
23140 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
23141 }
23142 }
23143 if (!sep) {
23144 rb_str_cat(buf, none, sizeof(none)-1);
23145 }
23146 return buf;
23147}
23148
23149static void
23150flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
23151{
23152 VALUE mesg = p->debug_buffer;
23153
23154 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
23155 p->debug_buffer = Qnil;
23156 rb_io_puts(1, &mesg, out);
23157 }
23158 if (!NIL_P(str) && RSTRING_LEN(str)) {
23159 rb_io_write(p->debug_output, str);
23160 }
23161}
23162
23163enum lex_state_e
23164rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
23165 enum lex_state_e to, int line)
23166{
23167 VALUE mesg;
23168 mesg = rb_str_new_cstr("lex_state: ");
23169 append_lex_state_name(p, from, mesg);
23170 rb_str_cat_cstr(mesg, " -> ");
23171 append_lex_state_name(p, to, mesg);
23172 rb_str_catf(mesg, " at line %d\n", line);
23173 flush_debug_buffer(p, p->debug_output, mesg);
23174 return to;
23175}
23176
23177VALUE
23178rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state)
23179{
23180 return rb_fstring(append_lex_state_name(p, state, rb_str_new(0, 0)));
23181}
23182
23183static void
23184append_bitstack_value(struct parser_params *p, stack_type stack, VALUE mesg)
23185{
23186 if (stack == 0) {
23187 rb_str_cat_cstr(mesg, "0");
23188 }
23189 else {
23190 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
23191 for (; mask && !(stack & mask); mask >>= 1) continue;
23192 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
23193 }
23194}
23195
23196void
23197rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
23198 const char *name, int line)
23199{
23200 VALUE mesg = rb_sprintf("%s: ", name);
23201 append_bitstack_value(p, stack, mesg);
23202 rb_str_catf(mesg, " at line %d\n", line);
23203 flush_debug_buffer(p, p->debug_output, mesg);
23204}
23205
23206void
23207rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
23208{
23209 va_list ap;
23210 VALUE mesg = rb_str_new_cstr("internal parser error: ");
23211
23212 va_start(ap, fmt);
23213 rb_str_vcatf(mesg, fmt, ap);
23214 va_end(ap);
23215 yyerror0(RSTRING_PTR(mesg));
23216 RB_GC_GUARD(mesg);
23217
23218 mesg = rb_str_new(0, 0);
23219 append_lex_state_name(p, p->lex.state, mesg);
23220 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
23221 rb_str_resize(mesg, 0);
23222 append_bitstack_value(p, p->cond_stack, mesg);
23223 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
23224 rb_str_resize(mesg, 0);
23225 append_bitstack_value(p, p->cmdarg_stack, mesg);
23226 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
23227 if (p->debug_output == rb_ractor_stdout())
23228 p->debug_output = rb_ractor_stderr();
23229 p->debug = TRUE;
23230}
23231
23232static YYLTYPE *
23233rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
23234{
23235 yylloc->beg_pos.lineno = sourceline;
23236 yylloc->beg_pos.column = beg_pos;
23237 yylloc->end_pos.lineno = sourceline;
23238 yylloc->end_pos.column = end_pos;
23239 return yylloc;
23240}
23241
23242YYLTYPE *
23243rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
23244{
23245 int sourceline = here->sourceline;
23246 int beg_pos = (int)here->offset - here->quote
23247 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
23248 int end_pos = (int)here->offset + here->length + here->quote;
23249
23250 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23251}
23252
23253YYLTYPE *
23254rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc)
23255{
23256 yylloc->beg_pos.lineno = p->delayed.beg_line;
23257 yylloc->beg_pos.column = p->delayed.beg_col;
23258 yylloc->end_pos.lineno = p->delayed.end_line;
23259 yylloc->end_pos.column = p->delayed.end_col;
23260
23261 return yylloc;
23262}
23263
23264YYLTYPE *
23265rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc)
23266{
23267 int sourceline = p->ruby_sourceline;
23268 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
23269 int end_pos = (int)(p->lex.pend - p->lex.pbeg);
23270 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23271}
23272
23273YYLTYPE *
23274rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc)
23275{
23276 yylloc->end_pos = yylloc->beg_pos;
23277
23278 return yylloc;
23279}
23280
23281YYLTYPE *
23282rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
23283{
23284 int sourceline = p->ruby_sourceline;
23285 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
23286 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
23287 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23288}
23289
23290YYLTYPE *
23291rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
23292{
23293 int sourceline = p->ruby_sourceline;
23294 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
23295 int end_pos = (int)(p->lex.pcur - p->lex.pbeg);
23296 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23297}
23298#endif /* !RIPPER */
23299
23300static int
23301assignable0(struct parser_params *p, ID id, const char **err)
23302{
23303 if (!id) return -1;
23304 switch (id) {
23305 case keyword_self:
23306 *err = "Can't change the value of self";
23307 return -1;
23308 case keyword_nil:
23309 *err = "Can't assign to nil";
23310 return -1;
23311 case keyword_true:
23312 *err = "Can't assign to true";
23313 return -1;
23314 case keyword_false:
23315 *err = "Can't assign to false";
23316 return -1;
23317 case keyword__FILE__:
23318 *err = "Can't assign to __FILE__";
23319 return -1;
23320 case keyword__LINE__:
23321 *err = "Can't assign to __LINE__";
23322 return -1;
23323 case keyword__ENCODING__:
23324 *err = "Can't assign to __ENCODING__";
23325 return -1;
23326 }
23327 switch (id_type(id)) {
23328 case ID_LOCAL:
23329 if (dyna_in_block(p)) {
23330 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
23331 compile_error(p, "Can't assign to numbered parameter _%d",
23332 NUMPARAM_ID_TO_IDX(id));
23333 return -1;
23334 }
23335 if (dvar_curr(p, id)) return NODE_DASGN;
23336 if (dvar_defined(p, id)) return NODE_DASGN;
23337 if (local_id(p, id)) return NODE_LASGN;
23338 dyna_var(p, id);
23339 return NODE_DASGN;
23340 }
23341 else {
23342 if (!local_id(p, id)) local_var(p, id);
23343 return NODE_LASGN;
23344 }
23345 break;
23346 case ID_GLOBAL: return NODE_GASGN;
23347 case ID_INSTANCE: return NODE_IASGN;
23348 case ID_CONST:
23349 if (!p->ctxt.in_def) return NODE_CDECL;
23350 *err = "dynamic constant assignment";
23351 return -1;
23352 case ID_CLASS: return NODE_CVASGN;
23353 default:
23354 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
23355 }
23356 return -1;
23357}
23358
23359#ifndef RIPPER
23360static NODE*
23361assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
23362{
23363 const char *err = 0;
23364 int node_type = assignable0(p, id, &err);
23365 switch (node_type) {
23366 case NODE_DASGN: return NEW_DASGN(id, val, loc);
23367 case NODE_LASGN: return NEW_LASGN(id, val, loc);
23368 case NODE_GASGN: return NEW_GASGN(id, val, loc);
23369 case NODE_IASGN: return NEW_IASGN(id, val, loc);
23370 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
23371 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
23372 }
23373 if (err) yyerror1(loc, err);
23374 return NEW_ERROR(loc);
23375}
23376#else
23377static VALUE
23378assignable(struct parser_params *p, VALUE lhs)
23379{
23380 const char *err = 0;
23381 assignable0(p, get_id(lhs), &err);
23382 if (err) lhs = assign_error(p, err, lhs);
23383 return lhs;
23384}
23385#endif
23386
23387static int
23388is_private_local_id(struct parser_params *p, ID name)
23389{
23390 VALUE s;
23391 if (name == idUScore) return 1;
23392 if (!is_local_id(name)) return 0;
23393 s = rb_id2str(name);
23394 if (!s) return 0;
23395 return RSTRING_PTR(s)[0] == '_';
23396}
23397
23398static int
23399shadowing_lvar_0(struct parser_params *p, ID name)
23400{
23401 if (dyna_in_block(p)) {
23402 if (dvar_curr(p, name)) {
23403 if (is_private_local_id(p, name)) return 1;
23404 yyerror0("duplicated argument name");
23405 }
23406 else if (dvar_defined(p, name) || local_id(p, name)) {
23407 vtable_add(p->lvtbl->vars, name);
23408 if (p->lvtbl->used) {
23409 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
23410 }
23411 return 0;
23412 }
23413 }
23414 else {
23415 if (local_id(p, name)) {
23416 if (is_private_local_id(p, name)) return 1;
23417 yyerror0("duplicated argument name");
23418 }
23419 }
23420 return 1;
23421}
23422
23423static ID
23424shadowing_lvar(struct parser_params *p, ID name)
23425{
23426 shadowing_lvar_0(p, name);
23427 return name;
23428}
23429
23430static void
23431new_bv(struct parser_params *p, ID name)
23432{
23433 if (!name) return;
23434 if (!is_local_id(name)) {
23435 compile_error(p, "invalid local variable - %"PRIsVALUE,
23436 rb_id2str(name));
23437 return;
23438 }
23439 if (!shadowing_lvar_0(p, name)) return;
23440 dyna_var(p, name);
23441}
23442
23443#ifndef RIPPER
23444static NODE *
23445aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
23446{
23447 return NEW_ATTRASGN(recv, tASET, idx, loc);
23448}
23449
23450static void
23451block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
23452{
23453 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
23454 compile_error(p, "both block arg and actual block given");
23455 }
23456}
23457
23458static NODE *
23459attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
23460{
23461 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
23462 return NEW_ATTRASGN(recv, id, 0, loc);
23463}
23464
23465static void
23466rb_backref_error(struct parser_params *p, NODE *node)
23467{
23468 switch (nd_type(node)) {
23469 case NODE_NTH_REF:
23470 compile_error(p, "Can't set variable $%ld", RNODE_NTH_REF(node)->nd_nth);
23471 break;
23472 case NODE_BACK_REF:
23473 compile_error(p, "Can't set variable $%c", (int)RNODE_BACK_REF(node)->nd_nth);
23474 break;
23475 }
23476}
23477#else
23478static VALUE
23479backref_error(struct parser_params *p, NODE *ref, VALUE expr)
23480{
23481 VALUE mesg = rb_str_new_cstr("Can't set variable ");
23482 rb_str_append(mesg, RNODE_RIPPER(ref)->nd_cval);
23483 return dispatch2(assign_error, mesg, expr);
23484}
23485#endif
23486
23487#ifndef RIPPER
23488static NODE *
23489arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
23490{
23491 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
23492 switch (nd_type(node1)) {
23493 case NODE_LIST:
23494 return list_append(p, node1, node2);
23495 case NODE_BLOCK_PASS:
23496 RNODE_BLOCK_PASS(node1)->nd_head = arg_append(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
23497 node1->nd_loc.end_pos = RNODE_BLOCK_PASS(node1)->nd_head->nd_loc.end_pos;
23498 return node1;
23499 case NODE_ARGSPUSH:
23500 RNODE_ARGSPUSH(node1)->nd_body = list_append(p, NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, &RNODE_ARGSPUSH(node1)->nd_body->nd_loc), node2);
23501 node1->nd_loc.end_pos = RNODE_ARGSPUSH(node1)->nd_body->nd_loc.end_pos;
23502 nd_set_type(node1, NODE_ARGSCAT);
23503 return node1;
23504 case NODE_ARGSCAT:
23505 if (!nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
23506 RNODE_ARGSCAT(node1)->nd_body = list_append(p, RNODE_ARGSCAT(node1)->nd_body, node2);
23507 node1->nd_loc.end_pos = RNODE_ARGSCAT(node1)->nd_body->nd_loc.end_pos;
23508 return node1;
23509 }
23510 return NEW_ARGSPUSH(node1, node2, loc);
23511}
23512
23513static NODE *
23514arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
23515{
23516 if (!node2) return node1;
23517 switch (nd_type(node1)) {
23518 case NODE_BLOCK_PASS:
23519 if (RNODE_BLOCK_PASS(node1)->nd_head)
23520 RNODE_BLOCK_PASS(node1)->nd_head = arg_concat(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
23521 else
23522 RNODE_LIST(node1)->nd_head = NEW_LIST(node2, loc);
23523 return node1;
23524 case NODE_ARGSPUSH:
23525 if (!nd_type_p(node2, NODE_LIST)) break;
23526 RNODE_ARGSPUSH(node1)->nd_body = list_concat(NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, loc), node2);
23527 nd_set_type(node1, NODE_ARGSCAT);
23528 return node1;
23529 case NODE_ARGSCAT:
23530 if (!nd_type_p(node2, NODE_LIST) ||
23531 !nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
23532 RNODE_ARGSCAT(node1)->nd_body = list_concat(RNODE_ARGSCAT(node1)->nd_body, node2);
23533 return node1;
23534 }
23535 return NEW_ARGSCAT(node1, node2, loc);
23536}
23537
23538static NODE *
23539last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
23540{
23541 NODE *n1;
23542 if ((n1 = splat_array(args)) != 0) {
23543 return list_append(p, n1, last_arg);
23544 }
23545 return arg_append(p, args, last_arg, loc);
23546}
23547
23548static NODE *
23549rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
23550{
23551 NODE *n1;
23552 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
23553 return list_concat(n1, rest_arg);
23554 }
23555 return arg_concat(p, args, rest_arg, loc);
23556}
23557
23558static NODE *
23559splat_array(NODE* node)
23560{
23561 if (nd_type_p(node, NODE_SPLAT)) node = RNODE_SPLAT(node)->nd_head;
23562 if (nd_type_p(node, NODE_LIST)) return node;
23563 return 0;
23564}
23565
23566static void
23567mark_lvar_used(struct parser_params *p, NODE *rhs)
23568{
23569 ID *vidp = NULL;
23570 if (!rhs) return;
23571 switch (nd_type(rhs)) {
23572 case NODE_LASGN:
23573 if (local_id_ref(p, RNODE_LASGN(rhs)->nd_vid, &vidp)) {
23574 if (vidp) *vidp |= LVAR_USED;
23575 }
23576 break;
23577 case NODE_DASGN:
23578 if (dvar_defined_ref(p, RNODE_DASGN(rhs)->nd_vid, &vidp)) {
23579 if (vidp) *vidp |= LVAR_USED;
23580 }
23581 break;
23582#if 0
23583 case NODE_MASGN:
23584 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
23585 mark_lvar_used(p, rhs->nd_head);
23586 }
23587 break;
23588#endif
23589 }
23590}
23591
23592static NODE *
23593const_decl_path(struct parser_params *p, NODE **dest)
23594{
23595 NODE *n = *dest;
23596 if (!nd_type_p(n, NODE_CALL)) {
23597 const YYLTYPE *loc = &n->nd_loc;
23598 VALUE path;
23599 if (RNODE_CDECL(n)->nd_vid) {
23600 path = rb_id2str(RNODE_CDECL(n)->nd_vid);
23601 }
23602 else {
23603 n = RNODE_CDECL(n)->nd_else;
23604 path = rb_ary_new();
23605 for (; n && nd_type_p(n, NODE_COLON2); n = RNODE_COLON2(n)->nd_head) {
23606 rb_ary_push(path, rb_id2str(RNODE_COLON2(n)->nd_mid));
23607 }
23608 if (n && nd_type_p(n, NODE_CONST)) {
23609 // Const::Name
23610 rb_ary_push(path, rb_id2str(RNODE_CONST(n)->nd_vid));
23611 }
23612 else if (n && nd_type_p(n, NODE_COLON3)) {
23613 // ::Const::Name
23614 rb_ary_push(path, rb_str_new(0, 0));
23615 }
23616 else {
23617 // expression::Name
23618 rb_ary_push(path, rb_str_new_cstr("..."));
23619 }
23620 path = rb_ary_join(rb_ary_reverse(path), rb_str_new_cstr("::"));
23621 path = rb_fstring(path);
23622 }
23623 *dest = n = NEW_LIT(path, loc);
23624 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(n)->nd_lit);
23625 }
23626 return n;
23627}
23628
23629static NODE *
23630make_shareable_node(struct parser_params *p, NODE *value, bool copy, const YYLTYPE *loc)
23631{
23632 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
23633
23634 if (copy) {
23635 return NEW_CALL(fcore, rb_intern("make_shareable_copy"),
23636 NEW_LIST(value, loc), loc);
23637 }
23638 else {
23639 return NEW_CALL(fcore, rb_intern("make_shareable"),
23640 NEW_LIST(value, loc), loc);
23641 }
23642}
23643
23644static NODE *
23645ensure_shareable_node(struct parser_params *p, NODE **dest, NODE *value, const YYLTYPE *loc)
23646{
23647 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
23648 NODE *args = NEW_LIST(value, loc);
23649 args = list_append(p, args, const_decl_path(p, dest));
23650 return NEW_CALL(fcore, rb_intern("ensure_shareable"), args, loc);
23651}
23652
23653static int is_static_content(NODE *node);
23654
23655static VALUE
23656shareable_literal_value(struct parser_params *p, NODE *node)
23657{
23658 if (!node) return Qnil;
23659 enum node_type type = nd_type(node);
23660 switch (type) {
23661 case NODE_TRUE:
23662 return Qtrue;
23663 case NODE_FALSE:
23664 return Qfalse;
23665 case NODE_NIL:
23666 return Qnil;
23667 case NODE_LIT:
23668 return RNODE_LIT(node)->nd_lit;
23669 default:
23670 return Qundef;
23671 }
23672}
23673
23674#ifndef SHAREABLE_BARE_EXPRESSION
23675#define SHAREABLE_BARE_EXPRESSION 1
23676#endif
23677
23678static NODE *
23679shareable_literal_constant(struct parser_params *p, enum shareability shareable,
23680 NODE **dest, NODE *value, const YYLTYPE *loc, size_t level)
23681{
23682# define shareable_literal_constant_next(n) \
23683 shareable_literal_constant(p, shareable, dest, (n), &(n)->nd_loc, level+1)
23684 VALUE lit = Qnil;
23685
23686 if (!value) return 0;
23687 enum node_type type = nd_type(value);
23688 switch (type) {
23689 case NODE_TRUE:
23690 case NODE_FALSE:
23691 case NODE_NIL:
23692 case NODE_LIT:
23693 return value;
23694
23695 case NODE_DSTR:
23696 if (shareable == shareable_literal) {
23697 value = NEW_CALL(value, idUMinus, 0, loc);
23698 }
23699 return value;
23700
23701 case NODE_STR:
23702 lit = rb_fstring(RNODE_STR(value)->nd_lit);
23703 nd_set_type(value, NODE_LIT);
23704 RB_OBJ_WRITE(p->ast, &RNODE_LIT(value)->nd_lit, lit);
23705 return value;
23706
23707 case NODE_ZLIST:
23708 lit = rb_ary_new();
23709 OBJ_FREEZE_RAW(lit);
23710 NODE *n = NEW_LIT(lit, loc);
23711 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(n)->nd_lit);
23712 return n;
23713
23714 case NODE_LIST:
23715 lit = rb_ary_new();
23716 for (NODE *n = value; n; n = RNODE_LIST(n)->nd_next) {
23717 NODE *elt = RNODE_LIST(n)->nd_head;
23718 if (elt) {
23719 elt = shareable_literal_constant_next(elt);
23720 if (elt) {
23721 RNODE_LIST(n)->nd_head = elt;
23722 }
23723 else if (RTEST(lit)) {
23724 rb_ary_clear(lit);
23725 lit = Qfalse;
23726 }
23727 }
23728 if (RTEST(lit)) {
23729 VALUE e = shareable_literal_value(p, elt);
23730 if (!UNDEF_P(e)) {
23731 rb_ary_push(lit, e);
23732 }
23733 else {
23734 rb_ary_clear(lit);
23735 lit = Qnil; /* make shareable at runtime */
23736 }
23737 }
23738 }
23739 break;
23740
23741 case NODE_HASH:
23742 if (!RNODE_HASH(value)->nd_brace) return 0;
23743 lit = rb_hash_new();
23744 for (NODE *n = RNODE_HASH(value)->nd_head; n; n = RNODE_LIST(RNODE_LIST(n)->nd_next)->nd_next) {
23745 NODE *key = RNODE_LIST(n)->nd_head;
23746 NODE *val = RNODE_LIST(RNODE_LIST(n)->nd_next)->nd_head;
23747 if (key) {
23748 key = shareable_literal_constant_next(key);
23749 if (key) {
23750 RNODE_LIST(n)->nd_head = key;
23751 }
23752 else if (RTEST(lit)) {
23753 rb_hash_clear(lit);
23754 lit = Qfalse;
23755 }
23756 }
23757 if (val) {
23758 val = shareable_literal_constant_next(val);
23759 if (val) {
23760 RNODE_LIST(RNODE_LIST(n)->nd_next)->nd_head = val;
23761 }
23762 else if (RTEST(lit)) {
23763 rb_hash_clear(lit);
23764 lit = Qfalse;
23765 }
23766 }
23767 if (RTEST(lit)) {
23768 VALUE k = shareable_literal_value(p, key);
23769 VALUE v = shareable_literal_value(p, val);
23770 if (!UNDEF_P(k) && !UNDEF_P(v)) {
23771 rb_hash_aset(lit, k, v);
23772 }
23773 else {
23774 rb_hash_clear(lit);
23775 lit = Qnil; /* make shareable at runtime */
23776 }
23777 }
23778 }
23779 break;
23780
23781 default:
23782 if (shareable == shareable_literal &&
23783 (SHAREABLE_BARE_EXPRESSION || level > 0)) {
23784 return ensure_shareable_node(p, dest, value, loc);
23785 }
23786 return 0;
23787 }
23788
23789 /* Array or Hash */
23790 if (!lit) return 0;
23791 if (NIL_P(lit)) {
23792 // if shareable_literal, all elements should have been ensured
23793 // as shareable
23794 value = make_shareable_node(p, value, false, loc);
23795 }
23796 else {
23797 value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
23798 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(value)->nd_lit);
23799 }
23800
23801 return value;
23802# undef shareable_literal_constant_next
23803}
23804
23805static NODE *
23806shareable_constant_value(struct parser_params *p, enum shareability shareable,
23807 NODE *lhs, NODE *value, const YYLTYPE *loc)
23808{
23809 if (!value) return 0;
23810 switch (shareable) {
23811 case shareable_none:
23812 return value;
23813
23814 case shareable_literal:
23815 {
23816 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
23817 if (lit) return lit;
23818 return value;
23819 }
23820 break;
23821
23822 case shareable_copy:
23823 case shareable_everything:
23824 {
23825 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
23826 if (lit) return lit;
23827 return make_shareable_node(p, value, shareable == shareable_copy, loc);
23828 }
23829 break;
23830
23831 default:
23833 }
23834}
23835
23836static NODE *
23837node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
23838{
23839 if (!lhs) return 0;
23840
23841 switch (nd_type(lhs)) {
23842 case NODE_CDECL:
23843 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
23844 /* fallthru */
23845
23846 case NODE_GASGN:
23847 case NODE_IASGN:
23848 case NODE_LASGN:
23849 case NODE_DASGN:
23850 case NODE_MASGN:
23851 case NODE_CVASGN:
23852 set_nd_value(p, lhs, rhs);
23853 nd_set_loc(lhs, loc);
23854 break;
23855
23856 case NODE_ATTRASGN:
23857 RNODE_ATTRASGN(lhs)->nd_args = arg_append(p, RNODE_ATTRASGN(lhs)->nd_args, rhs, loc);
23858 nd_set_loc(lhs, loc);
23859 break;
23860
23861 default:
23862 /* should not happen */
23863 break;
23864 }
23865
23866 return lhs;
23867}
23868
23869static NODE *
23870value_expr_check(struct parser_params *p, NODE *node)
23871{
23872 NODE *void_node = 0, *vn;
23873
23874 if (!node) {
23875 rb_warning0("empty expression");
23876 }
23877 while (node) {
23878 switch (nd_type(node)) {
23879 case NODE_RETURN:
23880 case NODE_BREAK:
23881 case NODE_NEXT:
23882 case NODE_REDO:
23883 case NODE_RETRY:
23884 return void_node ? void_node : node;
23885
23886 case NODE_CASE3:
23887 if (!RNODE_CASE3(node)->nd_body || !nd_type_p(RNODE_CASE3(node)->nd_body, NODE_IN)) {
23888 compile_error(p, "unexpected node");
23889 return NULL;
23890 }
23891 if (RNODE_IN(RNODE_CASE3(node)->nd_body)->nd_body) {
23892 return NULL;
23893 }
23894 /* single line pattern matching with "=>" operator */
23895 return void_node ? void_node : node;
23896
23897 case NODE_BLOCK:
23898 while (RNODE_BLOCK(node)->nd_next) {
23899 node = RNODE_BLOCK(node)->nd_next;
23900 }
23901 node = RNODE_BLOCK(node)->nd_head;
23902 break;
23903
23904 case NODE_BEGIN:
23905 node = RNODE_BEGIN(node)->nd_body;
23906 break;
23907
23908 case NODE_IF:
23909 case NODE_UNLESS:
23910 if (!RNODE_IF(node)->nd_body) {
23911 return NULL;
23912 }
23913 else if (!RNODE_IF(node)->nd_else) {
23914 return NULL;
23915 }
23916 vn = value_expr_check(p, RNODE_IF(node)->nd_body);
23917 if (!vn) return NULL;
23918 if (!void_node) void_node = vn;
23919 node = RNODE_IF(node)->nd_else;
23920 break;
23921
23922 case NODE_AND:
23923 case NODE_OR:
23924 node = RNODE_AND(node)->nd_1st;
23925 break;
23926
23927 case NODE_LASGN:
23928 case NODE_DASGN:
23929 case NODE_MASGN:
23930 mark_lvar_used(p, node);
23931 return NULL;
23932
23933 default:
23934 return NULL;
23935 }
23936 }
23937
23938 return NULL;
23939}
23940
23941static int
23942value_expr_gen(struct parser_params *p, NODE *node)
23943{
23944 NODE *void_node = value_expr_check(p, node);
23945 if (void_node) {
23946 yyerror1(&void_node->nd_loc, "void value expression");
23947 /* or "control never reach"? */
23948 return FALSE;
23949 }
23950 return TRUE;
23951}
23952
23953static void
23954void_expr(struct parser_params *p, NODE *node)
23955{
23956 const char *useless = 0;
23957
23958 if (!RTEST(ruby_verbose)) return;
23959
23960 if (!node || !(node = nd_once_body(node))) return;
23961 switch (nd_type(node)) {
23962 case NODE_OPCALL:
23963 switch (RNODE_OPCALL(node)->nd_mid) {
23964 case '+':
23965 case '-':
23966 case '*':
23967 case '/':
23968 case '%':
23969 case tPOW:
23970 case tUPLUS:
23971 case tUMINUS:
23972 case '|':
23973 case '^':
23974 case '&':
23975 case tCMP:
23976 case '>':
23977 case tGEQ:
23978 case '<':
23979 case tLEQ:
23980 case tEQ:
23981 case tNEQ:
23982 useless = rb_id2name(RNODE_OPCALL(node)->nd_mid);
23983 break;
23984 }
23985 break;
23986
23987 case NODE_LVAR:
23988 case NODE_DVAR:
23989 case NODE_GVAR:
23990 case NODE_IVAR:
23991 case NODE_CVAR:
23992 case NODE_NTH_REF:
23993 case NODE_BACK_REF:
23994 useless = "a variable";
23995 break;
23996 case NODE_CONST:
23997 useless = "a constant";
23998 break;
23999 case NODE_LIT:
24000 case NODE_STR:
24001 case NODE_DSTR:
24002 case NODE_DREGX:
24003 useless = "a literal";
24004 break;
24005 case NODE_COLON2:
24006 case NODE_COLON3:
24007 useless = "::";
24008 break;
24009 case NODE_DOT2:
24010 useless = "..";
24011 break;
24012 case NODE_DOT3:
24013 useless = "...";
24014 break;
24015 case NODE_SELF:
24016 useless = "self";
24017 break;
24018 case NODE_NIL:
24019 useless = "nil";
24020 break;
24021 case NODE_TRUE:
24022 useless = "true";
24023 break;
24024 case NODE_FALSE:
24025 useless = "false";
24026 break;
24027 case NODE_DEFINED:
24028 useless = "defined?";
24029 break;
24030 }
24031
24032 if (useless) {
24033 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
24034 }
24035}
24036
24037static NODE *
24038void_stmts(struct parser_params *p, NODE *node)
24039{
24040 NODE *const n = node;
24041 if (!RTEST(ruby_verbose)) return n;
24042 if (!node) return n;
24043 if (!nd_type_p(node, NODE_BLOCK)) return n;
24044
24045 while (RNODE_BLOCK(node)->nd_next) {
24046 void_expr(p, RNODE_BLOCK(node)->nd_head);
24047 node = RNODE_BLOCK(node)->nd_next;
24048 }
24049 return n;
24050}
24051
24052static NODE *
24053remove_begin(NODE *node)
24054{
24055 NODE **n = &node, *n1 = node;
24056 while (n1 && nd_type_p(n1, NODE_BEGIN) && RNODE_BEGIN(n1)->nd_body) {
24057 *n = n1 = RNODE_BEGIN(n1)->nd_body;
24058 }
24059 return node;
24060}
24061
24062static void
24063reduce_nodes(struct parser_params *p, NODE **body)
24064{
24065 NODE *node = *body;
24066
24067 if (!node) {
24068 *body = NEW_NIL(&NULL_LOC);
24069 return;
24070 }
24071#define subnodes(type, n1, n2) \
24072 ((!type(node)->n1) ? (type(node)->n2 ? (body = &type(node)->n2, 1) : 0) : \
24073 (!type(node)->n2) ? (body = &type(node)->n1, 1) : \
24074 (reduce_nodes(p, &type(node)->n1), body = &type(node)->n2, 1))
24075
24076 while (node) {
24077 int newline = (int)(nd_fl_newline(node));
24078 switch (nd_type(node)) {
24079 end:
24080 case NODE_NIL:
24081 *body = 0;
24082 return;
24083 case NODE_RETURN:
24084 *body = node = RNODE_RETURN(node)->nd_stts;
24085 if (newline && node) nd_set_fl_newline(node);
24086 continue;
24087 case NODE_BEGIN:
24088 *body = node = RNODE_BEGIN(node)->nd_body;
24089 if (newline && node) nd_set_fl_newline(node);
24090 continue;
24091 case NODE_BLOCK:
24092 body = &RNODE_BLOCK(RNODE_BLOCK(node)->nd_end)->nd_head;
24093 break;
24094 case NODE_IF:
24095 case NODE_UNLESS:
24096 if (subnodes(RNODE_IF, nd_body, nd_else)) break;
24097 return;
24098 case NODE_CASE:
24099 body = &RNODE_CASE(node)->nd_body;
24100 break;
24101 case NODE_WHEN:
24102 if (!subnodes(RNODE_WHEN, nd_body, nd_next)) goto end;
24103 break;
24104 case NODE_ENSURE:
24105 if (!subnodes(RNODE_ENSURE, nd_head, nd_resq)) goto end;
24106 break;
24107 case NODE_RESCUE:
24108 newline = 0; // RESBODY should not be a NEWLINE
24109 if (RNODE_RESCUE(node)->nd_else) {
24110 body = &RNODE_RESCUE(node)->nd_resq;
24111 break;
24112 }
24113 if (!subnodes(RNODE_RESCUE, nd_head, nd_resq)) goto end;
24114 break;
24115 default:
24116 return;
24117 }
24118 node = *body;
24119 if (newline && node) nd_set_fl_newline(node);
24120 }
24121
24122#undef subnodes
24123}
24124
24125static int
24126is_static_content(NODE *node)
24127{
24128 if (!node) return 1;
24129 switch (nd_type(node)) {
24130 case NODE_HASH:
24131 if (!(node = RNODE_HASH(node)->nd_head)) break;
24132 case NODE_LIST:
24133 do {
24134 if (!is_static_content(RNODE_LIST(node)->nd_head)) return 0;
24135 } while ((node = RNODE_LIST(node)->nd_next) != 0);
24136 case NODE_LIT:
24137 case NODE_STR:
24138 case NODE_NIL:
24139 case NODE_TRUE:
24140 case NODE_FALSE:
24141 case NODE_ZLIST:
24142 break;
24143 default:
24144 return 0;
24145 }
24146 return 1;
24147}
24148
24149static int
24150assign_in_cond(struct parser_params *p, NODE *node)
24151{
24152 switch (nd_type(node)) {
24153 case NODE_MASGN:
24154 case NODE_LASGN:
24155 case NODE_DASGN:
24156 case NODE_GASGN:
24157 case NODE_IASGN:
24158 case NODE_CVASGN:
24159 case NODE_CDECL:
24160 break;
24161
24162 default:
24163 return 0;
24164 }
24165
24166 if (!get_nd_value(p, node)) return 1;
24167 if (is_static_content(get_nd_value(p, node))) {
24168 /* reports always */
24169 parser_warn(p, get_nd_value(p, node), "found `= literal' in conditional, should be ==");
24170 }
24171 return 1;
24172}
24173
24174enum cond_type {
24175 COND_IN_OP,
24176 COND_IN_COND,
24177 COND_IN_FF
24178};
24179
24180#define SWITCH_BY_COND_TYPE(t, w, arg) do { \
24181 switch (t) { \
24182 case COND_IN_OP: break; \
24183 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
24184 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
24185 } \
24186} while (0)
24187
24188static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*,bool);
24189
24190static NODE*
24191range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24192{
24193 enum node_type type;
24194
24195 if (node == 0) return 0;
24196
24197 type = nd_type(node);
24198 value_expr(node);
24199 if (type == NODE_LIT && FIXNUM_P(RNODE_LIT(node)->nd_lit)) {
24200 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
24201 ID lineno = rb_intern("$.");
24202 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
24203 }
24204 return cond0(p, node, COND_IN_FF, loc, true);
24205}
24206
24207static NODE*
24208cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc, bool top)
24209{
24210 if (node == 0) return 0;
24211 if (!(node = nd_once_body(node))) return 0;
24212 assign_in_cond(p, node);
24213
24214 switch (nd_type(node)) {
24215 case NODE_BEGIN:
24216 RNODE_BEGIN(node)->nd_body = cond0(p, RNODE_BEGIN(node)->nd_body, type, loc, top);
24217 break;
24218
24219 case NODE_DSTR:
24220 case NODE_EVSTR:
24221 case NODE_STR:
24222 SWITCH_BY_COND_TYPE(type, warn, "string ");
24223 break;
24224
24225 case NODE_DREGX:
24226 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ");
24227
24228 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
24229
24230 case NODE_BLOCK:
24231 {
24232 NODE *end = RNODE_BLOCK(node)->nd_end;
24233 NODE **expr = &RNODE_BLOCK(end)->nd_head;
24234 if (top) top = node == end;
24235 *expr = cond0(p, *expr, type, loc, top);
24236 }
24237 break;
24238
24239 case NODE_AND:
24240 case NODE_OR:
24241 RNODE_AND(node)->nd_1st = cond0(p, RNODE_AND(node)->nd_1st, COND_IN_COND, loc, true);
24242 RNODE_AND(node)->nd_2nd = cond0(p, RNODE_AND(node)->nd_2nd, COND_IN_COND, loc, true);
24243 break;
24244
24245 case NODE_DOT2:
24246 case NODE_DOT3:
24247 if (!top) break;
24248 RNODE_DOT2(node)->nd_beg = range_op(p, RNODE_DOT2(node)->nd_beg, loc);
24249 RNODE_DOT2(node)->nd_end = range_op(p, RNODE_DOT2(node)->nd_end, loc);
24250 if (nd_type_p(node, NODE_DOT2)) nd_set_type(node,NODE_FLIP2);
24251 else if (nd_type_p(node, NODE_DOT3)) nd_set_type(node, NODE_FLIP3);
24252 break;
24253
24254 case NODE_DSYM:
24255 warn_symbol:
24256 SWITCH_BY_COND_TYPE(type, warning, "symbol ");
24257 break;
24258
24259 case NODE_LIT:
24260 if (RB_TYPE_P(RNODE_LIT(node)->nd_lit, T_REGEXP)) {
24261 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ");
24262 nd_set_type(node, NODE_MATCH);
24263 }
24264 else if (RNODE_LIT(node)->nd_lit == Qtrue ||
24265 RNODE_LIT(node)->nd_lit == Qfalse) {
24266 /* booleans are OK, e.g., while true */
24267 }
24268 else if (SYMBOL_P(RNODE_LIT(node)->nd_lit)) {
24269 goto warn_symbol;
24270 }
24271 else {
24272 SWITCH_BY_COND_TYPE(type, warning, "");
24273 }
24274 default:
24275 break;
24276 }
24277 return node;
24278}
24279
24280static NODE*
24281cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24282{
24283 if (node == 0) return 0;
24284 return cond0(p, node, COND_IN_COND, loc, true);
24285}
24286
24287static NODE*
24288method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24289{
24290 if (node == 0) return 0;
24291 return cond0(p, node, COND_IN_OP, loc, true);
24292}
24293
24294static NODE*
24295new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
24296{
24297 YYLTYPE loc = {*pos, *pos};
24298 return NEW_NIL(&loc);
24299}
24300
24301static NODE*
24302new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
24303{
24304 if (!cc) return right;
24305 cc = cond0(p, cc, COND_IN_COND, loc, true);
24306 return newline_node(NEW_IF(cc, left, right, loc));
24307}
24308
24309static NODE*
24310new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
24311{
24312 if (!cc) return right;
24313 cc = cond0(p, cc, COND_IN_COND, loc, true);
24314 return newline_node(NEW_UNLESS(cc, left, right, loc));
24315}
24316
24317#define NEW_AND_OR(type, f, s, loc) (type == NODE_AND ? NEW_AND(f,s,loc) : NEW_OR(f,s,loc))
24318
24319static NODE*
24320logop(struct parser_params *p, ID id, NODE *left, NODE *right,
24321 const YYLTYPE *op_loc, const YYLTYPE *loc)
24322{
24323 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
24324 NODE *op;
24325 value_expr(left);
24326 if (left && nd_type_p(left, type)) {
24327 NODE *node = left, *second;
24328 while ((second = RNODE_AND(node)->nd_2nd) != 0 && nd_type_p(second, type)) {
24329 node = second;
24330 }
24331 RNODE_AND(node)->nd_2nd = NEW_AND_OR(type, second, right, loc);
24332 nd_set_line(RNODE_AND(node)->nd_2nd, op_loc->beg_pos.lineno);
24333 left->nd_loc.end_pos = loc->end_pos;
24334 return left;
24335 }
24336 op = NEW_AND_OR(type, left, right, loc);
24337 nd_set_line(op, op_loc->beg_pos.lineno);
24338 return op;
24339}
24340
24341#undef NEW_AND_OR
24342
24343static void
24344no_blockarg(struct parser_params *p, NODE *node)
24345{
24346 if (nd_type_p(node, NODE_BLOCK_PASS)) {
24347 compile_error(p, "block argument should not be given");
24348 }
24349}
24350
24351static NODE *
24352ret_args(struct parser_params *p, NODE *node)
24353{
24354 if (node) {
24355 no_blockarg(p, node);
24356 if (nd_type_p(node, NODE_LIST) && !RNODE_LIST(node)->nd_next) {
24357 node = RNODE_LIST(node)->nd_head;
24358 }
24359 }
24360 return node;
24361}
24362
24363static NODE *
24364new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24365{
24366 if (node) no_blockarg(p, node);
24367
24368 return NEW_YIELD(node, loc);
24369}
24370
24371static VALUE
24372negate_lit(struct parser_params *p, VALUE lit)
24373{
24374 if (FIXNUM_P(lit)) {
24375 return LONG2FIX(-FIX2LONG(lit));
24376 }
24377 if (SPECIAL_CONST_P(lit)) {
24378#if USE_FLONUM
24379 if (FLONUM_P(lit)) {
24380 return DBL2NUM(-RFLOAT_VALUE(lit));
24381 }
24382#endif
24383 goto unknown;
24384 }
24385 switch (BUILTIN_TYPE(lit)) {
24386 case T_BIGNUM:
24387 bignum_negate(lit);
24388 lit = rb_big_norm(lit);
24389 break;
24390 case T_RATIONAL:
24391 rational_set_num(lit, negate_lit(p, rational_get_num(lit)));
24392 break;
24393 case T_COMPLEX:
24394 rcomplex_set_real(lit, negate_lit(p, rcomplex_get_real(lit)));
24395 rcomplex_set_imag(lit, negate_lit(p, rcomplex_get_imag(lit)));
24396 break;
24397 case T_FLOAT:
24398 lit = DBL2NUM(-RFLOAT_VALUE(lit));
24399 break;
24400 unknown:
24401 default:
24402 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
24403 rb_builtin_class_name(lit));
24404 break;
24405 }
24406 return lit;
24407}
24408
24409static NODE *
24410arg_blk_pass(NODE *node1, rb_node_block_pass_t *node2)
24411{
24412 if (node2) {
24413 if (!node1) return (NODE *)node2;
24414 node2->nd_head = node1;
24415 nd_set_first_lineno(node2, nd_first_lineno(node1));
24416 nd_set_first_column(node2, nd_first_column(node1));
24417 return (NODE *)node2;
24418 }
24419 return node1;
24420}
24421
24422static bool
24423args_info_empty_p(struct rb_args_info *args)
24424{
24425 if (args->pre_args_num) return false;
24426 if (args->post_args_num) return false;
24427 if (args->rest_arg) return false;
24428 if (args->opt_args) return false;
24429 if (args->block_arg) return false;
24430 if (args->kw_args) return false;
24431 if (args->kw_rest_arg) return false;
24432 return true;
24433}
24434
24435static rb_node_args_t *
24436new_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)
24437{
24438 struct rb_args_info *args = &tail->nd_ainfo;
24439
24440 if (args->forwarding) {
24441 if (rest_arg) {
24442 yyerror1(&RNODE(tail)->nd_loc, "... after rest argument");
24443 return tail;
24444 }
24445 rest_arg = idFWD_REST;
24446 }
24447
24448 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
24449 args->pre_init = pre_args ? pre_args->nd_next : 0;
24450
24451 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
24452 args->post_init = post_args ? post_args->nd_next : 0;
24453 args->first_post_arg = post_args ? post_args->nd_pid : 0;
24454
24455 args->rest_arg = rest_arg;
24456
24457 args->opt_args = opt_args;
24458
24459#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
24460 args->ruby2_keywords = args->forwarding;
24461#else
24462 args->ruby2_keywords = 0;
24463#endif
24464
24465 nd_set_loc(RNODE(tail), loc);
24466
24467 return tail;
24468}
24469
24470static rb_node_args_t *
24471new_args_tail(struct parser_params *p, rb_node_kw_arg_t *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
24472{
24473 rb_node_args_t *node = NEW_ARGS(&NULL_LOC);
24474 struct rb_args_info *args = &node->nd_ainfo;
24475 if (p->error_p) return node;
24476
24477 args->block_arg = block;
24478 args->kw_args = kw_args;
24479
24480 if (kw_args) {
24481 /*
24482 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
24483 * variable order: k1, kr1, k2, &b, internal_id, krest
24484 * #=> <reorder>
24485 * variable order: kr1, k1, k2, internal_id, krest, &b
24486 */
24487 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
24488 struct vtable *vtargs = p->lvtbl->args;
24489 rb_node_kw_arg_t *kwn = kw_args;
24490
24491 if (block) block = vtargs->tbl[vtargs->pos-1];
24492 vtable_pop(vtargs, !!block + !!kw_rest_arg);
24493 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
24494 while (kwn) {
24495 if (!NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body)))
24496 --kw_vars;
24497 --required_kw_vars;
24498 kwn = kwn->nd_next;
24499 }
24500
24501 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
24502 ID vid = get_nd_vid(p, kwn->nd_body);
24503 if (NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body))) {
24504 *required_kw_vars++ = vid;
24505 }
24506 else {
24507 *kw_vars++ = vid;
24508 }
24509 }
24510
24511 arg_var(p, kw_bits);
24512 if (kw_rest_arg) arg_var(p, kw_rest_arg);
24513 if (block) arg_var(p, block);
24514
24515 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
24516 }
24517 else if (kw_rest_arg == idNil) {
24518 args->no_kwarg = 1;
24519 }
24520 else if (kw_rest_arg) {
24521 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
24522 }
24523
24524 return node;
24525}
24526
24527static rb_node_args_t *
24528args_with_numbered(struct parser_params *p, rb_node_args_t *args, int max_numparam)
24529{
24530 if (max_numparam > NO_PARAM) {
24531 if (!args) {
24532 YYLTYPE loc = RUBY_INIT_YYLLOC();
24533 args = new_args_tail(p, 0, 0, 0, 0);
24534 nd_set_loc(RNODE(args), &loc);
24535 }
24536 args->nd_ainfo.pre_args_num = max_numparam;
24537 }
24538 return args;
24539}
24540
24541static NODE*
24542new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
24543{
24544 RNODE_ARYPTN(aryptn)->nd_pconst = constant;
24545
24546 if (pre_arg) {
24547 NODE *pre_args = NEW_LIST(pre_arg, loc);
24548 if (RNODE_ARYPTN(aryptn)->pre_args) {
24549 RNODE_ARYPTN(aryptn)->pre_args = list_concat(pre_args, RNODE_ARYPTN(aryptn)->pre_args);
24550 }
24551 else {
24552 RNODE_ARYPTN(aryptn)->pre_args = pre_args;
24553 }
24554 }
24555 return aryptn;
24556}
24557
24558static NODE*
24559new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
24560{
24561 if (has_rest) {
24562 rest_arg = rest_arg ? rest_arg : NODE_SPECIAL_NO_NAME_REST;
24563 }
24564 else {
24565 rest_arg = NULL;
24566 }
24567 NODE *node = NEW_ARYPTN(pre_args, rest_arg, post_args, loc);
24568
24569 return node;
24570}
24571
24572static NODE*
24573new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
24574{
24575 RNODE_FNDPTN(fndptn)->nd_pconst = constant;
24576
24577 return fndptn;
24578}
24579
24580static NODE*
24581new_find_pattern_tail(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
24582{
24583 pre_rest_arg = pre_rest_arg ? pre_rest_arg : NODE_SPECIAL_NO_NAME_REST;
24584 post_rest_arg = post_rest_arg ? post_rest_arg : NODE_SPECIAL_NO_NAME_REST;
24585 NODE *node = NEW_FNDPTN(pre_rest_arg, args, post_rest_arg, loc);
24586
24587 return node;
24588}
24589
24590static NODE*
24591new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
24592{
24593 RNODE_HSHPTN(hshptn)->nd_pconst = constant;
24594 return hshptn;
24595}
24596
24597static NODE*
24598new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
24599{
24600 NODE *node, *kw_rest_arg_node;
24601
24602 if (kw_rest_arg == idNil) {
24603 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
24604 }
24605 else if (kw_rest_arg) {
24606 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
24607 }
24608 else {
24609 kw_rest_arg_node = NULL;
24610 }
24611
24612 node = NEW_HSHPTN(0, kw_args, kw_rest_arg_node, loc);
24613
24614 return node;
24615}
24616
24617static NODE*
24618dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24619{
24620 VALUE lit;
24621
24622 if (!node) {
24623 return NEW_LIT(ID2SYM(idNULL), loc);
24624 }
24625
24626 switch (nd_type(node)) {
24627 case NODE_DSTR:
24628 nd_set_type(node, NODE_DSYM);
24629 nd_set_loc(node, loc);
24630 break;
24631 case NODE_STR:
24632 lit = RNODE_STR(node)->nd_lit;
24633 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(node)->nd_lit = ID2SYM(rb_intern_str(lit)));
24634 nd_set_type(node, NODE_LIT);
24635 nd_set_loc(node, loc);
24636 break;
24637 default:
24638 node = NEW_DSYM(Qnil, 1, NEW_LIST(node, loc), loc);
24639 break;
24640 }
24641 return node;
24642}
24643
24644static int
24645append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
24646{
24647 NODE *node = (NODE *)v;
24648 NODE **result = (NODE **)h;
24649 RNODE_LIST(node)->as.nd_alen = 2;
24650 RNODE_LIST(RNODE_LIST(node)->nd_next)->as.nd_end = RNODE_LIST(node)->nd_next;
24651 RNODE_LIST(RNODE_LIST(node)->nd_next)->nd_next = 0;
24652 if (*result)
24653 list_concat(*result, node);
24654 else
24655 *result = node;
24656 return ST_CONTINUE;
24657}
24658
24659static NODE *
24660remove_duplicate_keys(struct parser_params *p, NODE *hash)
24661{
24662 struct st_hash_type literal_type = {
24663 literal_cmp,
24664 literal_hash,
24665 };
24666
24667 st_table *literal_keys = st_init_table_with_size(&literal_type, RNODE_LIST(hash)->as.nd_alen / 2);
24668 NODE *result = 0;
24669 NODE *last_expr = 0;
24670 rb_code_location_t loc = hash->nd_loc;
24671 while (hash && RNODE_LIST(hash)->nd_next) {
24672 NODE *head = RNODE_LIST(hash)->nd_head;
24673 NODE *value = RNODE_LIST(hash)->nd_next;
24674 NODE *next = RNODE_LIST(value)->nd_next;
24675 st_data_t key = (st_data_t)head;
24676 st_data_t data;
24677 RNODE_LIST(value)->nd_next = 0;
24678 if (!head) {
24679 key = (st_data_t)value;
24680 }
24681 else if (nd_type_p(head, NODE_LIT) &&
24682 st_delete(literal_keys, (key = (st_data_t)RNODE_LIT(head)->nd_lit, &key), &data)) {
24683 NODE *dup_value = (RNODE_LIST((NODE *)data))->nd_next;
24684 rb_compile_warn(p->ruby_sourcefile, nd_line((NODE *)data),
24685 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
24686 RNODE_LIT(head)->nd_lit, nd_line(head));
24687 if (dup_value == last_expr) {
24688 RNODE_LIST(value)->nd_head = block_append(p, RNODE_LIST(dup_value)->nd_head, RNODE_LIST(value)->nd_head);
24689 }
24690 else {
24691 RNODE_LIST(last_expr)->nd_head = block_append(p, RNODE_LIST(dup_value)->nd_head, RNODE_LIST(last_expr)->nd_head);
24692 }
24693 }
24694 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
24695 last_expr = !head || nd_type_p(head, NODE_LIT) ? value : head;
24696 hash = next;
24697 }
24698 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
24699 st_free_table(literal_keys);
24700 if (hash) {
24701 if (!result) result = hash;
24702 else list_concat(result, hash);
24703 }
24704 result->nd_loc = loc;
24705 return result;
24706}
24707
24708static NODE *
24709new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
24710{
24711 if (hash) hash = remove_duplicate_keys(p, hash);
24712 return NEW_HASH(hash, loc);
24713}
24714#endif
24715
24716static void
24717error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
24718{
24719 if (is_private_local_id(p, id)) {
24720 return;
24721 }
24722 if (st_is_member(p->pvtbl, id)) {
24723 yyerror1(loc, "duplicated variable name");
24724 }
24725 else {
24726 st_insert(p->pvtbl, (st_data_t)id, 0);
24727 }
24728}
24729
24730static void
24731error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
24732{
24733 if (!p->pktbl) {
24734 p->pktbl = st_init_numtable();
24735 }
24736 else if (st_is_member(p->pktbl, key)) {
24737 yyerror1(loc, "duplicated key name");
24738 return;
24739 }
24740 st_insert(p->pktbl, (st_data_t)key, 0);
24741}
24742
24743#ifndef RIPPER
24744static NODE *
24745new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
24746{
24747 return NEW_HASH(hash, loc);
24748}
24749#endif /* !RIPPER */
24750
24751#ifndef RIPPER
24752static NODE *
24753new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
24754{
24755 NODE *asgn;
24756
24757 if (lhs) {
24758 ID vid = get_nd_vid(p, lhs);
24759 YYLTYPE lhs_loc = lhs->nd_loc;
24760 int shareable = ctxt.shareable_constant_value;
24761 if (shareable) {
24762 switch (nd_type(lhs)) {
24763 case NODE_CDECL:
24764 case NODE_COLON2:
24765 case NODE_COLON3:
24766 break;
24767 default:
24768 shareable = 0;
24769 break;
24770 }
24771 }
24772 if (op == tOROP) {
24773 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
24774 set_nd_value(p, lhs, rhs);
24775 nd_set_loc(lhs, loc);
24776 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
24777 }
24778 else if (op == tANDOP) {
24779 if (shareable) {
24780 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
24781 }
24782 set_nd_value(p, lhs, rhs);
24783 nd_set_loc(lhs, loc);
24784 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
24785 }
24786 else {
24787 asgn = lhs;
24788 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
24789 if (shareable) {
24790 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
24791 }
24792 set_nd_value(p, asgn, rhs);
24793 nd_set_loc(asgn, loc);
24794 }
24795 }
24796 else {
24797 asgn = NEW_ERROR(loc);
24798 }
24799 return asgn;
24800}
24801
24802static NODE *
24803new_ary_op_assign(struct parser_params *p, NODE *ary,
24804 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
24805{
24806 NODE *asgn;
24807
24808 args = make_list(args, args_loc);
24809 asgn = NEW_OP_ASGN1(ary, op, args, rhs, loc);
24810 fixpos(asgn, ary);
24811 return asgn;
24812}
24813
24814static NODE *
24815new_attr_op_assign(struct parser_params *p, NODE *lhs,
24816 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
24817{
24818 NODE *asgn;
24819
24820 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
24821 fixpos(asgn, lhs);
24822 return asgn;
24823}
24824
24825static NODE *
24826new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
24827{
24828 NODE *asgn;
24829
24830 if (lhs) {
24831 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
24832 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
24833 }
24834 else {
24835 asgn = NEW_ERROR(loc);
24836 }
24837 fixpos(asgn, lhs);
24838 return asgn;
24839}
24840
24841static NODE *
24842const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
24843{
24844 if (p->ctxt.in_def) {
24845 yyerror1(loc, "dynamic constant assignment");
24846 }
24847 return NEW_CDECL(0, 0, (path), loc);
24848}
24849#else
24850static VALUE
24851const_decl(struct parser_params *p, VALUE path)
24852{
24853 if (p->ctxt.in_def) {
24854 path = assign_error(p, "dynamic constant assignment", path);
24855 }
24856 return path;
24857}
24858
24859static VALUE
24860assign_error(struct parser_params *p, const char *mesg, VALUE a)
24861{
24862 a = dispatch2(assign_error, ERR_MESG(), a);
24863 ripper_error(p);
24864 return a;
24865}
24866
24867static VALUE
24868var_field(struct parser_params *p, VALUE a)
24869{
24870 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
24871}
24872#endif
24873
24874#ifndef RIPPER
24875static NODE *
24876new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
24877{
24878 NODE *result = head;
24879 if (rescue) {
24880 NODE *tmp = rescue_else ? rescue_else : rescue;
24881 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
24882
24883 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
24884 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
24885 }
24886 else if (rescue_else) {
24887 result = block_append(p, result, rescue_else);
24888 }
24889 if (ensure) {
24890 result = NEW_ENSURE(result, ensure, loc);
24891 }
24892 fixpos(result, head);
24893 return result;
24894}
24895#endif
24896
24897static void
24898warn_unused_var(struct parser_params *p, struct local_vars *local)
24899{
24900 int cnt;
24901
24902 if (!local->used) return;
24903 cnt = local->used->pos;
24904 if (cnt != local->vars->pos) {
24905 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
24906 }
24907#ifndef RIPPER
24908 ID *v = local->vars->tbl;
24909 ID *u = local->used->tbl;
24910 for (int i = 0; i < cnt; ++i) {
24911 if (!v[i] || (u[i] & LVAR_USED)) continue;
24912 if (is_private_local_id(p, v[i])) continue;
24913 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
24914 }
24915#endif
24916}
24917
24918static void
24919local_push(struct parser_params *p, int toplevel_scope)
24920{
24921 struct local_vars *local;
24922 int inherits_dvars = toplevel_scope && compile_for_eval;
24923 int warn_unused_vars = RTEST(ruby_verbose);
24924
24925 local = ALLOC(struct local_vars);
24926 local->prev = p->lvtbl;
24927 local->args = vtable_alloc(0);
24928 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
24929#ifndef RIPPER
24930 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
24931 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
24932 local->numparam.outer = 0;
24933 local->numparam.inner = 0;
24934 local->numparam.current = 0;
24935#endif
24936 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
24937
24938# if WARN_PAST_SCOPE
24939 local->past = 0;
24940# endif
24941 CMDARG_PUSH(0);
24942 COND_PUSH(0);
24943 p->lvtbl = local;
24944}
24945
24946static void
24947vtable_chain_free(struct parser_params *p, struct vtable *table)
24948{
24949 while (!DVARS_TERMINAL_P(table)) {
24950 struct vtable *cur_table = table;
24951 table = cur_table->prev;
24952 vtable_free(cur_table);
24953 }
24954}
24955
24956static void
24957local_free(struct parser_params *p, struct local_vars *local)
24958{
24959 vtable_chain_free(p, local->used);
24960
24961# if WARN_PAST_SCOPE
24962 vtable_chain_free(p, local->past);
24963# endif
24964
24965 vtable_chain_free(p, local->args);
24966 vtable_chain_free(p, local->vars);
24967
24968 ruby_sized_xfree(local, sizeof(struct local_vars));
24969}
24970
24971static void
24972local_pop(struct parser_params *p)
24973{
24974 struct local_vars *local = p->lvtbl->prev;
24975 if (p->lvtbl->used) {
24976 warn_unused_var(p, p->lvtbl);
24977 }
24978
24979 local_free(p, p->lvtbl);
24980 p->lvtbl = local;
24981
24982 CMDARG_POP();
24983 COND_POP();
24984}
24985
24986#ifndef RIPPER
24987static rb_ast_id_table_t *
24988local_tbl(struct parser_params *p)
24989{
24990 int cnt_args = vtable_size(p->lvtbl->args);
24991 int cnt_vars = vtable_size(p->lvtbl->vars);
24992 int cnt = cnt_args + cnt_vars;
24993 int i, j;
24994 rb_ast_id_table_t *tbl;
24995
24996 if (cnt <= 0) return 0;
24997 tbl = rb_ast_new_local_table(p->ast, cnt);
24998 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
24999 /* remove IDs duplicated to warn shadowing */
25000 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
25001 ID id = p->lvtbl->vars->tbl[i];
25002 if (!vtable_included(p->lvtbl->args, id)) {
25003 tbl->ids[j++] = id;
25004 }
25005 }
25006 if (j < cnt) {
25007 tbl = rb_ast_resize_latest_local_table(p->ast, j);
25008 }
25009
25010 return tbl;
25011}
25012
25013#endif
25014
25015static void
25016numparam_name(struct parser_params *p, ID id)
25017{
25018 if (!NUMPARAM_ID_P(id)) return;
25019 compile_error(p, "_%d is reserved for numbered parameter",
25020 NUMPARAM_ID_TO_IDX(id));
25021}
25022
25023static void
25024arg_var(struct parser_params *p, ID id)
25025{
25026 numparam_name(p, id);
25027 vtable_add(p->lvtbl->args, id);
25028}
25029
25030static void
25031local_var(struct parser_params *p, ID id)
25032{
25033 numparam_name(p, id);
25034 vtable_add(p->lvtbl->vars, id);
25035 if (p->lvtbl->used) {
25036 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
25037 }
25038}
25039
25040static int
25041local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
25042{
25043 struct vtable *vars, *args, *used;
25044
25045 vars = p->lvtbl->vars;
25046 args = p->lvtbl->args;
25047 used = p->lvtbl->used;
25048
25049 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25050 vars = vars->prev;
25051 args = args->prev;
25052 if (used) used = used->prev;
25053 }
25054
25055 if (vars && vars->prev == DVARS_INHERIT) {
25056 return rb_local_defined(id, p->parent_iseq);
25057 }
25058 else if (vtable_included(args, id)) {
25059 return 1;
25060 }
25061 else {
25062 int i = vtable_included(vars, id);
25063 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
25064 return i != 0;
25065 }
25066}
25067
25068static int
25069local_id(struct parser_params *p, ID id)
25070{
25071 return local_id_ref(p, id, NULL);
25072}
25073
25074static int
25075check_forwarding_args(struct parser_params *p)
25076{
25077 if (local_id(p, idFWD_ALL)) return TRUE;
25078 compile_error(p, "unexpected ...");
25079 return FALSE;
25080}
25081
25082static void
25083add_forwarding_args(struct parser_params *p)
25084{
25085 arg_var(p, idFWD_REST);
25086#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25087 arg_var(p, idFWD_KWREST);
25088#endif
25089 arg_var(p, idFWD_BLOCK);
25090 arg_var(p, idFWD_ALL);
25091}
25092
25093static void
25094forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var)
25095{
25096 bool conflict = false;
25097
25098 struct vtable *vars, *args;
25099
25100 vars = p->lvtbl->vars;
25101 args = p->lvtbl->args;
25102
25103 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25104 conflict |= (vtable_included(args, arg) && !(all && vtable_included(args, all)));
25105 vars = vars->prev;
25106 args = args->prev;
25107 }
25108
25109 bool found = false;
25110 if (vars && vars->prev == DVARS_INHERIT && !found) {
25111 found = (rb_local_defined(arg, p->parent_iseq) &&
25112 !(all && rb_local_defined(all, p->parent_iseq)));
25113 }
25114 else {
25115 found = (vtable_included(args, arg) &&
25116 !(all && vtable_included(args, all)));
25117 }
25118
25119 if (!found) {
25120 compile_error(p, "no anonymous %s parameter", var);
25121 }
25122 else if (conflict) {
25123 compile_error(p, "anonymous %s parameter is also used within block", var);
25124 }
25125}
25126
25127#ifndef RIPPER
25128static NODE *
25129new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
25130{
25131 NODE *rest = NEW_LVAR(idFWD_REST, loc);
25132#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25133 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
25134#endif
25135 rb_node_block_pass_t *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), loc);
25136 NODE *args = leading ? rest_arg_append(p, leading, rest, argsloc) : NEW_SPLAT(rest, loc);
25137#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25138 args = arg_append(p, args, new_hash(p, kwrest, loc), loc);
25139#endif
25140 return arg_blk_pass(args, block);
25141}
25142#endif
25143
25144static NODE *
25145numparam_push(struct parser_params *p)
25146{
25147#ifndef RIPPER
25148 struct local_vars *local = p->lvtbl;
25149 NODE *inner = local->numparam.inner;
25150 if (!local->numparam.outer) {
25151 local->numparam.outer = local->numparam.current;
25152 }
25153 local->numparam.inner = 0;
25154 local->numparam.current = 0;
25155 return inner;
25156#else
25157 return 0;
25158#endif
25159}
25160
25161static void
25162numparam_pop(struct parser_params *p, NODE *prev_inner)
25163{
25164#ifndef RIPPER
25165 struct local_vars *local = p->lvtbl;
25166 if (prev_inner) {
25167 /* prefer first one */
25168 local->numparam.inner = prev_inner;
25169 }
25170 else if (local->numparam.current) {
25171 /* current and inner are exclusive */
25172 local->numparam.inner = local->numparam.current;
25173 }
25174 if (p->max_numparam > NO_PARAM) {
25175 /* current and outer are exclusive */
25176 local->numparam.current = local->numparam.outer;
25177 local->numparam.outer = 0;
25178 }
25179 else {
25180 /* no numbered parameter */
25181 local->numparam.current = 0;
25182 }
25183#endif
25184}
25185
25186static const struct vtable *
25187dyna_push(struct parser_params *p)
25188{
25189 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
25190 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
25191 if (p->lvtbl->used) {
25192 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
25193 }
25194 return p->lvtbl->args;
25195}
25196
25197static void
25198dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
25199{
25200 struct vtable *tmp = *vtblp;
25201 *vtblp = tmp->prev;
25202# if WARN_PAST_SCOPE
25203 if (p->past_scope_enabled) {
25204 tmp->prev = p->lvtbl->past;
25205 p->lvtbl->past = tmp;
25206 return;
25207 }
25208# endif
25209 vtable_free(tmp);
25210}
25211
25212static void
25213dyna_pop_1(struct parser_params *p)
25214{
25215 struct vtable *tmp;
25216
25217 if ((tmp = p->lvtbl->used) != 0) {
25218 warn_unused_var(p, p->lvtbl);
25219 p->lvtbl->used = p->lvtbl->used->prev;
25220 vtable_free(tmp);
25221 }
25222 dyna_pop_vtable(p, &p->lvtbl->args);
25223 dyna_pop_vtable(p, &p->lvtbl->vars);
25224}
25225
25226static void
25227dyna_pop(struct parser_params *p, const struct vtable *lvargs)
25228{
25229 while (p->lvtbl->args != lvargs) {
25230 dyna_pop_1(p);
25231 if (!p->lvtbl->args) {
25232 struct local_vars *local = p->lvtbl->prev;
25233 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
25234 p->lvtbl = local;
25235 }
25236 }
25237 dyna_pop_1(p);
25238}
25239
25240static int
25241dyna_in_block(struct parser_params *p)
25242{
25243 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
25244}
25245
25246static int
25247dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
25248{
25249 struct vtable *vars, *args, *used;
25250 int i;
25251
25252 args = p->lvtbl->args;
25253 vars = p->lvtbl->vars;
25254 used = p->lvtbl->used;
25255
25256 while (!DVARS_TERMINAL_P(vars)) {
25257 if (vtable_included(args, id)) {
25258 return 1;
25259 }
25260 if ((i = vtable_included(vars, id)) != 0) {
25261 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
25262 return 1;
25263 }
25264 args = args->prev;
25265 vars = vars->prev;
25266 if (!vidrefp) used = 0;
25267 if (used) used = used->prev;
25268 }
25269
25270 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
25271 return rb_dvar_defined(id, p->parent_iseq);
25272 }
25273
25274 return 0;
25275}
25276
25277static int
25278dvar_defined(struct parser_params *p, ID id)
25279{
25280 return dvar_defined_ref(p, id, NULL);
25281}
25282
25283static int
25284dvar_curr(struct parser_params *p, ID id)
25285{
25286 return (vtable_included(p->lvtbl->args, id) ||
25287 vtable_included(p->lvtbl->vars, id));
25288}
25289
25290static void
25291reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
25292{
25293 compile_error(p,
25294 "regexp encoding option '%c' differs from source encoding '%s'",
25295 c, rb_enc_name(rb_enc_get(str)));
25296}
25297
25298#ifndef RIPPER
25299int
25300rb_reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
25301{
25302 int c = RE_OPTION_ENCODING_IDX(options);
25303
25304 if (c) {
25305 int opt, idx;
25306 rb_char_to_option_kcode(c, &opt, &idx);
25307 if (idx != ENCODING_GET(str) &&
25308 !is_ascii_string(str)) {
25309 goto error;
25310 }
25311 ENCODING_SET(str, idx);
25312 }
25313 else if (RE_OPTION_ENCODING_NONE(options)) {
25314 if (!ENCODING_IS_ASCII8BIT(str) &&
25315 !is_ascii_string(str)) {
25316 c = 'n';
25317 goto error;
25318 }
25319 rb_enc_associate(str, rb_ascii8bit_encoding());
25320 }
25321 else if (rb_is_usascii_enc(p->enc)) {
25322 if (!is_ascii_string(str)) {
25323 /* raise in re.c */
25324 rb_enc_associate(str, rb_usascii_encoding());
25325 }
25326 else {
25327 rb_enc_associate(str, rb_ascii8bit_encoding());
25328 }
25329 }
25330 return 0;
25331
25332 error:
25333 return c;
25334}
25335
25336static void
25337reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
25338{
25339 int c = rb_reg_fragment_setenc(p, str, options);
25340 if (c) reg_fragment_enc_error(p, str, c);
25341}
25342
25343static int
25344reg_fragment_check(struct parser_params* p, VALUE str, int options)
25345{
25346 VALUE err;
25347 reg_fragment_setenc(p, str, options);
25348 err = rb_reg_check_preprocess(str);
25349 if (err != Qnil) {
25350 err = rb_obj_as_string(err);
25351 compile_error(p, "%"PRIsVALUE, err);
25352 return 0;
25353 }
25354 return 1;
25355}
25356
25357#ifndef UNIVERSAL_PARSER
25358typedef struct {
25359 struct parser_params* parser;
25360 rb_encoding *enc;
25361 NODE *succ_block;
25362 const YYLTYPE *loc;
25364
25365static int
25366reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
25367 int back_num, int *back_refs, OnigRegex regex, void *arg0)
25368{
25370 struct parser_params* p = arg->parser;
25371 rb_encoding *enc = arg->enc;
25372 long len = name_end - name;
25373 const char *s = (const char *)name;
25374
25375 return rb_reg_named_capture_assign_iter_impl(p, s, len, enc, &arg->succ_block, arg->loc);
25376}
25377
25378static NODE *
25379reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
25380{
25382
25383 arg.parser = p;
25384 arg.enc = rb_enc_get(regexp);
25385 arg.succ_block = 0;
25386 arg.loc = loc;
25387 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
25388
25389 if (!arg.succ_block) return 0;
25390 return RNODE_BLOCK(arg.succ_block)->nd_next;
25391}
25392#endif
25393
25394int
25395rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len,
25396 rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc)
25397{
25398 ID var;
25399 NODE *node, *succ;
25400
25401 if (!len) return ST_CONTINUE;
25402 if (!VALID_SYMNAME_P(s, len, enc, ID_LOCAL))
25403 return ST_CONTINUE;
25404
25405 var = intern_cstr(s, len, enc);
25406 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
25407 if (!lvar_defined(p, var)) return ST_CONTINUE;
25408 }
25409 node = node_assign(p, assignable(p, var, 0, loc), NEW_LIT(ID2SYM(var), loc), NO_LEX_CTXT, loc);
25410 succ = *succ_block;
25411 if (!succ) succ = NEW_ERROR(loc);
25412 succ = block_append(p, succ, node);
25413 *succ_block = succ;
25414 return ST_CONTINUE;
25415}
25416
25417static VALUE
25418parser_reg_compile(struct parser_params* p, VALUE str, int options)
25419{
25420 reg_fragment_setenc(p, str, options);
25421 return rb_parser_reg_compile(p, str, options);
25422}
25423
25424VALUE
25425rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
25426{
25427 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
25428}
25429
25430static VALUE
25431reg_compile(struct parser_params* p, VALUE str, int options)
25432{
25433 VALUE re;
25434 VALUE err;
25435
25436 err = rb_errinfo();
25437 re = parser_reg_compile(p, str, options);
25438 if (NIL_P(re)) {
25439 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
25440 rb_set_errinfo(err);
25441 compile_error(p, "%"PRIsVALUE, m);
25442 return Qnil;
25443 }
25444 return re;
25445}
25446#else
25447static VALUE
25448parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
25449{
25450 VALUE err = rb_errinfo();
25451 VALUE re;
25452 str = ripper_is_node_yylval(p, str) ? RNODE_RIPPER(str)->nd_cval : str;
25453 int c = rb_reg_fragment_setenc(p, str, options);
25454 if (c) reg_fragment_enc_error(p, str, c);
25455 re = rb_parser_reg_compile(p, str, options);
25456 if (NIL_P(re)) {
25457 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
25458 rb_set_errinfo(err);
25459 }
25460 return re;
25461}
25462#endif
25463
25464#ifndef RIPPER
25465void
25466rb_ruby_parser_set_options(struct parser_params *p, int print, int loop, int chomp, int split)
25467{
25468 p->do_print = print;
25469 p->do_loop = loop;
25470 p->do_chomp = chomp;
25471 p->do_split = split;
25472}
25473
25474static NODE *
25475parser_append_options(struct parser_params *p, NODE *node)
25476{
25477 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
25478 const YYLTYPE *const LOC = &default_location;
25479
25480 if (p->do_print) {
25481 NODE *print = (NODE *)NEW_FCALL(rb_intern("print"),
25482 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
25483 LOC);
25484 node = block_append(p, node, print);
25485 }
25486
25487 if (p->do_loop) {
25488 NODE *irs = NEW_LIST(NEW_GVAR(rb_intern("$/"), LOC), LOC);
25489
25490 if (p->do_split) {
25491 ID ifs = rb_intern("$;");
25492 ID fields = rb_intern("$F");
25493 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
25494 NODE *split = NEW_GASGN(fields,
25495 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
25496 rb_intern("split"), args, LOC),
25497 LOC);
25498 node = block_append(p, split, node);
25499 }
25500 if (p->do_chomp) {
25501 NODE *chomp = NEW_LIT(ID2SYM(rb_intern("chomp")), LOC);
25502 chomp = list_append(p, NEW_LIST(chomp, LOC), NEW_TRUE(LOC));
25503 irs = list_append(p, irs, NEW_HASH(chomp, LOC));
25504 }
25505
25506 node = NEW_WHILE((NODE *)NEW_FCALL(idGets, irs, LOC), node, 1, LOC);
25507 }
25508
25509 return node;
25510}
25511
25512void
25513rb_init_parse(void)
25514{
25515 /* just to suppress unused-function warnings */
25516 (void)nodetype;
25517 (void)nodeline;
25518}
25519
25520static ID
25521internal_id(struct parser_params *p)
25522{
25523 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
25524}
25525#endif /* !RIPPER */
25526
25527static void
25528parser_initialize(struct parser_params *p)
25529{
25530 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
25531 p->command_start = TRUE;
25532 p->ruby_sourcefile_string = Qnil;
25533 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
25534 p->node_id = 0;
25535 p->delayed.token = Qnil;
25536 p->frozen_string_literal = -1; /* not specified */
25537#ifdef RIPPER
25538 p->result = Qnil;
25539 p->parsing_thread = Qnil;
25540#else
25541 p->error_buffer = Qfalse;
25542 p->end_expect_token_locations = Qnil;
25543 p->token_id = 0;
25544 p->tokens = Qnil;
25545#endif
25546 p->debug_buffer = Qnil;
25547 p->debug_output = rb_ractor_stdout();
25548 p->enc = rb_utf8_encoding();
25549 p->exits = 0;
25550}
25551
25552#ifdef RIPPER
25553#define rb_ruby_parser_mark ripper_parser_mark
25554#define rb_ruby_parser_free ripper_parser_free
25555#define rb_ruby_parser_memsize ripper_parser_memsize
25556#endif
25557
25558void
25559rb_ruby_parser_mark(void *ptr)
25560{
25561 struct parser_params *p = (struct parser_params*)ptr;
25562
25563 rb_gc_mark(p->lex.input);
25564 rb_gc_mark(p->lex.lastline);
25565 rb_gc_mark(p->lex.nextline);
25566 rb_gc_mark(p->ruby_sourcefile_string);
25567 rb_gc_mark((VALUE)p->ast);
25568 rb_gc_mark(p->case_labels);
25569 rb_gc_mark(p->delayed.token);
25570#ifndef RIPPER
25571 rb_gc_mark(p->debug_lines);
25572 rb_gc_mark(p->error_buffer);
25573 rb_gc_mark(p->end_expect_token_locations);
25574 rb_gc_mark(p->tokens);
25575#else
25576 rb_gc_mark(p->value);
25577 rb_gc_mark(p->result);
25578 rb_gc_mark(p->parsing_thread);
25579#endif
25580 rb_gc_mark(p->debug_buffer);
25581 rb_gc_mark(p->debug_output);
25582#ifdef YYMALLOC
25583 rb_gc_mark((VALUE)p->heap);
25584#endif
25585}
25586
25587void
25588rb_ruby_parser_free(void *ptr)
25589{
25590 struct parser_params *p = (struct parser_params*)ptr;
25591 struct local_vars *local, *prev;
25592#ifdef UNIVERSAL_PARSER
25593 rb_parser_config_t *config = p->config;
25594#endif
25595
25596 if (p->tokenbuf) {
25597 ruby_sized_xfree(p->tokenbuf, p->toksiz);
25598 }
25599
25600 for (local = p->lvtbl; local; local = prev) {
25601 prev = local->prev;
25602 local_free(p, local);
25603 }
25604
25605 {
25606 token_info *ptinfo;
25607 while ((ptinfo = p->token_info) != 0) {
25608 p->token_info = ptinfo->next;
25609 xfree(ptinfo);
25610 }
25611 }
25612 xfree(ptr);
25613
25614#ifdef UNIVERSAL_PARSER
25615 config->counter--;
25616 if (config->counter <= 0) {
25617 rb_ruby_parser_config_free(config);
25618 }
25619#endif
25620}
25621
25622size_t
25623rb_ruby_parser_memsize(const void *ptr)
25624{
25625 struct parser_params *p = (struct parser_params*)ptr;
25626 struct local_vars *local;
25627 size_t size = sizeof(*p);
25628
25629 size += p->toksiz;
25630 for (local = p->lvtbl; local; local = local->prev) {
25631 size += sizeof(*local);
25632 if (local->vars) size += local->vars->capa * sizeof(ID);
25633 }
25634 return size;
25635}
25636
25637#ifdef UNIVERSAL_PARSER
25638rb_parser_config_t *
25639rb_ruby_parser_config_new(void *(*malloc)(size_t size))
25640{
25641 return (rb_parser_config_t *)malloc(sizeof(rb_parser_config_t));
25642}
25643
25644void
25645rb_ruby_parser_config_free(rb_parser_config_t *config)
25646{
25647 config->free(config);
25648}
25649#endif
25650
25651#ifndef UNIVERSAL_PARSER
25652#ifndef RIPPER
25653static const rb_data_type_t parser_data_type = {
25654 "parser",
25655 {
25656 rb_ruby_parser_mark,
25657 rb_ruby_parser_free,
25658 rb_ruby_parser_memsize,
25659 },
25660 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
25661};
25662#endif
25663#endif
25664
25665#ifndef RIPPER
25666#undef rb_reserved_word
25667
25668const struct kwtable *
25669rb_reserved_word(const char *str, unsigned int len)
25670{
25671 return reserved_word(str, len);
25672}
25673
25674#ifdef UNIVERSAL_PARSER
25676rb_ruby_parser_allocate(rb_parser_config_t *config)
25677{
25678 /* parser_initialize expects fields to be set to 0 */
25679 rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t));
25680 p->config = config;
25681 p->config->counter++;
25682 return p;
25683}
25684
25686rb_ruby_parser_new(rb_parser_config_t *config)
25687{
25688 /* parser_initialize expects fields to be set to 0 */
25689 rb_parser_t *p = rb_ruby_parser_allocate(config);
25690 parser_initialize(p);
25691 return p;
25692}
25693#endif
25694
25696rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main)
25697{
25698 p->error_buffer = main ? Qfalse : Qnil;
25699 p->parent_iseq = base;
25700 return p;
25701}
25702
25703void
25704rb_ruby_parser_set_script_lines(rb_parser_t *p, VALUE lines)
25705{
25706 if (!RTEST(lines)) {
25707 lines = Qfalse;
25708 }
25709 else if (lines == Qtrue) {
25710 lines = rb_ary_new();
25711 }
25712 else {
25713 Check_Type(lines, T_ARRAY);
25714 rb_ary_modify(lines);
25715 }
25716 p->debug_lines = lines;
25717}
25718
25719void
25720rb_ruby_parser_error_tolerant(rb_parser_t *p)
25721{
25722 p->error_tolerant = 1;
25723 // TODO
25724 p->end_expect_token_locations = rb_ary_new();
25725}
25726
25727void
25728rb_ruby_parser_keep_tokens(rb_parser_t *p)
25729{
25730 p->keep_tokens = 1;
25731 // TODO
25732 p->tokens = rb_ary_new();
25733}
25734
25735#ifndef UNIVERSAL_PARSER
25736rb_ast_t*
25737rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
25738{
25739 struct parser_params *p;
25740
25741 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25742 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25743 return rb_ruby_parser_compile_file_path(p, fname, file, start);
25744}
25745
25746rb_ast_t*
25747rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
25748{
25749 struct parser_params *p;
25750
25751 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25752 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25753 return rb_ruby_parser_compile_generic(p, lex_gets, fname, input, start);
25754}
25755
25756rb_ast_t*
25757rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
25758{
25759 struct parser_params *p;
25760
25761 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25762 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25763 return rb_ruby_parser_compile_string(p, f, s, line);
25764}
25765
25766rb_ast_t*
25767rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
25768{
25769 struct parser_params *p;
25770
25771 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25772 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25773 return rb_ruby_parser_compile_string_path(p, f, s, line);
25774}
25775
25776VALUE
25777rb_parser_encoding(VALUE vparser)
25778{
25779 struct parser_params *p;
25780
25781 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25782 return rb_ruby_parser_encoding(p);
25783}
25784
25785VALUE
25786rb_parser_end_seen_p(VALUE vparser)
25787{
25788 struct parser_params *p;
25789
25790 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25791 return RBOOL(rb_ruby_parser_end_seen_p(p));
25792}
25793
25794void
25795rb_parser_error_tolerant(VALUE vparser)
25796{
25797 struct parser_params *p;
25798
25799 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25800 rb_ruby_parser_error_tolerant(p);
25801}
25802
25803void
25804rb_parser_set_script_lines(VALUE vparser, VALUE lines)
25805{
25806 struct parser_params *p;
25807
25808 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25809 rb_ruby_parser_set_script_lines(p, lines);
25810}
25811
25812void
25813rb_parser_keep_tokens(VALUE vparser)
25814{
25815 struct parser_params *p;
25816
25817 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25818 rb_ruby_parser_keep_tokens(p);
25819}
25820
25821VALUE
25822rb_parser_new(void)
25823{
25824 struct parser_params *p;
25825 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
25826 &parser_data_type, p);
25827 parser_initialize(p);
25828 return parser;
25829}
25830
25831VALUE
25832rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
25833{
25834 struct parser_params *p;
25835
25836 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25837 rb_ruby_parser_set_context(p, base, main);
25838 return vparser;
25839}
25840
25841void
25842rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
25843{
25844 struct parser_params *p;
25845
25846 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25847 rb_ruby_parser_set_options(p, print, loop, chomp, split);
25848}
25849
25850VALUE
25851rb_parser_set_yydebug(VALUE self, VALUE flag)
25852{
25853 struct parser_params *p;
25854
25855 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
25856 rb_ruby_parser_set_yydebug(p, RTEST(flag));
25857 return flag;
25858}
25859#endif /* !UNIVERSAL_PARSER */
25860
25861VALUE
25862rb_ruby_parser_encoding(rb_parser_t *p)
25863{
25864 return rb_enc_from_encoding(p->enc);
25865}
25866
25867int
25868rb_ruby_parser_end_seen_p(rb_parser_t *p)
25869{
25870 return p->ruby__end__seen;
25871}
25872
25873int
25874rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag)
25875{
25876 p->debug = flag;
25877 return flag;
25878}
25879#endif /* !RIPPER */
25880
25881#ifdef RIPPER
25882int
25883rb_ruby_parser_get_yydebug(rb_parser_t *p)
25884{
25885 return p->debug;
25886}
25887
25888void
25889rb_ruby_parser_set_value(rb_parser_t *p, VALUE value)
25890{
25891 p->value = value;
25892}
25893
25894int
25895rb_ruby_parser_error_p(rb_parser_t *p)
25896{
25897 return p->error_p;
25898}
25899
25900VALUE
25901rb_ruby_parser_debug_output(rb_parser_t *p)
25902{
25903 return p->debug_output;
25904}
25905
25906void
25907rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output)
25908{
25909 p->debug_output = output;
25910}
25911
25912VALUE
25913rb_ruby_parser_parsing_thread(rb_parser_t *p)
25914{
25915 return p->parsing_thread;
25916}
25917
25918void
25919rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread)
25920{
25921 p->parsing_thread = parsing_thread;
25922}
25923
25924void
25925rb_ruby_parser_ripper_initialize(rb_parser_t *p, VALUE (*gets)(struct parser_params*,VALUE), VALUE input, VALUE sourcefile_string, const char *sourcefile, int sourceline)
25926{
25927 p->lex.gets = gets;
25928 p->lex.input = input;
25929 p->eofp = 0;
25930 p->ruby_sourcefile_string = sourcefile_string;
25931 p->ruby_sourcefile = sourcefile;
25932 p->ruby_sourceline = sourceline;
25933}
25934
25935VALUE
25936rb_ruby_parser_result(rb_parser_t *p)
25937{
25938 return p->result;
25939}
25940
25942rb_ruby_parser_enc(rb_parser_t *p)
25943{
25944 return p->enc;
25945}
25946
25947VALUE
25948rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p)
25949{
25950 return p->ruby_sourcefile_string;
25951}
25952
25953int
25954rb_ruby_parser_ruby_sourceline(rb_parser_t *p)
25955{
25956 return p->ruby_sourceline;
25957}
25958
25959int
25960rb_ruby_parser_lex_state(rb_parser_t *p)
25961{
25962 return p->lex.state;
25963}
25964
25965void
25966rb_ruby_ripper_parse0(rb_parser_t *p)
25967{
25968 parser_prepare(p);
25969 p->ast = rb_ast_new();
25970 ripper_yyparse((void*)p);
25971 rb_ast_dispose(p->ast);
25972 p->ast = 0;
25973}
25974
25975int
25976rb_ruby_ripper_dedent_string(rb_parser_t *p, VALUE string, int width)
25977{
25978 return dedent_string(p, string, width);
25979}
25980
25981VALUE
25982rb_ruby_ripper_lex_get_str(rb_parser_t *p, VALUE s)
25983{
25984 return lex_get_str(p, s);
25985}
25986
25987int
25988rb_ruby_ripper_initialized_p(rb_parser_t *p)
25989{
25990 return p->lex.input != 0;
25991}
25992
25993void
25994rb_ruby_ripper_parser_initialize(rb_parser_t *p)
25995{
25996 parser_initialize(p);
25997}
25998
25999long
26000rb_ruby_ripper_column(rb_parser_t *p)
26001{
26002 return p->lex.ptok - p->lex.pbeg;
26003}
26004
26005long
26006rb_ruby_ripper_token_len(rb_parser_t *p)
26007{
26008 return p->lex.pcur - p->lex.ptok;
26009}
26010
26011VALUE
26012rb_ruby_ripper_lex_lastline(rb_parser_t *p)
26013{
26014 return p->lex.lastline;
26015}
26016
26017VALUE
26018rb_ruby_ripper_lex_state_name(struct parser_params *p, int state)
26019{
26020 return rb_parser_lex_state_name(p, (enum lex_state_e)state);
26021}
26022
26023struct parser_params*
26024rb_ruby_ripper_parser_allocate(void)
26025{
26026 return (struct parser_params *)ruby_xcalloc(1, sizeof(struct parser_params));
26027}
26028#endif /* RIPPER */
26029
26030#ifndef RIPPER
26031#ifdef YYMALLOC
26032#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
26033/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
26034 * potential memory leak */
26035#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
26036#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
26037 (new)->cnt = (cnt), (ptr))
26038
26039void *
26040rb_parser_malloc(struct parser_params *p, size_t size)
26041{
26042 size_t cnt = HEAPCNT(1, size);
26043 rb_imemo_tmpbuf_t *n = NEWHEAP();
26044 void *ptr = xmalloc(size);
26045
26046 return ADD2HEAP(n, cnt, ptr);
26047}
26048
26049void *
26050rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
26051{
26052 size_t cnt = HEAPCNT(nelem, size);
26053 rb_imemo_tmpbuf_t *n = NEWHEAP();
26054 void *ptr = xcalloc(nelem, size);
26055
26056 return ADD2HEAP(n, cnt, ptr);
26057}
26058
26059void *
26060rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
26061{
26063 size_t cnt = HEAPCNT(1, size);
26064
26065 if (ptr && (n = p->heap) != NULL) {
26066 do {
26067 if (n->ptr == ptr) {
26068 n->ptr = ptr = xrealloc(ptr, size);
26069 if (n->cnt) n->cnt = cnt;
26070 return ptr;
26071 }
26072 } while ((n = n->next) != NULL);
26073 }
26074 n = NEWHEAP();
26075 ptr = xrealloc(ptr, size);
26076 return ADD2HEAP(n, cnt, ptr);
26077}
26078
26079void
26080rb_parser_free(struct parser_params *p, void *ptr)
26081{
26082 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
26083
26084 while ((n = *prev) != NULL) {
26085 if (n->ptr == ptr) {
26086 *prev = n->next;
26087 break;
26088 }
26089 prev = &n->next;
26090 }
26091}
26092#endif
26093
26094void
26095rb_parser_printf(struct parser_params *p, const char *fmt, ...)
26096{
26097 va_list ap;
26098 VALUE mesg = p->debug_buffer;
26099
26100 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
26101 va_start(ap, fmt);
26102 rb_str_vcatf(mesg, fmt, ap);
26103 va_end(ap);
26104 if (end_with_newline_p(p, mesg)) {
26105 rb_io_write(p->debug_output, mesg);
26106 p->debug_buffer = Qnil;
26107 }
26108}
26109
26110static void
26111parser_compile_error(struct parser_params *p, const rb_code_location_t *loc, const char *fmt, ...)
26112{
26113 va_list ap;
26114 int lineno, column;
26115
26116 if (loc) {
26117 lineno = loc->end_pos.lineno;
26118 column = loc->end_pos.column;
26119 }
26120 else {
26121 lineno = p->ruby_sourceline;
26122 column = rb_long2int(p->lex.pcur - p->lex.pbeg);
26123 }
26124
26125 rb_io_flush(p->debug_output);
26126 p->error_p = 1;
26127 va_start(ap, fmt);
26128 p->error_buffer =
26129 rb_syntax_error_append(p->error_buffer,
26130 p->ruby_sourcefile_string,
26131 lineno, column,
26132 p->enc, fmt, ap);
26133 va_end(ap);
26134}
26135
26136static size_t
26137count_char(const char *str, int c)
26138{
26139 int n = 0;
26140 while (str[n] == c) ++n;
26141 return n;
26142}
26143
26144/*
26145 * strip enclosing double-quotes, same as the default yytnamerr except
26146 * for that single-quotes matching back-quotes do not stop stripping.
26147 *
26148 * "\"`class' keyword\"" => "`class' keyword"
26149 */
26150RUBY_FUNC_EXPORTED size_t
26151rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
26152{
26153 if (*yystr == '"') {
26154 size_t yyn = 0, bquote = 0;
26155 const char *yyp = yystr;
26156
26157 while (*++yyp) {
26158 switch (*yyp) {
26159 case '`':
26160 if (!bquote) {
26161 bquote = count_char(yyp+1, '`') + 1;
26162 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
26163 yyn += bquote;
26164 yyp += bquote - 1;
26165 break;
26166 }
26167 goto default_char;
26168
26169 case '\'':
26170 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
26171 if (yyres) memcpy(yyres + yyn, yyp, bquote);
26172 yyn += bquote;
26173 yyp += bquote - 1;
26174 bquote = 0;
26175 break;
26176 }
26177 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
26178 if (yyres) memcpy(yyres + yyn, yyp, 3);
26179 yyn += 3;
26180 yyp += 2;
26181 break;
26182 }
26183 goto do_not_strip_quotes;
26184
26185 case ',':
26186 goto do_not_strip_quotes;
26187
26188 case '\\':
26189 if (*++yyp != '\\')
26190 goto do_not_strip_quotes;
26191 /* Fall through. */
26192 default_char:
26193 default:
26194 if (yyres)
26195 yyres[yyn] = *yyp;
26196 yyn++;
26197 break;
26198
26199 case '"':
26200 case '\0':
26201 if (yyres)
26202 yyres[yyn] = '\0';
26203 return yyn;
26204 }
26205 }
26206 do_not_strip_quotes: ;
26207 }
26208
26209 if (!yyres) return strlen(yystr);
26210
26211 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
26212}
26213#endif
26214
26215#ifdef RIPPER
26216#ifdef RIPPER_DEBUG
26217/* :nodoc: */
26218static VALUE
26219ripper_validate_object(VALUE self, VALUE x)
26220{
26221 if (x == Qfalse) return x;
26222 if (x == Qtrue) return x;
26223 if (NIL_P(x)) return x;
26224 if (UNDEF_P(x))
26225 rb_raise(rb_eArgError, "Qundef given");
26226 if (FIXNUM_P(x)) return x;
26227 if (SYMBOL_P(x)) return x;
26228 switch (BUILTIN_TYPE(x)) {
26229 case T_STRING:
26230 case T_OBJECT:
26231 case T_ARRAY:
26232 case T_BIGNUM:
26233 case T_FLOAT:
26234 case T_COMPLEX:
26235 case T_RATIONAL:
26236 break;
26237 case T_NODE:
26238 if (!nd_type_p((NODE *)x, NODE_RIPPER)) {
26239 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
26240 }
26241 x = ((NODE *)x)->nd_rval;
26242 break;
26243 default:
26244 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
26245 (void *)x, rb_obj_classname(x));
26246 }
26247 if (!RBASIC_CLASS(x)) {
26248 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
26249 (void *)x, rb_builtin_type_name(TYPE(x)));
26250 }
26251 return x;
26252}
26253#endif
26254
26255#define validate(x) ((x) = get_value(x))
26256
26257static VALUE
26258ripper_dispatch0(struct parser_params *p, ID mid)
26259{
26260 return rb_funcall(p->value, mid, 0);
26261}
26262
26263static VALUE
26264ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
26265{
26266 validate(a);
26267 return rb_funcall(p->value, mid, 1, a);
26268}
26269
26270static VALUE
26271ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
26272{
26273 validate(a);
26274 validate(b);
26275 return rb_funcall(p->value, mid, 2, a, b);
26276}
26277
26278static VALUE
26279ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
26280{
26281 validate(a);
26282 validate(b);
26283 validate(c);
26284 return rb_funcall(p->value, mid, 3, a, b, c);
26285}
26286
26287static VALUE
26288ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
26289{
26290 validate(a);
26291 validate(b);
26292 validate(c);
26293 validate(d);
26294 return rb_funcall(p->value, mid, 4, a, b, c, d);
26295}
26296
26297static VALUE
26298ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
26299{
26300 validate(a);
26301 validate(b);
26302 validate(c);
26303 validate(d);
26304 validate(e);
26305 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
26306}
26307
26308static VALUE
26309ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
26310{
26311 validate(a);
26312 validate(b);
26313 validate(c);
26314 validate(d);
26315 validate(e);
26316 validate(f);
26317 validate(g);
26318 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
26319}
26320
26321void
26322ripper_error(struct parser_params *p)
26323{
26324 p->error_p = TRUE;
26325}
26326
26327VALUE
26328ripper_value(struct parser_params *p)
26329{
26330 (void)yystpcpy; /* may not used in newer bison */
26331
26332 return p->value;
26333}
26334
26335#endif /* RIPPER */
26336/*
26337 * Local variables:
26338 * mode: c
26339 * c-file-style: "ruby"
26340 * End:
26341 */
#define T_COMPLEX
Old name of RUBY_T_COMPLEX.
Definition value_type.h:59
#define TYPE(_)
Old name of rb_type.
Definition value_type.h:107
#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:397
#define ISSPACE
Old name of rb_isspace.
Definition ctype.h:88
#define ALLOC
Old name of RB_ALLOC.
Definition memory.h:394
#define RFLOAT_VALUE
Old name of rb_float_value.
Definition double.h:28
#define T_STRING
Old name of RUBY_T_STRING.
Definition value_type.h:78
#define xfree
Old name of ruby_xfree.
Definition xmalloc.h:58
#define Qundef
Old name of RUBY_Qundef.
#define INT2FIX
Old name of RB_INT2FIX.
Definition long.h:48
#define T_FLOAT
Old name of RUBY_T_FLOAT.
Definition value_type.h:64
#define xrealloc
Old name of ruby_xrealloc.
Definition xmalloc.h:56
#define ID2SYM
Old name of RB_ID2SYM.
Definition symbol.h:44
#define T_BIGNUM
Old name of RUBY_T_BIGNUM.
Definition value_type.h:57
#define SPECIAL_CONST_P
Old name of RB_SPECIAL_CONST_P.
#define OBJ_FREEZE_RAW
Old name of RB_OBJ_FREEZE_RAW.
Definition fl_type.h:136
#define UNREACHABLE_RETURN
Old name of RBIMPL_UNREACHABLE_RETURN.
Definition assume.h:29
#define SYM2ID
Old name of RB_SYM2ID.
Definition symbol.h:45
#define ZALLOC
Old name of RB_ZALLOC.
Definition memory.h:396
#define T_NODE
Old name of RUBY_T_NODE.
Definition value_type.h:73
#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 ENCODING_GET(obj)
Old name of RB_ENCODING_GET.
Definition encoding.h:108
#define LONG2FIX
Old name of RB_INT2FIX.
Definition long.h:49
#define ISDIGIT
Old name of rb_isdigit.
Definition ctype.h:93
#define ASSUME
Old name of RBIMPL_ASSUME.
Definition assume.h:27
#define T_RATIONAL
Old name of RUBY_T_RATIONAL.
Definition value_type.h:76
#define ALLOC_N
Old name of RB_ALLOC_N.
Definition memory.h:393
#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 FLONUM_P
Old name of RB_FLONUM_P.
#define Qtrue
Old name of RUBY_Qtrue.
#define FIXNUM_MAX
Old name of RUBY_FIXNUM_MAX.
Definition fixnum.h:26
#define NUM2INT
Old name of RB_NUM2INT.
Definition int.h:44
#define INT2NUM
Old name of RB_INT2NUM.
Definition int.h:43
#define Qnil
Old name of RUBY_Qnil.
#define Qfalse
Old name of RUBY_Qfalse.
#define FIX2LONG
Old name of RB_FIX2LONG.
Definition long.h:46
#define T_ARRAY
Old name of RUBY_T_ARRAY.
Definition value_type.h:56
#define T_OBJECT
Old name of RUBY_T_OBJECT.
Definition value_type.h:75
#define NIL_P
Old name of RB_NIL_P.
#define MBCLEN_CHARFOUND_P(ret)
Old name of ONIGENC_MBCLEN_CHARFOUND_P.
Definition encoding.h:515
#define DBL2NUM
Old name of rb_float_new.
Definition double.h:29
#define BUILTIN_TYPE
Old name of RB_BUILTIN_TYPE.
Definition value_type.h:85
#define xcalloc
Old name of ruby_xcalloc.
Definition xmalloc.h:55
#define ENCODING_SET(obj, i)
Old name of RB_ENCODING_SET.
Definition encoding.h:106
#define ENCODING_IS_ASCII8BIT(obj)
Old name of RB_ENCODING_IS_ASCII8BIT.
Definition encoding.h:109
#define FIXNUM_P
Old name of RB_FIXNUM_P.
#define rb_ary_new2
Old name of rb_ary_new_capa.
Definition array.h:651
#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 SYMBOL_P
Old name of RB_SYMBOL_P.
Definition value_type.h:88
#define T_REGEXP
Old name of RUBY_T_REGEXP.
Definition value_type.h:77
#define ruby_verbose
This variable controls whether the interpreter is in debug mode.
Definition error.h:471
VALUE rb_eRuntimeError
RuntimeError exception.
Definition error.c:1342
VALUE rb_eSyntaxError
SyntaxError exception.
Definition error.c:1361
VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
Allocates, then initialises an instance of the given class.
Definition object.c:2099
#define RB_OBJ_WRITTEN(old, oldv, young)
Identical to RB_OBJ_WRITE(), except it doesn't write any values, but only a WB declaration.
Definition gc.h:631
#define RB_OBJ_WRITE(old, slot, young)
Declaration of a "back" pointer.
Definition gc.h:619
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:653
VALUE rb_funcall(VALUE recv, ID mid, int n,...)
Calls a method.
Definition vm_eval.c:1121
#define rb_rational_raw1(x)
Shorthand of (x/1)r.
Definition rational.h:51
VALUE rb_str_append(VALUE dst, VALUE src)
Identical to rb_str_buf_append(), except it converts the right hand side before concatenating.
Definition string.c:3414
#define rb_str_new(str, len)
Allocates an instance of rb_cString.
Definition string.h:1498
#define rb_str_buf_cat
Just another name of rb_str_cat
Definition string.h:1681
#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
#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
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 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:366
#define ALLOCA_N(type, n)
Definition memory.h:286
#define MEMZERO(p, type, n)
Handy macro to erase a region of memory.
Definition memory.h:354
#define RB_GC_GUARD(v)
Prevents premature destruction of local objects.
Definition memory.h:161
#define MEMMOVE(p1, p2, type, n)
Handy macro to call memmove.
Definition memory.h:378
VALUE type(ANYARGS)
ANYARGS-ed function type.
#define RARRAY_LEN
Just another name of rb_array_len
Definition rarray.h:51
#define RARRAY_AREF(a, i)
Definition rarray.h:403
static VALUE RBASIC_CLASS(VALUE obj)
Queries the class of an object.
Definition rbasic.h:152
#define RREGEXP_PTR(obj)
Convenient accessor macro.
Definition rregexp.h:45
#define RSTRING_GETMEM(str, ptrvar, lenvar)
Convenient macro to obtain the contents and length at once.
Definition rstring.h:488
#define StringValueCStr(v)
Identical to StringValuePtr, except it additionally checks for the contents for viability as a C stri...
Definition rstring.h:89
#define TypedData_Get_Struct(obj, type, data_type, sval)
Obtains a C struct from inside of a wrapper Ruby object.
Definition rtypeddata.h:515
#define TypedData_Make_Struct(klass, type, data_type, sval)
Identical to TypedData_Wrap_Struct, except it allocates a new data region internally instead of takin...
Definition rtypeddata.h:497
const char * rb_obj_classname(VALUE obj)
Queries the name of the class of the passed object.
Definition variable.c:417
#define errno
Ractor-aware version of errno.
Definition ruby.h:388
#define RTEST
This is an old name of RB_TEST.
Definition lex.c:34
This is the struct that holds necessary info for a struct.
Definition rtypeddata.h:200
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
static void Check_Type(VALUE v, enum ruby_value_type t)
Identical to RB_TYPE_P(), except it raises exceptions on predication failure.
Definition value_type.h:432
#define RBIMPL_WARNING_IGNORED(flag)
Suppresses a warning.
#define RBIMPL_WARNING_PUSH()
Pushes compiler warning state.
#define RBIMPL_WARNING_POP()
Pops compiler warning state.