Ruby 3.3.0p0 (2023-12-25 revision 5124f9ac7513eb590c37717337c430cb93caa151)
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*);
1244static NODE *remove_begin_all(NODE*);
1245#define value_expr(node) value_expr_gen(p, (node))
1246static NODE *void_stmts(struct parser_params*,NODE*);
1247static void reduce_nodes(struct parser_params*,NODE**);
1248static void block_dup_check(struct parser_params*,NODE*,NODE*);
1249
1250static NODE *block_append(struct parser_params*,NODE*,NODE*);
1251static NODE *list_append(struct parser_params*,NODE*,NODE*);
1252static NODE *list_concat(NODE*,NODE*);
1253static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1254static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
1255static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
1256static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1257static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
1258static NODE *new_dstr(struct parser_params*,NODE*,const YYLTYPE*);
1259static NODE *str2dstr(struct parser_params*,NODE*);
1260static NODE *evstr2dstr(struct parser_params*,NODE*);
1261static NODE *splat_array(NODE*);
1262static void mark_lvar_used(struct parser_params *p, NODE *rhs);
1263
1264static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
1265static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
1266static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
1267static 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);
1268static 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;}
1269
1270static bool args_info_empty_p(struct rb_args_info *args);
1271static 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*);
1272static rb_node_args_t *new_args_tail(struct parser_params*,rb_node_kw_arg_t*,ID,ID,const YYLTYPE*);
1273static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
1274static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc);
1275static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc);
1276static NODE *new_find_pattern_tail(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc);
1277static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
1278static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
1279
1280static rb_node_kw_arg_t *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
1281static rb_node_args_t *args_with_numbered(struct parser_params*,rb_node_args_t*,int);
1282
1283static VALUE negate_lit(struct parser_params*, VALUE);
1284static NODE *ret_args(struct parser_params*,NODE*);
1285static NODE *arg_blk_pass(NODE*,rb_node_block_pass_t*);
1286static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
1287static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
1288
1289static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
1290static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
1291
1292static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
1293static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
1294
1295static void rb_backref_error(struct parser_params*,NODE*);
1296static NODE *node_assign(struct parser_params*,NODE*,NODE*,struct lex_context,const YYLTYPE*);
1297
1298static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
1299static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc);
1300static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc);
1301static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
1302static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
1303
1304static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
1305
1306static rb_node_opt_arg_t *opt_arg_append(rb_node_opt_arg_t*, rb_node_opt_arg_t*);
1307static rb_node_kw_arg_t *kwd_append(rb_node_kw_arg_t*, rb_node_kw_arg_t*);
1308
1309static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
1310static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
1311
1312static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
1313
1314static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
1315
1316#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
1317
1318static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
1319
1320static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
1321
1322static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
1323
1324static rb_ast_id_table_t *local_tbl(struct parser_params*);
1325
1326static VALUE reg_compile(struct parser_params*, VALUE, int);
1327static void reg_fragment_setenc(struct parser_params*, VALUE, int);
1328static int reg_fragment_check(struct parser_params*, VALUE, int);
1329
1330static int literal_concat0(struct parser_params *p, VALUE head, VALUE tail);
1331static NODE *heredoc_dedent(struct parser_params*,NODE*);
1332
1333static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
1334
1335#define get_id(id) (id)
1336#define get_value(val) (val)
1337#define get_num(num) (num)
1338#else /* RIPPER */
1339
1340static inline int ripper_is_node_yylval(struct parser_params *p, VALUE n);
1341
1342static inline VALUE
1343ripper_new_yylval(struct parser_params *p, ID a, VALUE b, VALUE c)
1344{
1345 if (ripper_is_node_yylval(p, c)) c = RNODE_RIPPER(c)->nd_cval;
1346 add_mark_object(p, b);
1347 add_mark_object(p, c);
1348 return NEW_RIPPER(a, b, c, &NULL_LOC);
1349}
1350
1351static inline VALUE
1352ripper_new_yylval2(struct parser_params *p, VALUE a, VALUE b, VALUE c)
1353{
1354 add_mark_object(p, a);
1355 add_mark_object(p, b);
1356 add_mark_object(p, c);
1357 return NEW_RIPPER_VALUES(a, b, c, &NULL_LOC);
1358}
1359
1360static inline int
1361ripper_is_node_yylval(struct parser_params *p, VALUE n)
1362{
1363 return RB_TYPE_P(n, T_NODE) && nd_type_p(RNODE(n), NODE_RIPPER);
1364}
1365
1366#define value_expr(node) ((void)(node))
1367#define remove_begin(node) (node)
1368#define void_stmts(p,x) (x)
1369#undef rb_dvar_defined
1370#define rb_dvar_defined(id, base) 0
1371#undef rb_local_defined
1372#define rb_local_defined(id, base) 0
1373#define get_id(id) ripper_get_id(id)
1374#define get_value(val) ripper_get_value(val)
1375#define get_num(num) (int)get_id(num)
1376static VALUE assignable(struct parser_params*,VALUE);
1377static int id_is_var(struct parser_params *p, ID id);
1378
1379#define method_cond(p,node,loc) (node)
1380#define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
1381#define match_op(p,node1,node2,op_loc,loc) call_bin_op(0, (node1), idEqTilde, (node2), op_loc, loc)
1382#define call_uni_op(p, recv,id,op_loc,loc) dispatch2(unary, STATIC_ID2SYM(id), (recv))
1383#define logop(p,id,node1,node2,op_loc,loc) call_bin_op(0, (node1), (id), (node2), op_loc, loc)
1384
1385#define new_nil(loc) Qnil
1386
1387static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *);
1388
1389static VALUE const_decl(struct parser_params *p, VALUE path);
1390
1391static VALUE var_field(struct parser_params *p, VALUE a);
1392static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
1393
1394static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
1395
1396static VALUE backref_error(struct parser_params*, NODE *, VALUE);
1397#endif /* !RIPPER */
1398
1399RUBY_SYMBOL_EXPORT_BEGIN
1400VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
1401int rb_reg_fragment_setenc(struct parser_params*, VALUE, int);
1402enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
1403VALUE rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state);
1404void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
1405PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
1406YYLTYPE *rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
1407YYLTYPE *rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc);
1408YYLTYPE *rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc);
1409YYLTYPE *rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc);
1410YYLTYPE *rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc);
1411YYLTYPE *rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc);
1412RUBY_SYMBOL_EXPORT_END
1413
1414static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
1415static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
1416#ifndef RIPPER
1417static ID formal_argument(struct parser_params*, ID);
1418#else
1419static ID formal_argument(struct parser_params*, VALUE);
1420#endif
1421static ID shadowing_lvar(struct parser_params*,ID);
1422static void new_bv(struct parser_params*,ID);
1423
1424static void local_push(struct parser_params*,int);
1425static void local_pop(struct parser_params*);
1426static void local_var(struct parser_params*, ID);
1427static void arg_var(struct parser_params*, ID);
1428static int local_id(struct parser_params *p, ID id);
1429static int local_id_ref(struct parser_params*, ID, ID **);
1430#ifndef RIPPER
1431static ID internal_id(struct parser_params*);
1432static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
1433#endif
1434static int check_forwarding_args(struct parser_params*);
1435static void add_forwarding_args(struct parser_params *p);
1436static void forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var);
1437
1438static const struct vtable *dyna_push(struct parser_params *);
1439static void dyna_pop(struct parser_params*, const struct vtable *);
1440static int dyna_in_block(struct parser_params*);
1441#define dyna_var(p, id) local_var(p, id)
1442static int dvar_defined(struct parser_params*, ID);
1443static int dvar_defined_ref(struct parser_params*, ID, ID**);
1444static int dvar_curr(struct parser_params*,ID);
1445
1446static int lvar_defined(struct parser_params*, ID);
1447
1448static NODE *numparam_push(struct parser_params *p);
1449static void numparam_pop(struct parser_params *p, NODE *prev_inner);
1450
1451#ifdef RIPPER
1452# define METHOD_NOT idNOT
1453#else
1454# define METHOD_NOT '!'
1455#endif
1456
1457#define idFWD_REST '*'
1458#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
1459#define idFWD_BLOCK '&'
1460#define idFWD_ALL idDot3
1461#ifdef RIPPER
1462#define arg_FWD_BLOCK Qnone
1463#else
1464#define arg_FWD_BLOCK idFWD_BLOCK
1465#endif
1466#define FORWARD_ARGS_WITH_RUBY2_KEYWORDS
1467
1468#define RE_OPTION_ONCE (1<<16)
1469#define RE_OPTION_ENCODING_SHIFT 8
1470#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
1471#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
1472#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
1473#define RE_OPTION_MASK 0xff
1474#define RE_OPTION_ARG_ENCODING_NONE 32
1475
1476#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
1477size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
1478
1479#define TOKEN2ID(tok) ( \
1480 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
1481 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
1482 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
1483 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
1484 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
1485 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
1486 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
1487
1488/****** Ripper *******/
1489
1490#ifdef RIPPER
1491
1492#include "eventids1.h"
1493#include "eventids2.h"
1494
1495extern const struct ripper_parser_ids ripper_parser_ids;
1496
1497static VALUE ripper_dispatch0(struct parser_params*,ID);
1498static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
1499static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
1500static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
1501static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
1502static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
1503static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
1504void ripper_error(struct parser_params *p);
1505
1506#define dispatch0(n) ripper_dispatch0(p, TOKEN_PASTE(ripper_id_, n))
1507#define dispatch1(n,a) ripper_dispatch1(p, TOKEN_PASTE(ripper_id_, n), (a))
1508#define dispatch2(n,a,b) ripper_dispatch2(p, TOKEN_PASTE(ripper_id_, n), (a), (b))
1509#define dispatch3(n,a,b,c) ripper_dispatch3(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c))
1510#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d))
1511#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e))
1512#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))
1513
1514#define yyparse ripper_yyparse
1515
1516#define ID2VAL(id) STATIC_ID2SYM(id)
1517#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
1518#define KWD2EID(t, v) ripper_new_yylval(p, keyword_##t, get_value(v), 0)
1519
1520#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
1521 dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
1522
1523static inline VALUE
1524new_args(struct parser_params *p, VALUE pre_args, VALUE opt_args, VALUE rest_arg, VALUE post_args, VALUE tail, YYLTYPE *loc)
1525{
1526 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(tail);
1527 VALUE kw_args = t->nd_val1, kw_rest_arg = t->nd_val2, block = t->nd_val3;
1528 return params_new(pre_args, opt_args, rest_arg, post_args, kw_args, kw_rest_arg, block);
1529}
1530
1531static inline VALUE
1532new_args_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, VALUE block, YYLTYPE *loc)
1533{
1534 return ripper_new_yylval2(p, kw_args, kw_rest_arg, block);
1535}
1536
1537static inline VALUE
1538args_with_numbered(struct parser_params *p, VALUE args, int max_numparam)
1539{
1540 return args;
1541}
1542
1543static VALUE
1544new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE aryptn, const YYLTYPE *loc)
1545{
1546 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(aryptn);
1547 VALUE pre_args = t->nd_val1, rest_arg = t->nd_val2, post_args = t->nd_val3;
1548
1549 if (!NIL_P(pre_arg)) {
1550 if (!NIL_P(pre_args)) {
1551 rb_ary_unshift(pre_args, pre_arg);
1552 }
1553 else {
1554 pre_args = rb_ary_new_from_args(1, pre_arg);
1555 }
1556 }
1557 return dispatch4(aryptn, constant, pre_args, rest_arg, post_args);
1558}
1559
1560static VALUE
1561new_array_pattern_tail(struct parser_params *p, VALUE pre_args, VALUE has_rest, VALUE rest_arg, VALUE post_args, const YYLTYPE *loc)
1562{
1563 return ripper_new_yylval2(p, pre_args, rest_arg, post_args);
1564}
1565
1566static VALUE
1567new_find_pattern(struct parser_params *p, VALUE constant, VALUE fndptn, const YYLTYPE *loc)
1568{
1569 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(fndptn);
1570 VALUE pre_rest_arg = t->nd_val1, args = t->nd_val2, post_rest_arg = t->nd_val3;
1571
1572 return dispatch4(fndptn, constant, pre_rest_arg, args, post_rest_arg);
1573}
1574
1575static VALUE
1576new_find_pattern_tail(struct parser_params *p, VALUE pre_rest_arg, VALUE args, VALUE post_rest_arg, const YYLTYPE *loc)
1577{
1578 return ripper_new_yylval2(p, pre_rest_arg, args, post_rest_arg);
1579}
1580
1581#define new_hash(p,h,l) rb_ary_new_from_args(0)
1582
1583static VALUE
1584new_unique_key_hash(struct parser_params *p, VALUE ary, const YYLTYPE *loc)
1585{
1586 return ary;
1587}
1588
1589static VALUE
1590new_hash_pattern(struct parser_params *p, VALUE constant, VALUE hshptn, const YYLTYPE *loc)
1591{
1592 struct RNode_RIPPER_VALUES *t = RNODE_RIPPER_VALUES(hshptn);
1593 VALUE kw_args = t->nd_val1, kw_rest_arg = t->nd_val2;
1594 return dispatch3(hshptn, constant, kw_args, kw_rest_arg);
1595}
1596
1597static VALUE
1598new_hash_pattern_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, const YYLTYPE *loc)
1599{
1600 if (kw_rest_arg) {
1601 kw_rest_arg = dispatch1(var_field, kw_rest_arg);
1602 }
1603 else {
1604 kw_rest_arg = Qnil;
1605 }
1606 return ripper_new_yylval2(p, kw_args, kw_rest_arg, Qnil);
1607}
1608
1609#define new_defined(p,expr,loc) dispatch1(defined, (expr))
1610
1611static VALUE heredoc_dedent(struct parser_params*,VALUE);
1612
1613#else
1614#define ID2VAL(id) (id)
1615#define TOKEN2VAL(t) ID2VAL(t)
1616#define KWD2EID(t, v) keyword_##t
1617
1618static NODE *
1619new_scope_body(struct parser_params *p, rb_node_args_t *args, NODE *body, const YYLTYPE *loc)
1620{
1621 body = remove_begin(body);
1622 reduce_nodes(p, &body);
1623 NODE *n = NEW_SCOPE(args, body, loc);
1624 nd_set_line(n, loc->end_pos.lineno);
1625 set_line_body(body, loc->beg_pos.lineno);
1626 return n;
1627}
1628
1629static NODE *
1630rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1631 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1632{
1633 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1634 rescue = NEW_RESBODY(0, remove_begin(rescue), 0, &loc);
1635 loc.beg_pos = arg_loc->beg_pos;
1636 return NEW_RESCUE(arg, rescue, 0, &loc);
1637}
1638
1639#endif /* RIPPER */
1640
1641static NODE *add_block_exit(struct parser_params *p, NODE *node);
1642static rb_node_exits_t *init_block_exit(struct parser_params *p);
1643static rb_node_exits_t *allow_block_exit(struct parser_params *p);
1644static void restore_block_exit(struct parser_params *p, rb_node_exits_t *exits);
1645static void clear_block_exit(struct parser_params *p, bool error);
1646
1647static void
1648next_rescue_context(struct lex_context *next, const struct lex_context *outer, enum rescue_context def)
1649{
1650 next->in_rescue = outer->in_rescue == after_rescue ? after_rescue : def;
1651}
1652
1653static void
1654restore_defun(struct parser_params *p, rb_node_def_temp_t *temp)
1655{
1656 /* See: def_name action */
1657 struct lex_context ctxt = temp->save.ctxt;
1658 p->cur_arg = temp->save.cur_arg;
1659 p->ctxt.in_def = ctxt.in_def;
1660 p->ctxt.shareable_constant_value = ctxt.shareable_constant_value;
1661 p->ctxt.in_rescue = ctxt.in_rescue;
1662 p->max_numparam = temp->save.max_numparam;
1663 numparam_pop(p, temp->save.numparam_save);
1664 clear_block_exit(p, true);
1665}
1666
1667static void
1668endless_method_name(struct parser_params *p, ID mid, const YYLTYPE *loc)
1669{
1670 if (is_attrset_id(mid)) {
1671 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1672 }
1673 token_info_drop(p, "def", loc->beg_pos);
1674}
1675
1676#define debug_token_line(p, name, line) do { \
1677 if (p->debug) { \
1678 const char *const pcur = p->lex.pcur; \
1679 const char *const ptok = p->lex.ptok; \
1680 rb_parser_printf(p, name ":%d (%d: %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF")\n", \
1681 line, p->ruby_sourceline, \
1682 ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur); \
1683 } \
1684 } while (0)
1685
1686#define begin_definition(k, loc_beg, loc_end) \
1687 do { \
1688 if (!(p->ctxt.in_class = (k)[0] != 0)) { \
1689 p->ctxt.in_def = 0; \
1690 } \
1691 else if (p->ctxt.in_def) { \
1692 YYLTYPE loc = code_loc_gen(loc_beg, loc_end); \
1693 yyerror1(&loc, k " definition in method body"); \
1694 } \
1695 local_push(p, 0); \
1696 } while (0)
1697
1698#ifndef RIPPER
1699# define Qnone 0
1700# define Qnull 0
1701# define ifndef_ripper(x) (x)
1702#else
1703# define Qnone Qnil
1704# define Qnull Qundef
1705# define ifndef_ripper(x)
1706#endif
1707
1708# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1709# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1710# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1711# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1712# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1713# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1714# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1715# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1716# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1717# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1718# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1719# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1720# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1721# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1722# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1723# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1724# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1725# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1726# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1727# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1728#ifdef RIPPER
1729extern const ID id_warn, id_warning, id_gets, id_assoc;
1730# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1731# define WARN_S_L(s,l) STR_NEW(s,l)
1732# define WARN_S(s) STR_NEW2(s)
1733# define WARN_I(i) INT2NUM(i)
1734# define WARN_ID(i) rb_id2str(i)
1735# define WARN_IVAL(i) i
1736# define PRIsWARN "s"
1737# define rb_warn0L_experimental(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1738# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1739# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1740# ifdef HAVE_VA_ARGS_MACRO
1741# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1742# else
1743# define WARN_CALL rb_funcall
1744# endif
1745# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1746# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1747# ifdef HAVE_VA_ARGS_MACRO
1748# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1749# else
1750# define WARNING_CALL rb_funcall
1751# endif
1752# define compile_error ripper_compile_error
1753#else
1754# define WARN_S_L(s,l) s
1755# define WARN_S(s) s
1756# define WARN_I(i) i
1757# define WARN_ID(i) rb_id2name(i)
1758# define WARN_IVAL(i) NUM2INT(i)
1759# define PRIsWARN PRIsVALUE
1760# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1761# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1762# define WARN_CALL rb_compile_warn
1763# define rb_warn0L_experimental(l,fmt) rb_category_compile_warn(RB_WARN_CATEGORY_EXPERIMENTAL, WARN_ARGS_L(l, fmt, 1))
1764# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1765# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1766# define WARNING_CALL rb_compile_warning
1767PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const rb_code_location_t *loc, const char *fmt, ...), 3, 4);
1768# define compile_error(p, ...) parser_compile_error(p, NULL, __VA_ARGS__)
1769#endif
1770
1771struct RNode_EXITS {
1772 NODE node;
1773
1774 NODE *nd_chain; /* Assume NODE_BREAK, NODE_NEXT, NODE_REDO have nd_chain here */
1775 NODE *nd_end;
1776};
1777
1778#define RNODE_EXITS(node) ((rb_node_exits_t*)(node))
1779
1780static NODE *
1781add_block_exit(struct parser_params *p, NODE *node)
1782{
1783 if (!node) {
1784 compile_error(p, "unexpected null node");
1785 return 0;
1786 }
1787 switch (nd_type(node)) {
1788 case NODE_BREAK: case NODE_NEXT: case NODE_REDO: break;
1789 default:
1790 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1791 return node;
1792 }
1793 if (!p->ctxt.in_defined) {
1794 rb_node_exits_t *exits = p->exits;
1795 if (exits) {
1796 RNODE_EXITS(exits->nd_end)->nd_chain = node;
1797 exits->nd_end = node;
1798 }
1799 }
1800 return node;
1801}
1802
1803static rb_node_exits_t *
1804init_block_exit(struct parser_params *p)
1805{
1806 rb_node_exits_t *old = p->exits;
1807 rb_node_exits_t *exits = NODE_NEW_INTERNAL(NODE_EXITS, rb_node_exits_t);
1808 exits->nd_chain = 0;
1809 exits->nd_end = RNODE(exits);
1810 p->exits = exits;
1811 return old;
1812}
1813
1814static rb_node_exits_t *
1815allow_block_exit(struct parser_params *p)
1816{
1817 rb_node_exits_t *exits = p->exits;
1818 p->exits = 0;
1819 return exits;
1820}
1821
1822static void
1823restore_block_exit(struct parser_params *p, rb_node_exits_t *exits)
1824{
1825 p->exits = exits;
1826}
1827
1828static void
1829clear_block_exit(struct parser_params *p, bool error)
1830{
1831 rb_node_exits_t *exits = p->exits;
1832 if (!exits) return;
1833 if (error && !compile_for_eval) {
1834 for (NODE *e = RNODE(exits); (e = RNODE_EXITS(e)->nd_chain) != 0; ) {
1835 switch (nd_type(e)) {
1836 case NODE_BREAK:
1837 yyerror1(&e->nd_loc, "Invalid break");
1838 break;
1839 case NODE_NEXT:
1840 yyerror1(&e->nd_loc, "Invalid next");
1841 break;
1842 case NODE_REDO:
1843 yyerror1(&e->nd_loc, "Invalid redo");
1844 break;
1845 default:
1846 yyerror1(&e->nd_loc, "unexpected node");
1847 goto end_checks; /* no nd_chain */
1848 }
1849 }
1850 end_checks:;
1851 }
1852 exits->nd_end = RNODE(exits);
1853 exits->nd_chain = 0;
1854}
1855
1856#define WARN_EOL(tok) \
1857 (looking_at_eol_p(p) ? \
1858 (void)rb_warning0("`" tok "' at the end of line without an expression") : \
1859 (void)0)
1860static int looking_at_eol_p(struct parser_params *p);
1861
1862#ifndef RIPPER
1863static NODE *
1864get_nd_value(struct parser_params *p, NODE *node)
1865{
1866 switch (nd_type(node)) {
1867 case NODE_GASGN:
1868 return RNODE_GASGN(node)->nd_value;
1869 case NODE_IASGN:
1870 return RNODE_IASGN(node)->nd_value;
1871 case NODE_LASGN:
1872 return RNODE_LASGN(node)->nd_value;
1873 case NODE_DASGN:
1874 return RNODE_DASGN(node)->nd_value;
1875 case NODE_MASGN:
1876 return RNODE_MASGN(node)->nd_value;
1877 case NODE_CVASGN:
1878 return RNODE_CVASGN(node)->nd_value;
1879 case NODE_CDECL:
1880 return RNODE_CDECL(node)->nd_value;
1881 default:
1882 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1883 return 0;
1884 }
1885}
1886
1887static void
1888set_nd_value(struct parser_params *p, NODE *node, NODE *rhs)
1889{
1890 switch (nd_type(node)) {
1891 case NODE_CDECL:
1892 RNODE_CDECL(node)->nd_value = rhs;
1893 break;
1894 case NODE_GASGN:
1895 RNODE_GASGN(node)->nd_value = rhs;
1896 break;
1897 case NODE_IASGN:
1898 RNODE_IASGN(node)->nd_value = rhs;
1899 break;
1900 case NODE_LASGN:
1901 RNODE_LASGN(node)->nd_value = rhs;
1902 break;
1903 case NODE_DASGN:
1904 RNODE_DASGN(node)->nd_value = rhs;
1905 break;
1906 case NODE_MASGN:
1907 RNODE_MASGN(node)->nd_value = rhs;
1908 break;
1909 case NODE_CVASGN:
1910 RNODE_CVASGN(node)->nd_value = rhs;
1911 break;
1912 default:
1913 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1914 break;
1915 }
1916}
1917
1918static ID
1919get_nd_vid(struct parser_params *p, NODE *node)
1920{
1921 switch (nd_type(node)) {
1922 case NODE_CDECL:
1923 return RNODE_CDECL(node)->nd_vid;
1924 case NODE_GASGN:
1925 return RNODE_GASGN(node)->nd_vid;
1926 case NODE_IASGN:
1927 return RNODE_IASGN(node)->nd_vid;
1928 case NODE_LASGN:
1929 return RNODE_LASGN(node)->nd_vid;
1930 case NODE_DASGN:
1931 return RNODE_DASGN(node)->nd_vid;
1932 case NODE_CVASGN:
1933 return RNODE_CVASGN(node)->nd_vid;
1934 default:
1935 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1936 return 0;
1937 }
1938}
1939
1940static NODE *
1941get_nd_args(struct parser_params *p, NODE *node)
1942{
1943 switch (nd_type(node)) {
1944 case NODE_CALL:
1945 return RNODE_CALL(node)->nd_args;
1946 case NODE_OPCALL:
1947 return RNODE_OPCALL(node)->nd_args;
1948 case NODE_FCALL:
1949 return RNODE_FCALL(node)->nd_args;
1950 case NODE_QCALL:
1951 return RNODE_QCALL(node)->nd_args;
1952 case NODE_VCALL:
1953 case NODE_SUPER:
1954 case NODE_ZSUPER:
1955 case NODE_YIELD:
1956 case NODE_RETURN:
1957 case NODE_BREAK:
1958 case NODE_NEXT:
1959 return 0;
1960 default:
1961 compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node)));
1962 return 0;
1963 }
1964}
1965#endif
1966
1967#line 1968 "parse.c"
1968
1969# ifndef YY_CAST
1970# ifdef __cplusplus
1971# define YY_CAST(Type, Val) static_cast<Type> (Val)
1972# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
1973# else
1974# define YY_CAST(Type, Val) ((Type) (Val))
1975# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
1976# endif
1977# endif
1978# ifndef YY_NULLPTR
1979# if defined __cplusplus
1980# if 201103L <= __cplusplus
1981# define YY_NULLPTR nullptr
1982# else
1983# define YY_NULLPTR 0
1984# endif
1985# else
1986# define YY_NULLPTR ((void*)0)
1987# endif
1988# endif
1989
1990#include "parse.h"
1991/* Symbol kind. */
1992enum yysymbol_kind_t
1993{
1994 YYSYMBOL_YYEMPTY = -2,
1995 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
1996 YYSYMBOL_YYerror = 1, /* error */
1997 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
1998 YYSYMBOL_keyword_class = 3, /* "`class'" */
1999 YYSYMBOL_keyword_module = 4, /* "`module'" */
2000 YYSYMBOL_keyword_def = 5, /* "`def'" */
2001 YYSYMBOL_keyword_undef = 6, /* "`undef'" */
2002 YYSYMBOL_keyword_begin = 7, /* "`begin'" */
2003 YYSYMBOL_keyword_rescue = 8, /* "`rescue'" */
2004 YYSYMBOL_keyword_ensure = 9, /* "`ensure'" */
2005 YYSYMBOL_keyword_end = 10, /* "`end'" */
2006 YYSYMBOL_keyword_if = 11, /* "`if'" */
2007 YYSYMBOL_keyword_unless = 12, /* "`unless'" */
2008 YYSYMBOL_keyword_then = 13, /* "`then'" */
2009 YYSYMBOL_keyword_elsif = 14, /* "`elsif'" */
2010 YYSYMBOL_keyword_else = 15, /* "`else'" */
2011 YYSYMBOL_keyword_case = 16, /* "`case'" */
2012 YYSYMBOL_keyword_when = 17, /* "`when'" */
2013 YYSYMBOL_keyword_while = 18, /* "`while'" */
2014 YYSYMBOL_keyword_until = 19, /* "`until'" */
2015 YYSYMBOL_keyword_for = 20, /* "`for'" */
2016 YYSYMBOL_keyword_break = 21, /* "`break'" */
2017 YYSYMBOL_keyword_next = 22, /* "`next'" */
2018 YYSYMBOL_keyword_redo = 23, /* "`redo'" */
2019 YYSYMBOL_keyword_retry = 24, /* "`retry'" */
2020 YYSYMBOL_keyword_in = 25, /* "`in'" */
2021 YYSYMBOL_keyword_do = 26, /* "`do'" */
2022 YYSYMBOL_keyword_do_cond = 27, /* "`do' for condition" */
2023 YYSYMBOL_keyword_do_block = 28, /* "`do' for block" */
2024 YYSYMBOL_keyword_do_LAMBDA = 29, /* "`do' for lambda" */
2025 YYSYMBOL_keyword_return = 30, /* "`return'" */
2026 YYSYMBOL_keyword_yield = 31, /* "`yield'" */
2027 YYSYMBOL_keyword_super = 32, /* "`super'" */
2028 YYSYMBOL_keyword_self = 33, /* "`self'" */
2029 YYSYMBOL_keyword_nil = 34, /* "`nil'" */
2030 YYSYMBOL_keyword_true = 35, /* "`true'" */
2031 YYSYMBOL_keyword_false = 36, /* "`false'" */
2032 YYSYMBOL_keyword_and = 37, /* "`and'" */
2033 YYSYMBOL_keyword_or = 38, /* "`or'" */
2034 YYSYMBOL_keyword_not = 39, /* "`not'" */
2035 YYSYMBOL_modifier_if = 40, /* "`if' modifier" */
2036 YYSYMBOL_modifier_unless = 41, /* "`unless' modifier" */
2037 YYSYMBOL_modifier_while = 42, /* "`while' modifier" */
2038 YYSYMBOL_modifier_until = 43, /* "`until' modifier" */
2039 YYSYMBOL_modifier_rescue = 44, /* "`rescue' modifier" */
2040 YYSYMBOL_keyword_alias = 45, /* "`alias'" */
2041 YYSYMBOL_keyword_defined = 46, /* "`defined?'" */
2042 YYSYMBOL_keyword_BEGIN = 47, /* "`BEGIN'" */
2043 YYSYMBOL_keyword_END = 48, /* "`END'" */
2044 YYSYMBOL_keyword__LINE__ = 49, /* "`__LINE__'" */
2045 YYSYMBOL_keyword__FILE__ = 50, /* "`__FILE__'" */
2046 YYSYMBOL_keyword__ENCODING__ = 51, /* "`__ENCODING__'" */
2047 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
2048 YYSYMBOL_tFID = 53, /* "method" */
2049 YYSYMBOL_tGVAR = 54, /* "global variable" */
2050 YYSYMBOL_tIVAR = 55, /* "instance variable" */
2051 YYSYMBOL_tCONSTANT = 56, /* "constant" */
2052 YYSYMBOL_tCVAR = 57, /* "class variable" */
2053 YYSYMBOL_tLABEL = 58, /* "label" */
2054 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
2055 YYSYMBOL_tFLOAT = 60, /* "float literal" */
2056 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
2057 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
2058 YYSYMBOL_tCHAR = 63, /* "char literal" */
2059 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
2060 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
2061 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
2062 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
2063 YYSYMBOL_tDUMNY_END = 68, /* "dummy end" */
2064 YYSYMBOL_69_ = 69, /* '.' */
2065 YYSYMBOL_70_backslash_ = 70, /* "backslash" */
2066 YYSYMBOL_tSP = 71, /* "escaped space" */
2067 YYSYMBOL_72_escaped_horizontal_tab_ = 72, /* "escaped horizontal tab" */
2068 YYSYMBOL_73_escaped_form_feed_ = 73, /* "escaped form feed" */
2069 YYSYMBOL_74_escaped_carriage_return_ = 74, /* "escaped carriage return" */
2070 YYSYMBOL_75_escaped_vertical_tab_ = 75, /* "escaped vertical tab" */
2071 YYSYMBOL_tUPLUS = 76, /* "unary+" */
2072 YYSYMBOL_tUMINUS = 77, /* "unary-" */
2073 YYSYMBOL_tPOW = 78, /* "**" */
2074 YYSYMBOL_tCMP = 79, /* "<=>" */
2075 YYSYMBOL_tEQ = 80, /* "==" */
2076 YYSYMBOL_tEQQ = 81, /* "===" */
2077 YYSYMBOL_tNEQ = 82, /* "!=" */
2078 YYSYMBOL_tGEQ = 83, /* ">=" */
2079 YYSYMBOL_tLEQ = 84, /* "<=" */
2080 YYSYMBOL_tANDOP = 85, /* "&&" */
2081 YYSYMBOL_tOROP = 86, /* "||" */
2082 YYSYMBOL_tMATCH = 87, /* "=~" */
2083 YYSYMBOL_tNMATCH = 88, /* "!~" */
2084 YYSYMBOL_tDOT2 = 89, /* ".." */
2085 YYSYMBOL_tDOT3 = 90, /* "..." */
2086 YYSYMBOL_tBDOT2 = 91, /* "(.." */
2087 YYSYMBOL_tBDOT3 = 92, /* "(..." */
2088 YYSYMBOL_tAREF = 93, /* "[]" */
2089 YYSYMBOL_tASET = 94, /* "[]=" */
2090 YYSYMBOL_tLSHFT = 95, /* "<<" */
2091 YYSYMBOL_tRSHFT = 96, /* ">>" */
2092 YYSYMBOL_tANDDOT = 97, /* "&." */
2093 YYSYMBOL_tCOLON2 = 98, /* "::" */
2094 YYSYMBOL_tCOLON3 = 99, /* ":: at EXPR_BEG" */
2095 YYSYMBOL_tOP_ASGN = 100, /* "operator-assignment" */
2096 YYSYMBOL_tASSOC = 101, /* "=>" */
2097 YYSYMBOL_tLPAREN = 102, /* "(" */
2098 YYSYMBOL_tLPAREN_ARG = 103, /* "( arg" */
2099 YYSYMBOL_tRPAREN = 104, /* ")" */
2100 YYSYMBOL_tLBRACK = 105, /* "[" */
2101 YYSYMBOL_tLBRACE = 106, /* "{" */
2102 YYSYMBOL_tLBRACE_ARG = 107, /* "{ arg" */
2103 YYSYMBOL_tSTAR = 108, /* "*" */
2104 YYSYMBOL_tDSTAR = 109, /* "**arg" */
2105 YYSYMBOL_tAMPER = 110, /* "&" */
2106 YYSYMBOL_tLAMBDA = 111, /* "->" */
2107 YYSYMBOL_tSYMBEG = 112, /* "symbol literal" */
2108 YYSYMBOL_tSTRING_BEG = 113, /* "string literal" */
2109 YYSYMBOL_tXSTRING_BEG = 114, /* "backtick literal" */
2110 YYSYMBOL_tREGEXP_BEG = 115, /* "regexp literal" */
2111 YYSYMBOL_tWORDS_BEG = 116, /* "word list" */
2112 YYSYMBOL_tQWORDS_BEG = 117, /* "verbatim word list" */
2113 YYSYMBOL_tSYMBOLS_BEG = 118, /* "symbol list" */
2114 YYSYMBOL_tQSYMBOLS_BEG = 119, /* "verbatim symbol list" */
2115 YYSYMBOL_tSTRING_END = 120, /* "terminator" */
2116 YYSYMBOL_tSTRING_DEND = 121, /* "'}'" */
2117 YYSYMBOL_tSTRING_DBEG = 122, /* tSTRING_DBEG */
2118 YYSYMBOL_tSTRING_DVAR = 123, /* tSTRING_DVAR */
2119 YYSYMBOL_tLAMBEG = 124, /* tLAMBEG */
2120 YYSYMBOL_tLABEL_END = 125, /* tLABEL_END */
2121 YYSYMBOL_tIGNORED_NL = 126, /* tIGNORED_NL */
2122 YYSYMBOL_tCOMMENT = 127, /* tCOMMENT */
2123 YYSYMBOL_tEMBDOC_BEG = 128, /* tEMBDOC_BEG */
2124 YYSYMBOL_tEMBDOC = 129, /* tEMBDOC */
2125 YYSYMBOL_tEMBDOC_END = 130, /* tEMBDOC_END */
2126 YYSYMBOL_tHEREDOC_BEG = 131, /* tHEREDOC_BEG */
2127 YYSYMBOL_tHEREDOC_END = 132, /* tHEREDOC_END */
2128 YYSYMBOL_k__END__ = 133, /* k__END__ */
2129 YYSYMBOL_tLOWEST = 134, /* tLOWEST */
2130 YYSYMBOL_135_ = 135, /* '=' */
2131 YYSYMBOL_136_ = 136, /* '?' */
2132 YYSYMBOL_137_ = 137, /* ':' */
2133 YYSYMBOL_138_ = 138, /* '>' */
2134 YYSYMBOL_139_ = 139, /* '<' */
2135 YYSYMBOL_140_ = 140, /* '|' */
2136 YYSYMBOL_141_ = 141, /* '^' */
2137 YYSYMBOL_142_ = 142, /* '&' */
2138 YYSYMBOL_143_ = 143, /* '+' */
2139 YYSYMBOL_144_ = 144, /* '-' */
2140 YYSYMBOL_145_ = 145, /* '*' */
2141 YYSYMBOL_146_ = 146, /* '/' */
2142 YYSYMBOL_147_ = 147, /* '%' */
2143 YYSYMBOL_tUMINUS_NUM = 148, /* tUMINUS_NUM */
2144 YYSYMBOL_149_ = 149, /* '!' */
2145 YYSYMBOL_150_ = 150, /* '~' */
2146 YYSYMBOL_tLAST_TOKEN = 151, /* tLAST_TOKEN */
2147 YYSYMBOL_152_ = 152, /* '{' */
2148 YYSYMBOL_153_ = 153, /* '}' */
2149 YYSYMBOL_154_ = 154, /* '[' */
2150 YYSYMBOL_155_ = 155, /* ',' */
2151 YYSYMBOL_156_ = 156, /* '`' */
2152 YYSYMBOL_157_ = 157, /* '(' */
2153 YYSYMBOL_158_ = 158, /* ')' */
2154 YYSYMBOL_159_ = 159, /* ']' */
2155 YYSYMBOL_160_ = 160, /* ';' */
2156 YYSYMBOL_161_ = 161, /* ' ' */
2157 YYSYMBOL_162_n_ = 162, /* '\n' */
2158 YYSYMBOL_YYACCEPT = 163, /* $accept */
2159 YYSYMBOL_program = 164, /* program */
2160 YYSYMBOL_165_1 = 165, /* $@1 */
2161 YYSYMBOL_top_compstmt = 166, /* top_compstmt */
2162 YYSYMBOL_top_stmts = 167, /* top_stmts */
2163 YYSYMBOL_top_stmt = 168, /* top_stmt */
2164 YYSYMBOL_block_open = 169, /* block_open */
2165 YYSYMBOL_begin_block = 170, /* begin_block */
2166 YYSYMBOL_bodystmt = 171, /* bodystmt */
2167 YYSYMBOL_172_2 = 172, /* $@2 */
2168 YYSYMBOL_173_3 = 173, /* $@3 */
2169 YYSYMBOL_174_4 = 174, /* $@4 */
2170 YYSYMBOL_compstmt = 175, /* compstmt */
2171 YYSYMBOL_stmts = 176, /* stmts */
2172 YYSYMBOL_stmt_or_begin = 177, /* stmt_or_begin */
2173 YYSYMBOL_178_5 = 178, /* $@5 */
2174 YYSYMBOL_allow_exits = 179, /* allow_exits */
2175 YYSYMBOL_k_END = 180, /* k_END */
2176 YYSYMBOL_stmt = 181, /* stmt */
2177 YYSYMBOL_182_6 = 182, /* $@6 */
2178 YYSYMBOL_command_asgn = 183, /* command_asgn */
2179 YYSYMBOL_endless_command = 184, /* endless_command */
2180 YYSYMBOL_command_rhs = 185, /* command_rhs */
2181 YYSYMBOL_expr = 186, /* expr */
2182 YYSYMBOL_187_7 = 187, /* $@7 */
2183 YYSYMBOL_188_8 = 188, /* $@8 */
2184 YYSYMBOL_def_name = 189, /* def_name */
2185 YYSYMBOL_defn_head = 190, /* defn_head */
2186 YYSYMBOL_defs_head = 191, /* defs_head */
2187 YYSYMBOL_192_9 = 192, /* $@9 */
2188 YYSYMBOL_expr_value = 193, /* expr_value */
2189 YYSYMBOL_expr_value_do = 194, /* expr_value_do */
2190 YYSYMBOL_195_10 = 195, /* $@10 */
2191 YYSYMBOL_196_11 = 196, /* $@11 */
2192 YYSYMBOL_command_call = 197, /* command_call */
2193 YYSYMBOL_block_command = 198, /* block_command */
2194 YYSYMBOL_cmd_brace_block = 199, /* cmd_brace_block */
2195 YYSYMBOL_fcall = 200, /* fcall */
2196 YYSYMBOL_command = 201, /* command */
2197 YYSYMBOL_mlhs = 202, /* mlhs */
2198 YYSYMBOL_mlhs_inner = 203, /* mlhs_inner */
2199 YYSYMBOL_mlhs_basic = 204, /* mlhs_basic */
2200 YYSYMBOL_mlhs_item = 205, /* mlhs_item */
2201 YYSYMBOL_mlhs_head = 206, /* mlhs_head */
2202 YYSYMBOL_mlhs_post = 207, /* mlhs_post */
2203 YYSYMBOL_mlhs_node = 208, /* mlhs_node */
2204 YYSYMBOL_lhs = 209, /* lhs */
2205 YYSYMBOL_cname = 210, /* cname */
2206 YYSYMBOL_cpath = 211, /* cpath */
2207 YYSYMBOL_fname = 212, /* fname */
2208 YYSYMBOL_fitem = 213, /* fitem */
2209 YYSYMBOL_undef_list = 214, /* undef_list */
2210 YYSYMBOL_215_12 = 215, /* $@12 */
2211 YYSYMBOL_op = 216, /* op */
2212 YYSYMBOL_reswords = 217, /* reswords */
2213 YYSYMBOL_arg = 218, /* arg */
2214 YYSYMBOL_endless_arg = 219, /* endless_arg */
2215 YYSYMBOL_relop = 220, /* relop */
2216 YYSYMBOL_rel_expr = 221, /* rel_expr */
2217 YYSYMBOL_lex_ctxt = 222, /* lex_ctxt */
2218 YYSYMBOL_begin_defined = 223, /* begin_defined */
2219 YYSYMBOL_after_rescue = 224, /* after_rescue */
2220 YYSYMBOL_arg_value = 225, /* arg_value */
2221 YYSYMBOL_aref_args = 226, /* aref_args */
2222 YYSYMBOL_arg_rhs = 227, /* arg_rhs */
2223 YYSYMBOL_paren_args = 228, /* paren_args */
2224 YYSYMBOL_opt_paren_args = 229, /* opt_paren_args */
2225 YYSYMBOL_opt_call_args = 230, /* opt_call_args */
2226 YYSYMBOL_call_args = 231, /* call_args */
2227 YYSYMBOL_command_args = 232, /* command_args */
2228 YYSYMBOL_233_13 = 233, /* $@13 */
2229 YYSYMBOL_block_arg = 234, /* block_arg */
2230 YYSYMBOL_opt_block_arg = 235, /* opt_block_arg */
2231 YYSYMBOL_args = 236, /* args */
2232 YYSYMBOL_arg_splat = 237, /* arg_splat */
2233 YYSYMBOL_mrhs_arg = 238, /* mrhs_arg */
2234 YYSYMBOL_mrhs = 239, /* mrhs */
2235 YYSYMBOL_primary = 240, /* primary */
2236 YYSYMBOL_241_14 = 241, /* $@14 */
2237 YYSYMBOL_242_15 = 242, /* $@15 */
2238 YYSYMBOL_243_16 = 243, /* @16 */
2239 YYSYMBOL_244_17 = 244, /* @17 */
2240 YYSYMBOL_245_18 = 245, /* $@18 */
2241 YYSYMBOL_246_19 = 246, /* $@19 */
2242 YYSYMBOL_247_20 = 247, /* $@20 */
2243 YYSYMBOL_248_21 = 248, /* $@21 */
2244 YYSYMBOL_249_22 = 249, /* $@22 */
2245 YYSYMBOL_primary_value = 250, /* primary_value */
2246 YYSYMBOL_k_begin = 251, /* k_begin */
2247 YYSYMBOL_k_if = 252, /* k_if */
2248 YYSYMBOL_k_unless = 253, /* k_unless */
2249 YYSYMBOL_k_while = 254, /* k_while */
2250 YYSYMBOL_k_until = 255, /* k_until */
2251 YYSYMBOL_k_case = 256, /* k_case */
2252 YYSYMBOL_k_for = 257, /* k_for */
2253 YYSYMBOL_k_class = 258, /* k_class */
2254 YYSYMBOL_k_module = 259, /* k_module */
2255 YYSYMBOL_k_def = 260, /* k_def */
2256 YYSYMBOL_k_do = 261, /* k_do */
2257 YYSYMBOL_k_do_block = 262, /* k_do_block */
2258 YYSYMBOL_k_rescue = 263, /* k_rescue */
2259 YYSYMBOL_k_ensure = 264, /* k_ensure */
2260 YYSYMBOL_k_when = 265, /* k_when */
2261 YYSYMBOL_k_else = 266, /* k_else */
2262 YYSYMBOL_k_elsif = 267, /* k_elsif */
2263 YYSYMBOL_k_end = 268, /* k_end */
2264 YYSYMBOL_k_return = 269, /* k_return */
2265 YYSYMBOL_k_yield = 270, /* k_yield */
2266 YYSYMBOL_then = 271, /* then */
2267 YYSYMBOL_do = 272, /* do */
2268 YYSYMBOL_if_tail = 273, /* if_tail */
2269 YYSYMBOL_opt_else = 274, /* opt_else */
2270 YYSYMBOL_for_var = 275, /* for_var */
2271 YYSYMBOL_f_marg = 276, /* f_marg */
2272 YYSYMBOL_f_marg_list = 277, /* f_marg_list */
2273 YYSYMBOL_f_margs = 278, /* f_margs */
2274 YYSYMBOL_f_rest_marg = 279, /* f_rest_marg */
2275 YYSYMBOL_f_any_kwrest = 280, /* f_any_kwrest */
2276 YYSYMBOL_f_eq = 281, /* f_eq */
2277 YYSYMBOL_282_23 = 282, /* $@23 */
2278 YYSYMBOL_block_args_tail = 283, /* block_args_tail */
2279 YYSYMBOL_opt_block_args_tail = 284, /* opt_block_args_tail */
2280 YYSYMBOL_excessed_comma = 285, /* excessed_comma */
2281 YYSYMBOL_block_param = 286, /* block_param */
2282 YYSYMBOL_opt_block_param = 287, /* opt_block_param */
2283 YYSYMBOL_block_param_def = 288, /* block_param_def */
2284 YYSYMBOL_opt_bv_decl = 289, /* opt_bv_decl */
2285 YYSYMBOL_bv_decls = 290, /* bv_decls */
2286 YYSYMBOL_bvar = 291, /* bvar */
2287 YYSYMBOL_max_numparam = 292, /* max_numparam */
2288 YYSYMBOL_numparam = 293, /* numparam */
2289 YYSYMBOL_lambda = 294, /* lambda */
2290 YYSYMBOL_295_24 = 295, /* @24 */
2291 YYSYMBOL_296_25 = 296, /* $@25 */
2292 YYSYMBOL_f_larglist = 297, /* f_larglist */
2293 YYSYMBOL_lambda_body = 298, /* lambda_body */
2294 YYSYMBOL_299_26 = 299, /* $@26 */
2295 YYSYMBOL_do_block = 300, /* do_block */
2296 YYSYMBOL_block_call = 301, /* block_call */
2297 YYSYMBOL_method_call = 302, /* method_call */
2298 YYSYMBOL_brace_block = 303, /* brace_block */
2299 YYSYMBOL_brace_body = 304, /* brace_body */
2300 YYSYMBOL_305_27 = 305, /* @27 */
2301 YYSYMBOL_do_body = 306, /* do_body */
2302 YYSYMBOL_307_28 = 307, /* @28 */
2303 YYSYMBOL_case_args = 308, /* case_args */
2304 YYSYMBOL_case_body = 309, /* case_body */
2305 YYSYMBOL_cases = 310, /* cases */
2306 YYSYMBOL_p_pvtbl = 311, /* p_pvtbl */
2307 YYSYMBOL_p_pktbl = 312, /* p_pktbl */
2308 YYSYMBOL_p_in_kwarg = 313, /* p_in_kwarg */
2309 YYSYMBOL_p_case_body = 314, /* p_case_body */
2310 YYSYMBOL_315_29 = 315, /* $@29 */
2311 YYSYMBOL_p_cases = 316, /* p_cases */
2312 YYSYMBOL_p_top_expr = 317, /* p_top_expr */
2313 YYSYMBOL_p_top_expr_body = 318, /* p_top_expr_body */
2314 YYSYMBOL_p_expr = 319, /* p_expr */
2315 YYSYMBOL_p_as = 320, /* p_as */
2316 YYSYMBOL_p_alt = 321, /* p_alt */
2317 YYSYMBOL_p_lparen = 322, /* p_lparen */
2318 YYSYMBOL_p_lbracket = 323, /* p_lbracket */
2319 YYSYMBOL_p_expr_basic = 324, /* p_expr_basic */
2320 YYSYMBOL_325_30 = 325, /* $@30 */
2321 YYSYMBOL_p_args = 326, /* p_args */
2322 YYSYMBOL_p_args_head = 327, /* p_args_head */
2323 YYSYMBOL_p_args_tail = 328, /* p_args_tail */
2324 YYSYMBOL_p_find = 329, /* p_find */
2325 YYSYMBOL_p_rest = 330, /* p_rest */
2326 YYSYMBOL_p_args_post = 331, /* p_args_post */
2327 YYSYMBOL_p_arg = 332, /* p_arg */
2328 YYSYMBOL_p_kwargs = 333, /* p_kwargs */
2329 YYSYMBOL_p_kwarg = 334, /* p_kwarg */
2330 YYSYMBOL_p_kw = 335, /* p_kw */
2331 YYSYMBOL_p_kw_label = 336, /* p_kw_label */
2332 YYSYMBOL_p_kwrest = 337, /* p_kwrest */
2333 YYSYMBOL_p_kwnorest = 338, /* p_kwnorest */
2334 YYSYMBOL_p_any_kwrest = 339, /* p_any_kwrest */
2335 YYSYMBOL_p_value = 340, /* p_value */
2336 YYSYMBOL_p_primitive = 341, /* p_primitive */
2337 YYSYMBOL_p_variable = 342, /* p_variable */
2338 YYSYMBOL_p_var_ref = 343, /* p_var_ref */
2339 YYSYMBOL_p_expr_ref = 344, /* p_expr_ref */
2340 YYSYMBOL_p_const = 345, /* p_const */
2341 YYSYMBOL_opt_rescue = 346, /* opt_rescue */
2342 YYSYMBOL_exc_list = 347, /* exc_list */
2343 YYSYMBOL_exc_var = 348, /* exc_var */
2344 YYSYMBOL_opt_ensure = 349, /* opt_ensure */
2345 YYSYMBOL_literal = 350, /* literal */
2346 YYSYMBOL_strings = 351, /* strings */
2347 YYSYMBOL_string = 352, /* string */
2348 YYSYMBOL_string1 = 353, /* string1 */
2349 YYSYMBOL_xstring = 354, /* xstring */
2350 YYSYMBOL_regexp = 355, /* regexp */
2351 YYSYMBOL_words_sep = 356, /* words_sep */
2352 YYSYMBOL_words = 357, /* words */
2353 YYSYMBOL_word_list = 358, /* word_list */
2354 YYSYMBOL_word = 359, /* word */
2355 YYSYMBOL_symbols = 360, /* symbols */
2356 YYSYMBOL_symbol_list = 361, /* symbol_list */
2357 YYSYMBOL_qwords = 362, /* qwords */
2358 YYSYMBOL_qsymbols = 363, /* qsymbols */
2359 YYSYMBOL_qword_list = 364, /* qword_list */
2360 YYSYMBOL_qsym_list = 365, /* qsym_list */
2361 YYSYMBOL_string_contents = 366, /* string_contents */
2362 YYSYMBOL_xstring_contents = 367, /* xstring_contents */
2363 YYSYMBOL_regexp_contents = 368, /* regexp_contents */
2364 YYSYMBOL_string_content = 369, /* string_content */
2365 YYSYMBOL_370_31 = 370, /* @31 */
2366 YYSYMBOL_371_32 = 371, /* @32 */
2367 YYSYMBOL_372_33 = 372, /* @33 */
2368 YYSYMBOL_373_34 = 373, /* @34 */
2369 YYSYMBOL_string_dend = 374, /* string_dend */
2370 YYSYMBOL_string_dvar = 375, /* string_dvar */
2371 YYSYMBOL_symbol = 376, /* symbol */
2372 YYSYMBOL_ssym = 377, /* ssym */
2373 YYSYMBOL_sym = 378, /* sym */
2374 YYSYMBOL_dsym = 379, /* dsym */
2375 YYSYMBOL_numeric = 380, /* numeric */
2376 YYSYMBOL_simple_numeric = 381, /* simple_numeric */
2377 YYSYMBOL_nonlocal_var = 382, /* nonlocal_var */
2378 YYSYMBOL_user_variable = 383, /* user_variable */
2379 YYSYMBOL_keyword_variable = 384, /* keyword_variable */
2380 YYSYMBOL_var_ref = 385, /* var_ref */
2381 YYSYMBOL_var_lhs = 386, /* var_lhs */
2382 YYSYMBOL_backref = 387, /* backref */
2383 YYSYMBOL_superclass = 388, /* superclass */
2384 YYSYMBOL_389_35 = 389, /* $@35 */
2385 YYSYMBOL_f_opt_paren_args = 390, /* f_opt_paren_args */
2386 YYSYMBOL_f_paren_args = 391, /* f_paren_args */
2387 YYSYMBOL_f_arglist = 392, /* f_arglist */
2388 YYSYMBOL_393_36 = 393, /* @36 */
2389 YYSYMBOL_args_tail = 394, /* args_tail */
2390 YYSYMBOL_opt_args_tail = 395, /* opt_args_tail */
2391 YYSYMBOL_f_args = 396, /* f_args */
2392 YYSYMBOL_args_forward = 397, /* args_forward */
2393 YYSYMBOL_f_bad_arg = 398, /* f_bad_arg */
2394 YYSYMBOL_f_norm_arg = 399, /* f_norm_arg */
2395 YYSYMBOL_f_arg_asgn = 400, /* f_arg_asgn */
2396 YYSYMBOL_f_arg_item = 401, /* f_arg_item */
2397 YYSYMBOL_f_arg = 402, /* f_arg */
2398 YYSYMBOL_f_label = 403, /* f_label */
2399 YYSYMBOL_f_kw = 404, /* f_kw */
2400 YYSYMBOL_f_block_kw = 405, /* f_block_kw */
2401 YYSYMBOL_f_block_kwarg = 406, /* f_block_kwarg */
2402 YYSYMBOL_f_kwarg = 407, /* f_kwarg */
2403 YYSYMBOL_kwrest_mark = 408, /* kwrest_mark */
2404 YYSYMBOL_f_no_kwarg = 409, /* f_no_kwarg */
2405 YYSYMBOL_f_kwrest = 410, /* f_kwrest */
2406 YYSYMBOL_f_opt = 411, /* f_opt */
2407 YYSYMBOL_f_block_opt = 412, /* f_block_opt */
2408 YYSYMBOL_f_block_optarg = 413, /* f_block_optarg */
2409 YYSYMBOL_f_optarg = 414, /* f_optarg */
2410 YYSYMBOL_restarg_mark = 415, /* restarg_mark */
2411 YYSYMBOL_f_rest_arg = 416, /* f_rest_arg */
2412 YYSYMBOL_blkarg_mark = 417, /* blkarg_mark */
2413 YYSYMBOL_f_block_arg = 418, /* f_block_arg */
2414 YYSYMBOL_opt_f_block_arg = 419, /* opt_f_block_arg */
2415 YYSYMBOL_singleton = 420, /* singleton */
2416 YYSYMBOL_421_37 = 421, /* $@37 */
2417 YYSYMBOL_assoc_list = 422, /* assoc_list */
2418 YYSYMBOL_assocs = 423, /* assocs */
2419 YYSYMBOL_assoc = 424, /* assoc */
2420 YYSYMBOL_operation = 425, /* operation */
2421 YYSYMBOL_operation2 = 426, /* operation2 */
2422 YYSYMBOL_operation3 = 427, /* operation3 */
2423 YYSYMBOL_dot_or_colon = 428, /* dot_or_colon */
2424 YYSYMBOL_call_op = 429, /* call_op */
2425 YYSYMBOL_call_op2 = 430, /* call_op2 */
2426 YYSYMBOL_opt_terms = 431, /* opt_terms */
2427 YYSYMBOL_opt_nl = 432, /* opt_nl */
2428 YYSYMBOL_rparen = 433, /* rparen */
2429 YYSYMBOL_rbracket = 434, /* rbracket */
2430 YYSYMBOL_rbrace = 435, /* rbrace */
2431 YYSYMBOL_trailer = 436, /* trailer */
2432 YYSYMBOL_term = 437, /* term */
2433 YYSYMBOL_terms = 438, /* terms */
2434 YYSYMBOL_none = 439 /* none */
2435};
2436typedef enum yysymbol_kind_t yysymbol_kind_t;
2437
2438
2439
2440
2441#ifdef short
2442# undef short
2443#endif
2444
2445/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
2446 <limits.h> and (if available) <stdint.h> are included
2447 so that the code can choose integer types of a good width. */
2448
2449#ifndef __PTRDIFF_MAX__
2450# include <limits.h> /* INFRINGES ON USER NAME SPACE */
2451# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2452# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
2453# define YY_STDINT_H
2454# endif
2455#endif
2456
2457/* Narrow types that promote to a signed type and that can represent a
2458 signed or unsigned integer of at least N bits. In tables they can
2459 save space and decrease cache pressure. Promoting to a signed type
2460 helps avoid bugs in integer arithmetic. */
2461
2462#ifdef __INT_LEAST8_MAX__
2463typedef __INT_LEAST8_TYPE__ yytype_int8;
2464#elif defined YY_STDINT_H
2465typedef int_least8_t yytype_int8;
2466#else
2467typedef signed char yytype_int8;
2468#endif
2469
2470#ifdef __INT_LEAST16_MAX__
2471typedef __INT_LEAST16_TYPE__ yytype_int16;
2472#elif defined YY_STDINT_H
2473typedef int_least16_t yytype_int16;
2474#else
2475typedef short yytype_int16;
2476#endif
2477
2478/* Work around bug in HP-UX 11.23, which defines these macros
2479 incorrectly for preprocessor constants. This workaround can likely
2480 be removed in 2023, as HPE has promised support for HP-UX 11.23
2481 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
2482 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
2483#ifdef __hpux
2484# undef UINT_LEAST8_MAX
2485# undef UINT_LEAST16_MAX
2486# define UINT_LEAST8_MAX 255
2487# define UINT_LEAST16_MAX 65535
2488#endif
2489
2490#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
2491typedef __UINT_LEAST8_TYPE__ yytype_uint8;
2492#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
2493 && UINT_LEAST8_MAX <= INT_MAX)
2494typedef uint_least8_t yytype_uint8;
2495#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
2496typedef unsigned char yytype_uint8;
2497#else
2498typedef short yytype_uint8;
2499#endif
2500
2501#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
2502typedef __UINT_LEAST16_TYPE__ yytype_uint16;
2503#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
2504 && UINT_LEAST16_MAX <= INT_MAX)
2505typedef uint_least16_t yytype_uint16;
2506#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
2507typedef unsigned short yytype_uint16;
2508#else
2509typedef int yytype_uint16;
2510#endif
2511
2512#ifndef YYPTRDIFF_T
2513# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
2514# define YYPTRDIFF_T __PTRDIFF_TYPE__
2515# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
2516# elif defined PTRDIFF_MAX
2517# ifndef ptrdiff_t
2518# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2519# endif
2520# define YYPTRDIFF_T ptrdiff_t
2521# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
2522# else
2523# define YYPTRDIFF_T long
2524# define YYPTRDIFF_MAXIMUM LONG_MAX
2525# endif
2526#endif
2527
2528#ifndef YYSIZE_T
2529# ifdef __SIZE_TYPE__
2530# define YYSIZE_T __SIZE_TYPE__
2531# elif defined size_t
2532# define YYSIZE_T size_t
2533# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2534# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2535# define YYSIZE_T size_t
2536# else
2537# define YYSIZE_T unsigned
2538# endif
2539#endif
2540
2541#define YYSIZE_MAXIMUM \
2542 YY_CAST (YYPTRDIFF_T, \
2543 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
2544 ? YYPTRDIFF_MAXIMUM \
2545 : YY_CAST (YYSIZE_T, -1)))
2546
2547#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
2548
2549
2550/* Stored state numbers (used for stacks). */
2551typedef yytype_int16 yy_state_t;
2552
2553/* State numbers in computations. */
2554typedef int yy_state_fast_t;
2555
2556#ifndef YY_
2557# if defined YYENABLE_NLS && YYENABLE_NLS
2558# if ENABLE_NLS
2559# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2560# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
2561# endif
2562# endif
2563# ifndef YY_
2564# define YY_(Msgid) Msgid
2565# endif
2566#endif
2567
2568
2569#ifndef YY_ATTRIBUTE_PURE
2570# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
2571# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
2572# else
2573# define YY_ATTRIBUTE_PURE
2574# endif
2575#endif
2576
2577#ifndef YY_ATTRIBUTE_UNUSED
2578# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
2579# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
2580# else
2581# define YY_ATTRIBUTE_UNUSED
2582# endif
2583#endif
2584
2585/* Suppress unused-variable warnings by "using" E. */
2586#if ! defined lint || defined __GNUC__
2587# define YY_USE(E) ((void) (E))
2588#else
2589# define YY_USE(E) /* empty */
2590#endif
2591
2592/* Suppress an incorrect diagnostic about yylval being uninitialized. */
2593#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
2594# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
2595# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2596 _Pragma ("GCC diagnostic push") \
2597 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
2598# else
2599# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2600 _Pragma ("GCC diagnostic push") \
2601 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
2602 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
2603# endif
2604# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
2605 _Pragma ("GCC diagnostic pop")
2606#else
2607# define YY_INITIAL_VALUE(Value) Value
2608#endif
2609#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2610# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2611# define YY_IGNORE_MAYBE_UNINITIALIZED_END
2612#endif
2613#ifndef YY_INITIAL_VALUE
2614# define YY_INITIAL_VALUE(Value) /* Nothing. */
2615#endif
2616
2617#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
2618# define YY_IGNORE_USELESS_CAST_BEGIN \
2619 _Pragma ("GCC diagnostic push") \
2620 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
2621# define YY_IGNORE_USELESS_CAST_END \
2622 _Pragma ("GCC diagnostic pop")
2623#endif
2624#ifndef YY_IGNORE_USELESS_CAST_BEGIN
2625# define YY_IGNORE_USELESS_CAST_BEGIN
2626# define YY_IGNORE_USELESS_CAST_END
2627#endif
2628
2629
2630#define YY_ASSERT(E) ((void) (0 && (E)))
2631
2632#if 1
2633
2634/* The parser invokes alloca or malloc; define the necessary symbols. */
2635
2636# ifdef YYSTACK_USE_ALLOCA
2637# if YYSTACK_USE_ALLOCA
2638# ifdef __GNUC__
2639# define YYSTACK_ALLOC __builtin_alloca
2640# elif defined __BUILTIN_VA_ARG_INCR
2641# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2642# elif defined _AIX
2643# define YYSTACK_ALLOC __alloca
2644# elif defined _MSC_VER
2645# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2646# define alloca _alloca
2647# else
2648# define YYSTACK_ALLOC alloca
2649# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
2650# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2651 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
2652# ifndef EXIT_SUCCESS
2653# define EXIT_SUCCESS 0
2654# endif
2655# endif
2656# endif
2657# endif
2658# endif
2659
2660# ifdef YYSTACK_ALLOC
2661 /* Pacify GCC's 'empty if-body' warning. */
2662# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
2663# ifndef YYSTACK_ALLOC_MAXIMUM
2664 /* The OS might guarantee only one guard page at the bottom of the stack,
2665 and a page size can be as small as 4096 bytes. So we cannot safely
2666 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2667 to allow for a few compiler-allocated temporary stack slots. */
2668# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2669# endif
2670# else
2671# define YYSTACK_ALLOC YYMALLOC
2672# define YYSTACK_FREE YYFREE
2673# ifndef YYSTACK_ALLOC_MAXIMUM
2674# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2675# endif
2676# if (defined __cplusplus && ! defined EXIT_SUCCESS \
2677 && ! ((defined YYMALLOC || defined malloc) \
2678 && (defined YYFREE || defined free)))
2679# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2680# ifndef EXIT_SUCCESS
2681# define EXIT_SUCCESS 0
2682# endif
2683# endif
2684# ifndef YYMALLOC
2685# define YYMALLOC malloc
2686# if ! defined malloc && ! defined EXIT_SUCCESS
2687void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2688# endif
2689# endif
2690# ifndef YYFREE
2691# define YYFREE free
2692# if ! defined free && ! defined EXIT_SUCCESS
2693void free (void *); /* INFRINGES ON USER NAME SPACE */
2694# endif
2695# endif
2696# endif
2697#endif /* 1 */
2698
2699#if (! defined yyoverflow \
2700 && (! defined __cplusplus \
2701 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
2702 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2703
2704/* A type that is properly aligned for any stack member. */
2705union yyalloc
2706{
2707 yy_state_t yyss_alloc;
2708 YYSTYPE yyvs_alloc;
2709 YYLTYPE yyls_alloc;
2710};
2711
2712/* The size of the maximum gap between one aligned stack and the next. */
2713# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
2714
2715/* The size of an array large to enough to hold all stacks, each with
2716 N elements. */
2717# define YYSTACK_BYTES(N) \
2718 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
2719 + YYSIZEOF (YYLTYPE)) \
2720 + 2 * YYSTACK_GAP_MAXIMUM)
2721
2722# define YYCOPY_NEEDED 1
2723
2724/* Relocate STACK from its old location to the new one. The
2725 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2726 elements in the stack, and YYPTR gives the new location of the
2727 stack. Advance YYPTR to a properly aligned location for the next
2728 stack. */
2729# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2730 do \
2731 { \
2732 YYPTRDIFF_T yynewbytes; \
2733 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2734 Stack = &yyptr->Stack_alloc; \
2735 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
2736 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
2737 } \
2738 while (0)
2739
2740#endif
2741
2742#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
2743/* Copy COUNT objects from SRC to DST. The source and destination do
2744 not overlap. */
2745# ifndef YYCOPY
2746# if defined __GNUC__ && 1 < __GNUC__
2747# define YYCOPY(Dst, Src, Count) \
2748 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
2749# else
2750# define YYCOPY(Dst, Src, Count) \
2751 do \
2752 { \
2753 YYPTRDIFF_T yyi; \
2754 for (yyi = 0; yyi < (Count); yyi++) \
2755 (Dst)[yyi] = (Src)[yyi]; \
2756 } \
2757 while (0)
2758# endif
2759# endif
2760#endif /* !YYCOPY_NEEDED */
2761
2762/* YYFINAL -- State number of the termination state. */
2763#define YYFINAL 3
2764/* YYLAST -- Last index in YYTABLE. */
2765#define YYLAST 15486
2766
2767/* YYNTOKENS -- Number of terminals. */
2768#define YYNTOKENS 163
2769/* YYNNTS -- Number of nonterminals. */
2770#define YYNNTS 277
2771/* YYNRULES -- Number of rules. */
2772#define YYNRULES 783
2773/* YYNSTATES -- Number of states. */
2774#define YYNSTATES 1341
2775
2776/* YYMAXUTOK -- Last valid token kind. */
2777#define YYMAXUTOK 362
2778
2779
2780/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
2781 as returned by yylex, with out-of-bounds checking. */
2782#define YYTRANSLATE(YYX) \
2783 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
2784 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
2785 : YYSYMBOL_YYUNDEF)
2786
2787/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
2788 as returned by yylex. */
2789static const yytype_uint8 yytranslate[] =
2790{
2791 0, 2, 2, 2, 2, 2, 2, 2, 2, 72,
2792 162, 75, 73, 74, 2, 2, 2, 2, 2, 2,
2793 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2794 2, 2, 161, 149, 2, 2, 2, 147, 142, 2,
2795 157, 158, 145, 143, 155, 144, 69, 146, 2, 2,
2796 2, 2, 2, 2, 2, 2, 2, 2, 137, 160,
2797 139, 135, 138, 136, 2, 2, 2, 2, 2, 2,
2798 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2799 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2800 2, 154, 70, 159, 141, 2, 156, 2, 2, 2,
2801 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2802 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2803 2, 2, 2, 152, 140, 153, 150, 2, 89, 90,
2804 91, 92, 76, 77, 78, 79, 95, 96, 84, 83,
2805 80, 81, 82, 87, 88, 93, 94, 98, 85, 86,
2806 97, 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, 2, 2, 2, 2,
2816 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2817 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2818 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2819 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2820 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2821 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2822 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2823 65, 66, 67, 68, 71, 99, 100, 101, 102, 103,
2824 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2825 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
2826 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2827 134, 148, 151
2828};
2829
2830#if YYDEBUG
2831/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
2832static const yytype_int16 yyrline[] =
2833{
2834 0, 2194, 2194, 2194, 2222, 2228, 2235, 2242, 2251, 2256,
2835 2262, 2264, 2280, 2285, 2276, 2298, 2295, 2310, 2316, 2323,
2836 2330, 2339, 2344, 2343, 2353, 2355, 2361, 2361, 2368, 2375,
2837 2385, 2394, 2401, 2409, 2417, 2430, 2443, 2454, 2469, 2470,
2838 2478, 2485, 2498, 2505, 2506, 2515, 2522, 2529, 2537, 2544,
2839 2551, 2559, 2566, 2579, 2592, 2602, 2603, 2611, 2617, 2622,
2840 2632, 2635, 2636, 2640, 2644, 2648, 2653, 2652, 2668, 2667,
2841 2682, 2685, 2697, 2710, 2709, 2729, 2734, 2742, 2742, 2742,
2842 2748, 2749, 2752, 2753, 2762, 2771, 2780, 2789, 2800, 2807,
2843 2814, 2821, 2828, 2836, 2844, 2852, 2859, 2868, 2879, 2880,
2844 2889, 2890, 2899, 2906, 2913, 2920, 2927, 2934, 2941, 2948,
2845 2955, 2962, 2971, 2972, 2981, 2988, 2997, 3004, 3013, 3020,
2846 3027, 3034, 3042, 3049, 3057, 3064, 3071, 3081, 3088, 3095,
2847 3102, 3109, 3116, 3123, 3130, 3137, 3147, 3155, 3158, 3165,
2848 3172, 3181, 3182, 3183, 3184, 3189, 3192, 3199, 3202, 3209,
2849 3209, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227,
2850 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237,
2851 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 3247,
2852 3248, 3251, 3251, 3251, 3252, 3252, 3253, 3253, 3253, 3254,
2853 3254, 3254, 3254, 3255, 3255, 3255, 3255, 3256, 3256, 3256,
2854 3257, 3257, 3257, 3257, 3258, 3258, 3258, 3258, 3259, 3259,
2855 3259, 3259, 3260, 3260, 3260, 3260, 3261, 3261, 3261, 3261,
2856 3262, 3262, 3265, 3272, 3279, 3286, 3293, 3300, 3307, 3315,
2857 3323, 3331, 3340, 3349, 3357, 3365, 3373, 3381, 3385, 3389,
2858 3393, 3397, 3401, 3405, 3409, 3413, 3417, 3421, 3425, 3429,
2859 3433, 3434, 3438, 3442, 3446, 3450, 3454, 3458, 3462, 3466,
2860 3470, 3474, 3478, 3483, 3492, 3505, 3518, 3524, 3525, 3533,
2861 3539, 3540, 3541, 3542, 3545, 3549, 3556, 3562, 3569, 3576,
2862 3583, 3584, 3588, 3595, 3604, 3609, 3620, 3627, 3639, 3653,
2863 3654, 3657, 3658, 3659, 3663, 3670, 3679, 3687, 3694, 3702,
2864 3710, 3714, 3714, 3751, 3758, 3768, 3772, 3779, 3786, 3793,
2865 3800, 3810, 3814, 3825, 3826, 3830, 3837, 3844, 3853, 3854,
2866 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3871,
2867 3870, 3885, 3885, 3893, 3901, 3908, 3915, 3922, 3930, 3937,
2868 3944, 3951, 3958, 3963, 3967, 3971, 3978, 3979, 3987, 3988,
2869 3999, 4010, 4021, 4033, 4032, 4049, 4048, 4063, 4072, 4117,
2870 4116, 4135, 4134, 4155, 4154, 4174, 4172, 4193, 4191, 4210,
2871 4215, 4220, 4225, 4242, 4249, 4258, 4278, 4287, 4297, 4307,
2872 4316, 4326, 4337, 4348, 4356, 4365, 4374, 4382, 4389, 4395,
2873 4410, 4417, 4424, 4430, 4437, 4444, 4445, 4446, 4449, 4450,
2874 4453, 4454, 4466, 4467, 4476, 4477, 4480, 4488, 4497, 4504,
2875 4513, 4520, 4527, 4534, 4541, 4550, 4558, 4567, 4568, 4571,
2876 4571, 4573, 4577, 4581, 4585, 4591, 4596, 4601, 4611, 4615,
2877 4619, 4623, 4627, 4631, 4636, 4640, 4644, 4648, 4652, 4656,
2878 4660, 4664, 4668, 4674, 4675, 4681, 4692, 4705, 4709, 4718,
2879 4720, 4724, 4729, 4735, 4741, 4747, 4755, 4746, 4781, 4790,
2880 4801, 4807, 4806, 4818, 4827, 4841, 4848, 4855, 4864, 4873,
2881 4881, 4889, 4896, 4904, 4912, 4919, 4926, 4936, 4943, 4952,
2882 4952, 4969, 4969, 4990, 4998, 5005, 5013, 5022, 5034, 5035,
2883 5038, 5039, 5041, 5052, 5049, 5067, 5068, 5071, 5072, 5080,
2884 5090, 5091, 5096, 5104, 5108, 5112, 5118, 5121, 5130, 5133,
2885 5140, 5143, 5144, 5146, 5147, 5148, 5157, 5166, 5175, 5180,
2886 5189, 5198, 5207, 5212, 5216, 5220, 5226, 5225, 5235, 5240,
2887 5247, 5256, 5260, 5269, 5273, 5277, 5280, 5284, 5293, 5297,
2888 5303, 5310, 5318, 5327, 5328, 5337, 5346, 5350, 5354, 5358,
2889 5364, 5366, 5375, 5383, 5397, 5398, 5421, 5425, 5431, 5437,
2890 5438, 5441, 5442, 5451, 5460, 5468, 5476, 5477, 5478, 5479,
2891 5487, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505,
2892 5512, 5515, 5525, 5536, 5545, 5554, 5561, 5568, 5577, 5601,
2893 5604, 5611, 5618, 5621, 5625, 5628, 5636, 5639, 5640, 5643,
2894 5660, 5661, 5662, 5671, 5681, 5690, 5696, 5697, 5700, 5710,
2895 5716, 5725, 5727, 5736, 5746, 5752, 5761, 5770, 5780, 5786,
2896 5796, 5802, 5812, 5822, 5841, 5847, 5857, 5867, 5908, 5911,
2897 5910, 5927, 5936, 5940, 5926, 5961, 5962, 5965, 5972, 5975,
2898 5976, 5979, 5989, 5990, 5993, 6003, 6004, 6014, 6015, 6016,
2899 6017, 6020, 6021, 6022, 6025, 6026, 6027, 6030, 6031, 6032,
2900 6033, 6034, 6035, 6036, 6039, 6052, 6061, 6068, 6077, 6078,
2901 6082, 6081, 6091, 6099, 6100, 6108, 6120, 6121, 6121, 6137,
2902 6141, 6145, 6149, 6153, 6163, 6168, 6173, 6177, 6181, 6185,
2903 6189, 6193, 6197, 6201, 6205, 6209, 6213, 6217, 6221, 6225,
2904 6230, 6236, 6249, 6258, 6267, 6276, 6287, 6288, 6296, 6305,
2905 6313, 6334, 6336, 6349, 6359, 6368, 6379, 6387, 6397, 6404,
2906 6414, 6421, 6430, 6431, 6434, 6442, 6450, 6460, 6471, 6482,
2907 6489, 6498, 6505, 6514, 6515, 6518, 6526, 6536, 6537, 6540,
2908 6548, 6558, 6562, 6568, 6573, 6573, 6599, 6600, 6609, 6611,
2909 6634, 6645, 6652, 6661, 6669, 6686, 6697, 6698, 6699, 6702,
2910 6703, 6706, 6707, 6708, 6711, 6712, 6715, 6716, 6719, 6720,
2911 6723, 6724, 6727, 6728, 6731, 6734, 6737, 6740, 6741, 6744,
2912 6745, 6752, 6753, 6757
2913};
2914#endif
2915
2917#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
2918
2919#if 1
2920/* The user-facing name of the symbol whose (internal) number is
2921 YYSYMBOL. No bounds checking. */
2922static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
2923
2924/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2925 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2926static const char *const yytname[] =
2927{
2928 "\"end-of-input\"", "error", "\"invalid token\"", "\"`class'\"",
2929 "\"`module'\"", "\"`def'\"", "\"`undef'\"", "\"`begin'\"",
2930 "\"`rescue'\"", "\"`ensure'\"", "\"`end'\"", "\"`if'\"", "\"`unless'\"",
2931 "\"`then'\"", "\"`elsif'\"", "\"`else'\"", "\"`case'\"", "\"`when'\"",
2932 "\"`while'\"", "\"`until'\"", "\"`for'\"", "\"`break'\"", "\"`next'\"",
2933 "\"`redo'\"", "\"`retry'\"", "\"`in'\"", "\"`do'\"",
2934 "\"`do' for condition\"", "\"`do' for block\"", "\"`do' for lambda\"",
2935 "\"`return'\"", "\"`yield'\"", "\"`super'\"", "\"`self'\"", "\"`nil'\"",
2936 "\"`true'\"", "\"`false'\"", "\"`and'\"", "\"`or'\"", "\"`not'\"",
2937 "\"`if' modifier\"", "\"`unless' modifier\"", "\"`while' modifier\"",
2938 "\"`until' modifier\"", "\"`rescue' modifier\"", "\"`alias'\"",
2939 "\"`defined?'\"", "\"`BEGIN'\"", "\"`END'\"", "\"`__LINE__'\"",
2940 "\"`__FILE__'\"", "\"`__ENCODING__'\"", "\"local variable or method\"",
2941 "\"method\"", "\"global variable\"", "\"instance variable\"",
2942 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
2943 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
2944 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
2945 "\"literal content\"", "tREGEXP_END", "\"dummy end\"", "'.'",
2946 "\"backslash\"", "\"escaped space\"", "\"escaped horizontal tab\"",
2947 "\"escaped form feed\"", "\"escaped carriage return\"",
2948 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
2949 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
2950 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
2951 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
2952 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
2953 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
2954 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
2955 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
2956 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
2957 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "tSTRING_DBEG",
2958 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tIGNORED_NL", "tCOMMENT",
2959 "tEMBDOC_BEG", "tEMBDOC", "tEMBDOC_END", "tHEREDOC_BEG", "tHEREDOC_END",
2960 "k__END__", "tLOWEST", "'='", "'?'", "':'", "'>'", "'<'", "'|'", "'^'",
2961 "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "tUMINUS_NUM", "'!'", "'~'",
2962 "tLAST_TOKEN", "'{'", "'}'", "'['", "','", "'`'", "'('", "')'", "']'",
2963 "';'", "' '", "'\\n'", "$accept", "program", "$@1", "top_compstmt",
2964 "top_stmts", "top_stmt", "block_open", "begin_block", "bodystmt", "$@2",
2965 "$@3", "$@4", "compstmt", "stmts", "stmt_or_begin", "$@5", "allow_exits",
2966 "k_END", "stmt", "$@6", "command_asgn", "endless_command", "command_rhs",
2967 "expr", "$@7", "$@8", "def_name", "defn_head", "defs_head", "$@9",
2968 "expr_value", "expr_value_do", "$@10", "$@11", "command_call",
2969 "block_command", "cmd_brace_block", "fcall", "command", "mlhs",
2970 "mlhs_inner", "mlhs_basic", "mlhs_item", "mlhs_head", "mlhs_post",
2971 "mlhs_node", "lhs", "cname", "cpath", "fname", "fitem", "undef_list",
2972 "$@12", "op", "reswords", "arg", "endless_arg", "relop", "rel_expr",
2973 "lex_ctxt", "begin_defined", "after_rescue", "arg_value", "aref_args",
2974 "arg_rhs", "paren_args", "opt_paren_args", "opt_call_args", "call_args",
2975 "command_args", "$@13", "block_arg", "opt_block_arg", "args",
2976 "arg_splat", "mrhs_arg", "mrhs", "primary", "$@14", "$@15", "@16", "@17",
2977 "$@18", "$@19", "$@20", "$@21", "$@22", "primary_value", "k_begin",
2978 "k_if", "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
2979 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
2980 "k_when", "k_else", "k_elsif", "k_end", "k_return", "k_yield", "then",
2981 "do", "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list",
2982 "f_margs", "f_rest_marg", "f_any_kwrest", "f_eq", "$@23",
2983 "block_args_tail", "opt_block_args_tail", "excessed_comma",
2984 "block_param", "opt_block_param", "block_param_def", "opt_bv_decl",
2985 "bv_decls", "bvar", "max_numparam", "numparam", "lambda", "@24", "$@25",
2986 "f_larglist", "lambda_body", "$@26", "do_block", "block_call",
2987 "method_call", "brace_block", "brace_body", "@27", "do_body", "@28",
2988 "case_args", "case_body", "cases", "p_pvtbl", "p_pktbl", "p_in_kwarg",
2989 "p_case_body", "$@29", "p_cases", "p_top_expr", "p_top_expr_body",
2990 "p_expr", "p_as", "p_alt", "p_lparen", "p_lbracket", "p_expr_basic",
2991 "$@30", "p_args", "p_args_head", "p_args_tail", "p_find", "p_rest",
2992 "p_args_post", "p_arg", "p_kwargs", "p_kwarg", "p_kw", "p_kw_label",
2993 "p_kwrest", "p_kwnorest", "p_any_kwrest", "p_value", "p_primitive",
2994 "p_variable", "p_var_ref", "p_expr_ref", "p_const", "opt_rescue",
2995 "exc_list", "exc_var", "opt_ensure", "literal", "strings", "string",
2996 "string1", "xstring", "regexp", "words_sep", "words", "word_list",
2997 "word", "symbols", "symbol_list", "qwords", "qsymbols", "qword_list",
2998 "qsym_list", "string_contents", "xstring_contents", "regexp_contents",
2999 "string_content", "@31", "@32", "@33", "@34", "string_dend",
3000 "string_dvar", "symbol", "ssym", "sym", "dsym", "numeric",
3001 "simple_numeric", "nonlocal_var", "user_variable", "keyword_variable",
3002 "var_ref", "var_lhs", "backref", "superclass", "$@35",
3003 "f_opt_paren_args", "f_paren_args", "f_arglist", "@36", "args_tail",
3004 "opt_args_tail", "f_args", "args_forward", "f_bad_arg", "f_norm_arg",
3005 "f_arg_asgn", "f_arg_item", "f_arg", "f_label", "f_kw", "f_block_kw",
3006 "f_block_kwarg", "f_kwarg", "kwrest_mark", "f_no_kwarg", "f_kwrest",
3007 "f_opt", "f_block_opt", "f_block_optarg", "f_optarg", "restarg_mark",
3008 "f_rest_arg", "blkarg_mark", "f_block_arg", "opt_f_block_arg",
3009 "singleton", "$@37", "assoc_list", "assocs", "assoc", "operation",
3010 "operation2", "operation3", "dot_or_colon", "call_op", "call_op2",
3011 "opt_terms", "opt_nl", "rparen", "rbracket", "rbrace", "trailer", "term",
3012 "terms", "none", YY_NULLPTR
3013};
3014
3015static const char *
3016yysymbol_name (yysymbol_kind_t yysymbol)
3017{
3018 return yytname[yysymbol];
3019}
3020#endif
3021
3022#define YYPACT_NINF (-1088)
3023
3024#define yypact_value_is_default(Yyn) \
3025 ((Yyn) == YYPACT_NINF)
3026
3027#define YYTABLE_NINF (-784)
3028
3029#define yytable_value_is_error(Yyn) \
3030 ((Yyn) == YYTABLE_NINF)
3031
3032/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
3033 STATE-NUM. */
3034static const yytype_int16 yypact[] =
3035{
3036 -1088, 141, 4978, -1088, -1088, -1088, -1088, -1088, 10235, -1088,
3037 -1088, -1088, -1088, -1088, -1088, -1088, 11055, 11055, -1088, -1088,
3038 -1088, -1088, 6200, -1088, -1088, -1088, -1088, 527, 10081, 50,
3039 222, -1088, -1088, -1088, -1088, 5576, 6356, -1088, -1088, 5732,
3040 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 12507, 12507,
3041 12507, 12507, 427, 8462, 8622, 11539, 11781, 10537, -1088, 9927,
3042 -1088, -1088, -1088, 336, 336, 336, 336, 1285, 12628, 12507,
3043 -1088, 299, -1088, -1088, 1317, -1088, 485, 37, 37, -1088,
3044 -1088, 142, 480, 398, -1088, 406, 13112, -1088, 444, 1944,
3045 957, 57, 659, -1088, 10934, 10934, -1088, -1088, 9096, 13231,
3046 13350, 13469, 9772, 11055, 6824, -1088, 593, 97, -1088, -1088,
3047 476, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3048 -1088, -1088, -1088, -1088, 85, 561, -1088, 495, 645, -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, -1088, -1088, -1088,
3056 -1088, -1088, -1088, -1088, -1088, -1088, -1088, 446, -1088, -1088,
3057 -1088, -1088, -1088, -1088, 496, 12507, 581, 8622, 12507, 12507,
3058 12507, -1088, 12507, 37, 37, -1088, 562, 5702, 599, -1088,
3059 -1088, 556, -1088, 763, 69, 71, 632, 108, 610, -1088,
3060 -1088, 11176, -1088, -1088, 11055, 9651, -1088, 12749, 823, -1088,
3061 606, -1088, 8782, -1088, -1088, -1088, -1088, -1088, 616, 142,
3062 -1088, 769, -1088, 626, 762, 5390, 5390, 667, -1088, 8462,
3063 661, 299, -1088, 1317, 50, 710, -1088, -1088, 688, 240,
3064 369, -1088, 599, 699, 369, -1088, 50, 794, 1285, 13588,
3065 702, 702, 718, -1088, 793, 830, 843, 853, -1088, -1088,
3066 73, -1088, -1088, 687, 858, 852, -1088, 724, 724, 724,
3067 724, 801, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 9379,
3068 786, 10934, 10934, 10934, 10934, -1088, 12749, 12749, 2194, 819,
3069 835, -1088, 2194, -1088, 836, -1088, -1088, -1088, -1088, 866,
3070 -1088, -1088, -1088, -1088, -1088, -1088, -1088, 8462, 10675, 834,
3071 -1088, -1088, 12507, 12507, 12507, 12507, 12507, -1088, -1088, 12507,
3072 12507, 12507, 12507, 12507, 12507, 12507, 12507, -1088, 12507, -1088,
3073 -1088, 12507, 12507, 12507, 12507, 12507, 12507, 12507, 12507, 12507,
3074 12507, -1088, -1088, 4666, 11055, 5066, 7608, -1088, 485, 169,
3075 169, 8340, 10934, 8340, 299, -1088, 832, 942, -1088, -1088,
3076 879, 979, 91, 113, 127, 697, 732, 10934, 493, -1088,
3077 871, 888, -1088, -1088, -1088, -1088, 119, 347, 371, 378,
3078 466, 569, 576, 693, 700, -1088, -1088, -1088, -1088, 767,
3079 -1088, 9530, -1088, -1088, -1088, 15330, -1088, -1088, -1088, -1088,
3080 -1088, -1088, 318, -1088, -1088, -1088, 698, 870, 878, -1088,
3081 12507, 11297, -1088, -1088, 13944, 11055, 14043, -1088, -1088, 11660,
3082 -1088, 12507, 50, -1088, 863, 50, 868, -1088, -1088, 83,
3083 896, -1088, -1088, -1088, -1088, -1088, 10235, -1088, -1088, 12507,
3084 875, 14142, 14043, -1088, 222, 50, -1088, -1088, 9218, 882,
3085 897, -1088, 11539, -1088, -1088, 11781, -1088, -1088, -1088, 606,
3086 914, -1088, -1088, 906, -1088, 13588, 14241, 11055, 14340, -1088,
3087 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3088 -1088, 930, 117, 953, 331, 12507, -1088, -1088, 8942, -1088,
3089 -1088, -1088, -1088, -1088, 10813, -1088, -1088, -1088, -1088, -1088,
3090 -1088, -1088, -1088, -1088, -1088, 1150, -1088, -1088, -1088, -1088,
3091 -1088, 908, -1088, -1088, 50, -1088, -1088, -1088, 945, -1088,
3092 910, 12507, -1088, 927, 158, -1088, -1088, -1088, 931, 1033,
3093 932, 1041, -1088, 12870, 7608, 299, 12870, 7608, 941, -1088,
3094 -1088, -1088, 156, -1088, 156, 11902, 50, 13588, 944, -1088,
3095 11902, -1088, 762, 4760, 4760, 4760, 4760, 5858, 4273, 4760,
3096 4760, 5390, 5390, 631, 631, -1088, 5546, 642, 642, 1120,
3097 326, 326, 762, 762, 762, 1458, 1458, 6980, 5888, 7292,
3098 6044, -1088, -1088, 616, -1088, 50, 955, 808, -1088, 929,
3099 -1088, -1088, 6512, 156, -1088, -1088, 7730, 1084, 8096, 156,
3100 320, 156, 1081, 1094, 136, 14439, 11055, 14538, -1088, -1088,
3101 -1088, 914, -1088, -1088, -1088, 14637, 11055, 14736, 7608, 12749,
3102 -1088, -1088, -1088, 50, -1088, -1088, -1088, 1852, 12628, 12628,
3103 10235, 12507, 12991, 12991, 12507, -1088, 599, -1088, -1088, 610,
3104 5420, 6668, 50, 363, 412, 12507, 12507, -1088, -1088, 11418,
3105 -1088, 11660, -1088, -1088, -1088, 12749, 5702, -1088, 416, 616,
3106 616, 12507, -1088, 595, -1088, -1088, 369, 13588, 906, 486,
3107 657, 50, 264, 552, -1088, -1088, 1132, -1088, 67, -1088,
3108 336, -1088, -1088, 67, 336, -1088, 762, 959, -1088, 1150,
3109 1274, -1088, 961, 50, 963, -1088, 36, -1088, -1088, -1088,
3110 12507, 989, 2194, -1088, -1088, 461, -1088, -1088, -1088, 2194,
3111 -1088, -1088, 2479, -1088, -1088, 527, 1070, -1088, 5702, 1082,
3112 156, -1088, 1070, 1082, 156, -1088, -1088, 972, -1088, -1088,
3113 -1088, -1088, -1088, 12507, -1088, 973, 974, 1092, -1088, -1088,
3114 906, 13588, -1088, -1088, 1096, 1008, 2581, -1088, -1088, -1088,
3115 934, 428, -1088, -1088, 1009, -1088, -1088, -1088, -1088, 866,
3116 992, 943, 11297, -1088, -1088, -1088, -1088, 866, -1088, -1088,
3117 1140, 671, -1088, 1141, -1088, -1088, -1088, -1088, -1088, -1088,
3118 1094, 156, -1088, 12023, 156, 233, 254, 50, 166, 175,
3119 8340, 299, 10934, 7608, 807, 657, -1088, 50, 156, 83,
3120 10389, -1088, 97, 480, -1088, 6947, -1088, -1088, -1088, -1088,
3121 -1088, 527, -1088, -1088, -1088, 492, -1088, -1088, 50, 1002,
3122 83, -1088, -1088, -1088, 563, 1615, -1088, -1088, -1088, -1088,
3123 724, -1088, 724, 724, 724, -1088, 50, -1088, 1150, -1088,
3124 1188, -1088, -1088, -1088, -1088, -1088, 1004, 1006, -1088, 1111,
3125 908, 1016, -1088, 1017, -1088, 1016, 12870, -1088, -1088, -1088,
3126 -1088, -1088, -1088, -1088, 1018, 12144, -1088, 906, -1088, -1088,
3127 -1088, 14835, 11055, 14934, -1088, -1088, 12507, 12628, 12628, 1024,
3128 -1088, -1088, -1088, 12628, 12628, -1088, -1088, 12265, 1141, -1088,
3129 -1088, -1088, 8340, 10934, 156, -1088, -1088, 156, -1088, -1088,
3130 156, -1088, 12507, -1088, 109, -1088, 214, 156, 7608, 299,
3131 156, -1088, -1088, -1088, -1088, -1088, -1088, 12991, 12507, 12507,
3132 -1088, 12507, 12507, -1088, 11660, -1088, 2194, -1088, -1088, 5294,
3133 -1088, -1088, 1026, 1029, 2194, -1088, 2479, -1088, -1088, 2479,
3134 -1088, 2479, -1088, -1088, 1070, 1082, 12507, 12507, 1045, 1045,
3135 12507, 1036, 10813, 10813, 12628, 12507, 7136, 7448, 50, 500,
3136 504, 4476, 4476, 5702, -1088, -1088, -1088, -1088, -1088, 12628,
3137 -1088, -1088, -1088, -1088, 973, -1088, 1091, -1088, 1185, -1088,
3138 -1088, 169, -1088, -1088, -1088, -1088, -1088, 12386, 7852, -1088,
3139 156, -1088, -1088, 12507, 50, 98, 95, 1188, 1188, 1016,
3140 1044, 1016, 1016, 5702, 5702, 1874, 8942, -1088, -1088, 7608,
3141 1018, -1088, -1088, 5702, 511, -1088, -1088, -1088, 2448, 2448,
3142 741, -1088, 4166, 14, 1148, -1088, 1078, -1088, -1088, 309,
3143 -1088, 1063, -1088, -1088, -1088, 1053, -1088, 1055, -1088, 1686,
3144 -1088, -1088, -1088, -1088, 682, -1088, -1088, -1088, 45, -1088,
3145 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 447, -1088,
3146 -1088, -1088, 13707, 169, -1088, -1088, 8340, -1088, -1088, 8218,
3147 7730, 4476, 12507, -1088, 608, -1088, 1056, 1058, -1088, 8942,
3148 -1088, -1088, -1088, -1088, 1029, -1088, 2479, -1088, -1088, -1088,
3149 908, -1088, 50, 1087, 945, 1074, 13826, -1088, 1077, -1088,
3150 1080, 1099, -1088, -1088, -1088, -1088, -1088, -1088, -1088, 1686,
3151 324, 50, 13900, -1088, 50, 1100, -1088, -1088, 1086, -1088,
3152 -1088, 902, -1088, 10934, -1088, 1197, 13900, 1686, 1686, 958,
3153 1156, 2448, 2448, 741, 274, 739, 4476, 4476, -1088, 1195,
3154 -1088, 948, 188, 192, 200, 7608, -1088, -1088, 671, 169,
3155 831, -1088, -1088, -1088, -1088, -1088, 1280, 7608, 1115, 1016,
3156 -1088, 1129, -1088, 13826, 1539, -1088, -1088, 1217, 951, 461,
3157 -1088, 1539, -1088, 1472, -1088, 35, -1088, 1156, 1121, 1123,
3158 -1088, -1088, -1088, -1088, -1088, 50, -1088, -1088, 1124, -1088,
3159 1128, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3160 -1088, -1088, 50, 50, 50, 50, 50, 50, 218, 15033,
3161 11055, 15132, 1140, 1185, -1088, -1088, 10934, 10934, -1088, 467,
3162 -1088, -1088, 156, -1088, -1088, -1088, 951, -1088, 1134, 1137,
3163 -1088, 15231, -1088, 908, 1138, -1088, 1146, 1138, -1088, 1686,
3164 -1088, 958, -1088, 1686, 13900, 758, -1088, -1088, -1088, -1088,
3165 -1088, -1088, 121, 201, 50, 223, 238, -1088, -1088, 7974,
3166 -1088, -1088, 1280, -1088, -1088, 1539, -1088, 1472, -1088, 1118,
3167 1130, -1088, 1472, -1088, 1472, -1088, -1088, 1149, 50, 1149,
3168 -1088, -1088, 253, 417, -1088, 1138, 1155, 1138, 1138, 1686,
3169 -1088, -1088, -1088, -1088, -1088, 1472, -1088, -1088, -1088, 1138,
3170 -1088
3171};
3172
3173/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
3174 Performed when YYTABLE does not specify something else to do. Zero
3175 means the default is an error. */
3176static const yytype_int16 yydefact[] =
3177{
3178 2, 0, 0, 1, 44, 381, 382, 383, 0, 374,
3179 375, 376, 379, 24, 24, 24, 369, 370, 371, 372,
3180 393, 394, 301, 658, 657, 659, 660, 772, 0, 772,
3181 0, 783, 662, 661, 663, 756, 758, 652, 651, 757,
3182 653, 647, 648, 649, 650, 600, 668, 669, 0, 0,
3183 0, 0, 0, 0, 0, 783, 783, 110, 455, 622,
3184 622, 624, 626, 0, 0, 0, 0, 0, 0, 0,
3185 3, 770, 6, 24, 8, 38, 43, 677, 677, 61,
3186 81, 301, 80, 0, 98, 0, 102, 112, 0, 70,
3187 250, 266, 0, 329, 0, 0, 77, 77, 0, 0,
3188 0, 0, 0, 338, 301, 348, 82, 346, 318, 319,
3189 599, 601, 320, 321, 322, 324, 323, 325, 598, 639,
3190 640, 597, 645, 656, 664, 665, 326, 0, 327, 85,
3191 5, 191, 202, 192, 215, 188, 208, 198, 197, 218,
3192 219, 213, 196, 195, 190, 216, 220, 221, 200, 189,
3193 203, 207, 209, 201, 194, 210, 217, 212, 211, 204,
3194 214, 199, 187, 206, 205, 186, 193, 184, 185, 181,
3195 182, 183, 141, 143, 142, 176, 177, 172, 154, 155,
3196 156, 163, 160, 162, 157, 158, 178, 179, 164, 165,
3197 169, 173, 159, 161, 151, 152, 153, 166, 167, 168,
3198 170, 171, 174, 175, 180, 146, 148, 31, 144, 145,
3199 147, 377, 378, 380, 0, 752, 0, 0, 312, 755,
3200 304, 622, 0, 677, 677, 296, 0, 279, 307, 96,
3201 300, 783, 308, 0, 664, 665, 0, 327, 783, 748,
3202 97, 783, 474, 93, 0, 772, 773, 0, 0, 26,
3203 783, 10, 0, 9, 25, 276, 369, 370, 475, 0,
3204 244, 0, 338, 341, 245, 235, 236, 335, 22, 0,
3205 0, 770, 19, 21, 772, 100, 18, 331, 0, 772,
3206 772, 280, 0, 0, 772, 746, 772, 0, 0, 0,
3207 677, 677, 108, 373, 0, 118, 119, 126, 453, 642,
3208 0, 641, 643, 0, 0, 0, 606, 609, 618, 614,
3209 620, 646, 65, 256, 257, 779, 780, 4, 781, 0,
3210 0, 0, 0, 0, 0, 783, 0, 0, 700, 0,
3211 676, 365, 700, 674, 0, 367, 384, 479, 468, 86,
3212 481, 345, 385, 481, 464, 783, 114, 0, 106, 103,
3213 783, 68, 0, 0, 0, 0, 0, 272, 273, 0,
3214 0, 0, 0, 233, 234, 0, 0, 66, 0, 270,
3215 271, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3216 0, 766, 767, 0, 783, 0, 0, 76, 75, 0,
3217 0, 0, 0, 0, 770, 355, 771, 0, 405, 404,
3218 0, 0, 664, 665, 327, 136, 137, 0, 0, 139,
3219 672, 0, 664, 665, 327, 363, 211, 204, 214, 199,
3220 181, 182, 183, 141, 142, 744, 72, 71, 743, 0,
3221 95, 772, 94, 769, 768, 0, 347, 602, 783, 783,
3222 149, 751, 335, 311, 754, 303, 0, 0, 0, 783,
3223 0, 0, 297, 306, 0, 783, 0, 783, 783, 0,
3224 298, 701, 772, 292, 783, 772, 783, 291, 302, 772,
3225 0, 344, 64, 28, 30, 29, 0, 783, 277, 0,
3226 0, 0, 0, 783, 0, 772, 333, 17, 0, 99,
3227 0, 336, 778, 777, 281, 778, 283, 337, 747, 0,
3228 125, 646, 116, 111, 676, 0, 0, 783, 0, 454,
3229 628, 644, 631, 629, 623, 603, 604, 625, 605, 627,
3230 607, 0, 0, 0, 0, 0, 782, 7, 0, 32,
3231 33, 34, 35, 278, 0, 62, 63, 707, 704, 703,
3232 702, 705, 713, 722, 701, 0, 734, 723, 738, 737,
3233 733, 783, 724, 699, 772, 683, 706, 708, 709, 711,
3234 685, 715, 720, 783, 726, 418, 417, 731, 685, 736,
3235 685, 740, 682, 0, 0, 0, 0, 0, 0, 453,
3236 479, 87, 0, 453, 0, 0, 772, 0, 104, 115,
3237 0, 492, 242, 249, 251, 252, 253, 260, 261, 254,
3238 255, 231, 232, 258, 259, 492, 772, 246, 247, 248,
3239 237, 238, 239, 240, 241, 274, 275, 756, 758, 757,
3240 760, 473, 759, 301, 471, 772, 783, 756, 758, 757,
3241 760, 472, 301, 0, 783, 396, 0, 395, 0, 0,
3242 0, 0, 353, 0, 335, 0, 783, 0, 77, 361,
3243 136, 137, 138, 670, 359, 0, 783, 0, 0, 0,
3244 764, 765, 73, 772, 340, 756, 757, 301, 0, 0,
3245 0, 0, 0, 0, 0, 750, 309, 305, 310, 783,
3246 756, 757, 772, 756, 757, 0, 0, 749, 286, 293,
3247 288, 295, 343, 774, 27, 0, 262, 11, 334, 0,
3248 783, 0, 23, 101, 20, 332, 772, 0, 109, 761,
3249 124, 772, 756, 757, 24, 632, 0, 608, 0, 611,
3250 0, 616, 613, 0, 0, 617, 243, 0, 36, 0,
3251 416, 408, 410, 772, 413, 406, 0, 681, 742, 675,
3252 0, 0, 0, 692, 714, 0, 680, 558, 725, 0,
3253 695, 735, 0, 697, 739, 772, 52, 55, 267, 264,
3254 0, 678, 53, 265, 0, 477, 454, 0, 391, 392,
3255 478, 454, 463, 312, 39, 314, 0, 42, 313, 113,
3256 107, 0, 60, 45, 58, 0, 284, 307, 222, 40,
3257 0, 327, 490, 490, 0, 783, 783, 479, 470, 90,
3258 0, 476, 293, 783, 783, 290, 469, 88, 289, 330,
3259 783, 783, 397, 783, 351, 399, 78, 398, 352, 492,
3260 0, 0, 388, 0, 0, 761, 334, 772, 756, 757,
3261 0, 0, 0, 0, 136, 137, 140, 772, 0, 772,
3262 0, 339, 465, 83, 46, 284, 223, 54, 230, 150,
3263 753, 772, 299, 783, 783, 476, 783, 783, 772, 783,
3264 772, 229, 282, 117, 476, 700, 633, 630, 637, 638,
3265 610, 612, 619, 615, 621, 37, 772, 415, 0, 710,
3266 0, 741, 727, 420, 684, 712, 685, 685, 721, 726,
3267 783, 685, 732, 685, 709, 685, 0, 783, 783, 366,
3268 368, 24, 84, 24, 317, 0, 783, 105, 783, 783,
3269 783, 0, 783, 0, 491, 491, 0, 0, 0, 0,
3270 91, 775, 783, 0, 0, 89, 386, 783, 15, 589,
3271 390, 389, 0, 0, 0, 400, 402, 0, 79, 490,
3272 0, 357, 0, 483, 0, 356, 476, 0, 0, 0,
3273 0, 476, 364, 745, 74, 466, 467, 0, 0, 0,
3274 783, 0, 0, 287, 294, 342, 700, 456, 459, 0,
3275 407, 409, 411, 414, 0, 688, 0, 690, 679, 0,
3276 696, 0, 693, 698, 57, 269, 0, 0, 783, 783,
3277 312, 315, 0, 0, 0, 0, 756, 757, 772, 756,
3278 757, 0, 0, 263, 51, 227, 50, 228, 92, 0,
3279 48, 225, 49, 226, 590, 591, 783, 592, 783, 12,
3280 403, 0, 349, 350, 491, 354, 484, 0, 0, 358,
3281 0, 671, 360, 0, 772, 0, 0, 0, 0, 685,
3282 685, 685, 685, 56, 268, 772, 0, 444, 443, 0,
3283 316, 41, 59, 285, 476, 581, 587, 554, 0, 0,
3284 0, 491, 772, 491, 542, 622, 0, 580, 69, 500,
3285 506, 508, 510, 504, 503, 538, 505, 547, 550, 553,
3286 559, 560, 549, 513, 561, 514, 566, 567, 568, 571,
3287 572, 573, 574, 575, 577, 576, 578, 579, 557, 67,
3288 47, 224, 0, 0, 594, 387, 0, 16, 596, 0,
3289 0, 0, 0, 485, 783, 362, 0, 447, 461, 0,
3290 457, 636, 635, 634, 412, 689, 0, 686, 691, 694,
3291 783, 442, 772, 0, 709, 426, 717, 718, 783, 729,
3292 426, 426, 424, 480, 482, 569, 570, 137, 585, 0,
3293 530, 772, 531, 535, 772, 0, 525, 783, 0, 528,
3294 541, 0, 582, 0, 583, 0, 501, 0, 0, 548,
3295 552, 564, 565, 0, 491, 491, 0, 0, 556, 0,
3296 593, 0, 664, 665, 327, 0, 595, 13, 783, 0,
3297 497, 486, 488, 489, 487, 458, 0, 0, 0, 685,
3298 423, 0, 445, 0, 427, 435, 433, 0, 716, 0,
3299 422, 0, 438, 0, 440, 772, 523, 545, 533, 532,
3300 524, 536, 526, 776, 555, 772, 507, 502, 538, 509,
3301 539, 543, 622, 551, 546, 562, 563, 586, 512, 522,
3302 511, 518, 772, 772, 772, 772, 772, 772, 335, 0,
3303 783, 0, 783, 783, 401, 493, 0, 0, 451, 772,
3304 449, 452, 0, 460, 687, 446, 728, 425, 426, 426,
3305 335, 0, 719, 783, 426, 730, 426, 426, 529, 0,
3306 537, 0, 584, 0, 0, 0, 515, 516, 517, 519,
3307 520, 521, 761, 334, 772, 756, 757, 588, 14, 0,
3308 498, 499, 0, 448, 462, 0, 430, 0, 432, 761,
3309 334, 421, 0, 439, 0, 436, 441, 534, 772, 539,
3310 540, 544, 476, 783, 450, 426, 426, 426, 426, 0,
3311 527, 495, 496, 494, 431, 0, 428, 434, 437, 426,
3312 429
3313};
3314
3315/* YYPGOTO[NTERM-NUM]. */
3316static const yytype_int16 yypgoto[] =
3317{
3318 -1088, -1088, -1088, 1028, -1088, 976, -1088, 812, -540, -1088,
3319 -1088, -1088, -40, -1088, 817, -1088, 8, -1088, 9, -1088,
3320 -49, -510, -494, -26, -1088, -1088, 471, 2739, 3102, -1088,
3321 -89, -62, -1088, -1088, -60, -1088, -620, 1245, -14, 1213,
3322 -140, -7, -37, -1088, -425, 44, 3555, -392, 1214, -28,
3323 -10, -1088, -1088, 2, -1088, 4276, -500, 1226, -1088, 99,
3324 840, 340, 1165, -1088, 617, -17, 653, -372, 46, -39,
3325 -1088, -381, -212, 12, -401, -1088, -551, -13, -1088, -1088,
3326 -1088, -1088, -1088, -1088, -1088, -1088, -1088, 1125, -1088, -1088,
3327 -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088, -1088,
3328 -1088, -1088, -1088, 394, -1088, 32, 1883, 2367, -363, -1088,
3329 137, -789, -1088, -766, -767, 604, 463, -900, 190, -1088,
3330 304, 131, -1088, -1088, 361, -1088, -894, -1088, 49, -419,
3331 33, 1221, -1088, -1088, -1088, -1088, -1088, 509, -1088, -1088,
3332 -82, -478, -1088, 1011, -1088, -1088, -741, -1088, -662, -838,
3333 -495, 39, -1088, -1088, -1088, -885, -659, -1088, -1088, -1088,
3334 -1088, 196, -1088, -256, -1088, -637, -656, -968, -245, -1024,
3335 -721, -1088, 195, -1088, -1088, -854, 198, -1088, -468, 203,
3336 -1088, -1088, -1088, 122, -1088, -1088, 112, 1427, 1787, -1088,
3337 1261, 1866, 2213, 28, 2585, -1088, 850, 2724, -1088, 2820,
3338 2902, -1088, -1088, -56, -1088, -1088, -248, -1088, -1088, -1088,
3339 -1088, -1088, -1088, 25, -1088, -1088, -1088, -1088, 18, -52,
3340 3202, -2, 1273, 3772, 2516, -1088, -1088, 62, 641, 41,
3341 -1088, -287, 267, -285, -187, -817, -336, -311, -699, -599,
3342 -370, 633, 172, -1088, -1088, -663, -1088, -709, -641, -1087,
3343 178, 637, -1088, -617, -1088, 110, -531, -1088, -1088, -1088,
3344 3, -399, 170, -345, -1088, -1088, -91, -1088, -27, 433,
3345 262, 276, 68, -177, -23, 43, 103
3346};
3347
3348/* YYDEFGOTO[NTERM-NUM]. */
3349static const yytype_int16 yydefgoto[] =
3350{
3351 0, 1, 2, 70, 71, 72, 252, 253, 633, 1109,
3352 1253, 1018, 634, 271, 272, 484, 211, 73, 273, 476,
3353 75, 756, 783, 76, 605, 591, 426, 223, 224, 840,
3354 389, 391, 392, 938, 79, 80, 581, 259, 82, 83,
3355 274, 84, 85, 86, 503, 87, 226, 409, 410, 205,
3356 206, 207, 670, 620, 209, 89, 759, 379, 90, 533,
3357 479, 534, 228, 278, 788, 621, 806, 462, 463, 243,
3358 244, 230, 452, 626, 232, 777, 778, 91, 386, 490,
3359 820, 643, 833, 831, 658, 574, 577, 261, 93, 94,
3360 95, 96, 97, 98, 99, 100, 101, 102, 340, 343,
3361 927, 1106, 823, 932, 933, 770, 262, 263, 636, 816,
3362 934, 935, 401, 731, 732, 733, 734, 551, 740, 741,
3363 1267, 1205, 1206, 1132, 1046, 1047, 1116, 1259, 1260, 509,
3364 714, 105, 298, 1035, 967, 1120, 1197, 344, 106, 107,
3365 341, 578, 579, 582, 583, 944, 824, 1194, 914, 1001,
3366 792, 821, 1299, 1333, 1189, 1068, 1217, 1070, 1071, 1176,
3367 1177, 1072, 1281, 1151, 1152, 1153, 1074, 1075, 1230, 1155,
3368 1076, 1077, 1078, 1079, 1080, 552, 1082, 1083, 1084, 1085,
3369 1086, 1087, 1088, 928, 1016, 1103, 1107, 108, 109, 110,
3370 111, 112, 113, 307, 114, 521, 718, 115, 523, 116,
3371 117, 522, 524, 300, 304, 305, 514, 716, 715, 866,
3372 969, 1123, 867, 118, 119, 301, 120, 121, 122, 123,
3373 234, 235, 126, 236, 237, 654, 832, 329, 330, 331,
3374 332, 884, 743, 554, 555, 556, 557, 894, 559, 560,
3375 561, 562, 1137, 1138, 563, 564, 565, 566, 567, 1139,
3376 1140, 568, 569, 570, 571, 572, 737, 429, 659, 283,
3377 466, 239, 129, 699, 624, 662, 657, 435, 317, 470,
3378 471, 801, 1159, 494, 637, 396, 255
3379};
3380
3381/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
3382 positive, shift that token. If negative, reduce the rule whose
3383 number is the opposite. If YYTABLE_NINF, syntax error. */
3384static const yytype_int16 yytable[] =
3385{
3386 125, 385, 225, 225, 303, 242, 390, 302, 312, 394,
3387 208, 74, 625, 270, 277, 434, 652, 558, 249, 238,
3388 238, 558, 212, 213, 937, 436, 460, 638, 231, 231,
3389 208, 299, 746, 210, 760, 393, 890, 764, 623, 789,
3390 632, 553, 339, 885, 293, 553, 275, 575, 318, 349,
3391 678, 125, 125, 210, 465, 296, 517, 519, 280, 284,
3392 687, 208, 229, 240, 338, 432, 762, 279, 388, 388,
3393 677, 395, 388, 293, 427, 318, 763, 1002, 677, 940,
3394 708, 320, 889, 682, 296, 311, 293, 293, 293, 225,
3395 667, 678, 308, 309, 310, 1121, 687, 403, 413, 413,
3396 413, 292, 767, 496, 208, 130, 238, 498, 892, 623,
3397 793, 632, 971, 973, 319, 231, -127, 1099, 838, 335,
3398 326, 327, 635, 336, 1275, 887, -373, 1118, 1219, 485,
3399 254, 915, 893, 510, -131, 711, 1165, 700, -128, 510,
3400 334, 3, 456, 1173, 1231, 1130, 548, 1081, 1081, 430,
3401 891, 1133, -135, 895, -373, -373, 276, 276, 281, 285,
3402 766, -134, 780, 700, 771, 446, 768, -772, 336, -666,
3403 482, -667, -783, 763, 844, 847, 246, 270, 549, 920,
3404 333, 333, 635, 720, 1218, -666, 1111, 925, -658, 512,
3405 513, -130, 747, 511, 328, 512, 513, 246, 1228, 1174,
3406 -132, -127, 1175, 508, -127, -128, -128, 586, 458, 735,
3407 748, -373, 246, -135, -133, 125, 1122, -658, 1275, 469,
3408 -127, 472, 1119, 1149, 769, 1157, 1190, 225, 306, 270,
3409 225, -134, 529, 530, 531, 532, -130, 721, 1201, -129,
3410 -118, 242, 338, -135, 487, 246, -118, 238, 318, 337,
3411 125, -132, 502, 464, 460, 1231, 231, 1081, -131, 1231,
3412 1321, 74, 275, 836, 1027, 335, -129, 125, -119, 315,
3413 1124, 316, 971, 719, 827, 719, 293, 1024, -756, -133,
3414 885, -131, -126, -131, 837, 447, 448, 296, 678, -121,
3415 468, -125, 687, 950, 337, 388, 388, 388, 388, 241,
3416 535, 536, 700, 640, 1130, 1321, 501, 270, 677, 647,
3417 677, 1130, 700, 1130, 488, 1081, 1320, 125, 649, 919,
3418 276, -121, 1081, 1081, 939, 1192, 333, 333, 74, 315,
3419 -123, 316, 335, 892, 453, 293, 1238, 1240, 1098, 1098,
3420 275, 453, 1069, 1069, 467, 125, 296, 815, -127, 478,
3421 -127, 639, -128, 641, -128, 130, 907, 1040, -757, 978,
3422 -135, -133, -135, -133, 1073, 1073, 388, 642, 631, -120,
3423 225, 318, 276, 1193, 251, 1039, 1015, 1041, -134, 1261,
3424 -134, 388, 1042, -130, 125, -130, 984, 630, -122, 125,
3425 -756, 125, 588, 735, 877, 492, 985, 724, -132, -121,
3426 -132, 678, 246, 1150, 352, 1130, 1154, 1130, 1030, -124,
3427 1165, -757, 1130, -129, 1130, -129, -657, 225, 483, -121,
3428 1170, 677, -121, 1004, 1006, 1165, -121, 1081, 1141, 1010,
3429 1012, 558, 931, -772, 238, 1130, 246, 630, 558, 631,
3430 -659, 225, 819, 231, 585, -657, 1135, -660, 1098, 590,
3431 276, 725, 1069, -134, 679, 1244, 1247, 985, 630, 315,
3432 247, 316, 250, 856, 1166, 631, 694, 852, 502, -659,
3433 871, 376, 377, 378, 1073, 871, -660, 663, 208, -545,
3434 315, 747, 316, 267, 630, 1261, 125, 467, 727, 276,
3435 1215, 631, 293, 225, 276, 706, 276, 306, -130, 1178,
3436 1273, 210, 858, 296, 678, 885, 1098, 1150, 342, 1144,
3437 630, -122, 857, 1098, 1098, 1100, 854, 1150, 1150, 542,
3438 1243, 1246, 326, 327, 495, 774, 125, 1199, 439, 862,
3439 784, 246, 125, 345, 1331, -662, 489, 668, 669, 543,
3440 998, 782, 735, 728, 735, 650, 889, -132, 674, 651,
3441 502, -133, 761, 622, 558, 622, 685, 686, 467, 757,
3442 1318, 346, 757, -135, -662, 687, 623, 453, 632, 453,
3443 547, 548, 125, -757, 293, 125, 478, -123, 553, 350,
3444 968, 1028, 701, 677, 799, 296, 830, 1269, -120, 60,
3445 1145, 1146, 960, 807, 1276, 438, 811, 776, 813, 1200,
3446 803, 440, 776, 549, 804, 622, 798, 1210, 784, 784,
3447 467, 922, 1274, 885, 1277, 805, 772, 817, 1098, 782,
3448 782, -122, 1302, 931, 622, 822, 622, -129, 843, 246,
3449 631, 276, 225, 839, 125, -130, 125, 442, -661, -132,
3450 631, -122, 225, -756, -122, -663, -129, 852, -122, 630,
3451 805, 622, 622, 245, 738, 558, 125, 1262, 1110, 630,
3452 849, -667, 381, 558, 868, 809, 738, -661, 1148, 860,
3453 863, 814, 208, 818, -663, 1136, 622, 276, 622, 553,
3454 276, 1034, 798, 805, 245, 930, 931, -123, 1326, 246,
3455 382, 433, 859, 664, 293, 210, -128, 449, -120, 913,
3456 450, 735, 735, 1235, 1236, 296, 1325, -123, 1327, 352,
3457 -123, 451, 493, 493, -123, 1328, -119, 493, -120, 499,
3458 352, -120, 865, -756, 688, -120, -334, 690, 381, 453,
3459 -99, 692, 457, 810, 1134, 808, 1339, 365, 366, 276,
3460 1185, 276, 1311, 949, 502, 439, 870, 703, 872, 467,
3461 -113, 873, 874, 510, -334, -334, 382, 383, -757, 467,
3462 955, 276, -654, 477, 510, 459, -654, 483, 293, -655,
3463 808, 1171, 1172, 241, 374, 375, 376, 377, 378, 296,
3464 -135, 1237, 453, 431, 373, 374, 375, 376, 377, 378,
3465 947, -654, 899, 650, -654, -654, 900, 1147, -655, 901,
3466 -126, -655, -134, 808, 903, 859, 388, 515, 948, 512,
3467 513, -334, 427, 384, -757, 622, 739, 622, 515, 486,
3468 512, 513, -125, 671, 510, 622, 1255, 622, 125, -655,
3469 -655, 125, 381, -761, 1136, 750, 660, 753, 381, 1136,
3470 352, 1136, 208, 1136, 1021, -98, 881, 491, 779, -756,
3471 500, -654, 497, 941, -756, 881, 945, 784, 784, 328,
3472 382, 454, 381, 784, 784, 661, 382, 481, 782, 782,
3473 952, 1256, 1257, 505, 782, 782, -761, 473, 1294, 525,
3474 512, 513, 757, 1224, -757, 520, -655, 474, 475, -757,
3475 382, 506, 1020, 1134, 917, 918, 631, -772, 225, -664,
3476 1134, 246, 923, 924, -761, -761, 700, 388, 803, 988,
3477 1227, 989, -665, 929, 936, 630, 936, 455, 510, 518,
3478 1242, 1245, -327, 455, 510, 841, 1031, -664, -664, 1036,
3479 125, 504, 504, 276, 784, 1136, 276, 1136, 528, 776,
3480 -665, -665, 1136, -130, 1136, 782, 125, 507, 381, 784,
3481 -327, -327, 958, 959, 573, 961, 962, 381, 855, -761,
3482 782, -761, 453, -121, -756, 1136, 1022, 125, 510, 1023,
3483 -673, 576, 1025, 580, 512, 513, 382, 645, 516, 1029,
3484 512, 513, 1032, -335, -664, 382, 655, 864, 1114, 589,
3485 125, 125, 526, 738, 1134, 879, 510, -665, 644, 1097,
3486 1097, 1051, 1052, 381, 648, 672, 1143, -327, 994, 1161,
3487 653, -335, -335, 673, 1164, 467, 1057, 381, 689, 510,
3488 381, 1009, 515, 691, 512, 513, 125, 1224, 697, 804,
3489 1017, 382, 911, 646, 1317, 276, 543, -113, 1319, 794,
3490 357, 358, 656, 922, 125, 382, 1249, 125, 382, 1271,
3491 717, 276, 512, 513, 693, 705, 1097, 1097, 800, 1033,
3492 1097, 707, 1115, 736, -132, 742, 1186, 547, -335, 1187,
3493 1188, 1232, 276, 722, 1225, 512, 513, 1097, -129, 1198,
3494 -419, 622, 745, 622, -123, 751, 749, 752, 912, 293,
3495 1251, 1048, 1048, 754, 765, 369, 370, 812, -120, 781,
3496 1183, 953, 1250, 946, 125, 656, 819, 125, 125, 1097,
3497 802, 822, 875, 951, 897, 800, 878, 125, 880, 1104,
3498 963, 1108, 965, 293, 883, 902, 898, 92, -307, 905,
3499 1162, 276, 37, 38, 413, 40, 906, 388, 970, 493,
3500 908, 233, 233, 909, 800, 1252, 916, 1097, 926, 276,
3501 1097, 921, 276, 975, 977, 1142, 931, 964, 980, 974,
3502 982, 976, 983, 748, 1097, 1097, 1097, 1300, 1301, 1097,
3503 1097, 979, 981, -311, 1097, 1097, 1285, 1008, 92, 92,
3504 1163, 1037, 294, 125, 1038, 1045, 37, 38, 896, 40,
3505 293, -309, 1102, 233, 1105, 125, 46, 47, 352, 1126,
3506 1160, 413, 537, 1167, 538, 539, 540, 541, 1168, 276,
3507 1169, 294, 276, 276, 1195, 365, 366, 936, 1196, 233,
3508 233, 282, 276, 233, 400, 411, 411, 1202, 233, 1204,
3509 388, 388, 1209, 738, 631, 1211, 225, 986, 987, 1223,
3510 537, 738, 538, 539, 540, 541, 992, 81, 993, 1055,
3511 995, 1248, 729, 630, 1213, 1221, 1222, 1165, 730, 1323,
3512 800, 81, 81, 374, 375, 376, 377, 378, 1263, 1265,
3513 800, 1212, 1214, 1270, 1054, -756, 1279, 1097, 1280, 1283,
3514 480, 1097, 1097, 1284, 957, 846, 848, -757, 276, 1305,
3515 729, 936, 1307, 1312, 1304, 527, 702, 125, 81, 81,
3516 276, 1314, 846, 848, 1329, 704, 1125, 1127, 1128, 1129,
3517 1335, 954, 398, 81, 1142, 415, 380, 695, 861, 881,
3518 842, 1142, 1019, 1142, 1203, 1254, 537, 1097, 538, 539,
3519 540, 541, 1258, 876, 538, 539, 540, 541, 1156, 81,
3520 81, 972, 92, 81, 41, 42, 43, 44, 81, 1131,
3521 1049, 1324, 956, 467, 584, 929, 1108, 321, 322, 323,
3522 324, 325, 1332, 1229, 1233, 1298, 233, 1234, 1226, 233,
3523 233, 437, 233, 723, 1297, 428, 738, 92, 888, 886,
3524 441, 1272, 1268, 443, 444, 445, 1330, 0, 0, 0,
3525 0, 0, 0, 0, 92, 0, 0, 0, 0, 1306,
3526 1308, 0, 276, 0, 0, 1313, 0, 1315, 1316, 0,
3527 0, 0, 0, 0, 294, 1142, 0, 1142, 0, 622,
3528 0, 622, 1142, 0, 1142, 0, 936, 1216, 0, 0,
3529 1220, 800, 0, 0, 0, 0, 0, 1241, 0, 0,
3530 0, 622, 0, 0, 92, 1142, 233, 233, 233, 233,
3531 1239, 233, 233, 0, 0, 0, 1334, 1336, 1337, 1338,
3532 0, 0, 81, 0, 0, 0, 1264, 1117, 0, 0,
3533 1340, 0, 92, 294, 0, 0, 0, 1278, 1117, 0,
3534 0, 0, 0, 0, 0, 0, 81, 1282, 0, 81,
3535 81, 0, 81, 0, 0, 800, 1158, 81, 0, 0,
3536 0, 0, 0, 0, 1286, 1287, 1288, 0, 0, 233,
3537 0, 92, 0, 0, 81, 0, 92, 233, 92, 0,
3538 0, 1289, 1290, 1291, 537, 0, 538, 539, 540, 541,
3539 542, 0, 233, 0, 1005, 1007, 352, 0, 0, 0,
3540 1011, 1013, 0, 0, 0, 0, 0, 0, 0, 0,
3541 543, 0, 0, 365, 366, 0, 233, 0, 0, 0,
3542 0, 0, 0, 0, 81, 1117, 81, 81, 81, 81,
3543 1322, 81, 81, 0, 545, 1005, 1007, 0, 1011, 1013,
3544 233, 547, 548, 0, 800, 0, 0, 800, 0, 0,
3545 0, 537, 81, 538, 539, 540, 541, 542, 371, 372,
3546 373, 374, 375, 376, 377, 378, 0, 800, 0, 0,
3547 0, 0, 0, 92, 549, 675, 676, 543, 0, 0,
3548 0, 0, 0, 0, 282, 0, 1101, 0, 0, 81,
3549 294, 81, 233, 0, 0, 0, 81, 81, 81, 0,
3550 0, 545, 0, 0, 0, 0, 0, 546, 547, 548,
3551 1101, 0, 81, 92, 0, 0, 0, 676, 0, 92,
3552 282, 0, 0, 0, 0, 0, 0, 537, 0, 538,
3553 539, 540, 541, 542, 0, 0, 81, 0, 800, 800,
3554 800, 549, 0, 0, 550, 0, 0, 0, 0, 0,
3555 0, 0, 1303, 543, 0, 0, 0, 0, 233, 92,
3556 81, 233, 92, 0, 0, 0, 0, 544, 0, 0,
3557 233, 0, 294, 0, 0, 790, 0, 545, 0, 23,
3558 24, 25, 26, 546, 547, 548, 744, 800, 0, 0,
3559 0, 0, 0, 81, 0, 32, 33, 34, 1055, 0,
3560 0, 0, 1056, 0, 0, 41, 42, 43, 44, 45,
3561 775, 1158, 81, 0, 0, 787, 0, 549, 0, 0,
3562 550, 92, 0, 92, 0, 0, 0, 0, 0, 0,
3563 0, 233, 966, 81, 0, 0, 0, 1058, 1059, 81,
3564 0, 233, 0, 92, 233, 1060, 0, 0, 1061, 0,
3565 0, 1062, 1063, 790, 790, 0, 0, 58, 59, 60,
3566 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3567 0, 0, 0, 0, 0, 0, 0, 0, 81, 81,
3568 233, 81, 81, 0, 0, 0, 0, 1066, 0, 0,
3569 81, 0, 294, 0, 288, 81, 850, 0, 0, 0,
3570 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3571 0, 0, -783, 0, 676, 0, 282, 0, 0, 0,
3572 -783, -783, -783, 0, 0, -783, -783, -783, 0, -783,
3573 0, 0, 0, 0, 0, 0, 0, -783, -783, -783,
3574 0, 81, 0, 81, 0, 103, 0, 0, 0, -783,
3575 -783, 81, -783, -783, -783, -783, -783, 0, 0, 103,
3576 103, 81, 0, 81, 81, 882, 294, 0, 0, 0,
3577 0, 0, 0, 81, 81, 0, 0, 0, 0, 0,
3578 -783, -783, 0, 0, 0, 0, 537, 0, 538, 539,
3579 540, 541, 542, 0, 0, 0, 103, 103, 904, 0,
3580 81, 0, 0, 0, 0, 0, 0, 0, 0, -783,
3581 -783, 103, 543, 0, 0, 92, 0, 233, 92, 0,
3582 0, 0, 0, 0, 0, 0, 0, 676, 0, 351,
3583 0, 0, 0, -783, 0, 0, 545, 103, 103, 0,
3584 0, 103, 546, 547, 548, 0, 103, 0, 943, 0,
3585 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3586 0, 0, 0, 0, -783, -783, 0, 0, 0, 241,
3587 -783, 0, -783, 0, -783, 0, 549, 0, 0, 550,
3588 0, 233, 352, 353, 354, 355, 356, 357, 358, 359,
3589 360, 361, 362, 363, 364, 0, 246, 233, 0, 365,
3590 366, 0, 790, 790, 0, 367, 0, 0, 790, 790,
3591 0, 0, 0, 0, 0, 0, 0, 92, 233, 0,
3592 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3593 991, 0, 0, 92, 0, 81, 0, 81, 81, 0,
3594 368, 0, 369, 370, 371, 372, 373, 374, 375, 376,
3595 377, 378, 1014, 0, 92, 0, 0, 0, 0, 0,
3596 103, 0, 0, 0, 0, 0, 0, 1026, 0, 0,
3597 0, 0, 0, 0, 0, 0, 0, 92, 92, 790,
3598 0, 0, 0, 0, 103, 0, 0, 103, 103, 282,
3599 103, 0, 0, 0, 790, 103, 0, 0, 0, 0,
3600 0, 81, 0, 0, 0, 0, 0, 0, 0, 0,
3601 0, 0, 103, 92, 0, 1050, 0, 81, 0, 0,
3602 0, 0, 81, 81, 0, 0, 0, 0, 81, 81,
3603 0, 92, 0, 0, 92, 0, 0, 81, 81, 0,
3604 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3605 0, 0, 1113, 81, 0, 0, 0, 0, 0, 0,
3606 0, 0, 103, 0, 103, 103, 103, 103, 0, 103,
3607 103, 0, 0, 0, 81, 0, 0, 0, 0, 0,
3608 0, 0, 1067, 1067, 0, 0, 0, 1181, 0, 0,
3609 103, 92, 0, 0, 92, 92, 0, 81, 81, 81,
3610 0, 0, 0, 0, 92, 0, 537, 0, 538, 539,
3611 540, 541, 542, 0, 81, 0, 0, 0, 0, 0,
3612 0, 1208, 0, 0, 0, 0, 0, 103, 0, 103,
3613 0, 0, 543, 81, 103, 103, 103, 1191, 0, 1067,
3614 1067, 0, 0, 1067, 0, 0, 544, 0, 233, 0,
3615 103, 81, 0, 0, 81, 0, 545, 0, 0, 0,
3616 1067, 0, 546, 547, 548, 0, 0, 0, 0, 0,
3617 92, 0, 0, 0, 103, 0, 0, 0, 0, 0,
3618 0, 0, 92, 0, 0, 0, 0, 0, 1266, 0,
3619 0, 0, 1067, 0, 0, 0, 549, 0, 103, 550,
3620 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3621 0, 81, 0, 0, 81, 81, 0, 0, 0, 0,
3622 0, 0, 0, 0, 81, 0, 0, 0, 0, 104,
3623 1067, 103, 0, 1067, 0, 233, 0, 0, 0, 0,
3624 0, 233, 233, 104, 104, 0, 0, 1067, 1067, 1067,
3625 103, 0, 1067, 1067, 0, 0, 0, 1067, 1067, 0,
3626 0, 0, 0, 0, 0, 0, 0, 0, 81, 0,
3627 0, 103, 0, 0, 0, 0, 0, 103, 0, 0,
3628 104, 104, 0, 0, 92, 0, 0, 0, 1089, 1089,
3629 81, 0, 0, 0, 0, 104, 0, 0, 0, 0,
3630 0, 0, 81, 0, 0, 0, 0, 0, 0, 0,
3631 0, 0, 0, 0, 0, 0, 103, 103, 0, 103,
3632 103, 104, 104, 0, 0, 104, 0, 0, 103, 0,
3633 104, 0, 0, 103, 0, 0, 0, 0, 0, 0,
3634 0, 23, 24, 25, 26, 1089, 1089, 0, 0, 1089,
3635 0, 0, 0, 0, 0, 81, 0, 32, 33, 34,
3636 1067, 81, 81, 0, 1067, 1067, 1089, 41, 42, 43,
3637 44, 45, 0, 0, 0, 0, 0, 0, 128, 103,
3638 0, 103, 0, 0, 0, 0, 0, 0, 0, 103,
3639 0, 537, 0, 538, 539, 540, 541, 542, 1089, 103,
3640 0, 103, 103, 0, 81, 0, 0, 0, 0, 0,
3641 1067, 103, 103, 0, 0, 0, 0, 543, 0, 58,
3642 59, 60, 61, 62, 63, 64, 65, 66, 0, 128,
3643 128, 544, 0, 297, 0, 0, 1089, 0, 103, 1089,
3644 0, 545, 0, 0, 104, 0, 0, 0, 547, 548,
3645 0, 0, 0, 1089, 1089, 1089, 288, 0, 1089, 1089,
3646 0, 0, 297, 1089, 1089, 0, 0, 0, 104, 0,
3647 0, 104, 104, 0, 104, 404, 414, 414, 0, 104,
3648 0, 549, 0, 0, 0, 910, 0, 0, 0, 0,
3649 0, 0, 0, 0, 0, 0, 104, 0, 0, 0,
3650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3651 0, 0, 0, 0, 0, 0, 0, 0, 0, 352,
3652 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
3653 363, 364, 0, 0, 0, 0, 365, 366, 0, 0,
3654 0, 0, 0, 0, 0, 0, 104, 0, 104, 104,
3655 104, 104, 0, 104, 104, 0, 0, 0, 0, 0,
3656 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0,
3657 1089, 1089, 0, 103, 104, 103, 103, 368, 0, 369,
3658 370, 371, 372, 373, 374, 375, 376, 377, 378, 0,
3659 0, 0, 0, 128, 0, 0, -279, 0, 0, 0,
3660 0, 77, 0, 0, 0, 0, 0, 0, 0, 0,
3661 0, 104, 0, 104, 0, 0, 1089, 0, 104, 104,
3662 104, 0, 0, 0, 0, 0, 0, 0, 128, 0,
3663 0, 0, 0, 0, 104, 0, 0, 0, 0, 103,
3664 0, 0, 0, 0, 0, 128, 0, 0, 1090, 1090,
3665 0, 0, 77, 77, 0, 103, 290, 0, 104, 0,
3666 103, 103, 0, 0, 0, 297, 103, 103, 0, 0,
3667 0, 0, 0, 0, 0, 103, 103, 0, 0, 0,
3668 0, 0, 104, 0, 0, 290, 0, 0, 0, 0,
3669 0, 103, 0, 0, 0, 128, 0, 0, 290, 290,
3670 290, 0, 0, 0, 0, 1090, 1090, 0, 0, 1090,
3671 0, 0, 103, 0, 0, 104, 0, 0, 0, 0,
3672 0, 0, 0, 128, 297, 0, 1090, 1091, 1091, 0,
3673 0, 0, 0, 0, 104, 103, 103, 103, 0, 0,
3674 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3675 0, 0, 103, 0, 0, 104, 0, 0, 1090, 0,
3676 0, 104, 128, 0, 0, 0, 0, 128, 0, 128,
3677 0, 103, 0, 0, 0, 0, 0, 0, 0, 0,
3678 0, 0, 0, 0, 1091, 1091, 0, 0, 1091, 103,
3679 0, 0, 103, 0, 0, 0, 1090, 0, 0, 1090,
3680 104, 104, 0, 104, 104, 1091, 0, 0, 0, 0,
3681 0, 0, 104, 1090, 1090, 1090, 77, 104, 1090, 1090,
3682 0, 0, 0, 1090, 1090, 0, 0, 0, 0, 0,
3683 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0,
3684 0, 0, 0, 0, 0, 0, 0, 0, 0, 103,
3685 0, 77, 103, 103, 0, 0, 0, 0, 0, 0,
3686 0, 0, 103, 104, 128, 104, 0, 0, 77, 0,
3687 0, 0, 0, 104, 0, 1091, 0, 0, 1091, 0,
3688 0, 297, 0, 104, 0, 104, 104, 0, 290, 0,
3689 0, 0, 1091, 1091, 1091, 104, 104, 1091, 1091, 0,
3690 0, 0, 1091, 1091, 128, 0, 103, 0, 0, 0,
3691 128, 0, 0, 0, 0, 0, 0, 0, 77, 0,
3692 0, 0, 104, 0, 0, 0, 1090, 0, 103, 0,
3693 1090, 1090, 0, 0, 0, 0, 0, 0, 0, 0,
3694 103, 0, 0, 0, 0, 0, 77, 290, 0, 0,
3695 128, 0, 0, 128, 0, 0, 0, 0, 0, 0,
3696 0, 0, 0, 297, 78, 0, 791, 0, 0, 0,
3697 0, 0, 0, 0, 0, 0, 1090, 0, 0, 0,
3698 0, 0, 0, 0, 0, 77, 0, 0, 0, 0,
3699 77, 0, 77, 103, 0, 0, 0, 0, 0, 103,
3700 103, 0, 0, 0, 0, 1091, 0, 0, 0, 1091,
3701 1091, 0, 128, 0, 128, 78, 78, 0, 0, 291,
3702 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3703 0, 0, 0, 0, 128, 0, 0, 0, 0, 0,
3704 0, 0, 103, 0, 791, 791, 0, 0, 291, 0,
3705 0, 0, 0, 0, 0, 1091, 0, 104, 0, 104,
3706 104, 291, 291, 291, 124, 0, 0, 0, 0, 0,
3707 0, 0, 0, 0, 1092, 1092, 0, 0, 0, 0,
3708 0, 0, 0, 297, 0, 0, 0, 77, 0, 0,
3709 0, 0, 869, 0, 0, 0, 0, 0, 0, 0,
3710 0, 0, 0, 0, 290, 0, 0, 0, 0, 0,
3711 0, 0, 0, 0, 0, 124, 124, 0, 0, 295,
3712 0, 0, 0, 104, 0, 0, 0, 77, 0, 0,
3713 0, 1092, 1092, 77, 0, 1092, 0, 0, 0, 104,
3714 0, 0, 0, 0, 104, 104, 0, 0, 295, 0,
3715 104, 104, 1092, 0, 0, 0, 0, 297, 0, 104,
3716 104, 402, 412, 412, 412, 0, 0, 0, 0, 0,
3717 0, 0, 0, 77, 0, 104, 77, 0, 0, 78,
3718 0, 0, 0, 0, 1092, 0, 290, 0, 0, 77,
3719 0, 0, 0, 0, 0, 0, 104, 0, 0, 0,
3720 0, 0, 0, 0, 0, 0, 128, 0, 0, 128,
3721 0, 0, 0, 0, 78, 0, 0, 0, 0, 104,
3722 104, 104, 1092, 0, 0, 1092, 0, 0, 0, 0,
3723 0, 78, 0, 0, 0, 77, 104, 77, 0, 1092,
3724 1092, 1092, 0, 0, 1092, 1092, 0, 0, 0, 1092,
3725 1092, 291, 0, 0, 0, 104, 0, 77, 0, 0,
3726 0, 0, 0, 0, 0, 0, 0, 77, 77, 0,
3727 0, 0, 0, 104, 0, 0, 104, 0, 0, 124,
3728 0, 78, 0, 0, 0, 0, 0, 0, 0, 0,
3729 0, 0, 0, 791, 791, 0, 0, 0, 0, 791,
3730 791, 0, 0, 0, 0, 0, 290, 0, 128, 78,
3731 291, 0, 0, 0, 124, 0, 0, 0, 0, 0,
3732 0, 0, 0, 0, 128, 0, 0, 0, 0, 0,
3733 0, 124, 0, 104, 0, 0, 104, 104, 0, 0,
3734 0, 0, 0, 0, 0, 128, 104, 0, 78, 0,
3735 0, 295, 1092, 78, 0, 78, 1092, 1092, 0, 0,
3736 0, 0, 0, 0, 0, 0, 0, 0, 128, 128,
3737 791, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3738 290, 124, 0, 0, 0, 791, 0, 0, 0, 0,
3739 104, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3740 0, 0, 1092, 0, 128, 0, 0, 0, 0, 124,
3741 295, 0, 104, 0, 0, 0, 0, 88, 0, 0,
3742 0, 0, 128, 0, 104, 128, 0, 0, 0, 77,
3743 0, 0, 77, 0, 0, 0, 0, 0, 0, 0,
3744 0, 0, 0, 0, 0, 0, 1093, 1093, 124, 0,
3745 78, 0, 0, 124, 0, 124, 0, 0, 0, 0,
3746 0, 0, 0, 0, 0, 0, 0, 291, 88, 88,
3747 0, 0, 0, 0, 0, 0, 0, 104, 1184, 0,
3748 0, 0, 128, 104, 104, 128, 128, 0, 0, 0,
3749 78, 0, 0, 0, 0, 128, 78, 0, 0, 0,
3750 0, 0, 0, 1093, 1093, 0, 0, 1093, 0, 0,
3751 0, 0, 414, 0, 399, 0, 77, 77, 0, 0,
3752 0, 0, 77, 77, 1093, 0, 104, 0, 0, 0,
3753 0, 77, 0, 0, 0, 0, 78, 0, 0, 78,
3754 0, 0, 0, 0, 0, 0, 0, 77, 0, 291,
3755 124, 0, 78, 0, 0, 0, 1093, 0, 0, 0,
3756 0, 128, 0, 0, 0, 0, 0, 295, 77, 0,
3757 0, 0, 0, 128, 0, 0, 0, 0, 0, 414,
3758 0, 0, 0, 0, 0, 1094, 1094, 0, 0, 0,
3759 124, 77, 77, 77, 1093, 0, 124, 1093, 78, 0,
3760 78, 0, 0, 0, 0, 0, 0, 0, 77, 0,
3761 0, 1093, 1093, 1093, 0, 0, 1093, 1093, 0, 0,
3762 78, 1093, 1093, 0, 0, 0, 0, 77, 0, 0,
3763 78, 78, 88, 0, 127, 0, 124, 0, 0, 124,
3764 0, 0, 1094, 1094, 0, 77, 1094, 0, 77, 295,
3765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3766 0, 0, 0, 1094, 0, 0, 0, 88, 0, 291,
3767 0, 0, 0, 0, 0, 128, 0, 0, 0, 0,
3768 0, 1095, 1095, 0, 88, 127, 127, 0, 0, 0,
3769 0, 0, 0, 0, 0, 1094, 0, 0, 124, 0,
3770 124, 290, 0, 0, 0, 77, 0, 0, 77, 77,
3771 0, 0, 0, 0, 0, 0, 0, 0, 77, 0,
3772 124, 0, 0, 0, 1093, 0, 0, 0, 1093, 1093,
3773 0, 0, 0, 1094, 88, 290, 1094, 0, 1095, 1095,
3774 0, 0, 1095, 291, 0, 0, 0, 0, 0, 0,
3775 1094, 1094, 1094, 0, 0, 1094, 1094, 0, 0, 1095,
3776 1094, 1094, 88, 1096, 1096, 0, 0, 0, 0, 295,
3777 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0,
3778 0, 0, 0, 0, 77, 0, 0, 0, 0, 0,
3779 0, 1095, 78, 0, 0, 78, 77, 0, 0, 0,
3780 0, 88, 290, 0, 0, 0, 88, 0, 88, 0,
3781 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3782 1096, 1096, 0, 0, 1096, 0, 0, 0, 0, 1095,
3783 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0,
3784 0, 1096, 0, 295, 0, 0, 1095, 1095, 1095, 127,
3785 0, 1095, 1095, 0, 0, 0, 1095, 1095, 0, 0,
3786 0, 0, 0, 1094, 0, 0, 0, 1094, 1094, 0,
3787 0, 0, 0, 1096, 0, 0, 0, 0, 0, 78,
3788 78, 0, 0, 0, 127, 78, 78, 0, 0, 0,
3789 0, 0, 124, 0, 78, 124, 0, 0, 77, 0,
3790 0, 127, 0, 88, 0, 0, 0, 0, 0, 0,
3791 78, 1096, 0, 1094, 1096, 0, 0, 0, 0, 0,
3792 0, 0, 0, 0, 0, 0, 0, 0, 1096, 1096,
3793 1096, 78, 0, 1096, 1096, 0, 0, 0, 1096, 1096,
3794 0, 0, 0, 88, 0, 0, 0, 0, 0, 88,
3795 0, 127, 0, 0, 78, 78, 78, 0, 0, 1095,
3796 0, 0, 0, 1095, 1095, 0, 0, 0, 0, 0,
3797 0, 78, 0, 0, 0, 0, 0, 0, 0, 127,
3798 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,
3799 78, 0, 88, 0, 124, 0, 0, 0, 0, 0,
3800 0, 0, 0, 0, 0, 785, 0, 0, 78, 1095,
3801 124, 78, 0, 0, 0, 0, 0, 0, 127, 0,
3802 0, 0, 0, 127, 0, 127, 0, 0, 0, 0,
3803 0, 124, 0, 0, 0, 0, 0, 0, 0, 0,
3804 0, 1096, 0, 0, 0, 1096, 1096, 0, 0, 0,
3805 0, 88, 0, 88, 124, 124, 0, 0, 0, 23,
3806 24, 25, 26, 0, 291, 0, 0, 0, 78, 0,
3807 0, 78, 78, 88, 0, 32, 33, 34, 1055, 0,
3808 0, 78, 1056, 785, 785, 41, 42, 43, 44, 45,
3809 124, 1096, 0, 0, 0, 0, 0, 0, 291, 0,
3810 0, 0, 0, 0, 0, 0, 0, 0, 124, 0,
3811 0, 124, 0, 0, 0, 0, 0, 1058, 1059, 0,
3812 127, 0, 0, 0, 0, 1060, 0, 0, 1061, 0,
3813 0, 1062, 1063, 0, 1064, 0, 0, 58, 59, 60,
3814 61, 62, 63, 64, 65, 66, 0, 78, 0, 0,
3815 0, 0, 227, 227, 0, 0, 0, 0, 0, 78,
3816 127, 0, 0, 0, 1182, 291, 127, 1066, 124, 0,
3817 0, 124, 124, 0, 288, 0, 0, 0, 0, 0,
3818 0, 124, 0, 0, 260, 264, 265, 266, 246, 0,
3819 0, 227, 227, 0, 0, 0, 0, 0, 412, 0,
3820 0, 0, 0, 0, 313, 314, 127, 0, 0, 127,
3821 0, 352, 353, 354, 355, 356, 357, 358, 359, 0,
3822 361, 362, 127, 0, 0, 0, 0, 0, 365, 366,
3823 0, 0, 0, 0, 0, 0, 0, 0, 0, 227,
3824 0, 0, 0, 0, 0, 88, 0, 124, 88, 0,
3825 0, 0, 0, 0, 0, 0, 0, 0, 0, 124,
3826 0, 78, 0, 0, 0, 412, 0, 0, 127, 0,
3827 127, 369, 370, 371, 372, 373, 374, 375, 376, 377,
3828 378, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3829 127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3830 127, 127, 0, 0, 0, 0, 0, 0, 0, 0,
3831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3832 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3833 0, 0, 785, 785, 0, 0, 0, 0, 785, 785,
3834 0, 0, 0, 0, 0, 0, 0, 88, 0, 0,
3835 0, 227, 0, 0, 227, 227, 227, 0, 313, 0,
3836 0, 124, 0, 88, 0, 0, 0, 0, 0, 23,
3837 24, 25, 26, 0, 0, 0, 0, 227, 0, 0,
3838 227, 0, 0, 0, 88, 32, 33, 34, 1055, 0,
3839 0, 0, 1056, 0, 1057, 41, 42, 43, 44, 45,
3840 0, 0, 0, 0, 0, 0, 0, 88, 88, 785,
3841 0, 0, 0, 0, 543, 0, 0, 0, 0, 0,
3842 0, 0, 0, 0, 785, 0, 0, 1058, 1059, 0,
3843 0, 0, 0, 0, 0, 1060, 0, 0, 1061, 0,
3844 0, 1062, 1063, 88, 1064, 547, 0, 58, 59, 1065,
3845 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3846 0, 88, 127, 0, 88, 127, 0, 0, 0, 0,
3847 0, 0, 0, 0, 0, 0, 0, 1066, 0, 0,
3848 0, 0, 0, 0, 288, 0, 0, 0, 592, 593,
3849 594, 595, 596, 0, 0, 597, 598, 599, 600, 601,
3850 602, 603, 604, 0, 606, 0, 0, 607, 608, 609,
3851 610, 611, 612, 613, 614, 615, 616, 1180, 0, 0,
3852 227, 88, 0, 0, 88, 88, 0, 0, 0, 0,
3853 0, 0, 0, 0, 88, 0, 0, 0, 0, 0,
3854 0, 0, 0, 0, 0, 0, 0, 0, 0, 127,
3855 127, 0, 0, 0, 0, 127, 127, 0, 0, 0,
3856 0, 0, 0, 0, 127, 0, 0, 227, 0, 0,
3857 0, 0, 0, 0, 0, 0, 0, 0, 617, 618,
3858 127, 0, 619, 0, 0, 0, 227, 227, 0, 0,
3859 0, 227, 0, 0, 0, 227, 0, 266, 0, 0,
3860 88, 127, 175, 176, 177, 178, 179, 180, 181, 182,
3861 183, 0, 88, 184, 185, 696, 0, 0, 0, 186,
3862 187, 188, 189, 0, 127, 127, 127, 0, 227, 0,
3863 0, 227, 0, 0, 190, 191, 0, 0, 0, 0,
3864 0, 127, 0, 227, 0, 0, 0, 0, 0, 0,
3865 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3866 127, 726, 0, 0, 192, 193, 194, 195, 196, 197,
3867 198, 199, 200, 201, 0, 202, 203, 0, 127, 0,
3868 0, 127, 204, 241, 0, 0, 0, 0, 0, 0,
3869 0, 0, 0, 0, 0, 0, 0, 227, 352, -784,
3870 -784, -784, -784, 357, 358, 0, 0, -784, -784, 758,
3871 0, 0, 758, 0, 88, 365, 366, 0, 0, 0,
3872 0, 227, 0, 0, 0, 0, 786, 0, 0, 0,
3873 0, 0, 0, 0, 0, 0, 0, 0, 127, 0,
3874 0, 127, 127, 0, 0, 0, 0, 0, 0, 0,
3875 0, 127, 0, 0, 0, 0, 0, 0, 369, 370,
3876 371, 372, 373, 374, 375, 376, 377, 378, 0, 0,
3877 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3878 0, 0, 227, 0, 0, 0, 0, 0, 0, 0,
3879 0, 0, 227, 0, 0, 0, 0, 0, 0, 0,
3880 0, 0, 0, 0, 845, 845, 0, 227, 758, 758,
3881 845, 0, 0, 0, 0, 0, 0, 127, 0, 0,
3882 0, 845, 845, 0, 0, 227, 0, 227, 0, 127,
3883 0, 0, 0, 0, 0, 0, 0, 845, -783, 4,
3884 0, 5, 6, 7, 8, 9, 0, 0, 0, 10,
3885 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
3886 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
3887 22, 23, 24, 25, 26, 0, 227, 27, 0, 0,
3888 0, 0, 0, 28, 29, 30, 31, 32, 33, 34,
3889 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3890 44, 45, 46, 47, 0, 0, 0, 0, 0, 227,
3891 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3892 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3893 51, 127, 0, 0, 0, 0, 0, 52, 227, 0,
3894 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3895 59, 60, 61, 62, 63, 64, 65, 66, 0, 227,
3896 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3897 0, 0, 0, 0, 0, 0, 0, 0, 627, 628,
3898 0, 0, 629, 0, 0, 0, 67, 68, 69, 0,
3899 0, 0, 0, 0, 0, 0, 0, 0, -783, 0,
3900 -783, 0, 175, 176, 177, 178, 179, 180, 181, 182,
3901 183, 0, 0, 184, 185, 0, 0, 0, 0, 186,
3902 187, 188, 189, 0, 0, 0, 0, 0, 0, 0,
3903 0, 0, 758, 0, 190, 191, 0, 0, 0, 0,
3904 0, 227, 0, 0, 0, 0, 0, 0, 227, 0,
3905 0, 0, 1003, 845, 845, 0, 0, 0, 0, 845,
3906 845, 0, 0, 227, 192, 193, 194, 195, 196, 197,
3907 198, 199, 200, 201, 0, 202, 203, 0, 227, 0,
3908 0, 0, 204, 241, 0, 0, 0, 0, 0, 0,
3909 0, 0, 0, 758, 845, 845, 0, 845, 845, 0,
3910 227, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3911 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3912 0, 0, 1043, 1044, 0, 0, 227, 0, 0, 0,
3913 845, 1053, 0, 0, 0, 0, 0, 0, 0, 0,
3914 0, 0, 0, 0, 0, 845, 0, 0, 0, 0,
3915 0, 0, 0, 0, -783, 4, 0, 5, 6, 7,
3916 8, 9, 0, 227, 0, 10, 11, 0, 0, 845,
3917 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3918 0, 0, 0, 0, 20, 21, 22, 23, 24, 25,
3919 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3920 29, 268, 31, 32, 33, 34, 35, 36, 37, 38,
3921 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3922 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3923 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3924 0, 0, 0, 0, 0, 50, 51, 0, 227, 0,
3925 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3926 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3927 63, 64, 65, 66, 0, -783, 0, 0, 0, 0,
3928 -761, 0, 0, 0, 0, 0, 0, 0, -761, -761,
3929 -761, 0, 0, -761, -761, -761, 0, -761, 0, 0,
3930 0, 0, 67, 68, 69, -761, -761, -761, -761, -761,
3931 0, 0, 0, 0, -783, 0, -783, -761, -761, 0,
3932 -761, -761, -761, -761, -761, 0, 0, 0, 352, 353,
3933 354, 355, 356, 357, 358, 359, 360, 361, 362, -784,
3934 -784, 0, 0, 0, 0, 365, 366, 0, -761, -761,
3935 0, 0, 0, 0, 0, 0, 0, 0, -761, -761,
3936 -761, -761, -761, -761, -761, -761, -761, -761, -761, -761,
3937 -761, 0, 0, 0, 0, -761, -761, -761, -761, 0,
3938 853, -761, 0, 0, 0, 0, 227, -761, 369, 370,
3939 371, 372, 373, 374, 375, 376, 377, 378, 0, 0,
3940 0, -761, 0, 0, -761, 0, 0, 0, 0, 0,
3941 0, 0, 0, 0, 0, -131, -761, -761, -761, -761,
3942 -761, -761, -761, -761, -761, -761, -761, -761, 0, 0,
3943 0, 0, -761, -761, -761, -761, -654, 0, -761, -761,
3944 -761, 0, -761, 0, -654, -654, -654, 0, 0, -654,
3945 -654, -654, 0, -654, 0, 0, 0, 0, 0, 0,
3946 0, -654, 0, -654, -654, -654, 0, 0, 0, 0,
3947 0, 0, 0, -654, -654, 0, -654, -654, -654, -654,
3948 -654, 0, 0, 0, 352, 353, 354, 355, 356, 357,
3949 358, 359, 360, 361, 362, 363, 364, 0, 0, 0,
3950 0, 365, 366, 0, -654, -654, 0, 0, 0, 0,
3951 0, 0, 0, 0, -654, -654, -654, -654, -654, -654,
3952 -654, -654, -654, -654, -654, -654, -654, 0, 0, 0,
3953 0, -654, -654, -654, -654, 0, -654, -654, 0, 0,
3954 0, 0, 368, -654, 369, 370, 371, 372, 373, 374,
3955 375, 376, 377, 378, 0, 0, 0, -654, 0, 0,
3956 -654, 0, 0, 0, 0, 0, 0, 0, 246, 0,
3957 0, -654, -654, -654, -654, -654, -654, -654, -654, -654,
3958 -654, -654, -654, -654, 0, 0, 0, 0, 0, -654,
3959 -654, -654, -655, 0, -654, -654, -654, 0, -654, 0,
3960 -655, -655, -655, 0, 0, -655, -655, -655, 0, -655,
3961 0, 0, 0, 0, 0, 0, 0, -655, 0, -655,
3962 -655, -655, 0, 0, 0, 0, 0, 0, 0, -655,
3963 -655, 0, -655, -655, -655, -655, -655, 0, 0, 0,
3964 352, 353, 354, 355, 356, 357, 358, 359, 360, 361,
3965 362, 363, 364, 0, 0, 0, 0, 365, 366, 0,
3966 -655, -655, 0, 0, 0, 0, 0, 0, 0, 0,
3967 -655, -655, -655, -655, -655, -655, -655, -655, -655, -655,
3968 -655, -655, -655, 0, 0, 0, 0, -655, -655, -655,
3969 -655, 0, -655, -655, 0, 0, 0, 0, 368, -655,
3970 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,
3971 0, 0, 0, -655, 0, 0, -655, 0, 0, 0,
3972 0, 0, 0, 0, 0, 0, 0, -655, -655, -655,
3973 -655, -655, -655, -655, -655, -655, -655, -655, -655, -655,
3974 0, 0, 0, 0, 0, -655, -655, -655, -762, 0,
3975 -655, -655, -655, 0, -655, 0, -762, -762, -762, 0,
3976 0, -762, -762, -762, 0, -762, 0, 0, 0, 0,
3977 0, 0, 0, -762, -762, -762, -762, -762, 0, 0,
3978 0, 0, 0, 0, 0, -762, -762, 0, -762, -762,
3979 -762, -762, -762, 0, 0, 0, 352, 353, 354, 355,
3980 356, 357, 358, 0, 0, 361, 362, 0, 0, 0,
3981 0, 0, 0, 365, 366, 0, -762, -762, 0, 0,
3982 0, 0, 0, 0, 0, 0, -762, -762, -762, -762,
3983 -762, -762, -762, -762, -762, -762, -762, -762, -762, 0,
3984 0, 0, 0, -762, -762, -762, -762, 0, 0, -762,
3985 0, 0, 0, 0, 0, -762, 369, 370, 371, 372,
3986 373, 374, 375, 376, 377, 378, 0, 0, 0, -762,
3987 0, 0, -762, 0, 0, 0, 0, 0, 0, 0,
3988 0, 0, 0, 0, -762, -762, -762, -762, -762, -762,
3989 -762, -762, -762, -762, -762, -762, 0, 0, 0, 0,
3990 -762, -762, -762, -762, -763, 0, -762, -762, -762, 0,
3991 -762, 0, -763, -763, -763, 0, 0, -763, -763, -763,
3992 0, -763, 0, 0, 0, 0, 0, 0, 0, -763,
3993 -763, -763, -763, -763, 0, 0, 0, 0, 0, 0,
3994 0, -763, -763, 0, -763, -763, -763, -763, -763, 0,
3995 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3996 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3997 0, 0, -763, -763, 0, 0, 0, 0, 0, 0,
3998 0, 0, -763, -763, -763, -763, -763, -763, -763, -763,
3999 -763, -763, -763, -763, -763, 0, 0, 0, 0, -763,
4000 -763, -763, -763, 0, 0, -763, 0, 0, 0, 0,
4001 0, -763, 0, 0, 0, 0, 0, 0, 0, 0,
4002 0, 0, 0, 0, 0, -763, 0, 0, -763, 0,
4003 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4004 -763, -763, -763, -763, -763, -763, -763, -763, -763, -763,
4005 -763, -763, 0, 0, 0, 0, -763, -763, -763, -763,
4006 -475, 0, -763, -763, -763, 0, -763, 0, -475, -475,
4007 -475, 0, 0, -475, -475, -475, 0, -475, 0, 0,
4008 0, 0, 0, 0, 0, -475, -475, -475, -475, 0,
4009 0, 0, 0, 0, 0, 0, 0, -475, -475, 0,
4010 -475, -475, -475, -475, -475, 0, 0, 0, 0, 0,
4011 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4012 0, 0, 0, 0, 0, 0, 0, 0, -475, -475,
4013 0, 0, 0, 0, 0, 0, 0, 0, -475, -475,
4014 -475, -475, -475, -475, -475, -475, -475, -475, -475, -475,
4015 -475, 0, 0, 0, 0, -475, -475, -475, -475, 0,
4016 0, -475, 0, 0, 0, 0, 0, -475, 0, 0,
4017 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4018 0, -475, 0, 0, 0, 0, 0, 0, 0, 0,
4019 0, 0, 0, 0, 0, 0, -475, 0, -475, -475,
4020 -475, -475, -475, -475, -475, -475, -475, -475, 0, 0,
4021 0, 0, -475, -475, -475, -475, -328, 241, -475, -475,
4022 -475, 0, -475, 0, -328, -328, -328, 0, 0, -328,
4023 -328, -328, 0, -328, 0, 0, 0, 0, 0, 0,
4024 0, -328, 0, -328, -328, -328, 0, 0, 0, 0,
4025 0, 0, 0, -328, -328, 0, -328, -328, -328, -328,
4026 -328, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4027 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4028 0, 0, 0, 0, -328, -328, 0, 0, 0, 0,
4029 0, 0, 0, 0, -328, -328, -328, -328, -328, -328,
4030 -328, -328, -328, -328, -328, -328, -328, 0, 0, 0,
4031 0, -328, -328, -328, -328, 0, 0, -328, 0, 0,
4032 0, 0, 0, -328, 0, 0, 0, 0, 0, 0,
4033 0, 0, 0, 0, 0, 0, 0, -328, 0, 0,
4034 -328, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4035 0, 0, -328, -328, -328, -328, -328, -328, -328, -328,
4036 -328, -328, -328, -328, 0, 0, 0, 0, 0, -328,
4037 -328, -328, -783, 0, -328, -328, -328, 0, -328, 0,
4038 -783, -783, -783, 0, 0, -783, -783, -783, 0, -783,
4039 0, 0, 0, 0, 0, 0, 0, -783, -783, -783,
4040 -783, 0, 0, 0, 0, 0, 0, 0, 0, -783,
4041 -783, 0, -783, -783, -783, -783, -783, 0, 0, 0,
4042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4043 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4044 -783, -783, 0, 0, 0, 0, 0, 0, 0, 0,
4045 -783, -783, -783, -783, -783, -783, -783, -783, -783, -783,
4046 -783, -783, -783, 0, 0, 0, 0, -783, -783, -783,
4047 -783, 0, 0, -783, 0, 0, 0, 0, 0, -783,
4048 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4049 0, 0, 0, -783, 0, 0, 0, 0, 0, 0,
4050 0, 0, 0, 0, 0, 0, 0, 0, -783, 0,
4051 -783, -783, -783, -783, -783, -783, -783, -783, -783, -783,
4052 0, 0, 0, 0, -783, -783, -783, -783, -334, 241,
4053 -783, -783, -783, 0, -783, 0, -334, -334, -334, 0,
4054 0, -334, -334, -334, 0, -334, 0, 0, 0, 0,
4055 0, 0, 0, -334, 0, -334, -334, 0, 0, 0,
4056 0, 0, 0, 0, 0, -334, -334, 0, -334, -334,
4057 -334, -334, -334, 0, 0, 0, 0, 0, 0, 0,
4058 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4059 0, 0, 0, 0, 0, 0, -334, -334, 0, 0,
4060 0, 0, 0, 0, 0, 0, -334, -334, -334, -334,
4061 -334, -334, -334, -334, -334, -334, -334, -334, -334, 0,
4062 0, 0, 0, -334, -334, -334, -334, 0, 854, -334,
4063 0, 0, 0, 0, 0, -334, 0, 0, 0, 0,
4064 0, 0, 0, 0, 0, 0, 0, 0, 0, -334,
4065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4066 0, 0, 0, -133, -334, 0, -334, -334, -334, -334,
4067 -334, -334, -334, -334, -334, -334, 0, 0, 0, 0,
4068 797, -334, -334, -334, -341, 0, -334, -334, -334, 0,
4069 -334, 0, -341, -341, -341, 0, 0, -341, -341, -341,
4070 0, -341, 0, 0, 0, 0, 0, 0, 0, -341,
4071 0, -341, -341, 0, 0, 0, 0, 0, 0, 0,
4072 0, -341, -341, 0, -341, -341, -341, -341, -341, 0,
4073 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4074 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4075 0, 0, -341, -341, 0, 0, 0, 0, 0, 0,
4076 0, 0, -341, -341, -341, -341, -341, -341, -341, -341,
4077 -341, -341, -341, -341, -341, 0, 0, 0, 0, -341,
4078 -341, -341, -341, 0, 0, -341, 0, 0, 0, 0,
4079 0, -341, 0, 0, 0, 0, 0, 0, 0, 0,
4080 0, 0, 0, 0, 0, -341, 0, 0, 0, 0,
4081 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4082 -341, 0, -341, -341, -341, -341, -341, -341, -341, -341,
4083 -341, -341, 0, 0, 0, 0, 0, -341, -341, -341,
4084 -761, 431, -341, -341, -341, 0, -341, 0, -761, -761,
4085 -761, 910, 0, 0, -761, -761, 0, -761, 0, 0,
4086 0, 0, 0, 0, 0, -761, -761, 0, 0, 0,
4087 0, 0, 0, 0, 0, 0, 0, -761, -761, 0,
4088 -761, -761, -761, -761, -761, 352, 353, 354, 355, 356,
4089 357, 358, 359, 360, 361, 362, 363, 364, 0, 0,
4090 0, 0, 365, 366, 0, 0, 0, 0, -761, -761,
4091 0, 0, 0, 0, 0, 0, 0, 0, -761, -761,
4092 -761, -761, -761, -761, -761, -761, -761, -761, -761, -761,
4093 -761, 0, 0, 0, 0, -761, -761, -761, -761, 0,
4094 795, -761, 0, 368, 0, 369, 370, 371, 372, 373,
4095 374, 375, 376, 377, 378, 0, 0, 0, 0, 0,
4096 0, -761, 0, 0, 0, 0, 0, 0, 0, 0,
4097 0, 0, 0, 0, 0, -131, -761, 0, -761, -761,
4098 -761, -761, -761, -761, -761, -761, -761, -761, 0, 0,
4099 0, 0, -761, -761, -761, -122, -761, 0, -761, 0,
4100 -761, 0, -761, 0, -761, -761, -761, 0, 0, 0,
4101 -761, -761, 0, -761, 0, 0, 0, 0, 0, 0,
4102 0, -761, -761, 0, 0, 0, 0, 0, 0, 0,
4103 0, 0, 0, -761, -761, 0, -761, -761, -761, -761,
4104 -761, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4106 0, 0, 0, 0, -761, -761, 0, 0, 0, 0,
4107 0, 0, 0, 0, -761, -761, -761, -761, -761, -761,
4108 -761, -761, -761, -761, -761, -761, -761, 0, 0, 0,
4109 0, -761, -761, -761, -761, 0, 795, -761, 0, 0,
4110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4111 0, 0, 0, 0, 0, 0, 0, -761, 0, 0,
4112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4113 0, -131, -761, 0, -761, -761, -761, -761, -761, -761,
4114 -761, -761, -761, -761, 0, 0, 0, 0, -761, -761,
4115 -761, -761, -334, 0, -761, 0, -761, 0, -761, 0,
4116 -334, -334, -334, 0, 0, 0, -334, -334, 0, -334,
4117 0, 0, 0, 0, 0, 0, 0, -334, 0, 0,
4118 0, 0, 0, 0, 0, 0, 0, 0, 0, -334,
4119 -334, 0, -334, -334, -334, -334, -334, 0, 0, 0,
4120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4122 -334, -334, 0, 0, 0, 0, 0, 0, 0, 0,
4123 -334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
4124 -334, -334, -334, 0, 0, 0, 0, -334, -334, -334,
4125 -334, 0, 796, -334, 0, 0, 0, 0, 0, 0,
4126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4127 0, 0, 0, -334, 0, 0, 0, 0, 0, 0,
4128 0, 0, 0, 0, 0, 0, 0, -133, -334, 0,
4129 -334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
4130 0, 0, 0, 0, 797, -334, -334, -124, -334, 0,
4131 -334, 0, -334, 0, -334, 0, -334, -334, -334, 0,
4132 0, 0, -334, -334, 0, -334, 0, 0, 0, 0,
4133 0, 0, 0, -334, 0, 0, 0, 0, 0, 0,
4134 0, 0, 0, 0, 0, -334, -334, 0, -334, -334,
4135 -334, -334, -334, 0, 0, 0, 0, 0, 0, 0,
4136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4137 0, 0, 0, 0, 0, 0, -334, -334, 0, 0,
4138 0, 0, 0, 0, 0, 0, -334, -334, -334, -334,
4139 -334, -334, -334, -334, -334, -334, -334, -334, -334, 0,
4140 0, 0, 0, -334, -334, -334, -334, 0, 796, -334,
4141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4142 0, 0, 0, 0, 0, 0, 0, 0, 0, -334,
4143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4144 0, 0, 0, -133, -334, 0, -334, -334, -334, -334,
4145 -334, -334, -334, -334, -334, -334, 0, 0, 0, 0,
4146 797, -334, -334, -334, 0, 0, -334, 0, -334, 4,
4147 -334, 5, 6, 7, 8, 9, -783, -783, -783, 10,
4148 11, 0, 0, -783, 12, 0, 13, 14, 15, 16,
4149 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
4150 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
4151 0, 0, 0, 28, 29, 268, 31, 32, 33, 34,
4152 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4153 44, 45, 46, 47, 0, 0, -783, 0, 0, 0,
4154 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4155 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4156 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
4157 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
4158 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4159 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
4160 -783, 10, 11, 0, -783, -783, 12, 0, 13, 14,
4161 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
4162 20, 21, 22, 23, 24, 25, 26, 0, -783, 27,
4163 -783, 0, 0, 0, 0, 28, 29, 268, 31, 32,
4164 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4165 42, 43, 44, 45, 46, 47, 0, 0, -783, 0,
4166 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4168 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
4169 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
4170 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4171 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
4172 0, 0, -783, 10, 11, 0, 0, -783, 12, -783,
4173 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
4174 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4175 -783, 27, -783, 0, 0, 0, 0, 28, 29, 268,
4176 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4177 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4178 -783, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4180 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4181 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4182 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4183 65, 66, 0, 0, 0, 4, 0, 5, 6, 7,
4184 8, 9, 0, 0, -783, 10, 11, 0, 0, -783,
4185 12, 0, 13, 14, 15, 16, 17, 18, 19, -783,
4186 67, 68, 69, 0, 20, 21, 22, 23, 24, 25,
4187 26, 0, -783, 27, -783, 0, 0, 0, 0, 28,
4188 29, 268, 31, 32, 33, 34, 35, 36, 37, 38,
4189 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4190 0, 0, -783, 0, 0, 0, 0, 0, 0, 0,
4191 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4192 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4193 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
4194 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
4195 63, 64, 65, 66, 0, 0, 0, 4, 0, 5,
4196 6, 7, 8, 9, 0, 0, -783, 10, 11, 0,
4197 0, -783, 12, 0, 13, 14, 15, 16, 17, 18,
4198 19, 0, 67, 68, 69, 0, 20, 21, 22, 23,
4199 24, 25, 26, 0, -783, 27, -783, 0, 0, 0,
4200 0, 28, 29, 268, 31, 32, 33, 34, 35, 36,
4201 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4202 46, 47, 0, 0, -783, 0, 0, 0, 0, 0,
4203 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4204 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4205 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
4206 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
4207 61, 62, 63, 64, 65, 66, 0, 0, 0, 4,
4208 0, 5, 6, 7, 8, 9, 0, -783, -783, 10,
4209 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
4210 17, 18, 19, 0, 67, 68, 69, 0, 20, 21,
4211 22, 23, 24, 25, 26, 0, -783, 27, -783, 0,
4212 0, 0, 0, 28, 29, 268, 31, 32, 33, 34,
4213 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4214 44, 45, 46, 47, 0, 0, -783, 0, 0, 0,
4215 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4216 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4217 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
4218 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
4219 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4220 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
4221 -783, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4222 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
4223 20, 21, 22, 23, 24, 25, 26, 0, -783, 27,
4224 -783, 0, 0, 0, 0, 28, 29, 268, 31, 32,
4225 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4226 42, 43, 44, 45, 46, 47, 0, 0, -783, 0,
4227 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4229 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
4230 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
4231 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4232 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
4233 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4234 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
4235 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4236 -783, 27, -783, 0, 0, 0, 0, 28, 29, 268,
4237 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4238 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4239 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4240 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4241 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4242 0, 52, 0, 0, 269, 54, 0, 55, 56, 0,
4243 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4244 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4247 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
4248 -783, 0, -783, 4, -783, 5, 6, 7, 8, 9,
4249 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4250 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
4251 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4252 0, 27, 0, 0, 0, 0, 0, 28, 29, 268,
4253 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4254 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4255 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4257 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4258 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4259 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4260 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4262 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4263 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
4264 -783, 0, -783, 4, -783, 5, 6, 7, 8, 9,
4265 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4266 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
4267 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4268 0, 27, 0, 0, 0, 0, 0, 28, 29, 30,
4269 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4270 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4271 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4272 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4273 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4274 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4275 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4276 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4277 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4278 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4279 67, 68, 69, 0, 0, -783, 0, 0, 0, 0,
4280 0, 0, -783, 4, -783, 5, 6, 7, 8, 9,
4281 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4282 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
4283 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
4284 0, 27, 0, 0, 0, 0, 0, 28, 29, 268,
4285 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4286 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4287 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4289 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4290 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
4291 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4292 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4293 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4294 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4295 67, 68, 69, 0, 0, -783, 0, 387, 0, 5,
4296 6, 7, -783, 9, -783, 0, 0, 10, 11, 0,
4297 0, 0, 12, -770, 13, 14, 15, 16, 17, 18,
4298 19, 0, 0, 0, 0, 0, 20, 21, 22, 23,
4299 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
4300 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4301 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4302 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4303 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4304 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4305 0, 0, 0, 0, 0, 216, 0, 0, 217, 54,
4306 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
4307 61, 62, 63, 64, 65, 66, 0, 0, -771, 4,
4308 0, 5, 6, 7, 8, 9, -771, -771, -771, 10,
4309 11, 0, -771, -771, 12, -771, 13, 14, 15, 16,
4310 17, 18, 19, -771, 67, 68, 69, 0, 20, 21,
4311 22, 23, 24, 25, 26, 0, 315, 27, 316, 0,
4312 0, 0, 0, 28, 29, 268, 31, 32, 33, 34,
4313 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4314 44, 45, 46, 47, 0, 0, -771, 0, 0, 0,
4315 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4316 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4317 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
4318 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
4319 59, 60, 61, 62, 63, 64, 65, 66, 0, -771,
4320 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4321 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4322 0, 0, 0, 0, 0, 0, 67, 68, 69, 0,
4323 0, -771, 0, 0, 0, 0, -771, 0, 526, -771,
4324 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
4325 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4326 16, 17, 18, 19, 0, 0, 0, 0, 0, 20,
4327 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
4328 0, 0, 0, 0, 28, 29, 30, 31, 32, 33,
4329 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
4330 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4331 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4333 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
4334 0, 53, 54, 0, 55, 56, 0, 57, 0, 0,
4335 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
4336 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4337 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4338 0, 0, 0, 0, 0, 0, 0, 67, 68, 69,
4339 0, 0, -771, 5, 6, 7, 0, 9, 0, 526,
4340 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4341 15, 16, 17, 18, 19, 0, 0, 0, 0, 0,
4342 20, 21, 22, 23, 24, 25, 26, 0, 0, 214,
4343 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4344 33, 34, 35, 36, 37, 38, 39, 40, 215, 41,
4345 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4346 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4348 0, 50, 51, 0, 0, 0, 0, 0, 0, 216,
4349 0, 0, 217, 54, 0, 55, 56, 0, 218, 219,
4350 220, 58, 59, 221, 61, 62, 63, 64, 65, 66,
4351 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4352 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4353 14, 15, 16, 17, 18, 19, 0, 0, 67, 222,
4354 69, 20, 21, 22, 23, 24, 25, 26, 0, 0,
4355 27, 0, 246, 0, 0, 0, 0, 29, 0, 0,
4356 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4357 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4358 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4359 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4360 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4361 216, 0, 0, 217, 54, 0, 55, 56, 0, 0,
4362 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4363 66, 0, 0, 0, 0, 131, 132, 133, 134, 135,
4364 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
4365 146, 147, 148, 149, 150, 151, 152, 153, 154, 67,
4366 68, 69, 155, 156, 157, 416, 417, 418, 419, 162,
4367 163, 164, 0, 246, 0, 0, 0, 165, 166, 167,
4368 168, 420, 421, 422, 423, 173, 37, 38, 424, 40,
4369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4370 0, 0, 0, 0, 0, 0, 0, 0, 175, 176,
4371 177, 178, 179, 180, 181, 182, 183, 0, 0, 184,
4372 185, 0, 0, 0, 0, 186, 187, 188, 189, 0,
4373 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4374 190, 191, 0, 0, 0, 0, 0, 0, 0, 0,
4375 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4376 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4377 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
4378 0, 202, 203, 0, 0, 0, 0, 0, 204, 425,
4379 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
4380 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
4381 151, 152, 153, 154, 0, 0, 0, 155, 156, 157,
4382 158, 159, 160, 161, 162, 163, 164, 0, 0, 0,
4383 0, 0, 165, 166, 167, 168, 169, 170, 171, 172,
4384 173, 37, 38, 174, 40, 0, 0, 0, 0, 0,
4385 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4386 0, 0, 0, 175, 176, 177, 178, 179, 180, 181,
4387 182, 183, 0, 0, 184, 185, 0, 0, 0, 0,
4388 186, 187, 188, 189, 0, 0, 0, 0, 0, 0,
4389 0, 0, 0, 0, 0, 190, 191, 0, 0, 0,
4390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4391 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4392 0, 0, 0, 0, 0, 192, 193, 194, 195, 196,
4393 197, 198, 199, 200, 201, 0, 202, 203, 0, 0,
4394 0, 0, 0, 204, 131, 132, 133, 134, 135, 136,
4395 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
4396 147, 148, 149, 150, 151, 152, 153, 154, 0, 0,
4397 0, 155, 156, 157, 158, 159, 160, 161, 162, 163,
4398 164, 0, 0, 0, 0, 0, 165, 166, 167, 168,
4399 169, 170, 171, 172, 173, 248, 0, 174, 0, 0,
4400 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4401 0, 0, 0, 0, 0, 0, 0, 175, 176, 177,
4402 178, 179, 180, 181, 182, 183, 0, 0, 184, 185,
4403 0, 0, 0, 0, 186, 187, 188, 189, 0, 0,
4404 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4405 191, 0, 0, 59, 0, 0, 0, 0, 0, 0,
4406 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4407 0, 0, 0, 0, 0, 0, 0, 0, 0, 192,
4408 193, 194, 195, 196, 197, 198, 199, 200, 201, 0,
4409 202, 203, 0, 0, 0, 0, 0, 204, 131, 132,
4410 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
4411 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
4412 153, 154, 0, 0, 0, 155, 156, 157, 158, 159,
4413 160, 161, 162, 163, 164, 0, 0, 0, 0, 0,
4414 165, 166, 167, 168, 169, 170, 171, 172, 173, 0,
4415 0, 174, 0, 0, 0, 0, 0, 0, 0, 0,
4416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4417 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
4418 0, 0, 184, 185, 0, 0, 0, 0, 186, 187,
4419 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4420 0, 0, 0, 190, 191, 0, 0, 59, 0, 0,
4421 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4422 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4423 0, 0, 0, 192, 193, 194, 195, 196, 197, 198,
4424 199, 200, 201, 0, 202, 203, 0, 0, 0, 0,
4425 0, 204, 131, 132, 133, 134, 135, 136, 137, 138,
4426 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
4427 149, 150, 151, 152, 153, 154, 0, 0, 0, 155,
4428 156, 157, 158, 159, 160, 161, 162, 163, 164, 0,
4429 0, 0, 0, 0, 165, 166, 167, 168, 169, 170,
4430 171, 172, 173, 0, 0, 174, 0, 0, 0, 0,
4431 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4432 0, 0, 0, 0, 0, 175, 176, 177, 178, 179,
4433 180, 181, 182, 183, 0, 0, 184, 185, 0, 0,
4434 0, 0, 186, 187, 188, 189, 0, 0, 0, 0,
4435 0, 0, 0, 0, 0, 0, 0, 190, 191, 0,
4436 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4437 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4438 0, 0, 0, 0, 0, 0, 0, 192, 193, 194,
4439 195, 196, 197, 198, 199, 200, 201, 0, 202, 203,
4440 5, 6, 7, 0, 9, 204, 0, 0, 10, 11,
4441 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4442 18, 19, 0, 0, 0, 0, 0, 20, 21, 258,
4443 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4444 0, 0, 0, 286, 0, 0, 32, 33, 34, 35,
4445 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4446 45, 46, 47, 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, 0, 0, 0, 0,
4449 0, 0, 0, 0, 0, 0, 287, 0, 0, 217,
4450 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4451 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4453 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
4454 7, 0, 9, 0, 0, 288, 10, 11, 0, 0,
4455 0, 12, 289, 13, 14, 15, 256, 257, 18, 19,
4456 0, 0, 0, 0, 0, 20, 21, 258, 23, 24,
4457 25, 26, 0, 0, 214, 0, 0, 0, 0, 0,
4458 0, 286, 0, 0, 32, 33, 34, 35, 36, 37,
4459 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4460 47, 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, 0, 0, 0, 0, 0, 0,
4463 0, 0, 0, 0, 287, 0, 0, 217, 54, 0,
4464 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
4465 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
4466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4467 0, 0, 0, 0, 4, 0, 5, 6, 7, 8,
4468 9, 0, 0, 288, 10, 11, 0, 0, 0, 12,
4469 587, 13, 14, 15, 16, 17, 18, 19, 0, 0,
4470 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
4471 0, 0, 27, 0, 0, 0, 0, 0, 28, 29,
4472 0, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4473 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4474 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4475 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4476 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
4477 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
4478 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
4479 64, 65, 66, 0, 0, 387, 0, 5, 6, 7,
4480 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4481 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
4482 0, 67, 68, 69, 20, 21, 22, 23, 24, 25,
4483 26, 0, 0, 27, 0, 0, 0, 0, 0, 0,
4484 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4485 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4486 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4487 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4488 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4489 0, 0, 0, 216, 0, 0, 217, 54, 0, 55,
4490 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
4491 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4492 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4493 0, 12, 0, 13, 14, 15, 16, 17, 18, 19,
4494 0, 0, 67, 68, 69, 20, 21, 22, 23, 24,
4495 25, 26, 0, 0, 214, 0, 0, 0, 0, 0,
4496 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4497 38, 39, 40, 215, 41, 42, 43, 44, 45, 46,
4498 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4499 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4500 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
4501 0, 0, 0, 0, 216, 0, 0, 217, 54, 0,
4502 55, 56, 0, 218, 219, 220, 58, 59, 221, 61,
4503 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4504 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4505 0, 0, 12, 0, 13, 14, 15, 16, 17, 18,
4506 19, 0, 0, 67, 222, 69, 20, 21, 22, 23,
4507 24, 25, 26, 0, 0, 214, 0, 0, 0, 0,
4508 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4509 37, 38, 39, 40, 215, 41, 42, 43, 44, 45,
4510 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4511 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4512 0, 0, 0, 0, 0, 0, 0, 50, 461, 0,
4513 0, 0, 0, 0, 0, 216, 0, 0, 217, 54,
4514 0, 55, 56, 0, 218, 219, 220, 58, 59, 221,
4515 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4516 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4517 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4518 18, 19, 0, 0, 67, 222, 69, 20, 21, 258,
4519 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4520 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4521 36, 37, 38, 39, 40, 215, 41, 42, 43, 44,
4522 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4523 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4524 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4525 0, 0, 0, 0, 0, 0, 216, 0, 0, 217,
4526 54, 0, 55, 56, 0, 218, 219, 220, 58, 59,
4527 221, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4528 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4529 11, 0, 0, 0, 12, 0, 13, 14, 15, 256,
4530 257, 18, 19, 0, 0, 67, 222, 69, 20, 21,
4531 258, 23, 24, 25, 26, 0, 0, 214, 0, 0,
4532 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
4533 35, 36, 37, 38, 39, 40, 215, 41, 42, 43,
4534 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4535 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4536 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4537 461, 0, 0, 0, 0, 0, 0, 216, 0, 0,
4538 217, 54, 0, 55, 56, 0, 218, 219, 220, 58,
4539 59, 221, 61, 62, 63, 64, 65, 66, 0, 0,
4540 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4541 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4542 256, 257, 18, 19, 0, 0, 67, 222, 69, 20,
4543 21, 258, 23, 24, 25, 26, 0, 0, 214, 0,
4544 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
4545 34, 35, 36, 37, 38, 39, 40, 215, 41, 42,
4546 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4547 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4549 50, 51, 0, 0, 0, 0, 0, 0, 216, 0,
4550 0, 217, 54, 0, 55, 56, 0, 218, 219, 0,
4551 58, 59, 221, 61, 62, 63, 64, 65, 66, 0,
4552 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4553 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4554 15, 256, 257, 18, 19, 0, 0, 67, 222, 69,
4555 20, 21, 258, 23, 24, 25, 26, 0, 0, 214,
4556 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4557 33, 34, 35, 36, 37, 38, 39, 40, 215, 41,
4558 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4559 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4560 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4561 0, 50, 51, 0, 0, 0, 0, 0, 0, 216,
4562 0, 0, 217, 54, 0, 55, 56, 0, 0, 219,
4563 220, 58, 59, 221, 61, 62, 63, 64, 65, 66,
4564 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4565 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4566 14, 15, 256, 257, 18, 19, 0, 0, 67, 222,
4567 69, 20, 21, 258, 23, 24, 25, 26, 0, 0,
4568 214, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4569 32, 33, 34, 35, 36, 37, 38, 39, 40, 215,
4570 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4571 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4573 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4574 216, 0, 0, 217, 54, 0, 55, 56, 0, 0,
4575 219, 0, 58, 59, 221, 61, 62, 63, 64, 65,
4576 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4577 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4578 13, 14, 15, 16, 17, 18, 19, 0, 0, 67,
4579 222, 69, 20, 21, 22, 23, 24, 25, 26, 0,
4580 0, 214, 0, 0, 0, 0, 0, 0, 29, 0,
4581 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4582 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4583 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4584 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4585 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4586 0, 216, 0, 0, 217, 54, 0, 55, 56, 0,
4587 773, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4588 65, 66, 0, 0, 0, 0, 5, 6, 7, 0,
4589 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4590 0, 13, 14, 15, 256, 257, 18, 19, 0, 0,
4591 67, 222, 69, 20, 21, 258, 23, 24, 25, 26,
4592 0, 0, 214, 0, 0, 0, 0, 0, 0, 29,
4593 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4594 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4595 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4596 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4597 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
4598 0, 0, 216, 0, 0, 217, 54, 0, 55, 56,
4599 0, 942, 0, 0, 58, 59, 60, 61, 62, 63,
4600 64, 65, 66, 0, 0, 0, 0, 5, 6, 7,
4601 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4602 12, 0, 13, 14, 15, 256, 257, 18, 19, 0,
4603 0, 67, 222, 69, 20, 21, 258, 23, 24, 25,
4604 26, 0, 0, 214, 0, 0, 0, 0, 0, 0,
4605 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4606 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4607 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4608 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4609 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4610 0, 0, 0, 216, 0, 0, 217, 54, 0, 55,
4611 56, 0, 990, 0, 0, 58, 59, 60, 61, 62,
4612 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4613 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4614 0, 12, 0, 13, 14, 15, 256, 257, 18, 19,
4615 0, 0, 67, 222, 69, 20, 21, 258, 23, 24,
4616 25, 26, 0, 0, 214, 0, 0, 0, 0, 0,
4617 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4618 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4619 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4620 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4621 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
4622 0, 0, 0, 0, 216, 0, 0, 217, 54, 0,
4623 55, 56, 0, 773, 0, 0, 58, 59, 60, 61,
4624 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4625 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4626 0, 0, 12, 0, 13, 14, 15, 256, 257, 18,
4627 19, 0, 0, 67, 222, 69, 20, 21, 258, 23,
4628 24, 25, 26, 0, 0, 214, 0, 0, 0, 0,
4629 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4630 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4631 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4632 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4633 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4634 0, 0, 0, 0, 0, 216, 0, 0, 217, 54,
4635 0, 55, 56, 0, 1112, 0, 0, 58, 59, 60,
4636 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4637 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4638 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4639 18, 19, 0, 0, 67, 222, 69, 20, 21, 258,
4640 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4641 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4642 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4643 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4644 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4645 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4646 0, 0, 0, 0, 0, 0, 216, 0, 0, 217,
4647 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4648 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4649 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4650 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
4651 17, 18, 19, 0, 0, 67, 222, 69, 20, 21,
4652 22, 23, 24, 25, 26, 0, 0, 214, 0, 0,
4653 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
4654 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4655 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4656 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4657 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4658 51, 0, 0, 0, 0, 0, 0, 216, 0, 0,
4659 217, 54, 0, 55, 56, 0, 0, 0, 0, 58,
4660 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4661 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4662 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4663 16, 17, 18, 19, 0, 0, 67, 222, 69, 20,
4664 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
4665 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
4666 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
4667 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4668 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4669 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4670 50, 51, 0, 0, 0, 0, 0, 0, 216, 0,
4671 0, 217, 54, 0, 55, 56, 0, 0, 0, 0,
4672 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
4673 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4674 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4675 15, 16, 17, 18, 19, 0, 0, 67, 68, 69,
4676 20, 21, 22, 23, 24, 25, 26, 0, 0, 755,
4677 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4678 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4679 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4680 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4681 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4682 0, 50, 51, 0, 0, 0, 0, 0, 0, 216,
4683 0, 0, 217, 54, 0, 55, 56, 0, 0, 0,
4684 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4685 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4686 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4687 14, 15, 256, 257, 18, 19, 0, 0, 67, 222,
4688 69, 20, 21, 258, 23, 24, 25, 26, 0, 0,
4689 851, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4690 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4691 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4692 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4693 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4694 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4695 216, 0, 0, 217, 54, 0, 55, 56, 0, 0,
4696 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4697 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4698 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4699 13, 14, 15, 256, 257, 18, 19, 0, 0, 67,
4700 222, 69, 20, 21, 258, 23, 24, 25, 26, 0,
4701 0, 214, 0, 0, 0, 0, 0, 0, 286, 0,
4702 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4703 0, 41, 42, 43, 44, 45, 46, 47, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4707 0, 287, 0, 0, 347, 54, 0, 55, 56, 0,
4708 348, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4709 65, 66, 0, 0, 5, 6, 7, 0, 9, 0,
4710 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4711 14, 15, 256, 257, 18, 19, 0, 0, 0, 0,
4712 288, 20, 21, 258, 23, 24, 25, 26, 0, 0,
4713 214, 0, 0, 0, 0, 0, 0, 286, 0, 0,
4714 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4715 41, 42, 43, 44, 45, 46, 47, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4719 397, 0, 0, 53, 54, 0, 55, 56, 0, 57,
4720 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4721 66, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4722 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4723 15, 256, 257, 18, 19, 0, 0, 0, 0, 288,
4724 20, 21, 258, 23, 24, 25, 26, 0, 0, 214,
4725 0, 0, 0, 0, 0, 0, 286, 0, 0, 32,
4726 33, 34, 405, 36, 37, 38, 406, 40, 0, 41,
4727 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4728 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4729 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4730 0, 0, 0, 0, 0, 407, 0, 0, 0, 408,
4731 0, 0, 217, 54, 0, 55, 56, 0, 0, 0,
4732 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4733 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4734 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4735 256, 257, 18, 19, 0, 0, 0, 0, 288, 20,
4736 21, 258, 23, 24, 25, 26, 0, 0, 214, 0,
4737 0, 0, 0, 0, 0, 286, 0, 0, 32, 33,
4738 34, 405, 36, 37, 38, 406, 40, 0, 41, 42,
4739 43, 44, 45, 46, 47, 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, 0, 0,
4742 0, 0, 0, 0, 0, 0, 0, 0, 408, 0,
4743 0, 217, 54, 0, 55, 56, 0, 0, 0, 0,
4744 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
4745 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4746 11, 0, 0, 0, 12, 0, 13, 14, 15, 256,
4747 257, 18, 19, 0, 0, 0, 0, 288, 20, 21,
4748 258, 23, 24, 25, 26, 0, 0, 214, 0, 0,
4749 0, 0, 0, 0, 286, 0, 0, 32, 33, 34,
4750 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4751 44, 45, 46, 47, 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, 0, 0, 0,
4754 0, 0, 0, 0, 0, 0, 0, 287, 0, 0,
4755 347, 54, 0, 55, 56, 0, 0, 0, 0, 58,
4756 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4757 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4758 0, 0, 0, 12, 0, 13, 14, 15, 256, 257,
4759 18, 19, 0, 0, 0, 0, 288, 20, 21, 258,
4760 23, 24, 25, 26, 0, 0, 214, 0, 0, 0,
4761 0, 0, 0, 286, 0, 0, 32, 33, 34, 35,
4762 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4763 45, 46, 47, 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, 0, 0, 0, 0,
4766 0, 0, 0, 0, 0, 0, 1179, 0, 0, 217,
4767 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4768 60, 61, 62, 63, 64, 65, 66, 0, 0, 5,
4769 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4770 0, 0, 12, 0, 13, 14, 15, 256, 257, 18,
4771 19, 0, 0, 0, 0, 288, 20, 21, 258, 23,
4772 24, 25, 26, 0, 0, 214, 0, 0, 0, 0,
4773 0, 0, 286, 0, 0, 32, 33, 34, 35, 36,
4774 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4775 46, 47, 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, 0, 0, 0, 0, 0,
4778 0, 0, 0, 0, 0, 1207, 0, 0, 217, 54,
4779 0, 55, 56, 23, 24, 25, 26, 58, 59, 60,
4780 61, 62, 63, 64, 65, 66, 0, 0, 0, 32,
4781 33, 34, 1055, 0, 0, 0, 1056, 0, 0, 41,
4782 42, 43, 44, 45, 0, 0, 0, 0, 0, 0,
4783 0, 0, 0, 0, 288, 0, 0, 0, 0, 0,
4784 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4785 0, 1058, 1059, 0, 0, 0, 680, 618, 0, 1060,
4786 681, 0, 1061, 0, 0, 1062, 1063, 0, 1064, 0,
4787 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4788 175, 176, 177, 178, 179, 180, 181, 182, 183, 0,
4789 0, 184, 185, 0, 0, 0, 0, 186, 187, 188,
4790 189, 1066, 0, 0, 0, 0, 0, 0, 288, 0,
4791 0, 0, 190, 191, 0, 0, 0, 0, 0, 0,
4792 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4793 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4794 0, 0, 192, 193, 194, 195, 196, 197, 198, 199,
4795 200, 201, 0, 202, 203, 683, 628, 0, 0, 684,
4796 204, 241, 0, 0, 0, 0, 0, 0, 0, 0,
4797 0, 0, 0, 0, 0, 0, 0, 0, 0, 175,
4798 176, 177, 178, 179, 180, 181, 182, 183, 0, 0,
4799 184, 185, 0, 0, 0, 0, 186, 187, 188, 189,
4800 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4801 0, 190, 191, 0, 0, 0, 0, 0, 0, 0,
4802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4804 0, 192, 193, 194, 195, 196, 197, 198, 199, 200,
4805 201, 0, 202, 203, 680, 618, 0, 0, 698, 204,
4806 241, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4807 0, 0, 0, 0, 0, 0, 0, 0, 175, 176,
4808 177, 178, 179, 180, 181, 182, 183, 0, 0, 184,
4809 185, 0, 0, 0, 0, 186, 187, 188, 189, 0,
4810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4811 190, 191, 0, 0, 0, 0, 0, 0, 0, 0,
4812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4813 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4814 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
4815 0, 202, 203, 709, 618, 0, 0, 710, 204, 241,
4816 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4817 0, 0, 0, 0, 0, 0, 0, 175, 176, 177,
4818 178, 179, 180, 181, 182, 183, 0, 0, 184, 185,
4819 0, 0, 0, 0, 186, 187, 188, 189, 0, 0,
4820 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4821 191, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4822 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4823 0, 0, 0, 0, 0, 0, 0, 0, 0, 192,
4824 193, 194, 195, 196, 197, 198, 199, 200, 201, 0,
4825 202, 203, 712, 628, 0, 0, 713, 204, 241, 0,
4826 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4827 0, 0, 0, 0, 0, 0, 175, 176, 177, 178,
4828 179, 180, 181, 182, 183, 0, 0, 184, 185, 0,
4829 0, 0, 0, 186, 187, 188, 189, 0, 0, 0,
4830 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4832 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4833 0, 0, 0, 0, 0, 0, 0, 0, 192, 193,
4834 194, 195, 196, 197, 198, 199, 200, 201, 0, 202,
4835 203, 825, 618, 0, 0, 826, 204, 241, 0, 0,
4836 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4837 0, 0, 0, 0, 0, 175, 176, 177, 178, 179,
4838 180, 181, 182, 183, 0, 0, 184, 185, 0, 0,
4839 0, 0, 186, 187, 188, 189, 0, 0, 0, 0,
4840 0, 0, 0, 0, 0, 0, 0, 190, 191, 0,
4841 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4843 0, 0, 0, 0, 0, 0, 0, 192, 193, 194,
4844 195, 196, 197, 198, 199, 200, 201, 0, 202, 203,
4845 828, 628, 0, 0, 829, 204, 241, 0, 0, 0,
4846 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4847 0, 0, 0, 0, 175, 176, 177, 178, 179, 180,
4848 181, 182, 183, 0, 0, 184, 185, 0, 0, 0,
4849 0, 186, 187, 188, 189, 0, 0, 0, 0, 0,
4850 0, 0, 0, 0, 0, 0, 190, 191, 0, 0,
4851 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4852 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4853 0, 0, 0, 0, 0, 0, 192, 193, 194, 195,
4854 196, 197, 198, 199, 200, 201, 0, 202, 203, 834,
4855 618, 0, 0, 835, 204, 241, 0, 0, 0, 0,
4856 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4857 0, 0, 0, 175, 176, 177, 178, 179, 180, 181,
4858 182, 183, 0, 0, 184, 185, 0, 0, 0, 0,
4859 186, 187, 188, 189, 0, 0, 0, 0, 0, 0,
4860 0, 0, 0, 0, 0, 190, 191, 0, 0, 0,
4861 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4862 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4863 0, 0, 0, 0, 0, 192, 193, 194, 195, 196,
4864 197, 198, 199, 200, 201, 0, 202, 203, 665, 628,
4865 0, 0, 666, 204, 241, 0, 0, 0, 0, 0,
4866 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4867 0, 0, 175, 176, 177, 178, 179, 180, 181, 182,
4868 183, 0, 0, 184, 185, 0, 0, 0, 0, 186,
4869 187, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4870 0, 0, 0, 0, 190, 191, 0, 0, 0, 0,
4871 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4872 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4873 0, 0, 0, 0, 192, 193, 194, 195, 196, 197,
4874 198, 199, 200, 201, 0, 202, 203, 996, 618, 0,
4875 0, 997, 204, 241, 0, 0, 0, 0, 0, 0,
4876 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4877 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
4878 0, 0, 184, 185, 0, 0, 0, 0, 186, 187,
4879 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4880 0, 0, 0, 190, 191, 0, 0, 0, 0, 0,
4881 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4883 0, 0, 0, 192, 193, 194, 195, 196, 197, 198,
4884 199, 200, 201, 0, 202, 203, 999, 628, 0, 0,
4885 1000, 204, 241, 0, 0, 0, 0, 0, 0, 0,
4886 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4887 175, 176, 177, 178, 179, 180, 181, 182, 183, 0,
4888 0, 184, 185, 0, 0, 0, 0, 186, 187, 188,
4889 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4890 0, 0, 190, 191, 0, 0, 0, 0, 0, 0,
4891 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4892 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4893 0, 0, 192, 193, 194, 195, 196, 197, 198, 199,
4894 200, 201, 0, 202, 203, 1292, 618, 0, 0, 1293,
4895 204, 241, 0, 0, 0, 0, 0, 0, 0, 0,
4896 0, 0, 0, 0, 0, 0, 0, 0, 0, 175,
4897 176, 177, 178, 179, 180, 181, 182, 183, 0, 0,
4898 184, 185, 0, 0, 0, 0, 186, 187, 188, 189,
4899 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4900 0, 190, 191, 0, 0, 0, 0, 0, 0, 0,
4901 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4902 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4903 0, 192, 193, 194, 195, 196, 197, 198, 199, 200,
4904 201, 0, 202, 203, 1295, 628, 0, 0, 1296, 204,
4905 241, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4906 0, 0, 0, 0, 0, 0, 0, 0, 175, 176,
4907 177, 178, 179, 180, 181, 182, 183, 0, 0, 184,
4908 185, 0, 0, 0, 0, 186, 187, 188, 189, 0,
4909 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4910 190, 191, 0, 0, 0, 0, 0, 0, 0, 0,
4911 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4912 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4913 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
4914 0, 202, 203, 1309, 618, 0, 0, 1310, 204, 241,
4915 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4916 0, 0, 0, 0, 0, 0, 0, 175, 176, 177,
4917 178, 179, 180, 181, 182, 183, 0, 0, 184, 185,
4918 0, 0, 0, 0, 186, 187, 188, 189, 0, 0,
4919 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4920 191, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4921 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4922 0, 0, 0, 0, 0, 0, 0, 0, 0, 192,
4923 193, 194, 195, 196, 197, 198, 199, 200, 201, 0,
4924 202, 203, 665, 628, 0, 0, 666, 204, 241, 0,
4925 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4926 0, 0, 0, 0, 0, 0, 175, 176, 177, 178,
4927 179, 180, 181, 182, 183, 0, 0, 184, 185, 0,
4928 0, 0, 0, 186, 187, 188, 189, 0, 0, 0,
4929 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4930 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4931 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4932 0, 0, 0, 0, 0, 0, 0, 0, 192, 193,
4933 194, 195, 196, 197, 198, 199, 200, 201, 0, 202,
4934 203, 0, 0, 0, 0, 0, 204
4935};
4936
4937static const yytype_int16 yycheck[] =
4938{
4939 2, 92, 16, 17, 60, 22, 95, 59, 68, 98,
4940 8, 2, 384, 53, 54, 106, 408, 328, 28, 16,
4941 17, 332, 14, 15, 813, 107, 238, 390, 16, 17,
4942 28, 59, 563, 8, 574, 97, 745, 577, 383, 590,
4943 385, 328, 81, 742, 57, 332, 53, 332, 71, 86,
4944 451, 53, 54, 28, 241, 57, 304, 305, 55, 56,
4945 459, 59, 16, 17, 81, 104, 576, 55, 94, 95,
4946 451, 98, 98, 86, 102, 98, 576, 915, 459, 820,
4947 505, 73, 745, 455, 86, 67, 99, 100, 101, 103,
4948 435, 492, 64, 65, 66, 0, 495, 99, 100, 101,
4949 102, 57, 580, 280, 102, 2, 103, 284, 749, 454,
4950 605, 456, 878, 880, 71, 103, 25, 1002, 658, 78,
4951 37, 38, 13, 26, 1211, 742, 69, 29, 1152, 269,
4952 31, 793, 749, 66, 13, 507, 101, 482, 25, 66,
4953 78, 0, 233, 98, 1168, 1045, 110, 1001, 1002, 103,
4954 749, 1045, 25, 752, 97, 98, 53, 54, 55, 56,
4955 579, 25, 587, 508, 583, 221, 10, 153, 26, 100,
4956 261, 100, 135, 673, 668, 669, 162, 217, 142, 799,
4957 77, 78, 13, 66, 1152, 100, 1024, 807, 69, 122,
4958 123, 25, 34, 120, 157, 122, 123, 162, 1166, 154,
4959 25, 13, 157, 294, 135, 13, 135, 347, 100, 545,
4960 52, 154, 162, 13, 13, 217, 121, 98, 1305, 245,
4961 135, 247, 124, 1061, 68, 1063, 1111, 241, 161, 269,
4962 244, 13, 321, 322, 323, 324, 13, 120, 1132, 25,
4963 155, 258, 259, 135, 271, 162, 155, 244, 271, 152,
4964 252, 13, 289, 241, 466, 1279, 244, 1111, 25, 1283,
4965 1284, 252, 269, 655, 155, 224, 13, 269, 155, 160,
4966 1037, 162, 1038, 521, 646, 523, 289, 939, 157, 25,
4967 979, 160, 155, 162, 656, 223, 224, 289, 689, 25,
4968 244, 155, 691, 833, 152, 321, 322, 323, 324, 157,
4969 326, 327, 647, 392, 1204, 1329, 288, 347, 689, 400,
4970 691, 1211, 657, 1213, 271, 1169, 1284, 319, 407, 797,
4971 217, 155, 1176, 1177, 819, 1114, 223, 224, 319, 160,
4972 155, 162, 291, 974, 231, 348, 1174, 1175, 1001, 1002,
4973 347, 238, 1001, 1002, 241, 347, 348, 27, 160, 250,
4974 162, 391, 160, 393, 162, 252, 781, 974, 157, 890,
4975 160, 160, 162, 162, 1001, 1002, 392, 394, 385, 155,
4976 384, 394, 269, 1114, 152, 974, 927, 976, 160, 1196,
4977 162, 407, 981, 160, 386, 162, 896, 385, 155, 391,
4978 157, 393, 348, 729, 730, 155, 896, 66, 160, 135,
4979 162, 802, 162, 1062, 78, 1305, 1062, 1307, 948, 155,
4980 101, 157, 1312, 160, 1314, 162, 69, 431, 100, 155,
4981 1079, 802, 158, 917, 918, 101, 162, 1281, 1045, 923,
4982 924, 742, 15, 159, 431, 1335, 162, 435, 749, 456,
4983 69, 455, 25, 431, 345, 98, 1045, 69, 1111, 350,
4984 347, 120, 1111, 135, 451, 1176, 1177, 957, 456, 160,
4985 27, 162, 29, 100, 155, 482, 476, 679, 505, 98,
4986 718, 145, 146, 147, 1111, 723, 98, 431, 476, 155,
4987 160, 34, 162, 56, 482, 1302, 488, 384, 528, 386,
4988 1149, 508, 505, 507, 391, 492, 393, 161, 135, 52,
4989 1209, 476, 689, 505, 905, 1204, 1169, 1166, 28, 1049,
4990 508, 25, 100, 1176, 1177, 1009, 100, 1176, 1177, 58,
4991 1176, 1177, 37, 38, 155, 585, 528, 1126, 100, 706,
4992 590, 162, 534, 135, 1323, 69, 274, 438, 439, 78,
4993 912, 590, 878, 534, 880, 52, 1209, 135, 449, 56,
4994 587, 135, 575, 383, 865, 385, 457, 458, 455, 573,
4995 1281, 155, 576, 135, 98, 964, 911, 464, 913, 466,
4996 109, 110, 574, 157, 587, 577, 477, 25, 865, 135,
4997 865, 944, 483, 964, 623, 587, 648, 1204, 25, 113,
4998 1058, 1059, 100, 632, 1211, 100, 636, 585, 638, 1130,
4999 100, 155, 590, 142, 100, 435, 623, 1138, 668, 669,
5000 507, 100, 1211, 1312, 1213, 632, 584, 640, 1281, 668,
5001 669, 135, 155, 15, 454, 17, 456, 135, 667, 162,
5002 647, 528, 646, 659, 636, 135, 638, 56, 69, 135,
5003 657, 155, 656, 157, 158, 69, 135, 859, 162, 647,
5004 667, 481, 482, 157, 551, 966, 658, 1197, 1021, 657,
5005 670, 100, 69, 974, 716, 633, 563, 98, 1060, 695,
5006 707, 639, 670, 641, 98, 1045, 506, 574, 508, 966,
5007 577, 966, 699, 700, 157, 14, 15, 135, 1305, 162,
5008 97, 98, 689, 431, 707, 670, 135, 135, 135, 790,
5009 101, 1037, 1038, 1171, 1172, 707, 1305, 155, 1307, 78,
5010 158, 155, 279, 280, 162, 1314, 155, 284, 155, 286,
5011 78, 158, 714, 26, 462, 162, 69, 465, 69, 626,
5012 135, 469, 100, 634, 1045, 632, 1335, 95, 96, 636,
5013 1103, 638, 1273, 832, 781, 100, 718, 485, 720, 646,
5014 155, 723, 724, 66, 97, 98, 97, 98, 26, 656,
5015 842, 658, 69, 157, 66, 155, 69, 100, 781, 69,
5016 667, 89, 90, 157, 143, 144, 145, 146, 147, 781,
5017 135, 1173, 679, 157, 142, 143, 144, 145, 146, 147,
5018 830, 98, 760, 52, 97, 98, 764, 56, 98, 766,
5019 155, 69, 135, 700, 771, 802, 832, 120, 831, 122,
5020 123, 154, 840, 154, 157, 645, 554, 647, 120, 158,
5021 122, 123, 155, 125, 66, 655, 1189, 657, 830, 97,
5022 98, 833, 69, 26, 1204, 568, 69, 570, 69, 1209,
5023 78, 1211, 840, 1213, 933, 135, 736, 159, 586, 152,
5024 56, 154, 153, 821, 157, 745, 824, 917, 918, 157,
5025 97, 98, 69, 923, 924, 98, 97, 98, 917, 918,
5026 838, 40, 41, 155, 923, 924, 69, 54, 1250, 78,
5027 122, 123, 896, 125, 152, 161, 154, 64, 65, 157,
5028 97, 98, 932, 1204, 795, 796, 913, 158, 912, 69,
5029 1211, 162, 803, 804, 97, 98, 1251, 933, 100, 901,
5030 1166, 903, 69, 810, 811, 913, 813, 154, 66, 67,
5031 1176, 1177, 69, 154, 66, 663, 949, 97, 98, 969,
5032 932, 290, 291, 830, 994, 1305, 833, 1307, 152, 927,
5033 97, 98, 1312, 135, 1314, 994, 948, 154, 69, 1009,
5034 97, 98, 853, 854, 135, 856, 857, 69, 682, 152,
5035 1009, 154, 859, 155, 157, 1335, 934, 969, 66, 937,
5036 135, 135, 940, 107, 122, 123, 97, 98, 120, 947,
5037 122, 123, 950, 69, 154, 97, 98, 711, 1028, 155,
5038 992, 993, 160, 890, 1305, 733, 66, 154, 56, 1001,
5039 1002, 992, 993, 69, 25, 135, 1046, 154, 909, 1065,
5040 139, 97, 98, 135, 1066, 912, 58, 69, 155, 66,
5041 69, 922, 120, 155, 122, 123, 1028, 125, 153, 100,
5042 927, 97, 98, 154, 1279, 932, 78, 155, 1283, 606,
5043 83, 84, 154, 100, 1046, 97, 98, 1049, 97, 98,
5044 120, 948, 122, 123, 158, 158, 1058, 1059, 625, 960,
5045 1062, 155, 1030, 155, 135, 155, 1106, 109, 154, 1109,
5046 1110, 113, 969, 120, 1163, 122, 123, 1079, 135, 1119,
5047 135, 911, 155, 913, 155, 52, 155, 155, 154, 1102,
5048 1181, 988, 989, 52, 153, 138, 139, 13, 155, 155,
5049 1102, 839, 154, 827, 1106, 154, 25, 1109, 1110, 1111,
5050 155, 17, 153, 837, 44, 682, 155, 1119, 155, 1016,
5051 858, 1018, 860, 1136, 135, 153, 44, 2, 155, 155,
5052 52, 1028, 54, 55, 1136, 57, 44, 1163, 876, 706,
5053 44, 16, 17, 135, 711, 1185, 137, 1149, 8, 1046,
5054 1152, 159, 1049, 886, 887, 1045, 15, 155, 891, 155,
5055 893, 155, 895, 52, 1166, 1167, 1168, 1256, 1257, 1171,
5056 1172, 155, 155, 155, 1176, 1177, 1232, 153, 53, 54,
5057 102, 155, 57, 1185, 155, 140, 54, 55, 755, 57,
5058 1203, 155, 101, 68, 9, 1197, 64, 65, 78, 155,
5059 52, 1203, 52, 140, 54, 55, 56, 57, 155, 1106,
5060 155, 86, 1109, 1110, 158, 95, 96, 1114, 160, 94,
5061 95, 56, 1119, 98, 99, 100, 101, 140, 103, 155,
5062 1256, 1257, 155, 1130, 1251, 155, 1250, 897, 898, 153,
5063 52, 1138, 54, 55, 56, 57, 906, 2, 908, 52,
5064 910, 56, 102, 1251, 155, 155, 1157, 101, 108, 1299,
5065 827, 16, 17, 143, 144, 145, 146, 147, 153, 140,
5066 837, 1140, 1141, 56, 998, 157, 155, 1279, 155, 155,
5067 252, 1283, 1284, 155, 851, 668, 669, 157, 1185, 155,
5068 102, 1188, 155, 155, 1262, 319, 484, 1299, 53, 54,
5069 1197, 155, 685, 686, 155, 488, 1039, 1040, 1041, 1042,
5070 155, 840, 99, 68, 1204, 101, 90, 477, 701, 1209,
5071 667, 1211, 928, 1213, 1134, 1188, 52, 1329, 54, 55,
5072 56, 57, 52, 729, 54, 55, 56, 57, 1062, 94,
5073 95, 878, 217, 98, 59, 60, 61, 62, 103, 1045,
5074 989, 1302, 843, 1250, 343, 1252, 1253, 40, 41, 42,
5075 43, 44, 1323, 1167, 1169, 1253, 241, 1169, 1165, 244,
5076 245, 110, 247, 523, 1252, 102, 1273, 252, 745, 742,
5077 215, 1209, 1204, 218, 219, 220, 1318, -1, -1, -1,
5078 -1, -1, -1, -1, 269, -1, -1, -1, -1, 1268,
5079 1269, -1, 1299, -1, -1, 1274, -1, 1276, 1277, -1,
5080 -1, -1, -1, -1, 289, 1305, -1, 1307, -1, 1249,
5081 -1, 1251, 1312, -1, 1314, -1, 1323, 1151, -1, -1,
5082 1154, 998, -1, -1, -1, -1, -1, 1175, -1, -1,
5083 -1, 1271, -1, -1, 319, 1335, 321, 322, 323, 324,
5084 1174, 326, 327, -1, -1, -1, 1325, 1326, 1327, 1328,
5085 -1, -1, 217, -1, -1, -1, 1199, 1034, -1, -1,
5086 1339, -1, 347, 348, -1, -1, -1, 1215, 1045, -1,
5087 -1, -1, -1, -1, -1, -1, 241, 1225, -1, 244,
5088 245, -1, 247, -1, -1, 1062, 1063, 252, -1, -1,
5089 -1, -1, -1, -1, 1242, 1243, 1244, -1, -1, 384,
5090 -1, 386, -1, -1, 269, -1, 391, 392, 393, -1,
5091 -1, 1245, 1246, 1247, 52, -1, 54, 55, 56, 57,
5092 58, -1, 407, -1, 917, 918, 78, -1, -1, -1,
5093 923, 924, -1, -1, -1, -1, -1, -1, -1, -1,
5094 78, -1, -1, 95, 96, -1, 431, -1, -1, -1,
5095 -1, -1, -1, -1, 319, 1132, 321, 322, 323, 324,
5096 1294, 326, 327, -1, 102, 958, 959, -1, 961, 962,
5097 455, 109, 110, -1, 1151, -1, -1, 1154, -1, -1,
5098 -1, 52, 347, 54, 55, 56, 57, 58, 140, 141,
5099 142, 143, 144, 145, 146, 147, -1, 1174, -1, -1,
5100 -1, -1, -1, 488, 142, 450, 451, 78, -1, -1,
5101 -1, -1, -1, -1, 459, -1, 1009, -1, -1, 384,
5102 505, 386, 507, -1, -1, -1, 391, 392, 393, -1,
5103 -1, 102, -1, -1, -1, -1, -1, 108, 109, 110,
5104 1033, -1, 407, 528, -1, -1, -1, 492, -1, 534,
5105 495, -1, -1, -1, -1, -1, -1, 52, -1, 54,
5106 55, 56, 57, 58, -1, -1, 431, -1, 1245, 1246,
5107 1247, 142, -1, -1, 145, -1, -1, -1, -1, -1,
5108 -1, -1, 1259, 78, -1, -1, -1, -1, 573, 574,
5109 455, 576, 577, -1, -1, -1, -1, 92, -1, -1,
5110 585, -1, 587, -1, -1, 590, -1, 102, -1, 33,
5111 34, 35, 36, 108, 109, 110, 561, 1294, -1, -1,
5112 -1, -1, -1, 488, -1, 49, 50, 51, 52, -1,
5113 -1, -1, 56, -1, -1, 59, 60, 61, 62, 63,
5114 585, 1318, 507, -1, -1, 590, -1, 142, -1, -1,
5115 145, 636, -1, 638, -1, -1, -1, -1, -1, -1,
5116 -1, 646, 157, 528, -1, -1, -1, 91, 92, 534,
5117 -1, 656, -1, 658, 659, 99, -1, -1, 102, -1,
5118 -1, 105, 106, 668, 669, -1, -1, 111, 112, 113,
5119 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5120 -1, -1, -1, -1, -1, -1, -1, -1, 573, 574,
5121 695, 576, 577, -1, -1, -1, -1, 141, -1, -1,
5122 585, -1, 707, -1, 148, 590, 671, -1, -1, -1,
5123 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5124 -1, -1, 0, -1, 689, -1, 691, -1, -1, -1,
5125 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5126 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
5127 -1, 636, -1, 638, -1, 2, -1, -1, -1, 37,
5128 38, 646, 40, 41, 42, 43, 44, -1, -1, 16,
5129 17, 656, -1, 658, 659, 740, 781, -1, -1, -1,
5130 -1, -1, -1, 668, 669, -1, -1, -1, -1, -1,
5131 68, 69, -1, -1, -1, -1, 52, -1, 54, 55,
5132 56, 57, 58, -1, -1, -1, 53, 54, 773, -1,
5133 695, -1, -1, -1, -1, -1, -1, -1, -1, 97,
5134 98, 68, 78, -1, -1, 830, -1, 832, 833, -1,
5135 -1, -1, -1, -1, -1, -1, -1, 802, -1, 25,
5136 -1, -1, -1, 121, -1, -1, 102, 94, 95, -1,
5137 -1, 98, 108, 109, 110, -1, 103, -1, 823, -1,
5138 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5139 -1, -1, -1, -1, 152, 153, -1, -1, -1, 157,
5140 158, -1, 160, -1, 162, -1, 142, -1, -1, 145,
5141 -1, 896, 78, 79, 80, 81, 82, 83, 84, 85,
5142 86, 87, 88, 89, 90, -1, 162, 912, -1, 95,
5143 96, -1, 917, 918, -1, 101, -1, -1, 923, 924,
5144 -1, -1, -1, -1, -1, -1, -1, 932, 933, -1,
5145 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5146 905, -1, -1, 948, -1, 830, -1, 832, 833, -1,
5147 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5148 146, 147, 927, -1, 969, -1, -1, -1, -1, -1,
5149 217, -1, -1, -1, -1, -1, -1, 942, -1, -1,
5150 -1, -1, -1, -1, -1, -1, -1, 992, 993, 994,
5151 -1, -1, -1, -1, 241, -1, -1, 244, 245, 964,
5152 247, -1, -1, -1, 1009, 252, -1, -1, -1, -1,
5153 -1, 896, -1, -1, -1, -1, -1, -1, -1, -1,
5154 -1, -1, 269, 1028, -1, 990, -1, 912, -1, -1,
5155 -1, -1, 917, 918, -1, -1, -1, -1, 923, 924,
5156 -1, 1046, -1, -1, 1049, -1, -1, 932, 933, -1,
5157 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5158 -1, -1, 1027, 948, -1, -1, -1, -1, -1, -1,
5159 -1, -1, 319, -1, 321, 322, 323, 324, -1, 326,
5160 327, -1, -1, -1, 969, -1, -1, -1, -1, -1,
5161 -1, -1, 1001, 1002, -1, -1, -1, 1102, -1, -1,
5162 347, 1106, -1, -1, 1109, 1110, -1, 992, 993, 994,
5163 -1, -1, -1, -1, 1119, -1, 52, -1, 54, 55,
5164 56, 57, 58, -1, 1009, -1, -1, -1, -1, -1,
5165 -1, 1136, -1, -1, -1, -1, -1, 384, -1, 386,
5166 -1, -1, 78, 1028, 391, 392, 393, 1112, -1, 1058,
5167 1059, -1, -1, 1062, -1, -1, 92, -1, 1163, -1,
5168 407, 1046, -1, -1, 1049, -1, 102, -1, -1, -1,
5169 1079, -1, 108, 109, 110, -1, -1, -1, -1, -1,
5170 1185, -1, -1, -1, 431, -1, -1, -1, -1, -1,
5171 -1, -1, 1197, -1, -1, -1, -1, -1, 1203, -1,
5172 -1, -1, 1111, -1, -1, -1, 142, -1, 455, 145,
5173 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5174 -1, 1106, -1, -1, 1109, 1110, -1, -1, -1, -1,
5175 -1, -1, -1, -1, 1119, -1, -1, -1, -1, 2,
5176 1149, 488, -1, 1152, -1, 1250, -1, -1, -1, -1,
5177 -1, 1256, 1257, 16, 17, -1, -1, 1166, 1167, 1168,
5178 507, -1, 1171, 1172, -1, -1, -1, 1176, 1177, -1,
5179 -1, -1, -1, -1, -1, -1, -1, -1, 1163, -1,
5180 -1, 528, -1, -1, -1, -1, -1, 534, -1, -1,
5181 53, 54, -1, -1, 1299, -1, -1, -1, 1001, 1002,
5182 1185, -1, -1, -1, -1, 68, -1, -1, -1, -1,
5183 -1, -1, 1197, -1, -1, -1, -1, -1, -1, -1,
5184 -1, -1, -1, -1, -1, -1, 573, 574, -1, 576,
5185 577, 94, 95, -1, -1, 98, -1, -1, 585, -1,
5186 103, -1, -1, 590, -1, -1, -1, -1, -1, -1,
5187 -1, 33, 34, 35, 36, 1058, 1059, -1, -1, 1062,
5188 -1, -1, -1, -1, -1, 1250, -1, 49, 50, 51,
5189 1279, 1256, 1257, -1, 1283, 1284, 1079, 59, 60, 61,
5190 62, 63, -1, -1, -1, -1, -1, -1, 2, 636,
5191 -1, 638, -1, -1, -1, -1, -1, -1, -1, 646,
5192 -1, 52, -1, 54, 55, 56, 57, 58, 1111, 656,
5193 -1, 658, 659, -1, 1299, -1, -1, -1, -1, -1,
5194 1329, 668, 669, -1, -1, -1, -1, 78, -1, 111,
5195 112, 113, 114, 115, 116, 117, 118, 119, -1, 53,
5196 54, 92, -1, 57, -1, -1, 1149, -1, 695, 1152,
5197 -1, 102, -1, -1, 217, -1, -1, -1, 109, 110,
5198 -1, -1, -1, 1166, 1167, 1168, 148, -1, 1171, 1172,
5199 -1, -1, 86, 1176, 1177, -1, -1, -1, 241, -1,
5200 -1, 244, 245, -1, 247, 99, 100, 101, -1, 252,
5201 -1, 142, -1, -1, -1, 44, -1, -1, -1, -1,
5202 -1, -1, -1, -1, -1, -1, 269, -1, -1, -1,
5203 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5204 -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
5205 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
5206 89, 90, -1, -1, -1, -1, 95, 96, -1, -1,
5207 -1, -1, -1, -1, -1, -1, 319, -1, 321, 322,
5208 323, 324, -1, 326, 327, -1, -1, -1, -1, -1,
5209 -1, -1, -1, -1, -1, -1, 1279, -1, -1, -1,
5210 1283, 1284, -1, 830, 347, 832, 833, 136, -1, 138,
5211 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
5212 -1, -1, -1, 217, -1, -1, 155, -1, -1, -1,
5213 -1, 2, -1, -1, -1, -1, -1, -1, -1, -1,
5214 -1, 384, -1, 386, -1, -1, 1329, -1, 391, 392,
5215 393, -1, -1, -1, -1, -1, -1, -1, 252, -1,
5216 -1, -1, -1, -1, 407, -1, -1, -1, -1, 896,
5217 -1, -1, -1, -1, -1, 269, -1, -1, 1001, 1002,
5218 -1, -1, 53, 54, -1, 912, 57, -1, 431, -1,
5219 917, 918, -1, -1, -1, 289, 923, 924, -1, -1,
5220 -1, -1, -1, -1, -1, 932, 933, -1, -1, -1,
5221 -1, -1, 455, -1, -1, 86, -1, -1, -1, -1,
5222 -1, 948, -1, -1, -1, 319, -1, -1, 99, 100,
5223 101, -1, -1, -1, -1, 1058, 1059, -1, -1, 1062,
5224 -1, -1, 969, -1, -1, 488, -1, -1, -1, -1,
5225 -1, -1, -1, 347, 348, -1, 1079, 1001, 1002, -1,
5226 -1, -1, -1, -1, 507, 992, 993, 994, -1, -1,
5227 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5228 -1, -1, 1009, -1, -1, 528, -1, -1, 1111, -1,
5229 -1, 534, 386, -1, -1, -1, -1, 391, -1, 393,
5230 -1, 1028, -1, -1, -1, -1, -1, -1, -1, -1,
5231 -1, -1, -1, -1, 1058, 1059, -1, -1, 1062, 1046,
5232 -1, -1, 1049, -1, -1, -1, 1149, -1, -1, 1152,
5233 573, 574, -1, 576, 577, 1079, -1, -1, -1, -1,
5234 -1, -1, 585, 1166, 1167, 1168, 217, 590, 1171, 1172,
5235 -1, -1, -1, 1176, 1177, -1, -1, -1, -1, -1,
5236 -1, -1, -1, -1, -1, -1, -1, 1111, -1, -1,
5237 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1106,
5238 -1, 252, 1109, 1110, -1, -1, -1, -1, -1, -1,
5239 -1, -1, 1119, 636, 488, 638, -1, -1, 269, -1,
5240 -1, -1, -1, 646, -1, 1149, -1, -1, 1152, -1,
5241 -1, 505, -1, 656, -1, 658, 659, -1, 289, -1,
5242 -1, -1, 1166, 1167, 1168, 668, 669, 1171, 1172, -1,
5243 -1, -1, 1176, 1177, 528, -1, 1163, -1, -1, -1,
5244 534, -1, -1, -1, -1, -1, -1, -1, 319, -1,
5245 -1, -1, 695, -1, -1, -1, 1279, -1, 1185, -1,
5246 1283, 1284, -1, -1, -1, -1, -1, -1, -1, -1,
5247 1197, -1, -1, -1, -1, -1, 347, 348, -1, -1,
5248 574, -1, -1, 577, -1, -1, -1, -1, -1, -1,
5249 -1, -1, -1, 587, 2, -1, 590, -1, -1, -1,
5250 -1, -1, -1, -1, -1, -1, 1329, -1, -1, -1,
5251 -1, -1, -1, -1, -1, 386, -1, -1, -1, -1,
5252 391, -1, 393, 1250, -1, -1, -1, -1, -1, 1256,
5253 1257, -1, -1, -1, -1, 1279, -1, -1, -1, 1283,
5254 1284, -1, 636, -1, 638, 53, 54, -1, -1, 57,
5255 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5256 -1, -1, -1, -1, 658, -1, -1, -1, -1, -1,
5257 -1, -1, 1299, -1, 668, 669, -1, -1, 86, -1,
5258 -1, -1, -1, -1, -1, 1329, -1, 830, -1, 832,
5259 833, 99, 100, 101, 2, -1, -1, -1, -1, -1,
5260 -1, -1, -1, -1, 1001, 1002, -1, -1, -1, -1,
5261 -1, -1, -1, 707, -1, -1, -1, 488, -1, -1,
5262 -1, -1, 716, -1, -1, -1, -1, -1, -1, -1,
5263 -1, -1, -1, -1, 505, -1, -1, -1, -1, -1,
5264 -1, -1, -1, -1, -1, 53, 54, -1, -1, 57,
5265 -1, -1, -1, 896, -1, -1, -1, 528, -1, -1,
5266 -1, 1058, 1059, 534, -1, 1062, -1, -1, -1, 912,
5267 -1, -1, -1, -1, 917, 918, -1, -1, 86, -1,
5268 923, 924, 1079, -1, -1, -1, -1, 781, -1, 932,
5269 933, 99, 100, 101, 102, -1, -1, -1, -1, -1,
5270 -1, -1, -1, 574, -1, 948, 577, -1, -1, 217,
5271 -1, -1, -1, -1, 1111, -1, 587, -1, -1, 590,
5272 -1, -1, -1, -1, -1, -1, 969, -1, -1, -1,
5273 -1, -1, -1, -1, -1, -1, 830, -1, -1, 833,
5274 -1, -1, -1, -1, 252, -1, -1, -1, -1, 992,
5275 993, 994, 1149, -1, -1, 1152, -1, -1, -1, -1,
5276 -1, 269, -1, -1, -1, 636, 1009, 638, -1, 1166,
5277 1167, 1168, -1, -1, 1171, 1172, -1, -1, -1, 1176,
5278 1177, 289, -1, -1, -1, 1028, -1, 658, -1, -1,
5279 -1, -1, -1, -1, -1, -1, -1, 668, 669, -1,
5280 -1, -1, -1, 1046, -1, -1, 1049, -1, -1, 217,
5281 -1, 319, -1, -1, -1, -1, -1, -1, -1, -1,
5282 -1, -1, -1, 917, 918, -1, -1, -1, -1, 923,
5283 924, -1, -1, -1, -1, -1, 707, -1, 932, 347,
5284 348, -1, -1, -1, 252, -1, -1, -1, -1, -1,
5285 -1, -1, -1, -1, 948, -1, -1, -1, -1, -1,
5286 -1, 269, -1, 1106, -1, -1, 1109, 1110, -1, -1,
5287 -1, -1, -1, -1, -1, 969, 1119, -1, 386, -1,
5288 -1, 289, 1279, 391, -1, 393, 1283, 1284, -1, -1,
5289 -1, -1, -1, -1, -1, -1, -1, -1, 992, 993,
5290 994, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5291 781, 319, -1, -1, -1, 1009, -1, -1, -1, -1,
5292 1163, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5293 -1, -1, 1329, -1, 1028, -1, -1, -1, -1, 347,
5294 348, -1, 1185, -1, -1, -1, -1, 2, -1, -1,
5295 -1, -1, 1046, -1, 1197, 1049, -1, -1, -1, 830,
5296 -1, -1, 833, -1, -1, -1, -1, -1, -1, -1,
5297 -1, -1, -1, -1, -1, -1, 1001, 1002, 386, -1,
5298 488, -1, -1, 391, -1, 393, -1, -1, -1, -1,
5299 -1, -1, -1, -1, -1, -1, -1, 505, 53, 54,
5300 -1, -1, -1, -1, -1, -1, -1, 1250, 1102, -1,
5301 -1, -1, 1106, 1256, 1257, 1109, 1110, -1, -1, -1,
5302 528, -1, -1, -1, -1, 1119, 534, -1, -1, -1,
5303 -1, -1, -1, 1058, 1059, -1, -1, 1062, -1, -1,
5304 -1, -1, 1136, -1, 99, -1, 917, 918, -1, -1,
5305 -1, -1, 923, 924, 1079, -1, 1299, -1, -1, -1,
5306 -1, 932, -1, -1, -1, -1, 574, -1, -1, 577,
5307 -1, -1, -1, -1, -1, -1, -1, 948, -1, 587,
5308 488, -1, 590, -1, -1, -1, 1111, -1, -1, -1,
5309 -1, 1185, -1, -1, -1, -1, -1, 505, 969, -1,
5310 -1, -1, -1, 1197, -1, -1, -1, -1, -1, 1203,
5311 -1, -1, -1, -1, -1, 1001, 1002, -1, -1, -1,
5312 528, 992, 993, 994, 1149, -1, 534, 1152, 636, -1,
5313 638, -1, -1, -1, -1, -1, -1, -1, 1009, -1,
5314 -1, 1166, 1167, 1168, -1, -1, 1171, 1172, -1, -1,
5315 658, 1176, 1177, -1, -1, -1, -1, 1028, -1, -1,
5316 668, 669, 217, -1, 2, -1, 574, -1, -1, 577,
5317 -1, -1, 1058, 1059, -1, 1046, 1062, -1, 1049, 587,
5318 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5319 -1, -1, -1, 1079, -1, -1, -1, 252, -1, 707,
5320 -1, -1, -1, -1, -1, 1299, -1, -1, -1, -1,
5321 -1, 1001, 1002, -1, 269, 53, 54, -1, -1, -1,
5322 -1, -1, -1, -1, -1, 1111, -1, -1, 636, -1,
5323 638, 1102, -1, -1, -1, 1106, -1, -1, 1109, 1110,
5324 -1, -1, -1, -1, -1, -1, -1, -1, 1119, -1,
5325 658, -1, -1, -1, 1279, -1, -1, -1, 1283, 1284,
5326 -1, -1, -1, 1149, 319, 1136, 1152, -1, 1058, 1059,
5327 -1, -1, 1062, 781, -1, -1, -1, -1, -1, -1,
5328 1166, 1167, 1168, -1, -1, 1171, 1172, -1, -1, 1079,
5329 1176, 1177, 347, 1001, 1002, -1, -1, -1, -1, 707,
5330 -1, -1, -1, -1, 1329, -1, -1, -1, -1, -1,
5331 -1, -1, -1, -1, 1185, -1, -1, -1, -1, -1,
5332 -1, 1111, 830, -1, -1, 833, 1197, -1, -1, -1,
5333 -1, 386, 1203, -1, -1, -1, 391, -1, 393, -1,
5334 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5335 1058, 1059, -1, -1, 1062, -1, -1, -1, -1, 1149,
5336 -1, -1, 1152, -1, -1, -1, -1, -1, -1, -1,
5337 -1, 1079, -1, 781, -1, -1, 1166, 1167, 1168, 217,
5338 -1, 1171, 1172, -1, -1, -1, 1176, 1177, -1, -1,
5339 -1, -1, -1, 1279, -1, -1, -1, 1283, 1284, -1,
5340 -1, -1, -1, 1111, -1, -1, -1, -1, -1, 917,
5341 918, -1, -1, -1, 252, 923, 924, -1, -1, -1,
5342 -1, -1, 830, -1, 932, 833, -1, -1, 1299, -1,
5343 -1, 269, -1, 488, -1, -1, -1, -1, -1, -1,
5344 948, 1149, -1, 1329, 1152, -1, -1, -1, -1, -1,
5345 -1, -1, -1, -1, -1, -1, -1, -1, 1166, 1167,
5346 1168, 969, -1, 1171, 1172, -1, -1, -1, 1176, 1177,
5347 -1, -1, -1, 528, -1, -1, -1, -1, -1, 534,
5348 -1, 319, -1, -1, 992, 993, 994, -1, -1, 1279,
5349 -1, -1, -1, 1283, 1284, -1, -1, -1, -1, -1,
5350 -1, 1009, -1, -1, -1, -1, -1, -1, -1, 347,
5351 -1, -1, -1, -1, -1, -1, -1, -1, -1, 574,
5352 1028, -1, 577, -1, 932, -1, -1, -1, -1, -1,
5353 -1, -1, -1, -1, -1, 590, -1, -1, 1046, 1329,
5354 948, 1049, -1, -1, -1, -1, -1, -1, 386, -1,
5355 -1, -1, -1, 391, -1, 393, -1, -1, -1, -1,
5356 -1, 969, -1, -1, -1, -1, -1, -1, -1, -1,
5357 -1, 1279, -1, -1, -1, 1283, 1284, -1, -1, -1,
5358 -1, 636, -1, 638, 992, 993, -1, -1, -1, 33,
5359 34, 35, 36, -1, 1102, -1, -1, -1, 1106, -1,
5360 -1, 1109, 1110, 658, -1, 49, 50, 51, 52, -1,
5361 -1, 1119, 56, 668, 669, 59, 60, 61, 62, 63,
5362 1028, 1329, -1, -1, -1, -1, -1, -1, 1136, -1,
5363 -1, -1, -1, -1, -1, -1, -1, -1, 1046, -1,
5364 -1, 1049, -1, -1, -1, -1, -1, 91, 92, -1,
5365 488, -1, -1, -1, -1, 99, -1, -1, 102, -1,
5366 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5367 114, 115, 116, 117, 118, 119, -1, 1185, -1, -1,
5368 -1, -1, 16, 17, -1, -1, -1, -1, -1, 1197,
5369 528, -1, -1, -1, 1102, 1203, 534, 141, 1106, -1,
5370 -1, 1109, 1110, -1, 148, -1, -1, -1, -1, -1,
5371 -1, 1119, -1, -1, 48, 49, 50, 51, 162, -1,
5372 -1, 55, 56, -1, -1, -1, -1, -1, 1136, -1,
5373 -1, -1, -1, -1, 68, 69, 574, -1, -1, 577,
5374 -1, 78, 79, 80, 81, 82, 83, 84, 85, -1,
5375 87, 88, 590, -1, -1, -1, -1, -1, 95, 96,
5376 -1, -1, -1, -1, -1, -1, -1, -1, -1, 103,
5377 -1, -1, -1, -1, -1, 830, -1, 1185, 833, -1,
5378 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1197,
5379 -1, 1299, -1, -1, -1, 1203, -1, -1, 636, -1,
5380 638, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5381 147, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5382 658, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5383 668, 669, -1, -1, -1, -1, -1, -1, -1, -1,
5384 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5385 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5386 -1, -1, 917, 918, -1, -1, -1, -1, 923, 924,
5387 -1, -1, -1, -1, -1, -1, -1, 932, -1, -1,
5388 -1, 215, -1, -1, 218, 219, 220, -1, 222, -1,
5389 -1, 1299, -1, 948, -1, -1, -1, -1, -1, 33,
5390 34, 35, 36, -1, -1, -1, -1, 241, -1, -1,
5391 244, -1, -1, -1, 969, 49, 50, 51, 52, -1,
5392 -1, -1, 56, -1, 58, 59, 60, 61, 62, 63,
5393 -1, -1, -1, -1, -1, -1, -1, 992, 993, 994,
5394 -1, -1, -1, -1, 78, -1, -1, -1, -1, -1,
5395 -1, -1, -1, -1, 1009, -1, -1, 91, 92, -1,
5396 -1, -1, -1, -1, -1, 99, -1, -1, 102, -1,
5397 -1, 105, 106, 1028, 108, 109, -1, 111, 112, 113,
5398 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5399 -1, 1046, 830, -1, 1049, 833, -1, -1, -1, -1,
5400 -1, -1, -1, -1, -1, -1, -1, 141, -1, -1,
5401 -1, -1, -1, -1, 148, -1, -1, -1, 352, 353,
5402 354, 355, 356, -1, -1, 359, 360, 361, 362, 363,
5403 364, 365, 366, -1, 368, -1, -1, 371, 372, 373,
5404 374, 375, 376, 377, 378, 379, 380, 1102, -1, -1,
5405 384, 1106, -1, -1, 1109, 1110, -1, -1, -1, -1,
5406 -1, -1, -1, -1, 1119, -1, -1, -1, -1, -1,
5407 -1, -1, -1, -1, -1, -1, -1, -1, -1, 917,
5408 918, -1, -1, -1, -1, 923, 924, -1, -1, -1,
5409 -1, -1, -1, -1, 932, -1, -1, 431, -1, -1,
5410 -1, -1, -1, -1, -1, -1, -1, -1, 52, 53,
5411 948, -1, 56, -1, -1, -1, 450, 451, -1, -1,
5412 -1, 455, -1, -1, -1, 459, -1, 461, -1, -1,
5413 1185, 969, 76, 77, 78, 79, 80, 81, 82, 83,
5414 84, -1, 1197, 87, 88, 479, -1, -1, -1, 93,
5415 94, 95, 96, -1, 992, 993, 994, -1, 492, -1,
5416 -1, 495, -1, -1, 108, 109, -1, -1, -1, -1,
5417 -1, 1009, -1, 507, -1, -1, -1, -1, -1, -1,
5418 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5419 1028, 525, -1, -1, 138, 139, 140, 141, 142, 143,
5420 144, 145, 146, 147, -1, 149, 150, -1, 1046, -1,
5421 -1, 1049, 156, 157, -1, -1, -1, -1, -1, -1,
5422 -1, -1, -1, -1, -1, -1, -1, 561, 78, 79,
5423 80, 81, 82, 83, 84, -1, -1, 87, 88, 573,
5424 -1, -1, 576, -1, 1299, 95, 96, -1, -1, -1,
5425 -1, 585, -1, -1, -1, -1, 590, -1, -1, -1,
5426 -1, -1, -1, -1, -1, -1, -1, -1, 1106, -1,
5427 -1, 1109, 1110, -1, -1, -1, -1, -1, -1, -1,
5428 -1, 1119, -1, -1, -1, -1, -1, -1, 138, 139,
5429 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5430 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5431 -1, -1, 646, -1, -1, -1, -1, -1, -1, -1,
5432 -1, -1, 656, -1, -1, -1, -1, -1, -1, -1,
5433 -1, -1, -1, -1, 668, 669, -1, 671, 672, 673,
5434 674, -1, -1, -1, -1, -1, -1, 1185, -1, -1,
5435 -1, 685, 686, -1, -1, 689, -1, 691, -1, 1197,
5436 -1, -1, -1, -1, -1, -1, -1, 701, 0, 1,
5437 -1, 3, 4, 5, 6, 7, -1, -1, -1, 11,
5438 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5439 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
5440 32, 33, 34, 35, 36, -1, 740, 39, -1, -1,
5441 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5442 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5443 62, 63, 64, 65, -1, -1, -1, -1, -1, 773,
5444 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5445 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5446 92, 1299, -1, -1, -1, -1, -1, 99, 802, -1,
5447 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5448 112, 113, 114, 115, 116, 117, 118, 119, -1, 823,
5449 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5450 -1, -1, -1, -1, -1, -1, -1, -1, 52, 53,
5451 -1, -1, 56, -1, -1, -1, 148, 149, 150, -1,
5452 -1, -1, -1, -1, -1, -1, -1, -1, 160, -1,
5453 162, -1, 76, 77, 78, 79, 80, 81, 82, 83,
5454 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
5455 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
5456 -1, -1, 896, -1, 108, 109, -1, -1, -1, -1,
5457 -1, 905, -1, -1, -1, -1, -1, -1, 912, -1,
5458 -1, -1, 916, 917, 918, -1, -1, -1, -1, 923,
5459 924, -1, -1, 927, 138, 139, 140, 141, 142, 143,
5460 144, 145, 146, 147, -1, 149, 150, -1, 942, -1,
5461 -1, -1, 156, 157, -1, -1, -1, -1, -1, -1,
5462 -1, -1, -1, 957, 958, 959, -1, 961, 962, -1,
5463 964, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5464 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5465 -1, -1, 986, 987, -1, -1, 990, -1, -1, -1,
5466 994, 995, -1, -1, -1, -1, -1, -1, -1, -1,
5467 -1, -1, -1, -1, -1, 1009, -1, -1, -1, -1,
5468 -1, -1, -1, -1, 0, 1, -1, 3, 4, 5,
5469 6, 7, -1, 1027, -1, 11, 12, -1, -1, 1033,
5470 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5471 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
5472 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
5473 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5474 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5475 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5476 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5477 -1, -1, -1, -1, -1, 91, 92, -1, 1112, -1,
5478 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5479 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5480 116, 117, 118, 119, -1, 121, -1, -1, -1, -1,
5481 0, -1, -1, -1, -1, -1, -1, -1, 8, 9,
5482 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
5483 -1, -1, 148, 149, 150, 25, 26, 27, 28, 29,
5484 -1, -1, -1, -1, 160, -1, 162, 37, 38, -1,
5485 40, 41, 42, 43, 44, -1, -1, -1, 78, 79,
5486 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5487 90, -1, -1, -1, -1, 95, 96, -1, 68, 69,
5488 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5489 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5490 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5491 100, 101, -1, -1, -1, -1, 1250, 107, 138, 139,
5492 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5493 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
5494 -1, -1, -1, -1, -1, 135, 136, 137, 138, 139,
5495 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5496 -1, -1, 152, 153, 154, 155, 0, -1, 158, 159,
5497 160, -1, 162, -1, 8, 9, 10, -1, -1, 13,
5498 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5499 -1, 25, -1, 27, 28, 29, -1, -1, -1, -1,
5500 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5501 44, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5502 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5503 -1, 95, 96, -1, 68, 69, -1, -1, -1, -1,
5504 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5505 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5506 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
5507 -1, -1, 136, 107, 138, 139, 140, 141, 142, 143,
5508 144, 145, 146, 147, -1, -1, -1, 121, -1, -1,
5509 124, -1, -1, -1, -1, -1, -1, -1, 162, -1,
5510 -1, 135, 136, 137, 138, 139, 140, 141, 142, 143,
5511 144, 145, 146, 147, -1, -1, -1, -1, -1, 153,
5512 154, 155, 0, -1, 158, 159, 160, -1, 162, -1,
5513 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5514 -1, -1, -1, -1, -1, -1, -1, 25, -1, 27,
5515 28, 29, -1, -1, -1, -1, -1, -1, -1, 37,
5516 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5517 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5518 88, 89, 90, -1, -1, -1, -1, 95, 96, -1,
5519 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5520 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5521 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5522 98, -1, 100, 101, -1, -1, -1, -1, 136, 107,
5523 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5524 -1, -1, -1, 121, -1, -1, 124, -1, -1, -1,
5525 -1, -1, -1, -1, -1, -1, -1, 135, 136, 137,
5526 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5527 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5528 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5529 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5530 -1, -1, -1, 25, 26, 27, 28, 29, -1, -1,
5531 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5532 42, 43, 44, -1, -1, -1, 78, 79, 80, 81,
5533 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
5534 -1, -1, -1, 95, 96, -1, 68, 69, -1, -1,
5535 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5536 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5537 -1, -1, -1, 95, 96, 97, 98, -1, -1, 101,
5538 -1, -1, -1, -1, -1, 107, 138, 139, 140, 141,
5539 142, 143, 144, 145, 146, 147, -1, -1, -1, 121,
5540 -1, -1, 124, -1, -1, -1, -1, -1, -1, -1,
5541 -1, -1, -1, -1, 136, 137, 138, 139, 140, 141,
5542 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5543 152, 153, 154, 155, 0, -1, 158, 159, 160, -1,
5544 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5545 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5546 26, 27, 28, 29, -1, -1, -1, -1, -1, -1,
5547 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5548 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5549 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5550 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5551 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5552 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5553 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5554 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5555 -1, -1, -1, -1, -1, 121, -1, -1, 124, -1,
5556 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5557 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5558 146, 147, -1, -1, -1, -1, 152, 153, 154, 155,
5559 0, -1, 158, 159, 160, -1, 162, -1, 8, 9,
5560 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
5561 -1, -1, -1, -1, -1, 25, 26, 27, 28, -1,
5562 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5563 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
5564 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5565 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
5566 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5567 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5568 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5569 -1, 101, -1, -1, -1, -1, -1, 107, -1, -1,
5570 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5571 -1, 121, -1, -1, -1, -1, -1, -1, -1, -1,
5572 -1, -1, -1, -1, -1, -1, 136, -1, 138, 139,
5573 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5574 -1, -1, 152, 153, 154, 155, 0, 157, 158, 159,
5575 160, -1, 162, -1, 8, 9, 10, -1, -1, 13,
5576 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5577 -1, 25, -1, 27, 28, 29, -1, -1, -1, -1,
5578 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5579 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5580 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5581 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5582 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5583 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5584 -1, 95, 96, 97, 98, -1, -1, 101, -1, -1,
5585 -1, -1, -1, 107, -1, -1, -1, -1, -1, -1,
5586 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5587 124, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5588 -1, -1, 136, 137, 138, 139, 140, 141, 142, 143,
5589 144, 145, 146, 147, -1, -1, -1, -1, -1, 153,
5590 154, 155, 0, -1, 158, 159, 160, -1, 162, -1,
5591 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5592 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
5593 28, -1, -1, -1, -1, -1, -1, -1, -1, 37,
5594 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5595 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5596 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5597 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5598 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5599 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5600 98, -1, -1, 101, -1, -1, -1, -1, -1, 107,
5601 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5602 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
5603 -1, -1, -1, -1, -1, -1, -1, -1, 136, -1,
5604 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5605 -1, -1, -1, -1, 152, 153, 154, 155, 0, 157,
5606 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5607 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5608 -1, -1, -1, 25, -1, 27, 28, -1, -1, -1,
5609 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5610 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5611 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5612 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5613 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5614 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5615 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
5616 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
5617 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5618 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5619 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
5620 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5621 152, 153, 154, 155, 0, -1, 158, 159, 160, -1,
5622 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5623 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5624 -1, 27, 28, -1, -1, -1, -1, -1, -1, -1,
5625 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5628 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5629 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5630 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5631 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5632 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5633 -1, -1, -1, -1, -1, 121, -1, -1, -1, -1,
5634 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5635 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5636 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
5637 0, 157, 158, 159, 160, -1, 162, -1, 8, 9,
5638 10, 44, -1, -1, 14, 15, -1, 17, -1, -1,
5639 -1, -1, -1, -1, -1, 25, 26, -1, -1, -1,
5640 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5641 40, 41, 42, 43, 44, 78, 79, 80, 81, 82,
5642 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
5643 -1, -1, 95, 96, -1, -1, -1, -1, 68, 69,
5644 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5645 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5646 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5647 100, 101, -1, 136, -1, 138, 139, 140, 141, 142,
5648 143, 144, 145, 146, 147, -1, -1, -1, -1, -1,
5649 -1, 121, -1, -1, -1, -1, -1, -1, -1, -1,
5650 -1, -1, -1, -1, -1, 135, 136, -1, 138, 139,
5651 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5652 -1, -1, 152, 153, 154, 155, 0, -1, 158, -1,
5653 160, -1, 162, -1, 8, 9, 10, -1, -1, -1,
5654 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5655 -1, 25, 26, -1, -1, -1, -1, -1, -1, -1,
5656 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5657 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5658 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5659 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5660 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5661 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5662 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
5663 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5664 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5665 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5666 -1, 135, 136, -1, 138, 139, 140, 141, 142, 143,
5667 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
5668 154, 155, 0, -1, 158, -1, 160, -1, 162, -1,
5669 8, 9, 10, -1, -1, -1, 14, 15, -1, 17,
5670 -1, -1, -1, -1, -1, -1, -1, 25, -1, -1,
5671 -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
5672 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5673 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5674 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5675 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5676 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5677 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5678 98, -1, 100, 101, -1, -1, -1, -1, -1, -1,
5679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5680 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
5681 -1, -1, -1, -1, -1, -1, -1, 135, 136, -1,
5682 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5683 -1, -1, -1, -1, 152, 153, 154, 155, 0, -1,
5684 158, -1, 160, -1, 162, -1, 8, 9, 10, -1,
5685 -1, -1, 14, 15, -1, 17, -1, -1, -1, -1,
5686 -1, -1, -1, 25, -1, -1, -1, -1, -1, -1,
5687 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5688 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5689 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5690 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5691 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5692 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5693 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
5694 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5695 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5696 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5697 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
5698 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5699 152, 153, 154, 155, -1, -1, 158, -1, 160, 1,
5700 162, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5701 12, -1, -1, 15, 16, -1, 18, 19, 20, 21,
5702 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
5703 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5704 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5705 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5706 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5707 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5708 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5709 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5710 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5711 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5712 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5713 10, 11, 12, -1, 14, 15, 16, -1, 18, 19,
5714 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5715 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5716 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5717 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5718 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5719 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5720 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5721 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5722 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5723 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5724 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5725 -1, -1, 10, 11, 12, -1, -1, 15, 16, 17,
5726 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5727 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5728 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5729 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5730 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5731 68, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5732 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5733 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5734 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5735 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5736 118, 119, -1, -1, -1, 1, -1, 3, 4, 5,
5737 6, 7, -1, -1, 10, 11, 12, -1, -1, 15,
5738 16, -1, 18, 19, 20, 21, 22, 23, 24, 25,
5739 148, 149, 150, -1, 30, 31, 32, 33, 34, 35,
5740 36, -1, 160, 39, 162, -1, -1, -1, -1, 45,
5741 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5742 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5743 -1, -1, 68, -1, -1, -1, -1, -1, -1, -1,
5744 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5745 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5746 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5747 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5748 116, 117, 118, 119, -1, -1, -1, 1, -1, 3,
5749 4, 5, 6, 7, -1, -1, 10, 11, 12, -1,
5750 -1, 15, 16, -1, 18, 19, 20, 21, 22, 23,
5751 24, -1, 148, 149, 150, -1, 30, 31, 32, 33,
5752 34, 35, 36, -1, 160, 39, 162, -1, -1, -1,
5753 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
5754 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5755 64, 65, -1, -1, 68, -1, -1, -1, -1, -1,
5756 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5757 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5758 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5759 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5760 114, 115, 116, 117, 118, 119, -1, -1, -1, 1,
5761 -1, 3, 4, 5, 6, 7, -1, 9, 10, 11,
5762 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5763 22, 23, 24, -1, 148, 149, 150, -1, 30, 31,
5764 32, 33, 34, 35, 36, -1, 160, 39, 162, -1,
5765 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5766 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5767 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5768 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5769 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5770 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5771 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5772 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5773 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5774 10, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5775 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5776 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5777 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5778 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5779 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5780 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5781 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5782 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5783 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5784 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5785 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5786 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5787 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5788 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5789 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5790 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5791 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5792 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5793 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5794 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5795 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5796 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5797 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5798 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5799 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5800 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5801 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5802 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5803 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5804 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5805 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5806 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5807 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5808 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5809 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5810 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5811 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5812 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5813 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5814 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5815 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5816 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5817 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5818 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5819 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5820 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5821 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5822 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5823 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5824 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5825 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5826 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5827 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5828 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5829 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5830 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5831 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5832 148, 149, 150, -1, -1, 153, -1, -1, -1, -1,
5833 -1, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5834 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5835 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5836 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5837 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5838 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5839 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5840 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5841 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5842 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5843 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5844 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5845 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5846 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5847 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5848 148, 149, 150, -1, -1, 153, -1, 1, -1, 3,
5849 4, 5, 160, 7, 162, -1, -1, 11, 12, -1,
5850 -1, -1, 16, 17, 18, 19, 20, 21, 22, 23,
5851 24, -1, -1, -1, -1, -1, 30, 31, 32, 33,
5852 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5853 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5854 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5855 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5856 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5857 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5858 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5859 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
5860 114, 115, 116, 117, 118, 119, -1, -1, 0, 1,
5861 -1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5862 12, -1, 14, 15, 16, 17, 18, 19, 20, 21,
5863 22, 23, 24, 25, 148, 149, 150, -1, 30, 31,
5864 32, 33, 34, 35, 36, -1, 160, 39, 162, -1,
5865 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5866 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5867 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5868 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5869 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5870 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5871 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5872 112, 113, 114, 115, 116, 117, 118, 119, -1, 121,
5873 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5874 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5875 -1, -1, -1, -1, -1, -1, 148, 149, 150, -1,
5876 -1, 153, -1, -1, -1, -1, 158, -1, 160, 0,
5877 1, -1, 3, 4, 5, 6, 7, -1, -1, -1,
5878 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
5879 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5880 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5881 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5882 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5883 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5884 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
5885 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5886 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
5887 -1, 102, 103, -1, 105, 106, -1, 108, -1, -1,
5888 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
5889 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5890 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5891 -1, -1, -1, -1, -1, -1, -1, 148, 149, 150,
5892 -1, -1, 153, 3, 4, 5, -1, 7, -1, 160,
5893 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5894 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
5895 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5896 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
5897 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
5898 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5899 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5900 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5901 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5902 -1, -1, 102, 103, -1, 105, 106, -1, 108, 109,
5903 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5904 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5905 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5906 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
5907 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5908 39, -1, 162, -1, -1, -1, -1, 46, -1, -1,
5909 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5910 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5911 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
5912 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5913 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
5914 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
5915 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
5916 119, -1, -1, -1, -1, 3, 4, 5, 6, 7,
5917 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
5918 18, 19, 20, 21, 22, 23, 24, 25, 26, 148,
5919 149, 150, 30, 31, 32, 33, 34, 35, 36, 37,
5920 38, 39, -1, 162, -1, -1, -1, 45, 46, 47,
5921 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5922 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5923 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5924 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5925 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5926 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5927 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
5928 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5929 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5930 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5931 -1, 149, 150, -1, -1, -1, -1, -1, 156, 157,
5932 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
5933 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
5934 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
5935 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
5936 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
5937 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,
5938 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5939 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
5940 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
5941 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
5942 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
5943 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5944 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5945 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
5946 143, 144, 145, 146, 147, -1, 149, 150, -1, -1,
5947 -1, -1, -1, 156, 3, 4, 5, 6, 7, 8,
5948 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
5949 19, 20, 21, 22, 23, 24, 25, 26, -1, -1,
5950 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38,
5951 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
5952 49, 50, 51, 52, 53, 54, -1, 56, -1, -1,
5953 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5954 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
5955 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
5956 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
5957 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
5958 109, -1, -1, 112, -1, -1, -1, -1, -1, -1,
5959 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5960 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
5961 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
5962 149, 150, -1, -1, -1, -1, -1, 156, 3, 4,
5963 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
5964 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
5965 25, 26, -1, -1, -1, 30, 31, 32, 33, 34,
5966 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
5967 45, 46, 47, 48, 49, 50, 51, 52, 53, -1,
5968 -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
5969 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5970 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
5971 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
5972 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
5973 -1, -1, -1, 108, 109, -1, -1, 112, -1, -1,
5974 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5975 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5976 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
5977 145, 146, 147, -1, 149, 150, -1, -1, -1, -1,
5978 -1, 156, 3, 4, 5, 6, 7, 8, 9, 10,
5979 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
5980 21, 22, 23, 24, 25, 26, -1, -1, -1, 30,
5981 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
5982 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5983 51, 52, 53, -1, -1, 56, -1, -1, -1, -1,
5984 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5985 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
5986 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
5987 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
5988 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
5989 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5990 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5991 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
5992 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
5993 3, 4, 5, -1, 7, 156, -1, -1, 11, 12,
5994 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5995 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5996 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5997 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5998 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5999 63, 64, 65, -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, -1, -1, -1, -1,
6002 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6003 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6004 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6005 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6006 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
6007 5, -1, 7, -1, -1, 148, 11, 12, -1, -1,
6008 -1, 16, 155, 18, 19, 20, 21, 22, 23, 24,
6009 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
6010 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6011 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6012 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6013 65, -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, -1, -1, -1, -1, -1, -1,
6016 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6017 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
6018 115, 116, 117, 118, 119, -1, -1, -1, -1, -1,
6019 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6020 -1, -1, -1, -1, 1, -1, 3, 4, 5, 6,
6021 7, -1, -1, 148, 11, 12, -1, -1, -1, 16,
6022 155, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6023 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
6024 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
6025 -1, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6026 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6027 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6028 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6029 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6030 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6031 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6032 117, 118, 119, -1, -1, 1, -1, 3, 4, 5,
6033 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6034 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6035 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6036 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6037 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6038 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6039 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6040 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6041 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6042 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6043 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
6044 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6045 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6046 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6047 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6048 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6049 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6050 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
6051 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6052 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6053 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6054 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6055 105, 106, -1, 108, 109, 110, 111, 112, 113, 114,
6056 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6057 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6058 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6059 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6060 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6061 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6062 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
6063 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6064 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6065 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6066 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6067 -1, 105, 106, -1, 108, 109, 110, 111, 112, 113,
6068 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6069 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6070 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6071 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6072 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6073 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6074 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
6075 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6076 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6077 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6078 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6079 103, -1, 105, 106, -1, 108, 109, 110, 111, 112,
6080 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6081 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6082 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6083 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6084 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6085 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6086 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
6087 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6088 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6089 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6090 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6091 102, 103, -1, 105, 106, -1, 108, 109, 110, 111,
6092 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6093 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6094 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6095 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6096 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6097 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6098 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
6099 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6100 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6101 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6102 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6103 -1, 102, 103, -1, 105, 106, -1, 108, 109, -1,
6104 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6105 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6106 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6107 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6108 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6109 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6110 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
6111 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6112 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6113 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6114 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6115 -1, -1, 102, 103, -1, 105, 106, -1, -1, 109,
6116 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6117 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6118 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6119 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6120 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6121 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6122 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
6123 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6124 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6125 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6126 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6127 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6128 109, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6129 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6130 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6131 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6132 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6133 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6134 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6135 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
6136 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6137 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6138 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
6139 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6140 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6141 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
6142 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
6143 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
6144 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
6145 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
6146 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
6147 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
6148 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6149 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6150 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
6151 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
6152 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
6153 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
6154 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
6155 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
6156 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
6157 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
6158 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
6159 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
6160 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6161 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
6162 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
6163 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
6164 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
6165 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
6166 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
6167 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
6168 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
6169 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
6170 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
6171 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
6172 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6173 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
6174 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
6175 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
6176 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
6177 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
6178 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6179 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6180 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
6181 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6182 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6183 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
6184 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
6185 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
6186 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
6187 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6188 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
6189 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
6190 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6191 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6192 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
6193 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6194 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6195 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6196 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
6197 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
6198 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
6199 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6200 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6201 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
6202 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6203 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6204 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
6205 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6206 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6207 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6208 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
6209 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
6210 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
6211 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6212 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
6213 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6214 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6215 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6216 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
6217 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6218 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6219 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6220 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
6221 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
6222 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6223 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
6224 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6225 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6226 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6227 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6228 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
6229 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6230 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6231 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6232 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6233 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
6234 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6235 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
6236 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6237 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6238 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
6239 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6240 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
6241 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6242 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6243 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6244 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
6245 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
6246 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6247 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
6248 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
6249 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6250 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
6251 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
6252 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
6253 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
6254 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
6255 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
6256 -1, 59, 60, 61, 62, 63, 64, 65, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6260 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
6261 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
6262 118, 119, -1, -1, 3, 4, 5, -1, 7, -1,
6263 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
6264 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
6265 148, 30, 31, 32, 33, 34, 35, 36, -1, -1,
6266 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
6267 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
6268 59, 60, 61, 62, 63, 64, 65, -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 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6272 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
6273 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
6274 119, -1, -1, 3, 4, 5, -1, 7, -1, -1,
6275 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
6276 20, 21, 22, 23, 24, -1, -1, -1, -1, 148,
6277 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
6278 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
6279 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
6280 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
6281 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6282 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6283 -1, -1, -1, -1, -1, 95, -1, -1, -1, 99,
6284 -1, -1, 102, 103, -1, 105, 106, -1, -1, -1,
6285 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6286 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
6287 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
6288 21, 22, 23, 24, -1, -1, -1, -1, 148, 30,
6289 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
6290 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
6291 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
6292 61, 62, 63, 64, 65, -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, -1, -1,
6295 -1, -1, -1, -1, -1, -1, -1, -1, 99, -1,
6296 -1, 102, 103, -1, 105, 106, -1, -1, -1, -1,
6297 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
6298 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
6299 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
6300 22, 23, 24, -1, -1, -1, -1, 148, 30, 31,
6301 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
6302 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
6303 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
6304 62, 63, 64, 65, -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, -1, -1, -1,
6307 -1, -1, -1, -1, -1, -1, -1, 99, -1, -1,
6308 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
6309 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
6310 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
6311 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
6312 23, 24, -1, -1, -1, -1, 148, 30, 31, 32,
6313 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
6314 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
6315 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
6316 63, 64, 65, -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, -1, -1, -1, -1,
6319 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
6320 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
6321 113, 114, 115, 116, 117, 118, 119, -1, -1, 3,
6322 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
6323 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
6324 24, -1, -1, -1, -1, 148, 30, 31, 32, 33,
6325 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
6326 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
6327 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
6328 64, 65, -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, -1, -1, -1, -1, -1,
6331 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
6332 -1, 105, 106, 33, 34, 35, 36, 111, 112, 113,
6333 114, 115, 116, 117, 118, 119, -1, -1, -1, 49,
6334 50, 51, 52, -1, -1, -1, 56, -1, -1, 59,
6335 60, 61, 62, 63, -1, -1, -1, -1, -1, -1,
6336 -1, -1, -1, -1, 148, -1, -1, -1, -1, -1,
6337 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6338 -1, 91, 92, -1, -1, -1, 52, 53, -1, 99,
6339 56, -1, 102, -1, -1, 105, 106, -1, 108, -1,
6340 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
6341 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
6342 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
6343 96, 141, -1, -1, -1, -1, -1, -1, 148, -1,
6344 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
6345 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6346 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6347 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
6348 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
6349 156, 157, -1, -1, -1, -1, -1, -1, -1, -1,
6350 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6351 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
6352 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
6353 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6354 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
6355 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6356 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6357 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6358 147, -1, 149, 150, 52, 53, -1, -1, 56, 156,
6359 157, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6360 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6361 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6362 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6363 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6364 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
6365 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6366 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6367 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6368 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
6369 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6370 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
6371 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
6372 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
6373 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
6374 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6375 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6376 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
6377 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6378 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
6379 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6380 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
6381 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
6382 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
6383 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
6384 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6385 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6386 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
6387 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
6388 150, 52, 53, -1, -1, 56, 156, 157, -1, -1,
6389 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6390 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
6391 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
6392 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
6393 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
6394 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6395 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6396 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
6397 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
6398 52, 53, -1, -1, 56, 156, 157, -1, -1, -1,
6399 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6400 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
6401 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
6402 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
6403 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
6404 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6405 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6406 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
6407 142, 143, 144, 145, 146, 147, -1, 149, 150, 52,
6408 53, -1, -1, 56, 156, 157, -1, -1, -1, -1,
6409 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6410 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
6411 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
6412 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
6413 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
6414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6415 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6416 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
6417 143, 144, 145, 146, 147, -1, 149, 150, 52, 53,
6418 -1, -1, 56, 156, 157, -1, -1, -1, -1, -1,
6419 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6420 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
6421 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
6422 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
6423 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
6424 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6425 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6426 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
6427 144, 145, 146, 147, -1, 149, 150, 52, 53, -1,
6428 -1, 56, 156, 157, -1, -1, -1, -1, -1, -1,
6429 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6430 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
6431 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
6432 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
6433 -1, -1, -1, 108, 109, -1, -1, -1, -1, -1,
6434 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6435 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6436 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
6437 145, 146, 147, -1, 149, 150, 52, 53, -1, -1,
6438 56, 156, 157, -1, -1, -1, -1, -1, -1, -1,
6439 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6440 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
6441 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
6442 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6443 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
6444 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6445 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6446 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
6447 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
6448 156, 157, -1, -1, -1, -1, -1, -1, -1, -1,
6449 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
6450 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
6451 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
6452 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6453 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
6454 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6455 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6456 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
6457 147, -1, 149, 150, 52, 53, -1, -1, 56, 156,
6458 157, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6459 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
6460 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
6461 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
6462 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6463 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
6464 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6465 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6466 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6467 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
6468 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6469 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
6470 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
6471 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
6472 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
6473 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6474 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6475 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
6476 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6477 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
6478 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6479 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
6480 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
6481 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
6482 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
6483 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6484 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6485 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
6486 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
6487 150, -1, -1, -1, -1, -1, 156
6488};
6489
6490/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
6491 state STATE-NUM. */
6492static const yytype_int16 yystos[] =
6493{
6494 0, 164, 165, 0, 1, 3, 4, 5, 6, 7,
6495 11, 12, 16, 18, 19, 20, 21, 22, 23, 24,
6496 30, 31, 32, 33, 34, 35, 36, 39, 45, 46,
6497 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6498 57, 59, 60, 61, 62, 63, 64, 65, 76, 77,
6499 91, 92, 99, 102, 103, 105, 106, 108, 111, 112,
6500 113, 114, 115, 116, 117, 118, 119, 148, 149, 150,
6501 166, 167, 168, 180, 181, 183, 186, 190, 191, 197,
6502 198, 200, 201, 202, 204, 205, 206, 208, 209, 218,
6503 221, 240, 250, 251, 252, 253, 254, 255, 256, 257,
6504 258, 259, 260, 269, 270, 294, 301, 302, 350, 351,
6505 352, 353, 354, 355, 357, 360, 362, 363, 376, 377,
6506 379, 380, 381, 382, 383, 384, 385, 386, 387, 425,
6507 439, 3, 4, 5, 6, 7, 8, 9, 10, 11,
6508 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
6509 22, 23, 24, 25, 26, 30, 31, 32, 33, 34,
6510 35, 36, 37, 38, 39, 45, 46, 47, 48, 49,
6511 50, 51, 52, 53, 56, 76, 77, 78, 79, 80,
6512 81, 82, 83, 84, 87, 88, 93, 94, 95, 96,
6513 108, 109, 138, 139, 140, 141, 142, 143, 144, 145,
6514 146, 147, 149, 150, 156, 212, 213, 214, 216, 217,
6515 376, 179, 179, 179, 39, 58, 99, 102, 108, 109,
6516 110, 113, 149, 190, 191, 201, 209, 218, 225, 231,
6517 234, 236, 237, 250, 383, 384, 386, 387, 423, 424,
6518 231, 157, 228, 232, 233, 157, 162, 432, 54, 213,
6519 432, 152, 169, 170, 222, 439, 21, 22, 32, 200,
6520 218, 250, 269, 270, 218, 218, 218, 56, 47, 102,
6521 175, 176, 177, 181, 203, 204, 439, 175, 226, 236,
6522 423, 439, 225, 422, 423, 439, 46, 99, 148, 155,
6523 190, 191, 208, 240, 250, 383, 384, 387, 295, 212,
6524 366, 378, 382, 366, 367, 368, 161, 356, 356, 356,
6525 356, 381, 197, 218, 218, 160, 162, 431, 437, 438,
6526 179, 40, 41, 42, 43, 44, 37, 38, 157, 390,
6527 391, 392, 393, 439, 390, 392, 26, 152, 228, 232,
6528 261, 303, 28, 262, 300, 135, 155, 102, 108, 205,
6529 135, 25, 78, 79, 80, 81, 82, 83, 84, 85,
6530 86, 87, 88, 89, 90, 95, 96, 101, 136, 138,
6531 139, 140, 141, 142, 143, 144, 145, 146, 147, 220,
6532 220, 69, 97, 98, 154, 429, 241, 1, 186, 193,
6533 193, 194, 195, 194, 193, 431, 438, 99, 202, 209,
6534 250, 275, 383, 384, 387, 52, 56, 95, 99, 210,
6535 211, 250, 383, 384, 387, 211, 33, 34, 35, 36,
6536 49, 50, 51, 52, 56, 157, 189, 212, 385, 420,
6537 231, 157, 232, 98, 429, 430, 303, 353, 100, 100,
6538 155, 225, 56, 225, 225, 225, 366, 390, 390, 135,
6539 101, 155, 235, 439, 98, 154, 429, 100, 100, 155,
6540 235, 92, 230, 231, 236, 397, 423, 439, 231, 186,
6541 432, 433, 186, 54, 64, 65, 182, 157, 222, 223,
6542 166, 98, 429, 100, 178, 203, 158, 431, 438, 433,
6543 242, 159, 155, 432, 436, 155, 436, 153, 436, 432,
6544 56, 381, 205, 207, 391, 155, 98, 154, 429, 292,
6545 66, 120, 122, 123, 369, 120, 120, 369, 67, 369,
6546 161, 358, 364, 361, 365, 78, 160, 168, 152, 193,
6547 193, 193, 193, 222, 224, 186, 186, 52, 54, 55,
6548 56, 57, 58, 78, 92, 102, 108, 109, 110, 142,
6549 145, 280, 338, 394, 396, 397, 398, 399, 400, 401,
6550 402, 403, 404, 407, 408, 409, 410, 411, 414, 415,
6551 416, 417, 418, 135, 248, 396, 135, 249, 304, 305,
6552 107, 199, 306, 307, 306, 222, 203, 155, 208, 155,
6553 222, 188, 218, 218, 218, 218, 218, 218, 218, 218,
6554 218, 218, 218, 218, 218, 187, 218, 218, 218, 218,
6555 218, 218, 218, 218, 218, 218, 218, 52, 53, 56,
6556 216, 228, 425, 426, 427, 230, 236, 52, 53, 56,
6557 216, 228, 426, 171, 175, 13, 271, 437, 271, 175,
6558 193, 175, 431, 244, 56, 98, 154, 429, 25, 193,
6559 52, 56, 210, 139, 388, 98, 154, 429, 247, 421,
6560 69, 98, 428, 231, 433, 52, 56, 426, 222, 222,
6561 215, 125, 135, 135, 222, 225, 225, 234, 237, 423,
6562 52, 56, 230, 52, 56, 222, 222, 424, 433, 155,
6563 433, 155, 433, 158, 213, 223, 218, 153, 56, 426,
6564 426, 222, 170, 433, 177, 158, 423, 155, 207, 52,
6565 56, 230, 52, 56, 293, 371, 370, 120, 359, 369,
6566 66, 120, 120, 359, 66, 120, 218, 175, 181, 102,
6567 108, 276, 277, 278, 279, 399, 155, 419, 439, 433,
6568 281, 282, 155, 395, 225, 155, 419, 34, 52, 155,
6569 395, 52, 155, 395, 52, 39, 184, 201, 218, 219,
6570 171, 437, 184, 219, 171, 153, 292, 304, 10, 68,
6571 268, 292, 268, 108, 197, 225, 236, 238, 239, 433,
6572 207, 155, 183, 185, 197, 209, 218, 225, 227, 239,
6573 250, 387, 313, 313, 432, 100, 100, 152, 228, 232,
6574 432, 434, 155, 100, 100, 228, 229, 232, 439, 268,
6575 222, 175, 13, 175, 268, 27, 272, 437, 268, 25,
6576 243, 314, 17, 265, 309, 52, 56, 230, 52, 56,
6577 194, 246, 389, 245, 52, 56, 210, 230, 171, 186,
6578 192, 433, 229, 232, 185, 218, 227, 185, 227, 213,
6579 225, 39, 235, 100, 100, 434, 100, 100, 397, 423,
6580 186, 227, 436, 205, 434, 179, 372, 375, 382, 387,
6581 356, 369, 356, 356, 356, 153, 278, 399, 155, 433,
6582 155, 418, 225, 135, 394, 401, 414, 416, 404, 408,
6583 410, 402, 411, 416, 400, 402, 432, 44, 44, 268,
6584 268, 293, 153, 293, 225, 155, 44, 207, 44, 135,
6585 44, 98, 154, 429, 311, 311, 137, 222, 222, 304,
6586 199, 159, 100, 222, 222, 199, 8, 263, 346, 439,
6587 14, 15, 266, 267, 273, 274, 439, 274, 196, 313,
6588 309, 268, 108, 225, 308, 268, 434, 175, 437, 193,
6589 171, 434, 268, 433, 189, 303, 300, 432, 222, 222,
6590 100, 222, 222, 433, 155, 433, 157, 297, 396, 373,
6591 433, 276, 279, 277, 155, 395, 155, 395, 419, 155,
6592 395, 155, 395, 395, 184, 219, 224, 224, 179, 179,
6593 108, 225, 224, 224, 222, 224, 52, 56, 230, 52,
6594 56, 312, 312, 218, 185, 227, 185, 227, 153, 222,
6595 185, 227, 185, 227, 225, 239, 347, 439, 174, 266,
6596 175, 193, 268, 268, 311, 268, 225, 155, 271, 268,
6597 171, 437, 268, 222, 396, 296, 175, 155, 155, 402,
6598 416, 402, 402, 218, 218, 140, 287, 288, 439, 287,
6599 225, 181, 181, 218, 434, 52, 56, 58, 91, 92,
6600 99, 102, 105, 106, 108, 113, 141, 294, 318, 319,
6601 320, 321, 324, 328, 329, 330, 333, 334, 335, 336,
6602 337, 338, 339, 340, 341, 342, 343, 344, 345, 350,
6603 351, 354, 355, 357, 360, 362, 363, 384, 408, 318,
6604 185, 227, 101, 348, 439, 9, 264, 349, 439, 172,
6605 271, 312, 108, 225, 175, 268, 289, 432, 29, 124,
6606 298, 0, 121, 374, 277, 395, 155, 395, 395, 395,
6607 280, 283, 286, 289, 400, 402, 403, 405, 406, 412,
6608 413, 416, 418, 175, 171, 341, 341, 56, 210, 312,
6609 319, 326, 327, 328, 329, 332, 434, 312, 432, 435,
6610 52, 366, 52, 102, 382, 101, 155, 140, 155, 155,
6611 319, 89, 90, 98, 154, 157, 322, 323, 52, 99,
6612 209, 250, 383, 384, 387, 271, 175, 175, 175, 317,
6613 318, 225, 274, 309, 310, 158, 160, 299, 175, 402,
6614 419, 289, 140, 281, 155, 284, 285, 99, 250, 155,
6615 419, 155, 284, 155, 284, 319, 434, 319, 330, 332,
6616 434, 155, 222, 153, 125, 193, 342, 326, 330, 324,
6617 331, 332, 113, 335, 339, 341, 341, 210, 312, 434,
6618 312, 433, 326, 329, 333, 326, 329, 333, 56, 98,
6619 154, 429, 175, 173, 273, 271, 40, 41, 52, 290,
6620 291, 398, 171, 153, 395, 140, 250, 283, 413, 416,
6621 56, 98, 405, 410, 402, 412, 416, 402, 433, 155,
6622 155, 325, 433, 155, 155, 366, 433, 433, 433, 434,
6623 434, 434, 52, 56, 230, 52, 56, 346, 349, 315,
6624 193, 193, 155, 432, 268, 155, 284, 155, 284, 52,
6625 56, 419, 155, 284, 155, 284, 284, 331, 333, 331,
6626 330, 332, 434, 175, 291, 402, 416, 402, 402, 155,
6627 435, 274, 314, 316, 284, 155, 284, 284, 284, 402,
6628 284
6629};
6630
6631/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
6632static const yytype_int16 yyr1[] =
6633{
6634 0, 163, 165, 164, 166, 167, 167, 167, 168, 168,
6635 169, 170, 172, 173, 171, 174, 171, 175, 176, 176,
6636 176, 177, 178, 177, 179, 180, 182, 181, 181, 181,
6637 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
6638 181, 181, 181, 181, 181, 183, 183, 183, 183, 183,
6639 183, 183, 183, 183, 183, 184, 184, 184, 185, 185,
6640 185, 186, 186, 186, 186, 186, 187, 186, 188, 186,
6641 186, 189, 190, 192, 191, 193, 193, 195, 196, 194,
6642 197, 197, 198, 198, 199, 200, 201, 201, 201, 201,
6643 201, 201, 201, 201, 201, 201, 201, 201, 202, 202,
6644 203, 203, 204, 204, 204, 204, 204, 204, 204, 204,
6645 204, 204, 205, 205, 206, 206, 207, 207, 208, 208,
6646 208, 208, 208, 208, 208, 208, 208, 209, 209, 209,
6647 209, 209, 209, 209, 209, 209, 210, 210, 211, 211,
6648 211, 212, 212, 212, 212, 212, 213, 213, 214, 215,
6649 214, 216, 216, 216, 216, 216, 216, 216, 216, 216,
6650 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
6651 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
6652 216, 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, 217, 217, 217, 217, 217, 217, 217, 217,
6656 217, 217, 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, 218, 218, 218,
6660 218, 218, 218, 218, 218, 218, 218, 219, 219, 219,
6661 220, 220, 220, 220, 221, 221, 222, 223, 224, 225,
6662 226, 226, 226, 226, 227, 227, 228, 228, 228, 229,
6663 229, 230, 230, 230, 230, 230, 231, 231, 231, 231,
6664 231, 233, 232, 234, 234, 235, 235, 236, 236, 236,
6665 236, 237, 237, 238, 238, 239, 239, 239, 240, 240,
6666 240, 240, 240, 240, 240, 240, 240, 240, 240, 241,
6667 240, 242, 240, 240, 240, 240, 240, 240, 240, 240,
6668 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
6669 240, 240, 240, 243, 240, 244, 240, 240, 240, 245,
6670 240, 246, 240, 247, 240, 248, 240, 249, 240, 240,
6671 240, 240, 240, 250, 251, 252, 253, 254, 255, 256,
6672 257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
6673 267, 268, 268, 269, 270, 271, 271, 271, 272, 272,
6674 273, 273, 274, 274, 275, 275, 276, 276, 277, 277,
6675 278, 278, 278, 278, 278, 279, 279, 280, 280, 282,
6676 281, 283, 283, 283, 283, 284, 284, 285, 286, 286,
6677 286, 286, 286, 286, 286, 286, 286, 286, 286, 286,
6678 286, 286, 286, 287, 287, 288, 288, 289, 289, 290,
6679 290, 291, 291, 292, 293, 295, 296, 294, 297, 297,
6680 298, 299, 298, 300, 301, 301, 301, 301, 302, 302,
6681 302, 302, 302, 302, 302, 302, 302, 303, 303, 305,
6682 304, 307, 306, 308, 308, 308, 308, 309, 310, 310,
6683 311, 312, 313, 315, 314, 316, 316, 317, 317, 317,
6684 318, 318, 318, 318, 318, 318, 319, 320, 320, 321,
6685 321, 322, 323, 324, 324, 324, 324, 324, 324, 324,
6686 324, 324, 324, 324, 324, 324, 325, 324, 324, 324,
6687 326, 326, 326, 326, 326, 326, 327, 327, 328, 328,
6688 329, 330, 330, 331, 331, 332, 333, 333, 333, 333,
6689 334, 334, 335, 335, 336, 336, 337, 337, 338, 339,
6690 339, 340, 340, 340, 340, 340, 340, 340, 340, 340,
6691 340, 341, 341, 341, 341, 341, 341, 341, 341, 341,
6692 341, 342, 343, 343, 344, 345, 345, 345, 346, 346,
6693 347, 347, 347, 348, 348, 349, 349, 350, 350, 351,
6694 352, 352, 352, 353, 354, 355, 356, 356, 357, 358,
6695 358, 359, 359, 360, 361, 361, 362, 363, 364, 364,
6696 365, 365, 366, 366, 367, 367, 368, 368, 369, 370,
6697 369, 371, 372, 373, 369, 374, 374, 375, 375, 376,
6698 376, 377, 378, 378, 379, 380, 380, 381, 381, 381,
6699 381, 382, 382, 382, 383, 383, 383, 384, 384, 384,
6700 384, 384, 384, 384, 385, 385, 386, 386, 387, 387,
6701 389, 388, 388, 390, 390, 391, 392, 393, 392, 394,
6702 394, 394, 394, 394, 395, 395, 396, 396, 396, 396,
6703 396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
6704 396, 397, 398, 398, 398, 398, 399, 399, 400, 401,
6705 401, 402, 402, 403, 404, 404, 405, 405, 406, 406,
6706 407, 407, 408, 408, 409, 410, 410, 411, 412, 413,
6707 413, 414, 414, 415, 415, 416, 416, 417, 417, 418,
6708 418, 419, 419, 420, 421, 420, 422, 422, 423, 423,
6709 424, 424, 424, 424, 424, 424, 425, 425, 425, 426,
6710 426, 427, 427, 427, 428, 428, 429, 429, 430, 430,
6711 431, 431, 432, 432, 433, 434, 435, 436, 436, 437,
6712 437, 438, 438, 439
6713};
6714
6715/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
6716static const yytype_int8 yyr2[] =
6717{
6718 0, 2, 0, 2, 2, 1, 1, 3, 1, 2,
6719 1, 3, 0, 0, 8, 0, 5, 2, 1, 1,
6720 3, 1, 0, 3, 0, 2, 0, 4, 3, 3,
6721 3, 2, 3, 3, 3, 3, 4, 5, 1, 4,
6722 4, 7, 4, 1, 1, 4, 4, 7, 6, 6,
6723 6, 6, 4, 4, 4, 1, 4, 3, 1, 4,
6724 1, 1, 3, 3, 3, 2, 0, 7, 0, 7,
6725 1, 1, 2, 0, 5, 1, 1, 0, 0, 4,
6726 1, 1, 1, 4, 3, 1, 2, 3, 4, 5,
6727 4, 5, 6, 2, 2, 2, 2, 2, 1, 3,
6728 1, 3, 1, 2, 3, 5, 2, 4, 2, 4,
6729 1, 3, 1, 3, 2, 3, 1, 3, 1, 1,
6730 4, 3, 3, 3, 3, 2, 1, 1, 1, 4,
6731 3, 3, 3, 3, 2, 1, 1, 1, 2, 1,
6732 3, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6733 4, 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, 1, 1, 1, 1, 1, 1, 1, 1,
6740 1, 1, 4, 4, 7, 6, 6, 6, 6, 5,
6741 4, 3, 3, 2, 2, 2, 2, 3, 3, 3,
6742 3, 3, 3, 4, 2, 2, 3, 3, 3, 3,
6743 1, 3, 3, 3, 3, 3, 2, 2, 3, 3,
6744 3, 3, 4, 6, 4, 4, 1, 1, 4, 3,
6745 1, 1, 1, 1, 3, 3, 1, 1, 1, 1,
6746 1, 2, 4, 2, 1, 4, 3, 5, 3, 1,
6747 1, 1, 1, 2, 4, 2, 1, 2, 2, 4,
6748 1, 0, 2, 2, 1, 2, 1, 1, 1, 3,
6749 3, 2, 1, 1, 1, 3, 4, 2, 1, 1,
6750 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6751 4, 0, 4, 3, 3, 2, 3, 3, 1, 4,
6752 3, 1, 6, 4, 3, 2, 1, 2, 1, 6,
6753 6, 4, 4, 0, 6, 0, 5, 5, 6, 0,
6754 6, 0, 7, 0, 5, 0, 5, 0, 5, 1,
6755 1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
6756 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6757 1, 1, 1, 1, 1, 1, 1, 2, 1, 1,
6758 1, 5, 1, 2, 1, 1, 1, 3, 1, 3,
6759 1, 3, 5, 1, 3, 2, 1, 1, 1, 0,
6760 2, 4, 2, 2, 1, 2, 0, 1, 6, 8,
6761 4, 6, 4, 2, 6, 2, 4, 6, 2, 4,
6762 2, 4, 1, 1, 1, 3, 4, 1, 4, 1,
6763 3, 1, 1, 0, 0, 0, 0, 8, 4, 1,
6764 3, 0, 4, 3, 2, 4, 5, 5, 2, 4,
6765 4, 3, 3, 3, 2, 1, 4, 3, 3, 0,
6766 6, 0, 6, 1, 2, 3, 4, 5, 1, 1,
6767 0, 0, 0, 0, 9, 1, 1, 1, 3, 3,
6768 1, 2, 3, 1, 1, 1, 1, 3, 1, 3,
6769 1, 2, 2, 1, 1, 4, 4, 4, 3, 4,
6770 4, 4, 3, 3, 3, 2, 0, 6, 2, 4,
6771 1, 1, 2, 2, 4, 1, 2, 3, 1, 3,
6772 5, 2, 1, 1, 3, 1, 3, 1, 2, 1,
6773 1, 3, 2, 1, 1, 3, 2, 1, 2, 1,
6774 1, 1, 3, 3, 2, 2, 1, 1, 1, 2,
6775 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6776 1, 1, 2, 2, 4, 2, 3, 1, 6, 1,
6777 1, 1, 1, 2, 1, 2, 1, 1, 1, 1,
6778 1, 1, 2, 3, 3, 3, 1, 2, 4, 0,
6779 3, 1, 2, 4, 0, 3, 4, 4, 0, 3,
6780 0, 3, 0, 2, 0, 2, 0, 2, 1, 0,
6781 3, 0, 0, 0, 6, 1, 1, 1, 1, 1,
6782 1, 2, 1, 1, 3, 1, 2, 1, 1, 1,
6783 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6784 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6785 0, 4, 0, 1, 1, 3, 1, 0, 3, 4,
6786 2, 2, 1, 1, 2, 0, 6, 8, 4, 6,
6787 4, 6, 2, 4, 6, 2, 4, 2, 4, 1,
6788 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6789 3, 1, 3, 1, 2, 1, 2, 1, 1, 3,
6790 1, 3, 1, 1, 1, 2, 1, 3, 3, 1,
6791 3, 1, 3, 1, 1, 2, 1, 1, 1, 2,
6792 1, 2, 1, 1, 0, 4, 1, 2, 1, 3,
6793 3, 2, 1, 4, 2, 1, 1, 1, 1, 1,
6794 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6795 0, 1, 0, 1, 2, 2, 2, 1, 1, 1,
6796 1, 1, 2, 0
6797};
6798
6799
6800enum { YYENOMEM = -2 };
6801
6802#define yyerrok (yyerrstatus = 0)
6803#define yyclearin (yychar = YYEMPTY)
6804
6805#define YYACCEPT goto yyacceptlab
6806#define YYABORT goto yyabortlab
6807#define YYERROR goto yyerrorlab
6808#define YYNOMEM goto yyexhaustedlab
6809
6810
6811#define YYRECOVERING() (!!yyerrstatus)
6812
6813#define YYBACKUP(Token, Value) \
6814 do \
6815 if (yychar == YYEMPTY) \
6816 { \
6817 yychar = (Token); \
6818 yylval = (Value); \
6819 YYPOPSTACK (yylen); \
6820 yystate = *yyssp; \
6821 goto yybackup; \
6822 } \
6823 else \
6824 { \
6825 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
6826 YYERROR; \
6827 } \
6828 while (0)
6829
6830/* Backward compatibility with an undocumented macro.
6831 Use YYerror or YYUNDEF. */
6832#define YYERRCODE YYUNDEF
6833
6834/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6835 If N is 0, then set CURRENT to the empty location which ends
6836 the previous symbol: RHS[0] (always defined). */
6837
6838#ifndef YYLLOC_DEFAULT
6839# define YYLLOC_DEFAULT(Current, Rhs, N) \
6840 do \
6841 if (N) \
6842 { \
6843 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
6844 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
6845 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
6846 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
6847 } \
6848 else \
6849 { \
6850 (Current).first_line = (Current).last_line = \
6851 YYRHSLOC (Rhs, 0).last_line; \
6852 (Current).first_column = (Current).last_column = \
6853 YYRHSLOC (Rhs, 0).last_column; \
6854 } \
6855 while (0)
6856#endif
6857
6858#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6859
6860
6861/* Enable debugging if requested. */
6862#if YYDEBUG
6863
6864# ifndef YYFPRINTF
6865# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6866# define YYFPRINTF fprintf
6867# endif
6868
6869# define YYDPRINTF(Args) \
6870do { \
6871 if (yydebug) \
6872 YYFPRINTF Args; \
6873} while (0)
6874
6875
6876/* YYLOCATION_PRINT -- Print the location on the stream.
6877 This macro was not mandated originally: define only if we know
6878 we won't break user code: when these are the locations we know. */
6879
6880# ifndef YYLOCATION_PRINT
6881
6882# if defined YY_LOCATION_PRINT
6883
6884 /* Temporary convenience wrapper in case some people defined the
6885 undocumented and private YY_LOCATION_PRINT macros. */
6886# define YYLOCATION_PRINT(File, Loc, p) YY_LOCATION_PRINT(File, *(Loc), p)
6887
6888# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6889
6890/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
6891
6892YY_ATTRIBUTE_UNUSED
6893static int
6894yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
6895{
6896 int res = 0;
6897 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
6898 if (0 <= yylocp->first_line)
6899 {
6900 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
6901 if (0 <= yylocp->first_column)
6902 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
6903 }
6904 if (0 <= yylocp->last_line)
6905 {
6906 if (yylocp->first_line < yylocp->last_line)
6907 {
6908 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
6909 if (0 <= end_col)
6910 res += YYFPRINTF (yyo, ".%d", end_col);
6911 }
6912 else if (0 <= end_col && yylocp->first_column < end_col)
6913 res += YYFPRINTF (yyo, "-%d", end_col);
6914 }
6915 return res;
6916}
6917
6918# define YYLOCATION_PRINT yy_location_print_
6919
6920 /* Temporary convenience wrapper in case some people defined the
6921 undocumented and private YY_LOCATION_PRINT macros. */
6922# define YY_LOCATION_PRINT(File, Loc, p) YYLOCATION_PRINT(File, &(Loc), p)
6923
6924# else
6925
6926# define YYLOCATION_PRINT(File, Loc, p) ((void) 0)
6927 /* Temporary convenience wrapper in case some people defined the
6928 undocumented and private YY_LOCATION_PRINT macros. */
6929# define YY_LOCATION_PRINT YYLOCATION_PRINT
6930
6931# endif
6932# endif /* !defined YYLOCATION_PRINT */
6933
6934
6935# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p) \
6936do { \
6937 if (yydebug) \
6938 { \
6939 YYFPRINTF (stderr, "%s ", Title); \
6940 yy_symbol_print (stderr, \
6941 Kind, Value, Location, p); \
6942 YYFPRINTF (stderr, "\n"); \
6943 } \
6944} while (0)
6945
6946
6947/*-----------------------------------.
6948| Print this symbol's value on YYO. |
6949`-----------------------------------*/
6950
6951static void
6952yy_symbol_value_print (FILE *yyo,
6953 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6954{
6955 FILE *yyoutput = yyo;
6956 YY_USE (yyoutput);
6957 YY_USE (yylocationp);
6958 YY_USE (p);
6959 if (!yyvaluep)
6960 return;
6961 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6962switch (yykind)
6963 {
6964 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
6965#line 1927 "parse.y"
6966 {
6967#ifndef RIPPER
6968 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6969#else
6970 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
6971#endif
6972}
6973#line 6974 "parse.c"
6974 break;
6975
6976 case YYSYMBOL_tFID: /* "method" */
6977#line 1927 "parse.y"
6978 {
6979#ifndef RIPPER
6980 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6981#else
6982 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
6983#endif
6984}
6985#line 6986 "parse.c"
6986 break;
6987
6988 case YYSYMBOL_tGVAR: /* "global variable" */
6989#line 1927 "parse.y"
6990 {
6991#ifndef RIPPER
6992 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6993#else
6994 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
6995#endif
6996}
6997#line 6998 "parse.c"
6998 break;
6999
7000 case YYSYMBOL_tIVAR: /* "instance variable" */
7001#line 1927 "parse.y"
7002 {
7003#ifndef RIPPER
7004 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7005#else
7006 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7007#endif
7008}
7009#line 7010 "parse.c"
7010 break;
7011
7012 case YYSYMBOL_tCONSTANT: /* "constant" */
7013#line 1927 "parse.y"
7014 {
7015#ifndef RIPPER
7016 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7017#else
7018 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7019#endif
7020}
7021#line 7022 "parse.c"
7022 break;
7023
7024 case YYSYMBOL_tCVAR: /* "class variable" */
7025#line 1927 "parse.y"
7026 {
7027#ifndef RIPPER
7028 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7029#else
7030 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7031#endif
7032}
7033#line 7034 "parse.c"
7034 break;
7035
7036 case YYSYMBOL_tLABEL: /* "label" */
7037#line 1927 "parse.y"
7038 {
7039#ifndef RIPPER
7040 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7041#else
7042 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7043#endif
7044}
7045#line 7046 "parse.c"
7046 break;
7047
7048 case YYSYMBOL_tINTEGER: /* "integer literal" */
7049#line 1934 "parse.y"
7050 {
7051#ifndef RIPPER
7052 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7053#else
7054 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7055#endif
7056}
7057#line 7058 "parse.c"
7058 break;
7059
7060 case YYSYMBOL_tFLOAT: /* "float literal" */
7061#line 1934 "parse.y"
7062 {
7063#ifndef RIPPER
7064 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7065#else
7066 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7067#endif
7068}
7069#line 7070 "parse.c"
7070 break;
7071
7072 case YYSYMBOL_tRATIONAL: /* "rational literal" */
7073#line 1934 "parse.y"
7074 {
7075#ifndef RIPPER
7076 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7077#else
7078 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7079#endif
7080}
7081#line 7082 "parse.c"
7082 break;
7083
7084 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
7085#line 1934 "parse.y"
7086 {
7087#ifndef RIPPER
7088 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7089#else
7090 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7091#endif
7092}
7093#line 7094 "parse.c"
7094 break;
7095
7096 case YYSYMBOL_tCHAR: /* "char literal" */
7097#line 1934 "parse.y"
7098 {
7099#ifndef RIPPER
7100 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7101#else
7102 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7103#endif
7104}
7105#line 7106 "parse.c"
7106 break;
7107
7108 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
7109#line 1941 "parse.y"
7110 {
7111#ifndef RIPPER
7112 rb_parser_printf(p, "$%ld", RNODE_NTH_REF(((*yyvaluep).node))->nd_nth);
7113#else
7114 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
7115#endif
7116}
7117#line 7118 "parse.c"
7118 break;
7119
7120 case YYSYMBOL_tBACK_REF: /* "back reference" */
7121#line 1948 "parse.y"
7122 {
7123#ifndef RIPPER
7124 rb_parser_printf(p, "$%c", (int)RNODE_BACK_REF(((*yyvaluep).node))->nd_nth);
7125#else
7126 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
7127#endif
7128}
7129#line 7130 "parse.c"
7130 break;
7131
7132 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
7133#line 1934 "parse.y"
7134 {
7135#ifndef RIPPER
7136 rb_parser_printf(p, "%+"PRIsVALUE, RNODE_LIT(((*yyvaluep).node))->nd_lit);
7137#else
7138 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
7139#endif
7140}
7141#line 7142 "parse.c"
7142 break;
7143
7144 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
7145#line 1927 "parse.y"
7146 {
7147#ifndef RIPPER
7148 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
7149#else
7150 rb_parser_printf(p, "%"PRIsVALUE, RNODE_RIPPER(((*yyvaluep).id))->nd_rval);
7151#endif
7152}
7153#line 7154 "parse.c"
7154 break;
7155
7156 case YYSYMBOL_top_compstmt: /* top_compstmt */
7157#line 1916 "parse.y"
7158 {
7159#ifndef RIPPER
7160 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7161 rb_parser_printf(p, "NODE_SPECIAL");
7162 }
7163 else if (((*yyvaluep).node)) {
7164 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7165 }
7166#else
7167#endif
7168}
7169#line 7170 "parse.c"
7170 break;
7171
7172 case YYSYMBOL_top_stmts: /* top_stmts */
7173#line 1916 "parse.y"
7174 {
7175#ifndef RIPPER
7176 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7177 rb_parser_printf(p, "NODE_SPECIAL");
7178 }
7179 else if (((*yyvaluep).node)) {
7180 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7181 }
7182#else
7183#endif
7184}
7185#line 7186 "parse.c"
7186 break;
7187
7188 case YYSYMBOL_top_stmt: /* top_stmt */
7189#line 1916 "parse.y"
7190 {
7191#ifndef RIPPER
7192 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7193 rb_parser_printf(p, "NODE_SPECIAL");
7194 }
7195 else if (((*yyvaluep).node)) {
7196 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7197 }
7198#else
7199#endif
7200}
7201#line 7202 "parse.c"
7202 break;
7203
7204 case YYSYMBOL_begin_block: /* begin_block */
7205#line 1916 "parse.y"
7206 {
7207#ifndef RIPPER
7208 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7209 rb_parser_printf(p, "NODE_SPECIAL");
7210 }
7211 else if (((*yyvaluep).node)) {
7212 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7213 }
7214#else
7215#endif
7216}
7217#line 7218 "parse.c"
7218 break;
7219
7220 case YYSYMBOL_bodystmt: /* bodystmt */
7221#line 1916 "parse.y"
7222 {
7223#ifndef RIPPER
7224 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7225 rb_parser_printf(p, "NODE_SPECIAL");
7226 }
7227 else if (((*yyvaluep).node)) {
7228 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7229 }
7230#else
7231#endif
7232}
7233#line 7234 "parse.c"
7234 break;
7235
7236 case YYSYMBOL_compstmt: /* compstmt */
7237#line 1916 "parse.y"
7238 {
7239#ifndef RIPPER
7240 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7241 rb_parser_printf(p, "NODE_SPECIAL");
7242 }
7243 else if (((*yyvaluep).node)) {
7244 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7245 }
7246#else
7247#endif
7248}
7249#line 7250 "parse.c"
7250 break;
7251
7252 case YYSYMBOL_stmts: /* stmts */
7253#line 1916 "parse.y"
7254 {
7255#ifndef RIPPER
7256 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7257 rb_parser_printf(p, "NODE_SPECIAL");
7258 }
7259 else if (((*yyvaluep).node)) {
7260 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7261 }
7262#else
7263#endif
7264}
7265#line 7266 "parse.c"
7266 break;
7267
7268 case YYSYMBOL_stmt_or_begin: /* stmt_or_begin */
7269#line 1916 "parse.y"
7270 {
7271#ifndef RIPPER
7272 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7273 rb_parser_printf(p, "NODE_SPECIAL");
7274 }
7275 else if (((*yyvaluep).node)) {
7276 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7277 }
7278#else
7279#endif
7280}
7281#line 7282 "parse.c"
7282 break;
7283
7284 case YYSYMBOL_stmt: /* stmt */
7285#line 1916 "parse.y"
7286 {
7287#ifndef RIPPER
7288 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7289 rb_parser_printf(p, "NODE_SPECIAL");
7290 }
7291 else if (((*yyvaluep).node)) {
7292 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7293 }
7294#else
7295#endif
7296}
7297#line 7298 "parse.c"
7298 break;
7299
7300 case YYSYMBOL_command_asgn: /* command_asgn */
7301#line 1916 "parse.y"
7302 {
7303#ifndef RIPPER
7304 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7305 rb_parser_printf(p, "NODE_SPECIAL");
7306 }
7307 else if (((*yyvaluep).node)) {
7308 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7309 }
7310#else
7311#endif
7312}
7313#line 7314 "parse.c"
7314 break;
7315
7316 case YYSYMBOL_endless_command: /* endless_command */
7317#line 1916 "parse.y"
7318 {
7319#ifndef RIPPER
7320 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7321 rb_parser_printf(p, "NODE_SPECIAL");
7322 }
7323 else if (((*yyvaluep).node)) {
7324 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7325 }
7326#else
7327#endif
7328}
7329#line 7330 "parse.c"
7330 break;
7331
7332 case YYSYMBOL_command_rhs: /* command_rhs */
7333#line 1916 "parse.y"
7334 {
7335#ifndef RIPPER
7336 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7337 rb_parser_printf(p, "NODE_SPECIAL");
7338 }
7339 else if (((*yyvaluep).node)) {
7340 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7341 }
7342#else
7343#endif
7344}
7345#line 7346 "parse.c"
7346 break;
7347
7348 case YYSYMBOL_expr: /* expr */
7349#line 1916 "parse.y"
7350 {
7351#ifndef RIPPER
7352 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7353 rb_parser_printf(p, "NODE_SPECIAL");
7354 }
7355 else if (((*yyvaluep).node)) {
7356 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7357 }
7358#else
7359#endif
7360}
7361#line 7362 "parse.c"
7362 break;
7363
7364 case YYSYMBOL_expr_value: /* expr_value */
7365#line 1916 "parse.y"
7366 {
7367#ifndef RIPPER
7368 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7369 rb_parser_printf(p, "NODE_SPECIAL");
7370 }
7371 else if (((*yyvaluep).node)) {
7372 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7373 }
7374#else
7375#endif
7376}
7377#line 7378 "parse.c"
7378 break;
7379
7380 case YYSYMBOL_expr_value_do: /* expr_value_do */
7381#line 1916 "parse.y"
7382 {
7383#ifndef RIPPER
7384 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7385 rb_parser_printf(p, "NODE_SPECIAL");
7386 }
7387 else if (((*yyvaluep).node)) {
7388 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7389 }
7390#else
7391#endif
7392}
7393#line 7394 "parse.c"
7394 break;
7395
7396 case YYSYMBOL_command_call: /* command_call */
7397#line 1916 "parse.y"
7398 {
7399#ifndef RIPPER
7400 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7401 rb_parser_printf(p, "NODE_SPECIAL");
7402 }
7403 else if (((*yyvaluep).node)) {
7404 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7405 }
7406#else
7407#endif
7408}
7409#line 7410 "parse.c"
7410 break;
7411
7412 case YYSYMBOL_block_command: /* block_command */
7413#line 1916 "parse.y"
7414 {
7415#ifndef RIPPER
7416 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7417 rb_parser_printf(p, "NODE_SPECIAL");
7418 }
7419 else if (((*yyvaluep).node)) {
7420 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7421 }
7422#else
7423#endif
7424}
7425#line 7426 "parse.c"
7426 break;
7427
7428 case YYSYMBOL_cmd_brace_block: /* cmd_brace_block */
7429#line 1916 "parse.y"
7430 {
7431#ifndef RIPPER
7432 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7433 rb_parser_printf(p, "NODE_SPECIAL");
7434 }
7435 else if (((*yyvaluep).node)) {
7436 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7437 }
7438#else
7439#endif
7440}
7441#line 7442 "parse.c"
7442 break;
7443
7444 case YYSYMBOL_fcall: /* fcall */
7445#line 1916 "parse.y"
7446 {
7447#ifndef RIPPER
7448 if ((NODE *)((*yyvaluep).node_fcall) == (NODE *)-1) {
7449 rb_parser_printf(p, "NODE_SPECIAL");
7450 }
7451 else if (((*yyvaluep).node_fcall)) {
7452 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_fcall)))));
7453 }
7454#else
7455#endif
7456}
7457#line 7458 "parse.c"
7458 break;
7459
7460 case YYSYMBOL_command: /* command */
7461#line 1916 "parse.y"
7462 {
7463#ifndef RIPPER
7464 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7465 rb_parser_printf(p, "NODE_SPECIAL");
7466 }
7467 else if (((*yyvaluep).node)) {
7468 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7469 }
7470#else
7471#endif
7472}
7473#line 7474 "parse.c"
7474 break;
7475
7476 case YYSYMBOL_mlhs_item: /* mlhs_item */
7477#line 1916 "parse.y"
7478 {
7479#ifndef RIPPER
7480 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7481 rb_parser_printf(p, "NODE_SPECIAL");
7482 }
7483 else if (((*yyvaluep).node)) {
7484 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7485 }
7486#else
7487#endif
7488}
7489#line 7490 "parse.c"
7490 break;
7491
7492 case YYSYMBOL_mlhs_head: /* mlhs_head */
7493#line 1916 "parse.y"
7494 {
7495#ifndef RIPPER
7496 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7497 rb_parser_printf(p, "NODE_SPECIAL");
7498 }
7499 else if (((*yyvaluep).node)) {
7500 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7501 }
7502#else
7503#endif
7504}
7505#line 7506 "parse.c"
7506 break;
7507
7508 case YYSYMBOL_mlhs_post: /* mlhs_post */
7509#line 1916 "parse.y"
7510 {
7511#ifndef RIPPER
7512 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7513 rb_parser_printf(p, "NODE_SPECIAL");
7514 }
7515 else if (((*yyvaluep).node)) {
7516 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7517 }
7518#else
7519#endif
7520}
7521#line 7522 "parse.c"
7522 break;
7523
7524 case YYSYMBOL_mlhs_node: /* mlhs_node */
7525#line 1916 "parse.y"
7526 {
7527#ifndef RIPPER
7528 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7529 rb_parser_printf(p, "NODE_SPECIAL");
7530 }
7531 else if (((*yyvaluep).node)) {
7532 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7533 }
7534#else
7535#endif
7536}
7537#line 7538 "parse.c"
7538 break;
7539
7540 case YYSYMBOL_lhs: /* lhs */
7541#line 1916 "parse.y"
7542 {
7543#ifndef RIPPER
7544 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7545 rb_parser_printf(p, "NODE_SPECIAL");
7546 }
7547 else if (((*yyvaluep).node)) {
7548 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7549 }
7550#else
7551#endif
7552}
7553#line 7554 "parse.c"
7554 break;
7555
7556 case YYSYMBOL_cpath: /* cpath */
7557#line 1916 "parse.y"
7558 {
7559#ifndef RIPPER
7560 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7561 rb_parser_printf(p, "NODE_SPECIAL");
7562 }
7563 else if (((*yyvaluep).node)) {
7564 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7565 }
7566#else
7567#endif
7568}
7569#line 7570 "parse.c"
7570 break;
7571
7572 case YYSYMBOL_fitem: /* fitem */
7573#line 1916 "parse.y"
7574 {
7575#ifndef RIPPER
7576 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7577 rb_parser_printf(p, "NODE_SPECIAL");
7578 }
7579 else if (((*yyvaluep).node)) {
7580 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7581 }
7582#else
7583#endif
7584}
7585#line 7586 "parse.c"
7586 break;
7587
7588 case YYSYMBOL_undef_list: /* undef_list */
7589#line 1916 "parse.y"
7590 {
7591#ifndef RIPPER
7592 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7593 rb_parser_printf(p, "NODE_SPECIAL");
7594 }
7595 else if (((*yyvaluep).node)) {
7596 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7597 }
7598#else
7599#endif
7600}
7601#line 7602 "parse.c"
7602 break;
7603
7604 case YYSYMBOL_arg: /* arg */
7605#line 1916 "parse.y"
7606 {
7607#ifndef RIPPER
7608 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7609 rb_parser_printf(p, "NODE_SPECIAL");
7610 }
7611 else if (((*yyvaluep).node)) {
7612 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7613 }
7614#else
7615#endif
7616}
7617#line 7618 "parse.c"
7618 break;
7619
7620 case YYSYMBOL_endless_arg: /* endless_arg */
7621#line 1916 "parse.y"
7622 {
7623#ifndef RIPPER
7624 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7625 rb_parser_printf(p, "NODE_SPECIAL");
7626 }
7627 else if (((*yyvaluep).node)) {
7628 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7629 }
7630#else
7631#endif
7632}
7633#line 7634 "parse.c"
7634 break;
7635
7636 case YYSYMBOL_rel_expr: /* rel_expr */
7637#line 1916 "parse.y"
7638 {
7639#ifndef RIPPER
7640 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7641 rb_parser_printf(p, "NODE_SPECIAL");
7642 }
7643 else if (((*yyvaluep).node)) {
7644 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7645 }
7646#else
7647#endif
7648}
7649#line 7650 "parse.c"
7650 break;
7651
7652 case YYSYMBOL_arg_value: /* arg_value */
7653#line 1916 "parse.y"
7654 {
7655#ifndef RIPPER
7656 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7657 rb_parser_printf(p, "NODE_SPECIAL");
7658 }
7659 else if (((*yyvaluep).node)) {
7660 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7661 }
7662#else
7663#endif
7664}
7665#line 7666 "parse.c"
7666 break;
7667
7668 case YYSYMBOL_aref_args: /* aref_args */
7669#line 1916 "parse.y"
7670 {
7671#ifndef RIPPER
7672 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7673 rb_parser_printf(p, "NODE_SPECIAL");
7674 }
7675 else if (((*yyvaluep).node)) {
7676 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7677 }
7678#else
7679#endif
7680}
7681#line 7682 "parse.c"
7682 break;
7683
7684 case YYSYMBOL_arg_rhs: /* arg_rhs */
7685#line 1916 "parse.y"
7686 {
7687#ifndef RIPPER
7688 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7689 rb_parser_printf(p, "NODE_SPECIAL");
7690 }
7691 else if (((*yyvaluep).node)) {
7692 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7693 }
7694#else
7695#endif
7696}
7697#line 7698 "parse.c"
7698 break;
7699
7700 case YYSYMBOL_paren_args: /* paren_args */
7701#line 1916 "parse.y"
7702 {
7703#ifndef RIPPER
7704 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7705 rb_parser_printf(p, "NODE_SPECIAL");
7706 }
7707 else if (((*yyvaluep).node)) {
7708 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7709 }
7710#else
7711#endif
7712}
7713#line 7714 "parse.c"
7714 break;
7715
7716 case YYSYMBOL_opt_paren_args: /* opt_paren_args */
7717#line 1916 "parse.y"
7718 {
7719#ifndef RIPPER
7720 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7721 rb_parser_printf(p, "NODE_SPECIAL");
7722 }
7723 else if (((*yyvaluep).node)) {
7724 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7725 }
7726#else
7727#endif
7728}
7729#line 7730 "parse.c"
7730 break;
7731
7732 case YYSYMBOL_opt_call_args: /* opt_call_args */
7733#line 1916 "parse.y"
7734 {
7735#ifndef RIPPER
7736 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7737 rb_parser_printf(p, "NODE_SPECIAL");
7738 }
7739 else if (((*yyvaluep).node)) {
7740 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7741 }
7742#else
7743#endif
7744}
7745#line 7746 "parse.c"
7746 break;
7747
7748 case YYSYMBOL_call_args: /* call_args */
7749#line 1916 "parse.y"
7750 {
7751#ifndef RIPPER
7752 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7753 rb_parser_printf(p, "NODE_SPECIAL");
7754 }
7755 else if (((*yyvaluep).node)) {
7756 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7757 }
7758#else
7759#endif
7760}
7761#line 7762 "parse.c"
7762 break;
7763
7764 case YYSYMBOL_command_args: /* command_args */
7765#line 1916 "parse.y"
7766 {
7767#ifndef RIPPER
7768 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7769 rb_parser_printf(p, "NODE_SPECIAL");
7770 }
7771 else if (((*yyvaluep).node)) {
7772 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7773 }
7774#else
7775#endif
7776}
7777#line 7778 "parse.c"
7778 break;
7779
7780 case YYSYMBOL_block_arg: /* block_arg */
7781#line 1916 "parse.y"
7782 {
7783#ifndef RIPPER
7784 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
7785 rb_parser_printf(p, "NODE_SPECIAL");
7786 }
7787 else if (((*yyvaluep).node_block_pass)) {
7788 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
7789 }
7790#else
7791#endif
7792}
7793#line 7794 "parse.c"
7794 break;
7795
7796 case YYSYMBOL_opt_block_arg: /* opt_block_arg */
7797#line 1916 "parse.y"
7798 {
7799#ifndef RIPPER
7800 if ((NODE *)((*yyvaluep).node_block_pass) == (NODE *)-1) {
7801 rb_parser_printf(p, "NODE_SPECIAL");
7802 }
7803 else if (((*yyvaluep).node_block_pass)) {
7804 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_block_pass)))));
7805 }
7806#else
7807#endif
7808}
7809#line 7810 "parse.c"
7810 break;
7811
7812 case YYSYMBOL_args: /* args */
7813#line 1916 "parse.y"
7814 {
7815#ifndef RIPPER
7816 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7817 rb_parser_printf(p, "NODE_SPECIAL");
7818 }
7819 else if (((*yyvaluep).node)) {
7820 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7821 }
7822#else
7823#endif
7824}
7825#line 7826 "parse.c"
7826 break;
7827
7828 case YYSYMBOL_arg_splat: /* arg_splat */
7829#line 1916 "parse.y"
7830 {
7831#ifndef RIPPER
7832 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7833 rb_parser_printf(p, "NODE_SPECIAL");
7834 }
7835 else if (((*yyvaluep).node)) {
7836 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7837 }
7838#else
7839#endif
7840}
7841#line 7842 "parse.c"
7842 break;
7843
7844 case YYSYMBOL_mrhs_arg: /* mrhs_arg */
7845#line 1916 "parse.y"
7846 {
7847#ifndef RIPPER
7848 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7849 rb_parser_printf(p, "NODE_SPECIAL");
7850 }
7851 else if (((*yyvaluep).node)) {
7852 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7853 }
7854#else
7855#endif
7856}
7857#line 7858 "parse.c"
7858 break;
7859
7860 case YYSYMBOL_mrhs: /* mrhs */
7861#line 1916 "parse.y"
7862 {
7863#ifndef RIPPER
7864 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7865 rb_parser_printf(p, "NODE_SPECIAL");
7866 }
7867 else if (((*yyvaluep).node)) {
7868 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7869 }
7870#else
7871#endif
7872}
7873#line 7874 "parse.c"
7874 break;
7875
7876 case YYSYMBOL_primary: /* primary */
7877#line 1916 "parse.y"
7878 {
7879#ifndef RIPPER
7880 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7881 rb_parser_printf(p, "NODE_SPECIAL");
7882 }
7883 else if (((*yyvaluep).node)) {
7884 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7885 }
7886#else
7887#endif
7888}
7889#line 7890 "parse.c"
7890 break;
7891
7892 case YYSYMBOL_primary_value: /* primary_value */
7893#line 1916 "parse.y"
7894 {
7895#ifndef RIPPER
7896 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7897 rb_parser_printf(p, "NODE_SPECIAL");
7898 }
7899 else if (((*yyvaluep).node)) {
7900 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7901 }
7902#else
7903#endif
7904}
7905#line 7906 "parse.c"
7906 break;
7907
7908 case YYSYMBOL_if_tail: /* if_tail */
7909#line 1916 "parse.y"
7910 {
7911#ifndef RIPPER
7912 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7913 rb_parser_printf(p, "NODE_SPECIAL");
7914 }
7915 else if (((*yyvaluep).node)) {
7916 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7917 }
7918#else
7919#endif
7920}
7921#line 7922 "parse.c"
7922 break;
7923
7924 case YYSYMBOL_opt_else: /* opt_else */
7925#line 1916 "parse.y"
7926 {
7927#ifndef RIPPER
7928 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7929 rb_parser_printf(p, "NODE_SPECIAL");
7930 }
7931 else if (((*yyvaluep).node)) {
7932 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7933 }
7934#else
7935#endif
7936}
7937#line 7938 "parse.c"
7938 break;
7939
7940 case YYSYMBOL_for_var: /* for_var */
7941#line 1916 "parse.y"
7942 {
7943#ifndef RIPPER
7944 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7945 rb_parser_printf(p, "NODE_SPECIAL");
7946 }
7947 else if (((*yyvaluep).node)) {
7948 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7949 }
7950#else
7951#endif
7952}
7953#line 7954 "parse.c"
7954 break;
7955
7956 case YYSYMBOL_f_marg: /* f_marg */
7957#line 1916 "parse.y"
7958 {
7959#ifndef RIPPER
7960 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7961 rb_parser_printf(p, "NODE_SPECIAL");
7962 }
7963 else if (((*yyvaluep).node)) {
7964 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7965 }
7966#else
7967#endif
7968}
7969#line 7970 "parse.c"
7970 break;
7971
7972 case YYSYMBOL_f_marg_list: /* f_marg_list */
7973#line 1916 "parse.y"
7974 {
7975#ifndef RIPPER
7976 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7977 rb_parser_printf(p, "NODE_SPECIAL");
7978 }
7979 else if (((*yyvaluep).node)) {
7980 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7981 }
7982#else
7983#endif
7984}
7985#line 7986 "parse.c"
7986 break;
7987
7988 case YYSYMBOL_f_rest_marg: /* f_rest_marg */
7989#line 1916 "parse.y"
7990 {
7991#ifndef RIPPER
7992 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
7993 rb_parser_printf(p, "NODE_SPECIAL");
7994 }
7995 else if (((*yyvaluep).node)) {
7996 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
7997 }
7998#else
7999#endif
8000}
8001#line 8002 "parse.c"
8002 break;
8003
8004 case YYSYMBOL_block_args_tail: /* block_args_tail */
8005#line 1916 "parse.y"
8006 {
8007#ifndef RIPPER
8008 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8009 rb_parser_printf(p, "NODE_SPECIAL");
8010 }
8011 else if (((*yyvaluep).node_args)) {
8012 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8013 }
8014#else
8015#endif
8016}
8017#line 8018 "parse.c"
8018 break;
8019
8020 case YYSYMBOL_opt_block_args_tail: /* opt_block_args_tail */
8021#line 1916 "parse.y"
8022 {
8023#ifndef RIPPER
8024 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8025 rb_parser_printf(p, "NODE_SPECIAL");
8026 }
8027 else if (((*yyvaluep).node_args)) {
8028 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8029 }
8030#else
8031#endif
8032}
8033#line 8034 "parse.c"
8034 break;
8035
8036 case YYSYMBOL_block_param: /* block_param */
8037#line 1916 "parse.y"
8038 {
8039#ifndef RIPPER
8040 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8041 rb_parser_printf(p, "NODE_SPECIAL");
8042 }
8043 else if (((*yyvaluep).node_args)) {
8044 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8045 }
8046#else
8047#endif
8048}
8049#line 8050 "parse.c"
8050 break;
8051
8052 case YYSYMBOL_opt_block_param: /* opt_block_param */
8053#line 1916 "parse.y"
8054 {
8055#ifndef RIPPER
8056 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8057 rb_parser_printf(p, "NODE_SPECIAL");
8058 }
8059 else if (((*yyvaluep).node_args)) {
8060 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8061 }
8062#else
8063#endif
8064}
8065#line 8066 "parse.c"
8066 break;
8067
8068 case YYSYMBOL_block_param_def: /* block_param_def */
8069#line 1916 "parse.y"
8070 {
8071#ifndef RIPPER
8072 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8073 rb_parser_printf(p, "NODE_SPECIAL");
8074 }
8075 else if (((*yyvaluep).node_args)) {
8076 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8077 }
8078#else
8079#endif
8080}
8081#line 8082 "parse.c"
8082 break;
8083
8084 case YYSYMBOL_opt_bv_decl: /* opt_bv_decl */
8085#line 1916 "parse.y"
8086 {
8087#ifndef RIPPER
8088 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8089 rb_parser_printf(p, "NODE_SPECIAL");
8090 }
8091 else if (((*yyvaluep).node)) {
8092 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8093 }
8094#else
8095#endif
8096}
8097#line 8098 "parse.c"
8098 break;
8099
8100 case YYSYMBOL_bv_decls: /* bv_decls */
8101#line 1916 "parse.y"
8102 {
8103#ifndef RIPPER
8104 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8105 rb_parser_printf(p, "NODE_SPECIAL");
8106 }
8107 else if (((*yyvaluep).node)) {
8108 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8109 }
8110#else
8111#endif
8112}
8113#line 8114 "parse.c"
8114 break;
8115
8116 case YYSYMBOL_bvar: /* bvar */
8117#line 1916 "parse.y"
8118 {
8119#ifndef RIPPER
8120 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8121 rb_parser_printf(p, "NODE_SPECIAL");
8122 }
8123 else if (((*yyvaluep).node)) {
8124 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8125 }
8126#else
8127#endif
8128}
8129#line 8130 "parse.c"
8130 break;
8131
8132 case YYSYMBOL_numparam: /* numparam */
8133#line 1916 "parse.y"
8134 {
8135#ifndef RIPPER
8136 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8137 rb_parser_printf(p, "NODE_SPECIAL");
8138 }
8139 else if (((*yyvaluep).node)) {
8140 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8141 }
8142#else
8143#endif
8144}
8145#line 8146 "parse.c"
8146 break;
8147
8148 case YYSYMBOL_lambda: /* lambda */
8149#line 1916 "parse.y"
8150 {
8151#ifndef RIPPER
8152 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8153 rb_parser_printf(p, "NODE_SPECIAL");
8154 }
8155 else if (((*yyvaluep).node)) {
8156 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8157 }
8158#else
8159#endif
8160}
8161#line 8162 "parse.c"
8162 break;
8163
8164 case YYSYMBOL_f_larglist: /* f_larglist */
8165#line 1916 "parse.y"
8166 {
8167#ifndef RIPPER
8168 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
8169 rb_parser_printf(p, "NODE_SPECIAL");
8170 }
8171 else if (((*yyvaluep).node_args)) {
8172 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
8173 }
8174#else
8175#endif
8176}
8177#line 8178 "parse.c"
8178 break;
8179
8180 case YYSYMBOL_lambda_body: /* lambda_body */
8181#line 1916 "parse.y"
8182 {
8183#ifndef RIPPER
8184 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8185 rb_parser_printf(p, "NODE_SPECIAL");
8186 }
8187 else if (((*yyvaluep).node)) {
8188 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8189 }
8190#else
8191#endif
8192}
8193#line 8194 "parse.c"
8194 break;
8195
8196 case YYSYMBOL_do_block: /* do_block */
8197#line 1916 "parse.y"
8198 {
8199#ifndef RIPPER
8200 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8201 rb_parser_printf(p, "NODE_SPECIAL");
8202 }
8203 else if (((*yyvaluep).node)) {
8204 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8205 }
8206#else
8207#endif
8208}
8209#line 8210 "parse.c"
8210 break;
8211
8212 case YYSYMBOL_block_call: /* block_call */
8213#line 1916 "parse.y"
8214 {
8215#ifndef RIPPER
8216 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8217 rb_parser_printf(p, "NODE_SPECIAL");
8218 }
8219 else if (((*yyvaluep).node)) {
8220 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8221 }
8222#else
8223#endif
8224}
8225#line 8226 "parse.c"
8226 break;
8227
8228 case YYSYMBOL_method_call: /* method_call */
8229#line 1916 "parse.y"
8230 {
8231#ifndef RIPPER
8232 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8233 rb_parser_printf(p, "NODE_SPECIAL");
8234 }
8235 else if (((*yyvaluep).node)) {
8236 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8237 }
8238#else
8239#endif
8240}
8241#line 8242 "parse.c"
8242 break;
8243
8244 case YYSYMBOL_brace_block: /* brace_block */
8245#line 1916 "parse.y"
8246 {
8247#ifndef RIPPER
8248 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8249 rb_parser_printf(p, "NODE_SPECIAL");
8250 }
8251 else if (((*yyvaluep).node)) {
8252 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8253 }
8254#else
8255#endif
8256}
8257#line 8258 "parse.c"
8258 break;
8259
8260 case YYSYMBOL_brace_body: /* brace_body */
8261#line 1916 "parse.y"
8262 {
8263#ifndef RIPPER
8264 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8265 rb_parser_printf(p, "NODE_SPECIAL");
8266 }
8267 else if (((*yyvaluep).node)) {
8268 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8269 }
8270#else
8271#endif
8272}
8273#line 8274 "parse.c"
8274 break;
8275
8276 case YYSYMBOL_do_body: /* do_body */
8277#line 1916 "parse.y"
8278 {
8279#ifndef RIPPER
8280 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8281 rb_parser_printf(p, "NODE_SPECIAL");
8282 }
8283 else if (((*yyvaluep).node)) {
8284 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8285 }
8286#else
8287#endif
8288}
8289#line 8290 "parse.c"
8290 break;
8291
8292 case YYSYMBOL_case_args: /* case_args */
8293#line 1916 "parse.y"
8294 {
8295#ifndef RIPPER
8296 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8297 rb_parser_printf(p, "NODE_SPECIAL");
8298 }
8299 else if (((*yyvaluep).node)) {
8300 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8301 }
8302#else
8303#endif
8304}
8305#line 8306 "parse.c"
8306 break;
8307
8308 case YYSYMBOL_case_body: /* case_body */
8309#line 1916 "parse.y"
8310 {
8311#ifndef RIPPER
8312 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8313 rb_parser_printf(p, "NODE_SPECIAL");
8314 }
8315 else if (((*yyvaluep).node)) {
8316 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8317 }
8318#else
8319#endif
8320}
8321#line 8322 "parse.c"
8322 break;
8323
8324 case YYSYMBOL_cases: /* cases */
8325#line 1916 "parse.y"
8326 {
8327#ifndef RIPPER
8328 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8329 rb_parser_printf(p, "NODE_SPECIAL");
8330 }
8331 else if (((*yyvaluep).node)) {
8332 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8333 }
8334#else
8335#endif
8336}
8337#line 8338 "parse.c"
8338 break;
8339
8340 case YYSYMBOL_p_case_body: /* p_case_body */
8341#line 1916 "parse.y"
8342 {
8343#ifndef RIPPER
8344 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8345 rb_parser_printf(p, "NODE_SPECIAL");
8346 }
8347 else if (((*yyvaluep).node)) {
8348 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8349 }
8350#else
8351#endif
8352}
8353#line 8354 "parse.c"
8354 break;
8355
8356 case YYSYMBOL_p_cases: /* p_cases */
8357#line 1916 "parse.y"
8358 {
8359#ifndef RIPPER
8360 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8361 rb_parser_printf(p, "NODE_SPECIAL");
8362 }
8363 else if (((*yyvaluep).node)) {
8364 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8365 }
8366#else
8367#endif
8368}
8369#line 8370 "parse.c"
8370 break;
8371
8372 case YYSYMBOL_p_top_expr: /* p_top_expr */
8373#line 1916 "parse.y"
8374 {
8375#ifndef RIPPER
8376 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8377 rb_parser_printf(p, "NODE_SPECIAL");
8378 }
8379 else if (((*yyvaluep).node)) {
8380 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8381 }
8382#else
8383#endif
8384}
8385#line 8386 "parse.c"
8386 break;
8387
8388 case YYSYMBOL_p_top_expr_body: /* p_top_expr_body */
8389#line 1916 "parse.y"
8390 {
8391#ifndef RIPPER
8392 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8393 rb_parser_printf(p, "NODE_SPECIAL");
8394 }
8395 else if (((*yyvaluep).node)) {
8396 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8397 }
8398#else
8399#endif
8400}
8401#line 8402 "parse.c"
8402 break;
8403
8404 case YYSYMBOL_p_expr: /* p_expr */
8405#line 1916 "parse.y"
8406 {
8407#ifndef RIPPER
8408 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8409 rb_parser_printf(p, "NODE_SPECIAL");
8410 }
8411 else if (((*yyvaluep).node)) {
8412 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8413 }
8414#else
8415#endif
8416}
8417#line 8418 "parse.c"
8418 break;
8419
8420 case YYSYMBOL_p_as: /* p_as */
8421#line 1916 "parse.y"
8422 {
8423#ifndef RIPPER
8424 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8425 rb_parser_printf(p, "NODE_SPECIAL");
8426 }
8427 else if (((*yyvaluep).node)) {
8428 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8429 }
8430#else
8431#endif
8432}
8433#line 8434 "parse.c"
8434 break;
8435
8436 case YYSYMBOL_p_alt: /* p_alt */
8437#line 1916 "parse.y"
8438 {
8439#ifndef RIPPER
8440 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8441 rb_parser_printf(p, "NODE_SPECIAL");
8442 }
8443 else if (((*yyvaluep).node)) {
8444 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8445 }
8446#else
8447#endif
8448}
8449#line 8450 "parse.c"
8450 break;
8451
8452 case YYSYMBOL_p_expr_basic: /* p_expr_basic */
8453#line 1916 "parse.y"
8454 {
8455#ifndef RIPPER
8456 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8457 rb_parser_printf(p, "NODE_SPECIAL");
8458 }
8459 else if (((*yyvaluep).node)) {
8460 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8461 }
8462#else
8463#endif
8464}
8465#line 8466 "parse.c"
8466 break;
8467
8468 case YYSYMBOL_p_args: /* p_args */
8469#line 1916 "parse.y"
8470 {
8471#ifndef RIPPER
8472 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8473 rb_parser_printf(p, "NODE_SPECIAL");
8474 }
8475 else if (((*yyvaluep).node)) {
8476 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8477 }
8478#else
8479#endif
8480}
8481#line 8482 "parse.c"
8482 break;
8483
8484 case YYSYMBOL_p_args_head: /* p_args_head */
8485#line 1916 "parse.y"
8486 {
8487#ifndef RIPPER
8488 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8489 rb_parser_printf(p, "NODE_SPECIAL");
8490 }
8491 else if (((*yyvaluep).node)) {
8492 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8493 }
8494#else
8495#endif
8496}
8497#line 8498 "parse.c"
8498 break;
8499
8500 case YYSYMBOL_p_args_tail: /* p_args_tail */
8501#line 1916 "parse.y"
8502 {
8503#ifndef RIPPER
8504 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8505 rb_parser_printf(p, "NODE_SPECIAL");
8506 }
8507 else if (((*yyvaluep).node)) {
8508 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8509 }
8510#else
8511#endif
8512}
8513#line 8514 "parse.c"
8514 break;
8515
8516 case YYSYMBOL_p_find: /* p_find */
8517#line 1916 "parse.y"
8518 {
8519#ifndef RIPPER
8520 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8521 rb_parser_printf(p, "NODE_SPECIAL");
8522 }
8523 else if (((*yyvaluep).node)) {
8524 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8525 }
8526#else
8527#endif
8528}
8529#line 8530 "parse.c"
8530 break;
8531
8532 case YYSYMBOL_p_rest: /* p_rest */
8533#line 1916 "parse.y"
8534 {
8535#ifndef RIPPER
8536 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8537 rb_parser_printf(p, "NODE_SPECIAL");
8538 }
8539 else if (((*yyvaluep).node)) {
8540 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8541 }
8542#else
8543#endif
8544}
8545#line 8546 "parse.c"
8546 break;
8547
8548 case YYSYMBOL_p_args_post: /* p_args_post */
8549#line 1916 "parse.y"
8550 {
8551#ifndef RIPPER
8552 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8553 rb_parser_printf(p, "NODE_SPECIAL");
8554 }
8555 else if (((*yyvaluep).node)) {
8556 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8557 }
8558#else
8559#endif
8560}
8561#line 8562 "parse.c"
8562 break;
8563
8564 case YYSYMBOL_p_arg: /* p_arg */
8565#line 1916 "parse.y"
8566 {
8567#ifndef RIPPER
8568 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8569 rb_parser_printf(p, "NODE_SPECIAL");
8570 }
8571 else if (((*yyvaluep).node)) {
8572 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8573 }
8574#else
8575#endif
8576}
8577#line 8578 "parse.c"
8578 break;
8579
8580 case YYSYMBOL_p_kwargs: /* p_kwargs */
8581#line 1916 "parse.y"
8582 {
8583#ifndef RIPPER
8584 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8585 rb_parser_printf(p, "NODE_SPECIAL");
8586 }
8587 else if (((*yyvaluep).node)) {
8588 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8589 }
8590#else
8591#endif
8592}
8593#line 8594 "parse.c"
8594 break;
8595
8596 case YYSYMBOL_p_kwarg: /* p_kwarg */
8597#line 1916 "parse.y"
8598 {
8599#ifndef RIPPER
8600 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8601 rb_parser_printf(p, "NODE_SPECIAL");
8602 }
8603 else if (((*yyvaluep).node)) {
8604 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8605 }
8606#else
8607#endif
8608}
8609#line 8610 "parse.c"
8610 break;
8611
8612 case YYSYMBOL_p_kw: /* p_kw */
8613#line 1916 "parse.y"
8614 {
8615#ifndef RIPPER
8616 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8617 rb_parser_printf(p, "NODE_SPECIAL");
8618 }
8619 else if (((*yyvaluep).node)) {
8620 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8621 }
8622#else
8623#endif
8624}
8625#line 8626 "parse.c"
8626 break;
8627
8628 case YYSYMBOL_p_value: /* p_value */
8629#line 1916 "parse.y"
8630 {
8631#ifndef RIPPER
8632 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8633 rb_parser_printf(p, "NODE_SPECIAL");
8634 }
8635 else if (((*yyvaluep).node)) {
8636 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8637 }
8638#else
8639#endif
8640}
8641#line 8642 "parse.c"
8642 break;
8643
8644 case YYSYMBOL_p_primitive: /* p_primitive */
8645#line 1916 "parse.y"
8646 {
8647#ifndef RIPPER
8648 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8649 rb_parser_printf(p, "NODE_SPECIAL");
8650 }
8651 else if (((*yyvaluep).node)) {
8652 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8653 }
8654#else
8655#endif
8656}
8657#line 8658 "parse.c"
8658 break;
8659
8660 case YYSYMBOL_p_variable: /* p_variable */
8661#line 1916 "parse.y"
8662 {
8663#ifndef RIPPER
8664 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8665 rb_parser_printf(p, "NODE_SPECIAL");
8666 }
8667 else if (((*yyvaluep).node)) {
8668 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8669 }
8670#else
8671#endif
8672}
8673#line 8674 "parse.c"
8674 break;
8675
8676 case YYSYMBOL_p_var_ref: /* p_var_ref */
8677#line 1916 "parse.y"
8678 {
8679#ifndef RIPPER
8680 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8681 rb_parser_printf(p, "NODE_SPECIAL");
8682 }
8683 else if (((*yyvaluep).node)) {
8684 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8685 }
8686#else
8687#endif
8688}
8689#line 8690 "parse.c"
8690 break;
8691
8692 case YYSYMBOL_p_expr_ref: /* p_expr_ref */
8693#line 1916 "parse.y"
8694 {
8695#ifndef RIPPER
8696 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8697 rb_parser_printf(p, "NODE_SPECIAL");
8698 }
8699 else if (((*yyvaluep).node)) {
8700 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8701 }
8702#else
8703#endif
8704}
8705#line 8706 "parse.c"
8706 break;
8707
8708 case YYSYMBOL_p_const: /* p_const */
8709#line 1916 "parse.y"
8710 {
8711#ifndef RIPPER
8712 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8713 rb_parser_printf(p, "NODE_SPECIAL");
8714 }
8715 else if (((*yyvaluep).node)) {
8716 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8717 }
8718#else
8719#endif
8720}
8721#line 8722 "parse.c"
8722 break;
8723
8724 case YYSYMBOL_opt_rescue: /* opt_rescue */
8725#line 1916 "parse.y"
8726 {
8727#ifndef RIPPER
8728 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8729 rb_parser_printf(p, "NODE_SPECIAL");
8730 }
8731 else if (((*yyvaluep).node)) {
8732 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8733 }
8734#else
8735#endif
8736}
8737#line 8738 "parse.c"
8738 break;
8739
8740 case YYSYMBOL_exc_list: /* exc_list */
8741#line 1916 "parse.y"
8742 {
8743#ifndef RIPPER
8744 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8745 rb_parser_printf(p, "NODE_SPECIAL");
8746 }
8747 else if (((*yyvaluep).node)) {
8748 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8749 }
8750#else
8751#endif
8752}
8753#line 8754 "parse.c"
8754 break;
8755
8756 case YYSYMBOL_exc_var: /* exc_var */
8757#line 1916 "parse.y"
8758 {
8759#ifndef RIPPER
8760 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8761 rb_parser_printf(p, "NODE_SPECIAL");
8762 }
8763 else if (((*yyvaluep).node)) {
8764 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8765 }
8766#else
8767#endif
8768}
8769#line 8770 "parse.c"
8770 break;
8771
8772 case YYSYMBOL_opt_ensure: /* opt_ensure */
8773#line 1916 "parse.y"
8774 {
8775#ifndef RIPPER
8776 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8777 rb_parser_printf(p, "NODE_SPECIAL");
8778 }
8779 else if (((*yyvaluep).node)) {
8780 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8781 }
8782#else
8783#endif
8784}
8785#line 8786 "parse.c"
8786 break;
8787
8788 case YYSYMBOL_literal: /* literal */
8789#line 1916 "parse.y"
8790 {
8791#ifndef RIPPER
8792 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8793 rb_parser_printf(p, "NODE_SPECIAL");
8794 }
8795 else if (((*yyvaluep).node)) {
8796 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8797 }
8798#else
8799#endif
8800}
8801#line 8802 "parse.c"
8802 break;
8803
8804 case YYSYMBOL_strings: /* strings */
8805#line 1916 "parse.y"
8806 {
8807#ifndef RIPPER
8808 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8809 rb_parser_printf(p, "NODE_SPECIAL");
8810 }
8811 else if (((*yyvaluep).node)) {
8812 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8813 }
8814#else
8815#endif
8816}
8817#line 8818 "parse.c"
8818 break;
8819
8820 case YYSYMBOL_string: /* string */
8821#line 1916 "parse.y"
8822 {
8823#ifndef RIPPER
8824 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8825 rb_parser_printf(p, "NODE_SPECIAL");
8826 }
8827 else if (((*yyvaluep).node)) {
8828 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8829 }
8830#else
8831#endif
8832}
8833#line 8834 "parse.c"
8834 break;
8835
8836 case YYSYMBOL_string1: /* string1 */
8837#line 1916 "parse.y"
8838 {
8839#ifndef RIPPER
8840 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8841 rb_parser_printf(p, "NODE_SPECIAL");
8842 }
8843 else if (((*yyvaluep).node)) {
8844 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8845 }
8846#else
8847#endif
8848}
8849#line 8850 "parse.c"
8850 break;
8851
8852 case YYSYMBOL_xstring: /* xstring */
8853#line 1916 "parse.y"
8854 {
8855#ifndef RIPPER
8856 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8857 rb_parser_printf(p, "NODE_SPECIAL");
8858 }
8859 else if (((*yyvaluep).node)) {
8860 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8861 }
8862#else
8863#endif
8864}
8865#line 8866 "parse.c"
8866 break;
8867
8868 case YYSYMBOL_regexp: /* regexp */
8869#line 1916 "parse.y"
8870 {
8871#ifndef RIPPER
8872 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8873 rb_parser_printf(p, "NODE_SPECIAL");
8874 }
8875 else if (((*yyvaluep).node)) {
8876 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8877 }
8878#else
8879#endif
8880}
8881#line 8882 "parse.c"
8882 break;
8883
8884 case YYSYMBOL_words: /* words */
8885#line 1916 "parse.y"
8886 {
8887#ifndef RIPPER
8888 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8889 rb_parser_printf(p, "NODE_SPECIAL");
8890 }
8891 else if (((*yyvaluep).node)) {
8892 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8893 }
8894#else
8895#endif
8896}
8897#line 8898 "parse.c"
8898 break;
8899
8900 case YYSYMBOL_word_list: /* word_list */
8901#line 1916 "parse.y"
8902 {
8903#ifndef RIPPER
8904 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8905 rb_parser_printf(p, "NODE_SPECIAL");
8906 }
8907 else if (((*yyvaluep).node)) {
8908 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8909 }
8910#else
8911#endif
8912}
8913#line 8914 "parse.c"
8914 break;
8915
8916 case YYSYMBOL_word: /* word */
8917#line 1916 "parse.y"
8918 {
8919#ifndef RIPPER
8920 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8921 rb_parser_printf(p, "NODE_SPECIAL");
8922 }
8923 else if (((*yyvaluep).node)) {
8924 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8925 }
8926#else
8927#endif
8928}
8929#line 8930 "parse.c"
8930 break;
8931
8932 case YYSYMBOL_symbols: /* symbols */
8933#line 1916 "parse.y"
8934 {
8935#ifndef RIPPER
8936 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8937 rb_parser_printf(p, "NODE_SPECIAL");
8938 }
8939 else if (((*yyvaluep).node)) {
8940 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8941 }
8942#else
8943#endif
8944}
8945#line 8946 "parse.c"
8946 break;
8947
8948 case YYSYMBOL_symbol_list: /* symbol_list */
8949#line 1916 "parse.y"
8950 {
8951#ifndef RIPPER
8952 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8953 rb_parser_printf(p, "NODE_SPECIAL");
8954 }
8955 else if (((*yyvaluep).node)) {
8956 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8957 }
8958#else
8959#endif
8960}
8961#line 8962 "parse.c"
8962 break;
8963
8964 case YYSYMBOL_qwords: /* qwords */
8965#line 1916 "parse.y"
8966 {
8967#ifndef RIPPER
8968 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8969 rb_parser_printf(p, "NODE_SPECIAL");
8970 }
8971 else if (((*yyvaluep).node)) {
8972 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8973 }
8974#else
8975#endif
8976}
8977#line 8978 "parse.c"
8978 break;
8979
8980 case YYSYMBOL_qsymbols: /* qsymbols */
8981#line 1916 "parse.y"
8982 {
8983#ifndef RIPPER
8984 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
8985 rb_parser_printf(p, "NODE_SPECIAL");
8986 }
8987 else if (((*yyvaluep).node)) {
8988 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
8989 }
8990#else
8991#endif
8992}
8993#line 8994 "parse.c"
8994 break;
8995
8996 case YYSYMBOL_qword_list: /* qword_list */
8997#line 1916 "parse.y"
8998 {
8999#ifndef RIPPER
9000 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9001 rb_parser_printf(p, "NODE_SPECIAL");
9002 }
9003 else if (((*yyvaluep).node)) {
9004 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9005 }
9006#else
9007#endif
9008}
9009#line 9010 "parse.c"
9010 break;
9011
9012 case YYSYMBOL_qsym_list: /* qsym_list */
9013#line 1916 "parse.y"
9014 {
9015#ifndef RIPPER
9016 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9017 rb_parser_printf(p, "NODE_SPECIAL");
9018 }
9019 else if (((*yyvaluep).node)) {
9020 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9021 }
9022#else
9023#endif
9024}
9025#line 9026 "parse.c"
9026 break;
9027
9028 case YYSYMBOL_string_contents: /* string_contents */
9029#line 1916 "parse.y"
9030 {
9031#ifndef RIPPER
9032 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9033 rb_parser_printf(p, "NODE_SPECIAL");
9034 }
9035 else if (((*yyvaluep).node)) {
9036 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9037 }
9038#else
9039#endif
9040}
9041#line 9042 "parse.c"
9042 break;
9043
9044 case YYSYMBOL_xstring_contents: /* xstring_contents */
9045#line 1916 "parse.y"
9046 {
9047#ifndef RIPPER
9048 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9049 rb_parser_printf(p, "NODE_SPECIAL");
9050 }
9051 else if (((*yyvaluep).node)) {
9052 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9053 }
9054#else
9055#endif
9056}
9057#line 9058 "parse.c"
9058 break;
9059
9060 case YYSYMBOL_regexp_contents: /* regexp_contents */
9061#line 1916 "parse.y"
9062 {
9063#ifndef RIPPER
9064 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9065 rb_parser_printf(p, "NODE_SPECIAL");
9066 }
9067 else if (((*yyvaluep).node)) {
9068 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9069 }
9070#else
9071#endif
9072}
9073#line 9074 "parse.c"
9074 break;
9075
9076 case YYSYMBOL_string_content: /* string_content */
9077#line 1916 "parse.y"
9078 {
9079#ifndef RIPPER
9080 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9081 rb_parser_printf(p, "NODE_SPECIAL");
9082 }
9083 else if (((*yyvaluep).node)) {
9084 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9085 }
9086#else
9087#endif
9088}
9089#line 9090 "parse.c"
9090 break;
9091
9092 case YYSYMBOL_string_dvar: /* string_dvar */
9093#line 1916 "parse.y"
9094 {
9095#ifndef RIPPER
9096 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9097 rb_parser_printf(p, "NODE_SPECIAL");
9098 }
9099 else if (((*yyvaluep).node)) {
9100 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9101 }
9102#else
9103#endif
9104}
9105#line 9106 "parse.c"
9106 break;
9107
9108 case YYSYMBOL_symbol: /* symbol */
9109#line 1916 "parse.y"
9110 {
9111#ifndef RIPPER
9112 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9113 rb_parser_printf(p, "NODE_SPECIAL");
9114 }
9115 else if (((*yyvaluep).node)) {
9116 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9117 }
9118#else
9119#endif
9120}
9121#line 9122 "parse.c"
9122 break;
9123
9124 case YYSYMBOL_ssym: /* ssym */
9125#line 1916 "parse.y"
9126 {
9127#ifndef RIPPER
9128 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9129 rb_parser_printf(p, "NODE_SPECIAL");
9130 }
9131 else if (((*yyvaluep).node)) {
9132 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9133 }
9134#else
9135#endif
9136}
9137#line 9138 "parse.c"
9138 break;
9139
9140 case YYSYMBOL_dsym: /* dsym */
9141#line 1916 "parse.y"
9142 {
9143#ifndef RIPPER
9144 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9145 rb_parser_printf(p, "NODE_SPECIAL");
9146 }
9147 else if (((*yyvaluep).node)) {
9148 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9149 }
9150#else
9151#endif
9152}
9153#line 9154 "parse.c"
9154 break;
9155
9156 case YYSYMBOL_numeric: /* numeric */
9157#line 1916 "parse.y"
9158 {
9159#ifndef RIPPER
9160 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9161 rb_parser_printf(p, "NODE_SPECIAL");
9162 }
9163 else if (((*yyvaluep).node)) {
9164 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9165 }
9166#else
9167#endif
9168}
9169#line 9170 "parse.c"
9170 break;
9171
9172 case YYSYMBOL_simple_numeric: /* simple_numeric */
9173#line 1916 "parse.y"
9174 {
9175#ifndef RIPPER
9176 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9177 rb_parser_printf(p, "NODE_SPECIAL");
9178 }
9179 else if (((*yyvaluep).node)) {
9180 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9181 }
9182#else
9183#endif
9184}
9185#line 9186 "parse.c"
9186 break;
9187
9188 case YYSYMBOL_var_ref: /* var_ref */
9189#line 1916 "parse.y"
9190 {
9191#ifndef RIPPER
9192 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9193 rb_parser_printf(p, "NODE_SPECIAL");
9194 }
9195 else if (((*yyvaluep).node)) {
9196 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9197 }
9198#else
9199#endif
9200}
9201#line 9202 "parse.c"
9202 break;
9203
9204 case YYSYMBOL_var_lhs: /* var_lhs */
9205#line 1916 "parse.y"
9206 {
9207#ifndef RIPPER
9208 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9209 rb_parser_printf(p, "NODE_SPECIAL");
9210 }
9211 else if (((*yyvaluep).node)) {
9212 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9213 }
9214#else
9215#endif
9216}
9217#line 9218 "parse.c"
9218 break;
9219
9220 case YYSYMBOL_backref: /* backref */
9221#line 1916 "parse.y"
9222 {
9223#ifndef RIPPER
9224 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9225 rb_parser_printf(p, "NODE_SPECIAL");
9226 }
9227 else if (((*yyvaluep).node)) {
9228 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9229 }
9230#else
9231#endif
9232}
9233#line 9234 "parse.c"
9234 break;
9235
9236 case YYSYMBOL_superclass: /* superclass */
9237#line 1916 "parse.y"
9238 {
9239#ifndef RIPPER
9240 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9241 rb_parser_printf(p, "NODE_SPECIAL");
9242 }
9243 else if (((*yyvaluep).node)) {
9244 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9245 }
9246#else
9247#endif
9248}
9249#line 9250 "parse.c"
9250 break;
9251
9252 case YYSYMBOL_f_opt_paren_args: /* f_opt_paren_args */
9253#line 1916 "parse.y"
9254 {
9255#ifndef RIPPER
9256 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9257 rb_parser_printf(p, "NODE_SPECIAL");
9258 }
9259 else if (((*yyvaluep).node_args)) {
9260 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9261 }
9262#else
9263#endif
9264}
9265#line 9266 "parse.c"
9266 break;
9267
9268 case YYSYMBOL_f_paren_args: /* f_paren_args */
9269#line 1916 "parse.y"
9270 {
9271#ifndef RIPPER
9272 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9273 rb_parser_printf(p, "NODE_SPECIAL");
9274 }
9275 else if (((*yyvaluep).node_args)) {
9276 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9277 }
9278#else
9279#endif
9280}
9281#line 9282 "parse.c"
9282 break;
9283
9284 case YYSYMBOL_f_arglist: /* f_arglist */
9285#line 1916 "parse.y"
9286 {
9287#ifndef RIPPER
9288 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9289 rb_parser_printf(p, "NODE_SPECIAL");
9290 }
9291 else if (((*yyvaluep).node_args)) {
9292 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9293 }
9294#else
9295#endif
9296}
9297#line 9298 "parse.c"
9298 break;
9299
9300 case YYSYMBOL_args_tail: /* args_tail */
9301#line 1916 "parse.y"
9302 {
9303#ifndef RIPPER
9304 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9305 rb_parser_printf(p, "NODE_SPECIAL");
9306 }
9307 else if (((*yyvaluep).node_args)) {
9308 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9309 }
9310#else
9311#endif
9312}
9313#line 9314 "parse.c"
9314 break;
9315
9316 case YYSYMBOL_opt_args_tail: /* opt_args_tail */
9317#line 1916 "parse.y"
9318 {
9319#ifndef RIPPER
9320 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9321 rb_parser_printf(p, "NODE_SPECIAL");
9322 }
9323 else if (((*yyvaluep).node_args)) {
9324 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9325 }
9326#else
9327#endif
9328}
9329#line 9330 "parse.c"
9330 break;
9331
9332 case YYSYMBOL_f_args: /* f_args */
9333#line 1916 "parse.y"
9334 {
9335#ifndef RIPPER
9336 if ((NODE *)((*yyvaluep).node_args) == (NODE *)-1) {
9337 rb_parser_printf(p, "NODE_SPECIAL");
9338 }
9339 else if (((*yyvaluep).node_args)) {
9340 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args)))));
9341 }
9342#else
9343#endif
9344}
9345#line 9346 "parse.c"
9346 break;
9347
9348 case YYSYMBOL_f_arg_item: /* f_arg_item */
9349#line 1916 "parse.y"
9350 {
9351#ifndef RIPPER
9352 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
9353 rb_parser_printf(p, "NODE_SPECIAL");
9354 }
9355 else if (((*yyvaluep).node_args_aux)) {
9356 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
9357 }
9358#else
9359#endif
9360}
9361#line 9362 "parse.c"
9362 break;
9363
9364 case YYSYMBOL_f_arg: /* f_arg */
9365#line 1916 "parse.y"
9366 {
9367#ifndef RIPPER
9368 if ((NODE *)((*yyvaluep).node_args_aux) == (NODE *)-1) {
9369 rb_parser_printf(p, "NODE_SPECIAL");
9370 }
9371 else if (((*yyvaluep).node_args_aux)) {
9372 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_args_aux)))));
9373 }
9374#else
9375#endif
9376}
9377#line 9378 "parse.c"
9378 break;
9379
9380 case YYSYMBOL_f_kw: /* f_kw */
9381#line 1916 "parse.y"
9382 {
9383#ifndef RIPPER
9384 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9385 rb_parser_printf(p, "NODE_SPECIAL");
9386 }
9387 else if (((*yyvaluep).node_kw_arg)) {
9388 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9389 }
9390#else
9391#endif
9392}
9393#line 9394 "parse.c"
9394 break;
9395
9396 case YYSYMBOL_f_block_kw: /* f_block_kw */
9397#line 1916 "parse.y"
9398 {
9399#ifndef RIPPER
9400 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9401 rb_parser_printf(p, "NODE_SPECIAL");
9402 }
9403 else if (((*yyvaluep).node_kw_arg)) {
9404 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9405 }
9406#else
9407#endif
9408}
9409#line 9410 "parse.c"
9410 break;
9411
9412 case YYSYMBOL_f_block_kwarg: /* f_block_kwarg */
9413#line 1916 "parse.y"
9414 {
9415#ifndef RIPPER
9416 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9417 rb_parser_printf(p, "NODE_SPECIAL");
9418 }
9419 else if (((*yyvaluep).node_kw_arg)) {
9420 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9421 }
9422#else
9423#endif
9424}
9425#line 9426 "parse.c"
9426 break;
9427
9428 case YYSYMBOL_f_kwarg: /* f_kwarg */
9429#line 1916 "parse.y"
9430 {
9431#ifndef RIPPER
9432 if ((NODE *)((*yyvaluep).node_kw_arg) == (NODE *)-1) {
9433 rb_parser_printf(p, "NODE_SPECIAL");
9434 }
9435 else if (((*yyvaluep).node_kw_arg)) {
9436 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_kw_arg)))));
9437 }
9438#else
9439#endif
9440}
9441#line 9442 "parse.c"
9442 break;
9443
9444 case YYSYMBOL_f_opt: /* f_opt */
9445#line 1916 "parse.y"
9446 {
9447#ifndef RIPPER
9448 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9449 rb_parser_printf(p, "NODE_SPECIAL");
9450 }
9451 else if (((*yyvaluep).node_opt_arg)) {
9452 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9453 }
9454#else
9455#endif
9456}
9457#line 9458 "parse.c"
9458 break;
9459
9460 case YYSYMBOL_f_block_opt: /* f_block_opt */
9461#line 1916 "parse.y"
9462 {
9463#ifndef RIPPER
9464 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9465 rb_parser_printf(p, "NODE_SPECIAL");
9466 }
9467 else if (((*yyvaluep).node_opt_arg)) {
9468 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9469 }
9470#else
9471#endif
9472}
9473#line 9474 "parse.c"
9474 break;
9475
9476 case YYSYMBOL_f_block_optarg: /* f_block_optarg */
9477#line 1916 "parse.y"
9478 {
9479#ifndef RIPPER
9480 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9481 rb_parser_printf(p, "NODE_SPECIAL");
9482 }
9483 else if (((*yyvaluep).node_opt_arg)) {
9484 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9485 }
9486#else
9487#endif
9488}
9489#line 9490 "parse.c"
9490 break;
9491
9492 case YYSYMBOL_f_optarg: /* f_optarg */
9493#line 1916 "parse.y"
9494 {
9495#ifndef RIPPER
9496 if ((NODE *)((*yyvaluep).node_opt_arg) == (NODE *)-1) {
9497 rb_parser_printf(p, "NODE_SPECIAL");
9498 }
9499 else if (((*yyvaluep).node_opt_arg)) {
9500 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node_opt_arg)))));
9501 }
9502#else
9503#endif
9504}
9505#line 9506 "parse.c"
9506 break;
9507
9508 case YYSYMBOL_singleton: /* singleton */
9509#line 1916 "parse.y"
9510 {
9511#ifndef RIPPER
9512 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9513 rb_parser_printf(p, "NODE_SPECIAL");
9514 }
9515 else if (((*yyvaluep).node)) {
9516 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9517 }
9518#else
9519#endif
9520}
9521#line 9522 "parse.c"
9522 break;
9523
9524 case YYSYMBOL_assoc_list: /* assoc_list */
9525#line 1916 "parse.y"
9526 {
9527#ifndef RIPPER
9528 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9529 rb_parser_printf(p, "NODE_SPECIAL");
9530 }
9531 else if (((*yyvaluep).node)) {
9532 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9533 }
9534#else
9535#endif
9536}
9537#line 9538 "parse.c"
9538 break;
9539
9540 case YYSYMBOL_assocs: /* assocs */
9541#line 1916 "parse.y"
9542 {
9543#ifndef RIPPER
9544 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9545 rb_parser_printf(p, "NODE_SPECIAL");
9546 }
9547 else if (((*yyvaluep).node)) {
9548 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9549 }
9550#else
9551#endif
9552}
9553#line 9554 "parse.c"
9554 break;
9555
9556 case YYSYMBOL_assoc: /* assoc */
9557#line 1916 "parse.y"
9558 {
9559#ifndef RIPPER
9560 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9561 rb_parser_printf(p, "NODE_SPECIAL");
9562 }
9563 else if (((*yyvaluep).node)) {
9564 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9565 }
9566#else
9567#endif
9568}
9569#line 9570 "parse.c"
9570 break;
9571
9572 case YYSYMBOL_none: /* none */
9573#line 1916 "parse.y"
9574 {
9575#ifndef RIPPER
9576 if ((NODE *)((*yyvaluep).node) == (NODE *)-1) {
9577 rb_parser_printf(p, "NODE_SPECIAL");
9578 }
9579 else if (((*yyvaluep).node)) {
9580 rb_parser_printf(p, "%s", parser_node_name(nd_type(RNODE(((*yyvaluep).node)))));
9581 }
9582#else
9583#endif
9584}
9585#line 9586 "parse.c"
9586 break;
9587
9588 default:
9589 break;
9590 }
9591 YY_IGNORE_MAYBE_UNINITIALIZED_END
9592}
9593
9594
9595/*---------------------------.
9596| Print this symbol on YYO. |
9597`---------------------------*/
9598
9599static void
9600yy_symbol_print (FILE *yyo,
9601 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
9602{
9603 YYFPRINTF (yyo, "%s %s (",
9604 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
9605
9606 YYLOCATION_PRINT (yyo, yylocationp, p);
9607 YYFPRINTF (yyo, ": ");
9608 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
9609 YYFPRINTF (yyo, ")");
9610}
9611
9612/*------------------------------------------------------------------.
9613| yy_stack_print -- Print the state stack from its BOTTOM up to its |
9614| TOP (included). |
9615`------------------------------------------------------------------*/
9616
9617static void
9618yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
9619{
9620 YYFPRINTF (stderr, "Stack now");
9621 for (; yybottom <= yytop; yybottom++)
9622 {
9623 int yybot = *yybottom;
9624 YYFPRINTF (stderr, " %d", yybot);
9625 }
9626 YYFPRINTF (stderr, "\n");
9627}
9628
9629# define YY_STACK_PRINT(Bottom, Top, p) \
9630do { \
9631 if (yydebug) \
9632 yy_stack_print ((Bottom), (Top), p); \
9633} while (0)
9634
9635
9636/*------------------------------------------------.
9637| Report that the YYRULE is going to be reduced. |
9638`------------------------------------------------*/
9639
9640static void
9641yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
9642 int yyrule, struct parser_params *p)
9643{
9644 int yylno = yyrline[yyrule];
9645 int yynrhs = yyr2[yyrule];
9646 int yyi;
9647 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
9648 yyrule - 1, yylno);
9649 /* The symbols being reduced. */
9650 for (yyi = 0; yyi < yynrhs; yyi++)
9651 {
9652 YYFPRINTF (stderr, " $%d = ", yyi + 1);
9653 yy_symbol_print (stderr,
9654 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
9655 &yyvsp[(yyi + 1) - (yynrhs)],
9656 &(yylsp[(yyi + 1) - (yynrhs)]), p);
9657 YYFPRINTF (stderr, "\n");
9658 }
9659}
9660
9661# define YY_REDUCE_PRINT(Rule, p) \
9662do { \
9663 if (yydebug) \
9664 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
9665} while (0)
9666
9667/* Nonzero means print parse trace. It is left uninitialized so that
9668 multiple parsers can coexist. */
9669#ifndef yydebug
9670int yydebug;
9671#endif
9672#else /* !YYDEBUG */
9673# define YYDPRINTF(Args) ((void) 0)
9674# define YY_SYMBOL_PRINT(Title, Kind, Value, Location, p)
9675# define YY_STACK_PRINT(Bottom, Top, p)
9676# define YY_REDUCE_PRINT(Rule, p)
9677#endif /* !YYDEBUG */
9678
9679
9680/* YYINITDEPTH -- initial size of the parser's stacks. */
9681#ifndef YYINITDEPTH
9682# define YYINITDEPTH 200
9683#endif
9684
9685/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
9686 if the built-in stack extension method is used).
9687
9688 Do not make this value too large; the results are undefined if
9689 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
9690 evaluated with infinite-precision integer arithmetic. */
9691
9692#ifndef YYMAXDEPTH
9693# define YYMAXDEPTH 10000
9694#endif
9695
9696
9697/* Context of a parse error. */
9698typedef struct
9699{
9700 yy_state_t *yyssp;
9701 yysymbol_kind_t yytoken;
9702 YYLTYPE *yylloc;
9703} yypcontext_t;
9704
9705/* Put in YYARG at most YYARGN of the expected tokens given the
9706 current YYCTX, and return the number of tokens stored in YYARG. If
9707 YYARG is null, return the number of expected tokens (guaranteed to
9708 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
9709 Return 0 if there are more than YYARGN expected tokens, yet fill
9710 YYARG up to YYARGN. */
9711static int
9712yypcontext_expected_tokens (const yypcontext_t *yyctx,
9713 yysymbol_kind_t yyarg[], int yyargn)
9714{
9715 /* Actual size of YYARG. */
9716 int yycount = 0;
9717 int yyn = yypact[+*yyctx->yyssp];
9718 if (!yypact_value_is_default (yyn))
9719 {
9720 /* Start YYX at -YYN if negative to avoid negative indexes in
9721 YYCHECK. In other words, skip the first -YYN actions for
9722 this state because they are default actions. */
9723 int yyxbegin = yyn < 0 ? -yyn : 0;
9724 /* Stay within bounds of both yycheck and yytname. */
9725 int yychecklim = YYLAST - yyn + 1;
9726 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
9727 int yyx;
9728 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
9729 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
9730 && !yytable_value_is_error (yytable[yyx + yyn]))
9731 {
9732 if (!yyarg)
9733 ++yycount;
9734 else if (yycount == yyargn)
9735 return 0;
9736 else
9737 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
9738 }
9739 }
9740 if (yyarg && yycount == 0 && 0 < yyargn)
9741 yyarg[0] = YYSYMBOL_YYEMPTY;
9742 return yycount;
9743}
9744
9745
9746
9747
9748#ifndef yystrlen
9749# if defined __GLIBC__ && defined _STRING_H
9750# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
9751# else
9752/* Return the length of YYSTR. */
9753static YYPTRDIFF_T
9754yystrlen (const char *yystr)
9755{
9756 YYPTRDIFF_T yylen;
9757 for (yylen = 0; yystr[yylen]; yylen++)
9758 continue;
9759 return yylen;
9760}
9761# endif
9762#endif
9763
9764#ifndef yystpcpy
9765# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
9766# define yystpcpy stpcpy
9767# else
9768/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
9769 YYDEST. */
9770static char *
9771yystpcpy (char *yydest, const char *yysrc)
9772{
9773 char *yyd = yydest;
9774 const char *yys = yysrc;
9775
9776 while ((*yyd++ = *yys++) != '\0')
9777 continue;
9778
9779 return yyd - 1;
9780}
9781# endif
9782#endif
9783
9784#ifndef yytnamerr
9785/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
9786 quotes and backslashes, so that it's suitable for yyerror. The
9787 heuristic is that double-quoting is unnecessary unless the string
9788 contains an apostrophe, a comma, or backslash (other than
9789 backslash-backslash). YYSTR is taken from yytname. If YYRES is
9790 null, do not copy; instead, return the length of what the result
9791 would have been. */
9792static YYPTRDIFF_T
9793yytnamerr (char *yyres, const char *yystr)
9794{
9795 if (*yystr == '"')
9796 {
9797 YYPTRDIFF_T yyn = 0;
9798 char const *yyp = yystr;
9799 for (;;)
9800 switch (*++yyp)
9801 {
9802 case '\'':
9803 case ',':
9804 goto do_not_strip_quotes;
9805
9806 case '\\':
9807 if (*++yyp != '\\')
9808 goto do_not_strip_quotes;
9809 else
9810 goto append;
9811
9812 append:
9813 default:
9814 if (yyres)
9815 yyres[yyn] = *yyp;
9816 yyn++;
9817 break;
9818
9819 case '"':
9820 if (yyres)
9821 yyres[yyn] = '\0';
9822 return yyn;
9823 }
9824 do_not_strip_quotes: ;
9825 }
9826
9827 if (yyres)
9828 return yystpcpy (yyres, yystr) - yyres;
9829 else
9830 return yystrlen (yystr);
9831}
9832#endif
9833
9834
9835static int
9836yy_syntax_error_arguments (const yypcontext_t *yyctx,
9837 yysymbol_kind_t yyarg[], int yyargn)
9838{
9839 /* Actual size of YYARG. */
9840 int yycount = 0;
9841 /* There are many possibilities here to consider:
9842 - If this state is a consistent state with a default action, then
9843 the only way this function was invoked is if the default action
9844 is an error action. In that case, don't check for expected
9845 tokens because there are none.
9846 - The only way there can be no lookahead present (in yychar) is if
9847 this state is a consistent state with a default action. Thus,
9848 detecting the absence of a lookahead is sufficient to determine
9849 that there is no unexpected or expected token to report. In that
9850 case, just report a simple "syntax error".
9851 - Don't assume there isn't a lookahead just because this state is a
9852 consistent state with a default action. There might have been a
9853 previous inconsistent state, consistent state with a non-default
9854 action, or user semantic action that manipulated yychar.
9855 - Of course, the expected token list depends on states to have
9856 correct lookahead information, and it depends on the parser not
9857 to perform extra reductions after fetching a lookahead from the
9858 scanner and before detecting a syntax error. Thus, state merging
9859 (from LALR or IELR) and default reductions corrupt the expected
9860 token list. However, the list is correct for canonical LR with
9861 one exception: it will still contain any token that will not be
9862 accepted due to an error action in a later state.
9863 */
9864 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
9865 {
9866 int yyn;
9867 if (yyarg)
9868 yyarg[yycount] = yyctx->yytoken;
9869 ++yycount;
9870 yyn = yypcontext_expected_tokens (yyctx,
9871 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
9872 if (yyn == YYENOMEM)
9873 return YYENOMEM;
9874 else
9875 yycount += yyn;
9876 }
9877 return yycount;
9878}
9879
9880/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
9881 about the unexpected token YYTOKEN for the state stack whose top is
9882 YYSSP.
9883
9884 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
9885 not large enough to hold the message. In that case, also set
9886 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
9887 required number of bytes is too large to store. */
9888static int
9889yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
9890 const yypcontext_t *yyctx, struct parser_params *p)
9891{
9892 enum { YYARGS_MAX = 5 };
9893 /* Internationalized format string. */
9894 const char *yyformat = YY_NULLPTR;
9895 /* Arguments of yyformat: reported tokens (one for the "unexpected",
9896 one per "expected"). */
9897 yysymbol_kind_t yyarg[YYARGS_MAX];
9898 /* Cumulated lengths of YYARG. */
9899 YYPTRDIFF_T yysize = 0;
9900
9901 /* Actual size of YYARG. */
9902 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
9903 if (yycount == YYENOMEM)
9904 return YYENOMEM;
9905
9906 switch (yycount)
9907 {
9908#define YYCASE_(N, S) \
9909 case N: \
9910 yyformat = S; \
9911 break
9912 default: /* Avoid compiler warnings. */
9913 YYCASE_(0, YY_("syntax error"));
9914 YYCASE_(1, YY_("syntax error, unexpected %s"));
9915 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
9916 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
9917 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
9918 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
9919#undef YYCASE_
9920 }
9921
9922 /* Compute error message size. Don't count the "%s"s, but reserve
9923 room for the terminator. */
9924 yysize = yystrlen (yyformat) - 2 * yycount + 1;
9925 {
9926 int yyi;
9927 for (yyi = 0; yyi < yycount; ++yyi)
9928 {
9929 YYPTRDIFF_T yysize1
9930 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
9931 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
9932 yysize = yysize1;
9933 else
9934 return YYENOMEM;
9935 }
9936 }
9937
9938 if (*yymsg_alloc < yysize)
9939 {
9940 *yymsg_alloc = 2 * yysize;
9941 if (! (yysize <= *yymsg_alloc
9942 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
9943 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
9944 return -1;
9945 }
9946
9947 /* Avoid sprintf, as that infringes on the user's name space.
9948 Don't have undefined behavior even if the translation
9949 produced a string with the wrong number of "%s"s. */
9950 {
9951 char *yyp = *yymsg;
9952 int yyi = 0;
9953 while ((*yyp = *yyformat) != '\0')
9954 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
9955 {
9956 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
9957 yyformat += 2;
9958 }
9959 else
9960 {
9961 ++yyp;
9962 ++yyformat;
9963 }
9964 }
9965 return 0;
9966}
9967
9968
9969/*-----------------------------------------------.
9970| Release the memory associated to this symbol. |
9971`-----------------------------------------------*/
9972
9973static void
9974yydestruct (const char *yymsg,
9975 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
9976{
9977 YY_USE (yyvaluep);
9978 YY_USE (yylocationp);
9979 YY_USE (p);
9980 if (!yymsg)
9981 yymsg = "Deleting";
9982 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp, p);
9983
9984 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
9985 YY_USE (yykind);
9986 YY_IGNORE_MAYBE_UNINITIALIZED_END
9987}
9988
9989
9990
9991
9992
9993
9994/*----------.
9995| yyparse. |
9996`----------*/
9997
9998int
9999yyparse (struct parser_params *p)
10000{
10001/* Lookahead token kind. */
10002int yychar;
10003
10004
10005/* The semantic value of the lookahead symbol. */
10006/* Default value used for initialization, for pacifying older GCCs
10007 or non-GCC compilers. */
10008YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)
10009YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
10010
10011/* Location data for the lookahead symbol. */
10012static const YYLTYPE yyloc_default
10013# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
10014 = { 1, 1, 1, 1 }
10015# endif
10016;
10017YYLTYPE yylloc = yyloc_default;
10018
10019 /* Number of syntax errors so far. */
10020 int yynerrs = 0;
10021 YY_USE (yynerrs); /* Silence compiler warning. */
10022
10023 yy_state_fast_t yystate = 0;
10024 /* Number of tokens to shift before error messages enabled. */
10025 int yyerrstatus = 0;
10026
10027 /* Refer to the stacks through separate pointers, to allow yyoverflow
10028 to reallocate them elsewhere. */
10029
10030 /* Their size. */
10031 YYPTRDIFF_T yystacksize = YYINITDEPTH;
10032
10033 /* The state stack: array, bottom, top. */
10034 yy_state_t yyssa[YYINITDEPTH];
10035 yy_state_t *yyss = yyssa;
10036 yy_state_t *yyssp = yyss;
10037
10038 /* The semantic value stack: array, bottom, top. */
10039 YYSTYPE yyvsa[YYINITDEPTH];
10040 YYSTYPE *yyvs = yyvsa;
10041 YYSTYPE *yyvsp = yyvs;
10042
10043 /* The location stack: array, bottom, top. */
10044 YYLTYPE yylsa[YYINITDEPTH];
10045 YYLTYPE *yyls = yylsa;
10046 YYLTYPE *yylsp = yyls;
10047
10048 int yyn;
10049 /* The return value of yyparse. */
10050 int yyresult;
10051 /* Lookahead symbol kind. */
10052 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
10053 /* The variables used to return semantic value and location from the
10054 action routines. */
10055 YYSTYPE yyval;
10056 YYLTYPE yyloc;
10057
10058 /* The locations where the error started and ended. */
10059 YYLTYPE yyerror_range[3];
10060
10061 /* Buffer for error messages, and its allocated size. */
10062 char yymsgbuf[128];
10063 char *yymsg = yymsgbuf;
10064 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
10065
10066#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
10067
10068 /* The number of symbols on the RHS of the reduced rule.
10069 Keep to zero when no symbol should be popped. */
10070 int yylen = 0;
10071
10072 YYDPRINTF ((stderr, "Starting parse\n"));
10073
10074 yychar = YYEMPTY; /* Cause a token to be read. */
10075
10076
10077 /* User initialization code. */
10078#line 1959 "parse.y"
10079 {
10080 RUBY_SET_YYLLOC_OF_NONE(yylloc);
10081}
10082
10083#line 10084 "parse.c"
10084
10085 yylsp[0] = yylloc;
10086 goto yysetstate;
10087
10088
10089/*------------------------------------------------------------.
10090| yynewstate -- push a new state, which is found in yystate. |
10091`------------------------------------------------------------*/
10092yynewstate:
10093 /* In all cases, when you get here, the value and location stacks
10094 have just been pushed. So pushing a state here evens the stacks. */
10095 yyssp++;
10096
10097
10098/*--------------------------------------------------------------------.
10099| yysetstate -- set current state (the top of the stack) to yystate. |
10100`--------------------------------------------------------------------*/
10101yysetstate:
10102 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
10103 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
10104 YY_IGNORE_USELESS_CAST_BEGIN
10105 *yyssp = YY_CAST (yy_state_t, yystate);
10106 YY_IGNORE_USELESS_CAST_END
10107 YY_STACK_PRINT (yyss, yyssp, p);
10108
10109 if (yyss + yystacksize - 1 <= yyssp)
10110#if !defined yyoverflow && !defined YYSTACK_RELOCATE
10111 YYNOMEM;
10112#else
10113 {
10114 /* Get the current used size of the three stacks, in elements. */
10115 YYPTRDIFF_T yysize = yyssp - yyss + 1;
10116
10117# if defined yyoverflow
10118 {
10119 /* Give user a chance to reallocate the stack. Use copies of
10120 these so that the &'s don't force the real ones into
10121 memory. */
10122 yy_state_t *yyss1 = yyss;
10123 YYSTYPE *yyvs1 = yyvs;
10124 YYLTYPE *yyls1 = yyls;
10125
10126 /* Each stack pointer address is followed by the size of the
10127 data in use in that stack, in bytes. This used to be a
10128 conditional around just the two extra args, but that might
10129 be undefined if yyoverflow is a macro. */
10130 yyoverflow (YY_("memory exhausted"),
10131 &yyss1, yysize * YYSIZEOF (*yyssp),
10132 &yyvs1, yysize * YYSIZEOF (*yyvsp),
10133 &yyls1, yysize * YYSIZEOF (*yylsp),
10134 &yystacksize);
10135 yyss = yyss1;
10136 yyvs = yyvs1;
10137 yyls = yyls1;
10138 }
10139# else /* defined YYSTACK_RELOCATE */
10140 /* Extend the stack our own way. */
10141 if (YYMAXDEPTH <= yystacksize)
10142 YYNOMEM;
10143 yystacksize *= 2;
10144 if (YYMAXDEPTH < yystacksize)
10145 yystacksize = YYMAXDEPTH;
10146
10147 {
10148 yy_state_t *yyss1 = yyss;
10149 union yyalloc *yyptr =
10150 YY_CAST (union yyalloc *,
10151 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
10152 if (! yyptr)
10153 YYNOMEM;
10154 YYSTACK_RELOCATE (yyss_alloc, yyss);
10155 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
10156 YYSTACK_RELOCATE (yyls_alloc, yyls);
10157# undef YYSTACK_RELOCATE
10158 if (yyss1 != yyssa)
10159 YYSTACK_FREE (yyss1);
10160 }
10161# endif
10162
10163 yyssp = yyss + yysize - 1;
10164 yyvsp = yyvs + yysize - 1;
10165 yylsp = yyls + yysize - 1;
10166
10167 YY_IGNORE_USELESS_CAST_BEGIN
10168 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
10169 YY_CAST (long, yystacksize)));
10170 YY_IGNORE_USELESS_CAST_END
10171
10172 if (yyss + yystacksize - 1 <= yyssp)
10173 YYABORT;
10174 }
10175#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
10176
10177
10178 if (yystate == YYFINAL)
10179 YYACCEPT;
10180
10181 goto yybackup;
10182
10183
10184/*-----------.
10185| yybackup. |
10186`-----------*/
10187yybackup:
10188 /* Do appropriate processing given the current state. Read a
10189 lookahead token if we need one and don't already have one. */
10190
10191 /* First try to decide what to do without reference to lookahead token. */
10192 yyn = yypact[yystate];
10193 if (yypact_value_is_default (yyn))
10194 goto yydefault;
10195
10196 /* Not known => get a lookahead token if don't already have one. */
10197
10198 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
10199 if (yychar == YYEMPTY)
10200 {
10201 YYDPRINTF ((stderr, "Reading a token\n"));
10202 yychar = yylex (&yylval, &yylloc, p);
10203 }
10204
10205 if (yychar <= END_OF_INPUT)
10206 {
10207 yychar = END_OF_INPUT;
10208 yytoken = YYSYMBOL_YYEOF;
10209 YYDPRINTF ((stderr, "Now at end of input.\n"));
10210 }
10211 else if (yychar == YYerror)
10212 {
10213 /* The scanner already issued an error message, process directly
10214 to error recovery. But do not keep the error token as
10215 lookahead, it is too special and may lead us to an endless
10216 loop in error recovery. */
10217 yychar = YYUNDEF;
10218 yytoken = YYSYMBOL_YYerror;
10219 yyerror_range[1] = yylloc;
10220 goto yyerrlab1;
10221 }
10222 else
10223 {
10224 yytoken = YYTRANSLATE (yychar);
10225 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc, p);
10226 }
10227
10228 /* If the proper action on seeing token YYTOKEN is to reduce or to
10229 detect an error, take that action. */
10230 yyn += yytoken;
10231 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
10232 goto yydefault;
10233 yyn = yytable[yyn];
10234 if (yyn <= 0)
10235 {
10236 if (yytable_value_is_error (yyn))
10237 goto yyerrlab;
10238 yyn = -yyn;
10239 goto yyreduce;
10240 }
10241
10242 /* Count tokens shifted since error; after three, turn off error
10243 status. */
10244 if (yyerrstatus)
10245 yyerrstatus--;
10246
10247 /* Shift the lookahead token. */
10248 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc, p);
10249 yystate = yyn;
10250 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
10251 *++yyvsp = yylval;
10252 YY_IGNORE_MAYBE_UNINITIALIZED_END
10253 *++yylsp = yylloc;
10254
10255 /* Discard the shifted token. */
10256 yychar = YYEMPTY;
10257 goto yynewstate;
10258
10259
10260/*-----------------------------------------------------------.
10261| yydefault -- do the default action for the current state. |
10262`-----------------------------------------------------------*/
10263yydefault:
10264 yyn = yydefact[yystate];
10265 if (yyn == 0)
10266 goto yyerrlab;
10267 goto yyreduce;
10268
10269
10270/*-----------------------------.
10271| yyreduce -- do a reduction. |
10272`-----------------------------*/
10273yyreduce:
10274 /* yyn is the number of a rule to reduce with. */
10275 yylen = yyr2[yyn];
10276
10277 /* If YYLEN is nonzero, implement the default value of the action:
10278 '$$ = $1'.
10279
10280 Otherwise, the following line sets YYVAL to garbage.
10281 This behavior is undocumented and Bison
10282 users should not rely upon it. Assigning to YYVAL
10283 unconditionally makes the parser a bit smaller, and it avoids a
10284 GCC warning that YYVAL may be used uninitialized. */
10285 yyval = yyvsp[1-yylen];
10286
10287 /* Default location. */
10288 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
10289 yyerror_range[1] = yyloc;
10290 YY_REDUCE_PRINT (yyn, p);
10291 switch (yyn)
10292 {
10293 case 2: /* $@1: %empty */
10294#line 2194 "parse.y"
10295 {
10296 SET_LEX_STATE(EXPR_BEG);
10297 local_push(p, ifndef_ripper(1)+0);
10298 /* jumps are possible in the top-level loop. */
10299 if (!ifndef_ripper(p->do_loop) + 0) init_block_exit(p);
10300 }
10301#line 10302 "parse.c"
10302 break;
10303
10304 case 3: /* program: $@1 top_compstmt */
10305#line 2201 "parse.y"
10306 {
10307 /*%%%*/
10308 if ((yyvsp[0].node) && !compile_for_eval) {
10309 NODE *node = (yyvsp[0].node);
10310 /* last expression should not be void */
10311 if (nd_type_p(node, NODE_BLOCK)) {
10312 while (RNODE_BLOCK(node)->nd_next) {
10313 node = RNODE_BLOCK(node)->nd_next;
10314 }
10315 node = RNODE_BLOCK(node)->nd_head;
10316 }
10317 node = remove_begin(node);
10318 void_expr(p, node);
10319 }
10320 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
10321 /*% %*/
10322 /*% ripper[final]: program!($2) %*/
10323 local_pop(p);
10324 }
10325#line 10326 "parse.c"
10326 break;
10327
10328 case 4: /* top_compstmt: top_stmts opt_terms */
10329#line 2223 "parse.y"
10330 {
10331 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
10332 }
10333#line 10334 "parse.c"
10334 break;
10335
10336 case 5: /* top_stmts: none */
10337#line 2229 "parse.y"
10338 {
10339 /*%%%*/
10340 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10341 /*% %*/
10342 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
10343 }
10344#line 10345 "parse.c"
10345 break;
10346
10347 case 6: /* top_stmts: top_stmt */
10348#line 2236 "parse.y"
10349 {
10350 /*%%%*/
10351 (yyval.node) = newline_node((yyvsp[0].node));
10352 /*% %*/
10353 /*% ripper: stmts_add!(stmts_new!, $1) %*/
10354 }
10355#line 10356 "parse.c"
10356 break;
10357
10358 case 7: /* top_stmts: top_stmts terms top_stmt */
10359#line 2243 "parse.y"
10360 {
10361 /*%%%*/
10362 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
10363 /*% %*/
10364 /*% ripper: stmts_add!($1, $3) %*/
10365 }
10366#line 10367 "parse.c"
10367 break;
10368
10369 case 8: /* top_stmt: stmt */
10370#line 2252 "parse.y"
10371 {
10372 clear_block_exit(p, true);
10373 (yyval.node) = (yyvsp[0].node);
10374 }
10375#line 10376 "parse.c"
10376 break;
10377
10378 case 9: /* top_stmt: "`BEGIN'" begin_block */
10379#line 2257 "parse.y"
10380 {
10381 (yyval.node) = (yyvsp[0].node);
10382 }
10383#line 10384 "parse.c"
10384 break;
10385
10386 case 10: /* block_open: '{' */
10387#line 2262 "parse.y"
10388 {(yyval.node_exits) = init_block_exit(p);}
10389#line 10390 "parse.c"
10390 break;
10391
10392 case 11: /* begin_block: block_open top_compstmt '}' */
10393#line 2265 "parse.y"
10394 {
10395 restore_block_exit(p, (yyvsp[-2].node_exits));
10396 /*%%%*/
10397 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
10398 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
10399 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10400 /*% %*/
10401 /*% ripper: BEGIN!($2) %*/
10402 }
10403#line 10404 "parse.c"
10404 break;
10405
10406 case 12: /* $@2: %empty */
10407#line 2280 "parse.y"
10408 {
10409 if (!(yyvsp[-1].node)) yyerror1(&(yylsp[0]), "else without rescue is useless");
10410 next_rescue_context(&p->ctxt, &(yyvsp[-2].ctxt), after_else);
10411 }
10412#line 10413 "parse.c"
10413 break;
10414
10415 case 13: /* $@3: %empty */
10416#line 2285 "parse.y"
10417 {
10418 next_rescue_context(&p->ctxt, &(yyvsp[-4].ctxt), after_ensure);
10419 }
10420#line 10421 "parse.c"
10421 break;
10422
10423 case 14: /* bodystmt: compstmt lex_ctxt opt_rescue k_else $@2 compstmt $@3 opt_ensure */
10424#line 2289 "parse.y"
10425 {
10426 /*%%%*/
10427 (yyval.node) = new_bodystmt(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10428 /*% %*/
10429 /*% ripper: bodystmt!($body, $opt_rescue, $elsebody, $opt_ensure) %*/
10430 }
10431#line 10432 "parse.c"
10432 break;
10433
10434 case 15: /* $@4: %empty */
10435#line 2298 "parse.y"
10436 {
10437 next_rescue_context(&p->ctxt, &(yyvsp[-1].ctxt), after_ensure);
10438 }
10439#line 10440 "parse.c"
10440 break;
10441
10442 case 16: /* bodystmt: compstmt lex_ctxt opt_rescue $@4 opt_ensure */
10443#line 2302 "parse.y"
10444 {
10445 /*%%%*/
10446 (yyval.node) = new_bodystmt(p, (yyvsp[-4].node), (yyvsp[-2].node), 0, (yyvsp[0].node), &(yyloc));
10447 /*% %*/
10448 /*% ripper: bodystmt!($body, $opt_rescue, Qnil, $opt_ensure) %*/
10449 }
10450#line 10451 "parse.c"
10451 break;
10452
10453 case 17: /* compstmt: stmts opt_terms */
10454#line 2311 "parse.y"
10455 {
10456 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
10457 }
10458#line 10459 "parse.c"
10459 break;
10460
10461 case 18: /* stmts: none */
10462#line 2317 "parse.y"
10463 {
10464 /*%%%*/
10465 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10466 /*% %*/
10467 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
10468 }
10469#line 10470 "parse.c"
10470 break;
10471
10472 case 19: /* stmts: stmt_or_begin */
10473#line 2324 "parse.y"
10474 {
10475 /*%%%*/
10476 (yyval.node) = newline_node((yyvsp[0].node));
10477 /*% %*/
10478 /*% ripper: stmts_add!(stmts_new!, $1) %*/
10479 }
10480#line 10481 "parse.c"
10481 break;
10482
10483 case 20: /* stmts: stmts terms stmt_or_begin */
10484#line 2331 "parse.y"
10485 {
10486 /*%%%*/
10487 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
10488 /*% %*/
10489 /*% ripper: stmts_add!($1, $3) %*/
10490 }
10491#line 10492 "parse.c"
10492 break;
10493
10494 case 21: /* stmt_or_begin: stmt */
10495#line 2340 "parse.y"
10496 {
10497 (yyval.node) = (yyvsp[0].node);
10498 }
10499#line 10500 "parse.c"
10500 break;
10501
10502 case 22: /* $@5: %empty */
10503#line 2344 "parse.y"
10504 {
10505 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
10506 }
10507#line 10508 "parse.c"
10508 break;
10509
10510 case 23: /* stmt_or_begin: "`BEGIN'" $@5 begin_block */
10511#line 2348 "parse.y"
10512 {
10513 (yyval.node) = (yyvsp[0].node);
10514 }
10515#line 10516 "parse.c"
10516 break;
10517
10518 case 24: /* allow_exits: %empty */
10519#line 2353 "parse.y"
10520 {(yyval.node_exits) = allow_block_exit(p);}
10521#line 10522 "parse.c"
10522 break;
10523
10524 case 25: /* k_END: "`END'" lex_ctxt */
10525#line 2356 "parse.y"
10526 {
10527 (yyval.ctxt) = (yyvsp[0].ctxt);
10528 p->ctxt.in_rescue = before_rescue;
10529 }
10530#line 10531 "parse.c"
10531 break;
10532
10533 case 26: /* $@6: %empty */
10534#line 2361 "parse.y"
10535 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
10536#line 10537 "parse.c"
10537 break;
10538
10539 case 27: /* stmt: "`alias'" fitem $@6 fitem */
10540#line 2362 "parse.y"
10541 {
10542 /*%%%*/
10543 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10544 /*% %*/
10545 /*% ripper: alias!($2, $4) %*/
10546 }
10547#line 10548 "parse.c"
10548 break;
10549
10550 case 28: /* stmt: "`alias'" "global variable" "global variable" */
10551#line 2369 "parse.y"
10552 {
10553 /*%%%*/
10554 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10555 /*% %*/
10556 /*% ripper: var_alias!($2, $3) %*/
10557 }
10558#line 10559 "parse.c"
10559 break;
10560
10561 case 29: /* stmt: "`alias'" "global variable" "back reference" */
10562#line 2376 "parse.y"
10563 {
10564 /*%%%*/
10565 char buf[2];
10566 buf[0] = '$';
10567 buf[1] = (char)RNODE_BACK_REF((yyvsp[0].node))->nd_nth;
10568 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc));
10569 /*% %*/
10570 /*% ripper: var_alias!($2, $3) %*/
10571 }
10572#line 10573 "parse.c"
10573 break;
10574
10575 case 30: /* stmt: "`alias'" "global variable" "numbered reference" */
10576#line 2386 "parse.y"
10577 {
10578 static const char mesg[] = "can't make alias for the number variables";
10579 /*%%%*/
10580 yyerror1(&(yylsp[0]), mesg);
10581 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10582 /*% %*/
10583 /*% ripper[error]: alias_error!(ERR_MESG(), $3) %*/
10584 }
10585#line 10586 "parse.c"
10586 break;
10587
10588 case 31: /* stmt: "`undef'" undef_list */
10589#line 2395 "parse.y"
10590 {
10591 /*%%%*/
10592 (yyval.node) = (yyvsp[0].node);
10593 /*% %*/
10594 /*% ripper: undef!($2) %*/
10595 }
10596#line 10597 "parse.c"
10597 break;
10598
10599 case 32: /* stmt: stmt "`if' modifier" expr_value */
10600#line 2402 "parse.y"
10601 {
10602 /*%%%*/
10603 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10604 fixpos((yyval.node), (yyvsp[0].node));
10605 /*% %*/
10606 /*% ripper: if_mod!($3, $1) %*/
10607 }
10608#line 10609 "parse.c"
10609 break;
10610
10611 case 33: /* stmt: stmt "`unless' modifier" expr_value */
10612#line 2410 "parse.y"
10613 {
10614 /*%%%*/
10615 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10616 fixpos((yyval.node), (yyvsp[0].node));
10617 /*% %*/
10618 /*% ripper: unless_mod!($3, $1) %*/
10619 }
10620#line 10621 "parse.c"
10621 break;
10622
10623 case 34: /* stmt: stmt "`while' modifier" expr_value */
10624#line 2418 "parse.y"
10625 {
10626 clear_block_exit(p, false);
10627 /*%%%*/
10628 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
10629 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc));
10630 }
10631 else {
10632 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
10633 }
10634 /*% %*/
10635 /*% ripper: while_mod!($3, $1) %*/
10636 }
10637#line 10638 "parse.c"
10638 break;
10639
10640 case 35: /* stmt: stmt "`until' modifier" expr_value */
10641#line 2431 "parse.y"
10642 {
10643 clear_block_exit(p, false);
10644 /*%%%*/
10645 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
10646 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), RNODE_BEGIN((yyvsp[-2].node))->nd_body, 0, &(yyloc));
10647 }
10648 else {
10649 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
10650 }
10651 /*% %*/
10652 /*% ripper: until_mod!($3, $1) %*/
10653 }
10654#line 10655 "parse.c"
10655 break;
10656
10657 case 36: /* stmt: stmt "`rescue' modifier" after_rescue stmt */
10658#line 2444 "parse.y"
10659 {
10660 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
10661 /*%%%*/
10662 NODE *resq;
10663 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10664 resq = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
10665 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-3].node)), resq, 0, &(yyloc));
10666 /*% %*/
10667 /*% ripper: rescue_mod!($1, $4) %*/
10668 }
10669#line 10670 "parse.c"
10670 break;
10671
10672 case 37: /* stmt: k_END allow_exits '{' compstmt '}' */
10673#line 2455 "parse.y"
10674 {
10675 if (p->ctxt.in_def) {
10676 rb_warn0("END in method; use at_exit");
10677 }
10678 restore_block_exit(p, (yyvsp[-3].node_exits));
10679 p->ctxt = (yyvsp[-4].ctxt);
10680 /*%%%*/
10681 {
10682 NODE *scope = NEW_SCOPE2(0 /* tbl */, 0 /* args */, (yyvsp[-1].node) /* body */, &(yyloc));
10683 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
10684 }
10685 /*% %*/
10686 /*% ripper: END!($compstmt) %*/
10687 }
10688#line 10689 "parse.c"
10689 break;
10690
10691 case 39: /* stmt: mlhs '=' lex_ctxt command_call */
10692#line 2471 "parse.y"
10693 {
10694 /*%%%*/
10695 value_expr((yyvsp[0].node));
10696 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10697 /*% %*/
10698 /*% ripper: massign!($1, $4) %*/
10699 }
10700#line 10701 "parse.c"
10701 break;
10702
10703 case 40: /* stmt: lhs '=' lex_ctxt mrhs */
10704#line 2479 "parse.y"
10705 {
10706 /*%%%*/
10707 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10708 /*% %*/
10709 /*% ripper: assign!($1, $4) %*/
10710 }
10711#line 10712 "parse.c"
10712 break;
10713
10714 case 41: /* stmt: mlhs '=' lex_ctxt mrhs_arg "`rescue' modifier" after_rescue stmt */
10715#line 2487 "parse.y"
10716 {
10717 p->ctxt.in_rescue = (yyvsp[-4].ctxt).in_rescue;
10718 /*%%%*/
10719 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10720 (yyvsp[0].node) = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
10721 loc.beg_pos = (yylsp[-3]).beg_pos;
10722 (yyvsp[-3].node) = NEW_RESCUE((yyvsp[-3].node), (yyvsp[0].node), 0, &loc);
10723 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-6].node_masgn), (yyvsp[-3].node), (yyvsp[-4].ctxt), &(yyloc));
10724 /*% %*/
10725 /*% ripper: massign!($1, rescue_mod!($4, $7)) %*/
10726 }
10727#line 10728 "parse.c"
10728 break;
10729
10730 case 42: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
10731#line 2499 "parse.y"
10732 {
10733 /*%%%*/
10734 (yyval.node) = node_assign(p, (NODE *)(yyvsp[-3].node_masgn), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10735 /*% %*/
10736 /*% ripper: massign!($1, $4) %*/
10737 }
10738#line 10739 "parse.c"
10739 break;
10740
10741 case 44: /* stmt: error */
10742#line 2507 "parse.y"
10743 {
10744 (void)yynerrs;
10745 /*%%%*/
10746 (yyval.node) = NEW_ERROR(&(yyloc));
10747 /*% %*/
10748 }
10749#line 10750 "parse.c"
10750 break;
10751
10752 case 45: /* command_asgn: lhs '=' lex_ctxt command_rhs */
10753#line 2516 "parse.y"
10754 {
10755 /*%%%*/
10756 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10757 /*% %*/
10758 /*% ripper: assign!($1, $4) %*/
10759 }
10760#line 10761 "parse.c"
10761 break;
10762
10763 case 46: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
10764#line 2523 "parse.y"
10765 {
10766 /*%%%*/
10767 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
10768 /*% %*/
10769 /*% ripper: opassign!($1, $2, $4) %*/
10770 }
10771#line 10772 "parse.c"
10772 break;
10773
10774 case 47: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
10775#line 2530 "parse.y"
10776 {
10777 /*%%%*/
10778 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
10779 /*% %*/
10780 /*% ripper: opassign!(aref_field!($1, $3), $5, $7) %*/
10781
10782 }
10783#line 10784 "parse.c"
10784 break;
10785
10786 case 48: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
10787#line 2538 "parse.y"
10788 {
10789 /*%%%*/
10790 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10791 /*% %*/
10792 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
10793 }
10794#line 10795 "parse.c"
10795 break;
10796
10797 case 49: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
10798#line 2545 "parse.y"
10799 {
10800 /*%%%*/
10801 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10802 /*% %*/
10803 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
10804 }
10805#line 10806 "parse.c"
10806 break;
10807
10808 case 50: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
10809#line 2552 "parse.y"
10810 {
10811 /*%%%*/
10812 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
10813 (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));
10814 /*% %*/
10815 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
10816 }
10817#line 10818 "parse.c"
10818 break;
10819
10820 case 51: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
10821#line 2560 "parse.y"
10822 {
10823 /*%%%*/
10824 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10825 /*% %*/
10826 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
10827 }
10828#line 10829 "parse.c"
10829 break;
10830
10831 case 52: /* command_asgn: defn_head f_opt_paren_args '=' endless_command */
10832#line 2567 "parse.y"
10833 {
10834 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
10835 restore_defun(p, (yyvsp[-3].node_def_temp));
10836 /*%%%*/
10837 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
10838 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
10839 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
10840 /*% %*/
10841 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
10842 /*% ripper: def!($head->nd_mid, $args, $bodystmt) %*/
10843 local_pop(p);
10844 }
10845#line 10846 "parse.c"
10846 break;
10847
10848 case 53: /* command_asgn: defs_head f_opt_paren_args '=' endless_command */
10849#line 2580 "parse.y"
10850 {
10851 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
10852 restore_defun(p, (yyvsp[-3].node_def_temp));
10853 /*%%%*/
10854 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
10855 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
10856 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
10857 /*% %*/
10858 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
10859 /*% ripper: defs!($head->nd_recv, $head->dot_or_colon, $head->nd_mid, $args, $bodystmt) %*/
10860 local_pop(p);
10861 }
10862#line 10863 "parse.c"
10863 break;
10864
10865 case 54: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
10866#line 2593 "parse.y"
10867 {
10868 /*%%%*/
10869 rb_backref_error(p, (yyvsp[-3].node));
10870 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10871 /*% %*/
10872 /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/
10873 }
10874#line 10875 "parse.c"
10875 break;
10876
10877 case 56: /* endless_command: endless_command "`rescue' modifier" after_rescue arg */
10878#line 2604 "parse.y"
10879 {
10880 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
10881 /*%%%*/
10882 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
10883 /*% %*/
10884 /*% ripper: rescue_mod!($1, $4) %*/
10885 }
10886#line 10887 "parse.c"
10887 break;
10888
10889 case 57: /* endless_command: "`not'" opt_nl endless_command */
10890#line 2612 "parse.y"
10891 {
10892 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
10893 }
10894#line 10895 "parse.c"
10895 break;
10896
10897 case 58: /* command_rhs: command_call */
10898#line 2618 "parse.y"
10899 {
10900 value_expr((yyvsp[0].node));
10901 (yyval.node) = (yyvsp[0].node);
10902 }
10903#line 10904 "parse.c"
10904 break;
10905
10906 case 59: /* command_rhs: command_call "`rescue' modifier" after_rescue stmt */
10907#line 2623 "parse.y"
10908 {
10909 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
10910 /*%%%*/
10911 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10912 value_expr((yyvsp[-3].node));
10913 (yyval.node) = NEW_RESCUE((yyvsp[-3].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
10914 /*% %*/
10915 /*% ripper: rescue_mod!($1, $4) %*/
10916 }
10917#line 10918 "parse.c"
10918 break;
10919
10920 case 62: /* expr: expr "`and'" expr */
10921#line 2637 "parse.y"
10922 {
10923 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10924 }
10925#line 10926 "parse.c"
10926 break;
10927
10928 case 63: /* expr: expr "`or'" expr */
10929#line 2641 "parse.y"
10930 {
10931 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10932 }
10933#line 10934 "parse.c"
10934 break;
10935
10936 case 64: /* expr: "`not'" opt_nl expr */
10937#line 2645 "parse.y"
10938 {
10939 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
10940 }
10941#line 10942 "parse.c"
10942 break;
10943
10944 case 65: /* expr: '!' command_call */
10945#line 2649 "parse.y"
10946 {
10947 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
10948 }
10949#line 10950 "parse.c"
10950 break;
10951
10952 case 66: /* $@7: %empty */
10953#line 2653 "parse.y"
10954 {
10955 value_expr((yyvsp[-1].node));
10956 }
10957#line 10958 "parse.c"
10958 break;
10959
10960 case 67: /* expr: arg "=>" $@7 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
10961#line 2658 "parse.y"
10962 {
10963 pop_pktbl(p, (yyvsp[-1].tbl));
10964 pop_pvtbl(p, (yyvsp[-2].tbl));
10965 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10966 /*%%%*/
10967 (yyval.node) = NEW_CASE3((yyvsp[-6].node), NEW_IN((yyvsp[0].node), 0, 0, &(yylsp[0])), &(yyloc));
10968 /*% %*/
10969 /*% ripper: case!($arg, in!($body, Qnil, Qnil)) %*/
10970 }
10971#line 10972 "parse.c"
10972 break;
10973
10974 case 68: /* $@8: %empty */
10975#line 2668 "parse.y"
10976 {
10977 value_expr((yyvsp[-1].node));
10978 }
10979#line 10980 "parse.c"
10980 break;
10981
10982 case 69: /* expr: arg "`in'" $@8 p_in_kwarg p_pvtbl p_pktbl p_top_expr_body */
10983#line 2673 "parse.y"
10984 {
10985 pop_pktbl(p, (yyvsp[-1].tbl));
10986 pop_pvtbl(p, (yyvsp[-2].tbl));
10987 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10988 /*%%%*/
10989 (yyval.node) = NEW_CASE3((yyvsp[-6].node), NEW_IN((yyvsp[0].node), NEW_TRUE(&(yylsp[0])), NEW_FALSE(&(yylsp[0])), &(yylsp[0])), &(yyloc));
10990 /*% %*/
10991 /*% ripper: case!($arg, in!($body, Qnil, Qnil)) %*/
10992 }
10993#line 10994 "parse.c"
10994 break;
10995
10996 case 71: /* def_name: fname */
10997#line 2686 "parse.y"
10998 {
10999 ID fname = get_id((yyvsp[0].id));
11000 numparam_name(p, fname);
11001 local_push(p, 0);
11002 p->cur_arg = 0;
11003 p->ctxt.in_def = 1;
11004 p->ctxt.in_rescue = before_rescue;
11005 (yyval.id) = (yyvsp[0].id);
11006 }
11007#line 11008 "parse.c"
11008 break;
11009
11010 case 72: /* defn_head: k_def def_name */
11011#line 2698 "parse.y"
11012 {
11013 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-1].node_def_temp));
11014 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
11015 /*%%%*/
11016 (yyval.node_def_temp)->nd_def = NEW_DEFN((yyvsp[0].id), 0, &(yyloc));
11017 /*%
11018 add_mark_object(p, $def_name);
11019 %*/
11020 }
11021#line 11022 "parse.c"
11022 break;
11023
11024 case 73: /* $@9: %empty */
11025#line 2710 "parse.y"
11026 {
11027 SET_LEX_STATE(EXPR_FNAME);
11028 p->ctxt.in_argdef = 1;
11029 }
11030#line 11031 "parse.c"
11031 break;
11032
11033 case 74: /* defs_head: k_def singleton dot_or_colon $@9 def_name */
11034#line 2715 "parse.y"
11035 {
11036 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
11037 (yyval.node_def_temp) = def_head_save(p, (yyvsp[-4].node_def_temp));
11038 (yyval.node_def_temp)->nd_mid = (yyvsp[0].id);
11039 /*%%%*/
11040 (yyval.node_def_temp)->nd_def = NEW_DEFS((yyvsp[-3].node), (yyvsp[0].id), 0, &(yyloc));
11041 /*%
11042 add_mark_object(p, $def_name);
11043 $$->nd_recv = add_mark_object(p, $singleton);
11044 $$->dot_or_colon = add_mark_object(p, $dot_or_colon);
11045 %*/
11046 }
11047#line 11048 "parse.c"
11048 break;
11049
11050 case 75: /* expr_value: expr */
11051#line 2730 "parse.y"
11052 {
11053 value_expr((yyvsp[0].node));
11054 (yyval.node) = (yyvsp[0].node);
11055 }
11056#line 11057 "parse.c"
11057 break;
11058
11059 case 76: /* expr_value: error */
11060#line 2735 "parse.y"
11061 {
11062 /*%%%*/
11063 (yyval.node) = NEW_ERROR(&(yyloc));
11064 /*% %*/
11065 }
11066#line 11067 "parse.c"
11067 break;
11068
11069 case 77: /* $@10: %empty */
11070#line 2742 "parse.y"
11071 {COND_PUSH(1);}
11072#line 11073 "parse.c"
11073 break;
11074
11075 case 78: /* $@11: %empty */
11076#line 2742 "parse.y"
11077 {COND_POP();}
11078#line 11079 "parse.c"
11079 break;
11080
11081 case 79: /* expr_value_do: $@10 expr_value do $@11 */
11082#line 2743 "parse.y"
11083 {
11084 (yyval.node) = (yyvsp[-2].node);
11085 }
11086#line 11087 "parse.c"
11087 break;
11088
11089 case 83: /* block_command: block_call call_op2 operation2 command_args */
11090#line 2754 "parse.y"
11091 {
11092 /*%%%*/
11093 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11094 /*% %*/
11095 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
11096 }
11097#line 11098 "parse.c"
11098 break;
11099
11100 case 84: /* cmd_brace_block: "{ arg" brace_body '}' */
11101#line 2763 "parse.y"
11102 {
11103 (yyval.node) = (yyvsp[-1].node);
11104 /*%%%*/
11105 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
11106 /*% %*/
11107 }
11108#line 11109 "parse.c"
11109 break;
11110
11111 case 85: /* fcall: operation */
11112#line 2772 "parse.y"
11113 {
11114 /*%%%*/
11115 (yyval.node_fcall) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
11116 /*% %*/
11117 /*% ripper: $1 %*/
11118 }
11119#line 11120 "parse.c"
11120 break;
11121
11122 case 86: /* command: fcall command_args */
11123#line 2781 "parse.y"
11124 {
11125 /*%%%*/
11126 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
11127 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
11128 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
11129 /*% %*/
11130 /*% ripper: command!($1, $2) %*/
11131 }
11132#line 11133 "parse.c"
11133 break;
11134
11135 case 87: /* command: fcall command_args cmd_brace_block */
11136#line 2790 "parse.y"
11137 {
11138 /*%%%*/
11139 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
11140 (yyvsp[-2].node_fcall)->nd_args = (yyvsp[-1].node);
11141 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-2].node_fcall), (yyvsp[0].node), &(yyloc));
11142 fixpos((yyval.node), RNODE((yyvsp[-2].node_fcall)));
11143 nd_set_last_loc((yyvsp[-2].node_fcall), (yylsp[-1]).end_pos);
11144 /*% %*/
11145 /*% ripper: method_add_block!(command!($1, $2), $3) %*/
11146 }
11147#line 11148 "parse.c"
11148 break;
11149
11150 case 88: /* command: primary_value call_op operation2 command_args */
11151#line 2801 "parse.y"
11152 {
11153 /*%%%*/
11154 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
11155 /*% %*/
11156 /*% ripper: command_call!($1, $2, $3, $4) %*/
11157 }
11158#line 11159 "parse.c"
11159 break;
11160
11161 case 89: /* command: primary_value call_op operation2 command_args cmd_brace_block */
11162#line 2808 "parse.y"
11163 {
11164 /*%%%*/
11165 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
11166 /*% %*/
11167 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
11168 }
11169#line 11170 "parse.c"
11170 break;
11171
11172 case 90: /* command: primary_value "::" operation2 command_args */
11173#line 2815 "parse.y"
11174 {
11175 /*%%%*/
11176 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
11177 /*% %*/
11178 /*% ripper: command_call!($1, $2, $3, $4) %*/
11179 }
11180#line 11181 "parse.c"
11181 break;
11182
11183 case 91: /* command: primary_value "::" operation2 command_args cmd_brace_block */
11184#line 2822 "parse.y"
11185 {
11186 /*%%%*/
11187 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
11188 /*% %*/
11189 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
11190 }
11191#line 11192 "parse.c"
11192 break;
11193
11194 case 92: /* command: primary_value "::" "constant" '{' brace_body '}' */
11195#line 2829 "parse.y"
11196 {
11197 /*%%%*/
11198 set_embraced_location((yyvsp[-1].node), &(yylsp[-2]), &(yylsp[0]));
11199 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-5].node), (yyvsp[-3].id), Qnull, (yyvsp[-1].node), &(yylsp[-3]), &(yyloc));
11200 /*% %*/
11201 /*% ripper: method_add_block!(command_call!($1, $2, $3, Qnull), $5) %*/
11202 }
11203#line 11204 "parse.c"
11204 break;
11205
11206 case 93: /* command: "`super'" command_args */
11207#line 2837 "parse.y"
11208 {
11209 /*%%%*/
11210 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
11211 fixpos((yyval.node), (yyvsp[0].node));
11212 /*% %*/
11213 /*% ripper: super!($2) %*/
11214 }
11215#line 11216 "parse.c"
11216 break;
11217
11218 case 94: /* command: k_yield command_args */
11219#line 2845 "parse.y"
11220 {
11221 /*%%%*/
11222 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
11223 fixpos((yyval.node), (yyvsp[0].node));
11224 /*% %*/
11225 /*% ripper: yield!($2) %*/
11226 }
11227#line 11228 "parse.c"
11228 break;
11229
11230 case 95: /* command: k_return call_args */
11231#line 2853 "parse.y"
11232 {
11233 /*%%%*/
11234 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc));
11235 /*% %*/
11236 /*% ripper: return!($2) %*/
11237 }
11238#line 11239 "parse.c"
11239 break;
11240
11241 case 96: /* command: "`break'" call_args */
11242#line 2860 "parse.y"
11243 {
11244 NODE *args = 0;
11245 /*%%%*/
11246 args = ret_args(p, (yyvsp[0].node));
11247 /*% %*/
11248 (yyval.node) = add_block_exit(p, NEW_BREAK(args, &(yyloc)));
11249 /*% ripper: break!($2) %*/
11250 }
11251#line 11252 "parse.c"
11252 break;
11253
11254 case 97: /* command: "`next'" call_args */
11255#line 2869 "parse.y"
11256 {
11257 NODE *args = 0;
11258 /*%%%*/
11259 args = ret_args(p, (yyvsp[0].node));
11260 /*% %*/
11261 (yyval.node) = add_block_exit(p, NEW_NEXT(args, &(yyloc)));
11262 /*% ripper: next!($2) %*/
11263 }
11264#line 11265 "parse.c"
11265 break;
11266
11267 case 99: /* mlhs: "(" mlhs_inner rparen */
11268#line 2881 "parse.y"
11269 {
11270 /*%%%*/
11271 (yyval.node_masgn) = (yyvsp[-1].node_masgn);
11272 /*% %*/
11273 /*% ripper: mlhs_paren!($2) %*/
11274 }
11275#line 11276 "parse.c"
11276 break;
11277
11278 case 101: /* mlhs_inner: "(" mlhs_inner rparen */
11279#line 2891 "parse.y"
11280 {
11281 /*%%%*/
11282 (yyval.node_masgn) = NEW_MASGN(NEW_LIST((NODE *)(yyvsp[-1].node_masgn), &(yyloc)), 0, &(yyloc));
11283 /*% %*/
11284 /*% ripper: mlhs_paren!($2) %*/
11285 }
11286#line 11287 "parse.c"
11287 break;
11288
11289 case 102: /* mlhs_basic: mlhs_head */
11290#line 2900 "parse.y"
11291 {
11292 /*%%%*/
11293 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
11294 /*% %*/
11295 /*% ripper: $1 %*/
11296 }
11297#line 11298 "parse.c"
11298 break;
11299
11300 case 103: /* mlhs_basic: mlhs_head mlhs_item */
11301#line 2907 "parse.y"
11302 {
11303 /*%%%*/
11304 (yyval.node_masgn) = NEW_MASGN(list_append(p, (yyvsp[-1].node), (yyvsp[0].node)), 0, &(yyloc));
11305 /*% %*/
11306 /*% ripper: mlhs_add!($1, $2) %*/
11307 }
11308#line 11309 "parse.c"
11309 break;
11310
11311 case 104: /* mlhs_basic: mlhs_head "*" mlhs_node */
11312#line 2914 "parse.y"
11313 {
11314 /*%%%*/
11315 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11316 /*% %*/
11317 /*% ripper: mlhs_add_star!($1, $3) %*/
11318 }
11319#line 11320 "parse.c"
11320 break;
11321
11322 case 105: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
11323#line 2921 "parse.y"
11324 {
11325 /*%%%*/
11326 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
11327 /*% %*/
11328 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
11329 }
11330#line 11331 "parse.c"
11331 break;
11332
11333 case 106: /* mlhs_basic: mlhs_head "*" */
11334#line 2928 "parse.y"
11335 {
11336 /*%%%*/
11337 (yyval.node_masgn) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
11338 /*% %*/
11339 /*% ripper: mlhs_add_star!($1, Qnil) %*/
11340 }
11341#line 11342 "parse.c"
11342 break;
11343
11344 case 107: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
11345#line 2935 "parse.y"
11346 {
11347 /*%%%*/
11348 (yyval.node_masgn) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
11349 /*% %*/
11350 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/
11351 }
11352#line 11353 "parse.c"
11353 break;
11354
11355 case 108: /* mlhs_basic: "*" mlhs_node */
11356#line 2942 "parse.y"
11357 {
11358 /*%%%*/
11359 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
11360 /*% %*/
11361 /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/
11362 }
11363#line 11364 "parse.c"
11364 break;
11365
11366 case 109: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
11367#line 2949 "parse.y"
11368 {
11369 /*%%%*/
11370 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
11371 /*% %*/
11372 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/
11373 }
11374#line 11375 "parse.c"
11375 break;
11376
11377 case 110: /* mlhs_basic: "*" */
11378#line 2956 "parse.y"
11379 {
11380 /*%%%*/
11381 (yyval.node_masgn) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
11382 /*% %*/
11383 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
11384 }
11385#line 11386 "parse.c"
11386 break;
11387
11388 case 111: /* mlhs_basic: "*" ',' mlhs_post */
11389#line 2963 "parse.y"
11390 {
11391 /*%%%*/
11392 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
11393 /*% %*/
11394 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/
11395 }
11396#line 11397 "parse.c"
11397 break;
11398
11399 case 113: /* mlhs_item: "(" mlhs_inner rparen */
11400#line 2973 "parse.y"
11401 {
11402 /*%%%*/
11403 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
11404 /*% %*/
11405 /*% ripper: mlhs_paren!($2) %*/
11406 }
11407#line 11408 "parse.c"
11408 break;
11409
11410 case 114: /* mlhs_head: mlhs_item ',' */
11411#line 2982 "parse.y"
11412 {
11413 /*%%%*/
11414 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
11415 /*% %*/
11416 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
11417 }
11418#line 11419 "parse.c"
11419 break;
11420
11421 case 115: /* mlhs_head: mlhs_head mlhs_item ',' */
11422#line 2989 "parse.y"
11423 {
11424 /*%%%*/
11425 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
11426 /*% %*/
11427 /*% ripper: mlhs_add!($1, $2) %*/
11428 }
11429#line 11430 "parse.c"
11430 break;
11431
11432 case 116: /* mlhs_post: mlhs_item */
11433#line 2998 "parse.y"
11434 {
11435 /*%%%*/
11436 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11437 /*% %*/
11438 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
11439 }
11440#line 11441 "parse.c"
11441 break;
11442
11443 case 117: /* mlhs_post: mlhs_post ',' mlhs_item */
11444#line 3005 "parse.y"
11445 {
11446 /*%%%*/
11447 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
11448 /*% %*/
11449 /*% ripper: mlhs_add!($1, $3) %*/
11450 }
11451#line 11452 "parse.c"
11452 break;
11453
11454 case 118: /* mlhs_node: user_variable */
11455#line 3014 "parse.y"
11456 {
11457 /*%%%*/
11458 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11459 /*% %*/
11460 /*% ripper: assignable(p, var_field(p, $1)) %*/
11461 }
11462#line 11463 "parse.c"
11463 break;
11464
11465 case 119: /* mlhs_node: keyword_variable */
11466#line 3021 "parse.y"
11467 {
11468 /*%%%*/
11469 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11470 /*% %*/
11471 /*% ripper: assignable(p, var_field(p, $1)) %*/
11472 }
11473#line 11474 "parse.c"
11474 break;
11475
11476 case 120: /* mlhs_node: primary_value '[' opt_call_args rbracket */
11477#line 3028 "parse.y"
11478 {
11479 /*%%%*/
11480 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11481 /*% %*/
11482 /*% ripper: aref_field!($1, $3) %*/
11483 }
11484#line 11485 "parse.c"
11485 break;
11486
11487 case 121: /* mlhs_node: primary_value call_op "local variable or method" */
11488#line 3035 "parse.y"
11489 {
11490 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
11491 /*%%%*/
11492 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11493 /*% %*/
11494 /*% ripper: field!($1, $2, $3) %*/
11495 }
11496#line 11497 "parse.c"
11497 break;
11498
11499 case 122: /* mlhs_node: primary_value "::" "local variable or method" */
11500#line 3043 "parse.y"
11501 {
11502 /*%%%*/
11503 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
11504 /*% %*/
11505 /*% ripper: const_path_field!($1, $3) %*/
11506 }
11507#line 11508 "parse.c"
11508 break;
11509
11510 case 123: /* mlhs_node: primary_value call_op "constant" */
11511#line 3050 "parse.y"
11512 {
11513 anddot_multiple_assignment_check(p, &(yylsp[-1]), (yyvsp[-1].id));
11514 /*%%%*/
11515 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11516 /*% %*/
11517 /*% ripper: field!($1, $2, $3) %*/
11518 }
11519#line 11520 "parse.c"
11520 break;
11521
11522 case 124: /* mlhs_node: primary_value "::" "constant" */
11523#line 3058 "parse.y"
11524 {
11525 /*%%%*/
11526 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
11527 /*% %*/
11528 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
11529 }
11530#line 11531 "parse.c"
11531 break;
11532
11533 case 125: /* mlhs_node: ":: at EXPR_BEG" "constant" */
11534#line 3065 "parse.y"
11535 {
11536 /*%%%*/
11537 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
11538 /*% %*/
11539 /*% ripper: const_decl(p, top_const_field!($2)) %*/
11540 }
11541#line 11542 "parse.c"
11542 break;
11543
11544 case 126: /* mlhs_node: backref */
11545#line 3072 "parse.y"
11546 {
11547 /*%%%*/
11548 rb_backref_error(p, (yyvsp[0].node));
11549 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11550 /*% %*/
11551 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
11552 }
11553#line 11554 "parse.c"
11554 break;
11555
11556 case 127: /* lhs: user_variable */
11557#line 3082 "parse.y"
11558 {
11559 /*%%%*/
11560 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11561 /*% %*/
11562 /*% ripper: assignable(p, var_field(p, $1)) %*/
11563 }
11564#line 11565 "parse.c"
11565 break;
11566
11567 case 128: /* lhs: keyword_variable */
11568#line 3089 "parse.y"
11569 {
11570 /*%%%*/
11571 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11572 /*% %*/
11573 /*% ripper: assignable(p, var_field(p, $1)) %*/
11574 }
11575#line 11576 "parse.c"
11576 break;
11577
11578 case 129: /* lhs: primary_value '[' opt_call_args rbracket */
11579#line 3096 "parse.y"
11580 {
11581 /*%%%*/
11582 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11583 /*% %*/
11584 /*% ripper: aref_field!($1, $3) %*/
11585 }
11586#line 11587 "parse.c"
11587 break;
11588
11589 case 130: /* lhs: primary_value call_op "local variable or method" */
11590#line 3103 "parse.y"
11591 {
11592 /*%%%*/
11593 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11594 /*% %*/
11595 /*% ripper: field!($1, $2, $3) %*/
11596 }
11597#line 11598 "parse.c"
11598 break;
11599
11600 case 131: /* lhs: primary_value "::" "local variable or method" */
11601#line 3110 "parse.y"
11602 {
11603 /*%%%*/
11604 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
11605 /*% %*/
11606 /*% ripper: field!($1, $2, $3) %*/
11607 }
11608#line 11609 "parse.c"
11609 break;
11610
11611 case 132: /* lhs: primary_value call_op "constant" */
11612#line 3117 "parse.y"
11613 {
11614 /*%%%*/
11615 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
11616 /*% %*/
11617 /*% ripper: field!($1, $2, $3) %*/
11618 }
11619#line 11620 "parse.c"
11620 break;
11621
11622 case 133: /* lhs: primary_value "::" "constant" */
11623#line 3124 "parse.y"
11624 {
11625 /*%%%*/
11626 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
11627 /*% %*/
11628 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
11629 }
11630#line 11631 "parse.c"
11631 break;
11632
11633 case 134: /* lhs: ":: at EXPR_BEG" "constant" */
11634#line 3131 "parse.y"
11635 {
11636 /*%%%*/
11637 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
11638 /*% %*/
11639 /*% ripper: const_decl(p, top_const_field!($2)) %*/
11640 }
11641#line 11642 "parse.c"
11642 break;
11643
11644 case 135: /* lhs: backref */
11645#line 3138 "parse.y"
11646 {
11647 /*%%%*/
11648 rb_backref_error(p, (yyvsp[0].node));
11649 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11650 /*% %*/
11651 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
11652 }
11653#line 11654 "parse.c"
11654 break;
11655
11656 case 136: /* cname: "local variable or method" */
11657#line 3148 "parse.y"
11658 {
11659 static const char mesg[] = "class/module name must be CONSTANT";
11660 /*%%%*/
11661 yyerror1(&(yylsp[0]), mesg);
11662 /*% %*/
11663 /*% ripper[error]: class_name_error!(ERR_MESG(), $1) %*/
11664 }
11665#line 11666 "parse.c"
11666 break;
11667
11668 case 138: /* cpath: ":: at EXPR_BEG" cname */
11669#line 3159 "parse.y"
11670 {
11671 /*%%%*/
11672 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
11673 /*% %*/
11674 /*% ripper: top_const_ref!($2) %*/
11675 }
11676#line 11677 "parse.c"
11677 break;
11678
11679 case 139: /* cpath: cname */
11680#line 3166 "parse.y"
11681 {
11682 /*%%%*/
11683 (yyval.node) = NEW_COLON2(0, (yyvsp[0].id), &(yyloc));
11684 /*% %*/
11685 /*% ripper: const_ref!($1) %*/
11686 }
11687#line 11688 "parse.c"
11688 break;
11689
11690 case 140: /* cpath: primary_value "::" cname */
11691#line 3173 "parse.y"
11692 {
11693 /*%%%*/
11694 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11695 /*% %*/
11696 /*% ripper: const_path_ref!($1, $3) %*/
11697 }
11698#line 11699 "parse.c"
11699 break;
11700
11701 case 144: /* fname: op */
11702#line 3185 "parse.y"
11703 {
11704 SET_LEX_STATE(EXPR_ENDFN);
11705 (yyval.id) = (yyvsp[0].id);
11706 }
11707#line 11708 "parse.c"
11708 break;
11709
11710 case 146: /* fitem: fname */
11711#line 3193 "parse.y"
11712 {
11713 /*%%%*/
11714 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
11715 /*% %*/
11716 /*% ripper: symbol_literal!($1) %*/
11717 }
11718#line 11719 "parse.c"
11719 break;
11720
11721 case 148: /* undef_list: fitem */
11722#line 3203 "parse.y"
11723 {
11724 /*%%%*/
11725 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
11726 /*% %*/
11727 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
11728 }
11729#line 11730 "parse.c"
11730 break;
11731
11732 case 149: /* $@12: %empty */
11733#line 3209 "parse.y"
11734 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
11735#line 11736 "parse.c"
11736 break;
11737
11738 case 150: /* undef_list: undef_list ',' $@12 fitem */
11739#line 3210 "parse.y"
11740 {
11741 /*%%%*/
11742 NODE *undef = NEW_UNDEF((yyvsp[0].node), &(yylsp[0]));
11743 (yyval.node) = block_append(p, (yyvsp[-3].node), undef);
11744 /*% %*/
11745 /*% ripper: rb_ary_push($1, get_value($4)) %*/
11746 }
11747#line 11748 "parse.c"
11748 break;
11749
11750 case 151: /* op: '|' */
11751#line 3219 "parse.y"
11752 { ifndef_ripper((yyval.id) = '|'); }
11753#line 11754 "parse.c"
11754 break;
11755
11756 case 152: /* op: '^' */
11757#line 3220 "parse.y"
11758 { ifndef_ripper((yyval.id) = '^'); }
11759#line 11760 "parse.c"
11760 break;
11761
11762 case 153: /* op: '&' */
11763#line 3221 "parse.y"
11764 { ifndef_ripper((yyval.id) = '&'); }
11765#line 11766 "parse.c"
11766 break;
11767
11768 case 154: /* op: "<=>" */
11769#line 3222 "parse.y"
11770 { ifndef_ripper((yyval.id) = tCMP); }
11771#line 11772 "parse.c"
11772 break;
11773
11774 case 155: /* op: "==" */
11775#line 3223 "parse.y"
11776 { ifndef_ripper((yyval.id) = tEQ); }
11777#line 11778 "parse.c"
11778 break;
11779
11780 case 156: /* op: "===" */
11781#line 3224 "parse.y"
11782 { ifndef_ripper((yyval.id) = tEQQ); }
11783#line 11784 "parse.c"
11784 break;
11785
11786 case 157: /* op: "=~" */
11787#line 3225 "parse.y"
11788 { ifndef_ripper((yyval.id) = tMATCH); }
11789#line 11790 "parse.c"
11790 break;
11791
11792 case 158: /* op: "!~" */
11793#line 3226 "parse.y"
11794 { ifndef_ripper((yyval.id) = tNMATCH); }
11795#line 11796 "parse.c"
11796 break;
11797
11798 case 159: /* op: '>' */
11799#line 3227 "parse.y"
11800 { ifndef_ripper((yyval.id) = '>'); }
11801#line 11802 "parse.c"
11802 break;
11803
11804 case 160: /* op: ">=" */
11805#line 3228 "parse.y"
11806 { ifndef_ripper((yyval.id) = tGEQ); }
11807#line 11808 "parse.c"
11808 break;
11809
11810 case 161: /* op: '<' */
11811#line 3229 "parse.y"
11812 { ifndef_ripper((yyval.id) = '<'); }
11813#line 11814 "parse.c"
11814 break;
11815
11816 case 162: /* op: "<=" */
11817#line 3230 "parse.y"
11818 { ifndef_ripper((yyval.id) = tLEQ); }
11819#line 11820 "parse.c"
11820 break;
11821
11822 case 163: /* op: "!=" */
11823#line 3231 "parse.y"
11824 { ifndef_ripper((yyval.id) = tNEQ); }
11825#line 11826 "parse.c"
11826 break;
11827
11828 case 164: /* op: "<<" */
11829#line 3232 "parse.y"
11830 { ifndef_ripper((yyval.id) = tLSHFT); }
11831#line 11832 "parse.c"
11832 break;
11833
11834 case 165: /* op: ">>" */
11835#line 3233 "parse.y"
11836 { ifndef_ripper((yyval.id) = tRSHFT); }
11837#line 11838 "parse.c"
11838 break;
11839
11840 case 166: /* op: '+' */
11841#line 3234 "parse.y"
11842 { ifndef_ripper((yyval.id) = '+'); }
11843#line 11844 "parse.c"
11844 break;
11845
11846 case 167: /* op: '-' */
11847#line 3235 "parse.y"
11848 { ifndef_ripper((yyval.id) = '-'); }
11849#line 11850 "parse.c"
11850 break;
11851
11852 case 168: /* op: '*' */
11853#line 3236 "parse.y"
11854 { ifndef_ripper((yyval.id) = '*'); }
11855#line 11856 "parse.c"
11856 break;
11857
11858 case 169: /* op: "*" */
11859#line 3237 "parse.y"
11860 { ifndef_ripper((yyval.id) = '*'); }
11861#line 11862 "parse.c"
11862 break;
11863
11864 case 170: /* op: '/' */
11865#line 3238 "parse.y"
11866 { ifndef_ripper((yyval.id) = '/'); }
11867#line 11868 "parse.c"
11868 break;
11869
11870 case 171: /* op: '%' */
11871#line 3239 "parse.y"
11872 { ifndef_ripper((yyval.id) = '%'); }
11873#line 11874 "parse.c"
11874 break;
11875
11876 case 172: /* op: "**" */
11877#line 3240 "parse.y"
11878 { ifndef_ripper((yyval.id) = tPOW); }
11879#line 11880 "parse.c"
11880 break;
11881
11882 case 173: /* op: "**arg" */
11883#line 3241 "parse.y"
11884 { ifndef_ripper((yyval.id) = tDSTAR); }
11885#line 11886 "parse.c"
11886 break;
11887
11888 case 174: /* op: '!' */
11889#line 3242 "parse.y"
11890 { ifndef_ripper((yyval.id) = '!'); }
11891#line 11892 "parse.c"
11892 break;
11893
11894 case 175: /* op: '~' */
11895#line 3243 "parse.y"
11896 { ifndef_ripper((yyval.id) = '~'); }
11897#line 11898 "parse.c"
11898 break;
11899
11900 case 176: /* op: "unary+" */
11901#line 3244 "parse.y"
11902 { ifndef_ripper((yyval.id) = tUPLUS); }
11903#line 11904 "parse.c"
11904 break;
11905
11906 case 177: /* op: "unary-" */
11907#line 3245 "parse.y"
11908 { ifndef_ripper((yyval.id) = tUMINUS); }
11909#line 11910 "parse.c"
11910 break;
11911
11912 case 178: /* op: "[]" */
11913#line 3246 "parse.y"
11914 { ifndef_ripper((yyval.id) = tAREF); }
11915#line 11916 "parse.c"
11916 break;
11917
11918 case 179: /* op: "[]=" */
11919#line 3247 "parse.y"
11920 { ifndef_ripper((yyval.id) = tASET); }
11921#line 11922 "parse.c"
11922 break;
11923
11924 case 180: /* op: '`' */
11925#line 3248 "parse.y"
11926 { ifndef_ripper((yyval.id) = '`'); }
11927#line 11928 "parse.c"
11928 break;
11929
11930 case 222: /* arg: lhs '=' lex_ctxt arg_rhs */
11931#line 3266 "parse.y"
11932 {
11933 /*%%%*/
11934 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11935 /*% %*/
11936 /*% ripper: assign!($1, $4) %*/
11937 }
11938#line 11939 "parse.c"
11939 break;
11940
11941 case 223: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
11942#line 3273 "parse.y"
11943 {
11944 /*%%%*/
11945 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11946 /*% %*/
11947 /*% ripper: opassign!($1, $2, $4) %*/
11948 }
11949#line 11950 "parse.c"
11950 break;
11951
11952 case 224: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
11953#line 3280 "parse.y"
11954 {
11955 /*%%%*/
11956 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
11957 /*% %*/
11958 /*% ripper: opassign!(aref_field!($1, $3), $5, $7) %*/
11959 }
11960#line 11961 "parse.c"
11961 break;
11962
11963 case 225: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11964#line 3287 "parse.y"
11965 {
11966 /*%%%*/
11967 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11968 /*% %*/
11969 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11970 }
11971#line 11972 "parse.c"
11972 break;
11973
11974 case 226: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
11975#line 3294 "parse.y"
11976 {
11977 /*%%%*/
11978 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11979 /*% %*/
11980 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11981 }
11982#line 11983 "parse.c"
11983 break;
11984
11985 case 227: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11986#line 3301 "parse.y"
11987 {
11988 /*%%%*/
11989 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11990 /*% %*/
11991 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11992 }
11993#line 11994 "parse.c"
11994 break;
11995
11996 case 228: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
11997#line 3308 "parse.y"
11998 {
11999 /*%%%*/
12000 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
12001 (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));
12002 /*% %*/
12003 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
12004 }
12005#line 12006 "parse.c"
12006 break;
12007
12008 case 229: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
12009#line 3316 "parse.y"
12010 {
12011 /*%%%*/
12012 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-3]));
12013 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
12014 /*% %*/
12015 /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/
12016 }
12017#line 12018 "parse.c"
12018 break;
12019
12020 case 230: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
12021#line 3324 "parse.y"
12022 {
12023 /*%%%*/
12024 rb_backref_error(p, (yyvsp[-3].node));
12025 (yyval.node) = NEW_BEGIN(0, &(yyloc));
12026 /*% %*/
12027 /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/
12028 }
12029#line 12030 "parse.c"
12030 break;
12031
12032 case 231: /* arg: arg ".." arg */
12033#line 3332 "parse.y"
12034 {
12035 /*%%%*/
12036 value_expr((yyvsp[-2].node));
12037 value_expr((yyvsp[0].node));
12038 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12039 /*% %*/
12040 /*% ripper: dot2!($1, $3) %*/
12041 }
12042#line 12043 "parse.c"
12043 break;
12044
12045 case 232: /* arg: arg "..." arg */
12046#line 3341 "parse.y"
12047 {
12048 /*%%%*/
12049 value_expr((yyvsp[-2].node));
12050 value_expr((yyvsp[0].node));
12051 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12052 /*% %*/
12053 /*% ripper: dot3!($1, $3) %*/
12054 }
12055#line 12056 "parse.c"
12056 break;
12057
12058 case 233: /* arg: arg ".." */
12059#line 3350 "parse.y"
12060 {
12061 /*%%%*/
12062 value_expr((yyvsp[-1].node));
12063 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
12064 /*% %*/
12065 /*% ripper: dot2!($1, Qnil) %*/
12066 }
12067#line 12068 "parse.c"
12068 break;
12069
12070 case 234: /* arg: arg "..." */
12071#line 3358 "parse.y"
12072 {
12073 /*%%%*/
12074 value_expr((yyvsp[-1].node));
12075 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
12076 /*% %*/
12077 /*% ripper: dot3!($1, Qnil) %*/
12078 }
12079#line 12080 "parse.c"
12080 break;
12081
12082 case 235: /* arg: "(.." arg */
12083#line 3366 "parse.y"
12084 {
12085 /*%%%*/
12086 value_expr((yyvsp[0].node));
12087 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
12088 /*% %*/
12089 /*% ripper: dot2!(Qnil, $2) %*/
12090 }
12091#line 12092 "parse.c"
12092 break;
12093
12094 case 236: /* arg: "(..." arg */
12095#line 3374 "parse.y"
12096 {
12097 /*%%%*/
12098 value_expr((yyvsp[0].node));
12099 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
12100 /*% %*/
12101 /*% ripper: dot3!(Qnil, $2) %*/
12102 }
12103#line 12104 "parse.c"
12104 break;
12105
12106 case 237: /* arg: arg '+' arg */
12107#line 3382 "parse.y"
12108 {
12109 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12110 }
12111#line 12112 "parse.c"
12112 break;
12113
12114 case 238: /* arg: arg '-' arg */
12115#line 3386 "parse.y"
12116 {
12117 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12118 }
12119#line 12120 "parse.c"
12120 break;
12121
12122 case 239: /* arg: arg '*' arg */
12123#line 3390 "parse.y"
12124 {
12125 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12126 }
12127#line 12128 "parse.c"
12128 break;
12129
12130 case 240: /* arg: arg '/' arg */
12131#line 3394 "parse.y"
12132 {
12133 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12134 }
12135#line 12136 "parse.c"
12136 break;
12137
12138 case 241: /* arg: arg '%' arg */
12139#line 3398 "parse.y"
12140 {
12141 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12142 }
12143#line 12144 "parse.c"
12144 break;
12145
12146 case 242: /* arg: arg "**" arg */
12147#line 3402 "parse.y"
12148 {
12149 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12150 }
12151#line 12152 "parse.c"
12152 break;
12153
12154 case 243: /* arg: tUMINUS_NUM simple_numeric "**" arg */
12155#line 3406 "parse.y"
12156 {
12157 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
12158 }
12159#line 12160 "parse.c"
12160 break;
12161
12162 case 244: /* arg: "unary+" arg */
12163#line 3410 "parse.y"
12164 {
12165 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
12166 }
12167#line 12168 "parse.c"
12168 break;
12169
12170 case 245: /* arg: "unary-" arg */
12171#line 3414 "parse.y"
12172 {
12173 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
12174 }
12175#line 12176 "parse.c"
12176 break;
12177
12178 case 246: /* arg: arg '|' arg */
12179#line 3418 "parse.y"
12180 {
12181 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12182 }
12183#line 12184 "parse.c"
12184 break;
12185
12186 case 247: /* arg: arg '^' arg */
12187#line 3422 "parse.y"
12188 {
12189 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12190 }
12191#line 12192 "parse.c"
12192 break;
12193
12194 case 248: /* arg: arg '&' arg */
12195#line 3426 "parse.y"
12196 {
12197 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12198 }
12199#line 12200 "parse.c"
12200 break;
12201
12202 case 249: /* arg: arg "<=>" arg */
12203#line 3430 "parse.y"
12204 {
12205 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12206 }
12207#line 12208 "parse.c"
12208 break;
12209
12210 case 251: /* arg: arg "==" arg */
12211#line 3435 "parse.y"
12212 {
12213 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12214 }
12215#line 12216 "parse.c"
12216 break;
12217
12218 case 252: /* arg: arg "===" arg */
12219#line 3439 "parse.y"
12220 {
12221 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12222 }
12223#line 12224 "parse.c"
12224 break;
12225
12226 case 253: /* arg: arg "!=" arg */
12227#line 3443 "parse.y"
12228 {
12229 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12230 }
12231#line 12232 "parse.c"
12232 break;
12233
12234 case 254: /* arg: arg "=~" arg */
12235#line 3447 "parse.y"
12236 {
12237 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12238 }
12239#line 12240 "parse.c"
12240 break;
12241
12242 case 255: /* arg: arg "!~" arg */
12243#line 3451 "parse.y"
12244 {
12245 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12246 }
12247#line 12248 "parse.c"
12248 break;
12249
12250 case 256: /* arg: '!' arg */
12251#line 3455 "parse.y"
12252 {
12253 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
12254 }
12255#line 12256 "parse.c"
12256 break;
12257
12258 case 257: /* arg: '~' arg */
12259#line 3459 "parse.y"
12260 {
12261 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
12262 }
12263#line 12264 "parse.c"
12264 break;
12265
12266 case 258: /* arg: arg "<<" arg */
12267#line 3463 "parse.y"
12268 {
12269 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12270 }
12271#line 12272 "parse.c"
12272 break;
12273
12274 case 259: /* arg: arg ">>" arg */
12275#line 3467 "parse.y"
12276 {
12277 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12278 }
12279#line 12280 "parse.c"
12280 break;
12281
12282 case 260: /* arg: arg "&&" arg */
12283#line 3471 "parse.y"
12284 {
12285 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12286 }
12287#line 12288 "parse.c"
12288 break;
12289
12290 case 261: /* arg: arg "||" arg */
12291#line 3475 "parse.y"
12292 {
12293 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12294 }
12295#line 12296 "parse.c"
12296 break;
12297
12298 case 262: /* arg: "`defined?'" opt_nl begin_defined arg */
12299#line 3479 "parse.y"
12300 {
12301 p->ctxt.in_defined = (yyvsp[-1].ctxt).in_defined;
12302 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
12303 }
12304#line 12305 "parse.c"
12305 break;
12306
12307 case 263: /* arg: arg '?' arg opt_nl ':' arg */
12308#line 3484 "parse.y"
12309 {
12310 /*%%%*/
12311 value_expr((yyvsp[-5].node));
12312 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
12313 fixpos((yyval.node), (yyvsp[-5].node));
12314 /*% %*/
12315 /*% ripper: ifop!($1, $3, $6) %*/
12316 }
12317#line 12318 "parse.c"
12318 break;
12319
12320 case 264: /* arg: defn_head f_opt_paren_args '=' endless_arg */
12321#line 3493 "parse.y"
12322 {
12323 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
12324 restore_defun(p, (yyvsp[-3].node_def_temp));
12325 /*%%%*/
12326 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12327 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12328 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[0].node);
12329 /*% %*/
12330 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
12331 /*% ripper: def!($head->nd_mid, $args, $bodystmt) %*/
12332 local_pop(p);
12333 }
12334#line 12335 "parse.c"
12335 break;
12336
12337 case 265: /* arg: defs_head f_opt_paren_args '=' endless_arg */
12338#line 3506 "parse.y"
12339 {
12340 endless_method_name(p, get_id((yyvsp[-3].node_def_temp)->nd_mid), &(yylsp[-3]));
12341 restore_defun(p, (yyvsp[-3].node_def_temp));
12342 /*%%%*/
12343 (yyvsp[0].node) = new_scope_body(p, (yyvsp[-2].node_args), (yyvsp[0].node), &(yyloc));
12344 ((yyval.node) = (yyvsp[-3].node_def_temp)->nd_def)->nd_loc = (yyloc);
12345 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[0].node);
12346 /*% %*/
12347 /*% ripper[$bodystmt]: bodystmt!($bodystmt, Qnil, Qnil, Qnil) %*/
12348 /*% ripper: defs!($head->nd_recv, $head->dot_or_colon, $head->nd_mid, $args, $bodystmt) %*/
12349 local_pop(p);
12350 }
12351#line 12352 "parse.c"
12352 break;
12353
12354 case 266: /* arg: primary */
12355#line 3519 "parse.y"
12356 {
12357 (yyval.node) = (yyvsp[0].node);
12358 }
12359#line 12360 "parse.c"
12360 break;
12361
12362 case 268: /* endless_arg: endless_arg "`rescue' modifier" after_rescue arg */
12363#line 3526 "parse.y"
12364 {
12365 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12366 /*%%%*/
12367 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
12368 /*% %*/
12369 /*% ripper: rescue_mod!($1, $4) %*/
12370 }
12371#line 12372 "parse.c"
12372 break;
12373
12374 case 269: /* endless_arg: "`not'" opt_nl endless_arg */
12375#line 3534 "parse.y"
12376 {
12377 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12378 }
12379#line 12380 "parse.c"
12380 break;
12381
12382 case 270: /* relop: '>' */
12383#line 3539 "parse.y"
12384 {(yyval.id) = '>';}
12385#line 12386 "parse.c"
12386 break;
12387
12388 case 271: /* relop: '<' */
12389#line 3540 "parse.y"
12390 {(yyval.id) = '<';}
12391#line 12392 "parse.c"
12392 break;
12393
12394 case 272: /* relop: ">=" */
12395#line 3541 "parse.y"
12396 {(yyval.id) = idGE;}
12397#line 12398 "parse.c"
12398 break;
12399
12400 case 273: /* relop: "<=" */
12401#line 3542 "parse.y"
12402 {(yyval.id) = idLE;}
12403#line 12404 "parse.c"
12404 break;
12405
12406 case 274: /* rel_expr: arg relop arg */
12407#line 3546 "parse.y"
12408 {
12409 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12410 }
12411#line 12412 "parse.c"
12412 break;
12413
12414 case 275: /* rel_expr: rel_expr relop arg */
12415#line 3550 "parse.y"
12416 {
12417 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
12418 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
12419 }
12420#line 12421 "parse.c"
12421 break;
12422
12423 case 276: /* lex_ctxt: none */
12424#line 3557 "parse.y"
12425 {
12426 (yyval.ctxt) = p->ctxt;
12427 }
12428#line 12429 "parse.c"
12429 break;
12430
12431 case 277: /* begin_defined: lex_ctxt */
12432#line 3563 "parse.y"
12433 {
12434 p->ctxt.in_defined = 1;
12435 (yyval.ctxt) = (yyvsp[0].ctxt);
12436 }
12437#line 12438 "parse.c"
12438 break;
12439
12440 case 278: /* after_rescue: lex_ctxt */
12441#line 3570 "parse.y"
12442 {
12443 p->ctxt.in_rescue = after_rescue;
12444 (yyval.ctxt) = (yyvsp[0].ctxt);
12445 }
12446#line 12447 "parse.c"
12447 break;
12448
12449 case 279: /* arg_value: arg */
12450#line 3577 "parse.y"
12451 {
12452 value_expr((yyvsp[0].node));
12453 (yyval.node) = (yyvsp[0].node);
12454 }
12455#line 12456 "parse.c"
12456 break;
12457
12458 case 281: /* aref_args: args trailer */
12459#line 3585 "parse.y"
12460 {
12461 (yyval.node) = (yyvsp[-1].node);
12462 }
12463#line 12464 "parse.c"
12464 break;
12465
12466 case 282: /* aref_args: args ',' assocs trailer */
12467#line 3589 "parse.y"
12468 {
12469 /*%%%*/
12470 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
12471 /*% %*/
12472 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
12473 }
12474#line 12475 "parse.c"
12475 break;
12476
12477 case 283: /* aref_args: assocs trailer */
12478#line 3596 "parse.y"
12479 {
12480 /*%%%*/
12481 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
12482 /*% %*/
12483 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
12484 }
12485#line 12486 "parse.c"
12486 break;
12487
12488 case 284: /* arg_rhs: arg */
12489#line 3605 "parse.y"
12490 {
12491 value_expr((yyvsp[0].node));
12492 (yyval.node) = (yyvsp[0].node);
12493 }
12494#line 12495 "parse.c"
12495 break;
12496
12497 case 285: /* arg_rhs: arg "`rescue' modifier" after_rescue arg */
12498#line 3610 "parse.y"
12499 {
12500 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
12501 /*%%%*/
12502 value_expr((yyvsp[-3].node));
12503 (yyval.node) = rescued_expr(p, (yyvsp[-3].node), (yyvsp[0].node), &(yylsp[-3]), &(yylsp[-2]), &(yylsp[0]));
12504 /*% %*/
12505 /*% ripper: rescue_mod!($1, $4) %*/
12506 }
12507#line 12508 "parse.c"
12508 break;
12509
12510 case 286: /* paren_args: '(' opt_call_args rparen */
12511#line 3621 "parse.y"
12512 {
12513 /*%%%*/
12514 (yyval.node) = (yyvsp[-1].node);
12515 /*% %*/
12516 /*% ripper: arg_paren!($2) %*/
12517 }
12518#line 12519 "parse.c"
12519 break;
12520
12521 case 287: /* paren_args: '(' args ',' args_forward rparen */
12522#line 3628 "parse.y"
12523 {
12524 if (!check_forwarding_args(p)) {
12525 (yyval.node) = Qnone;
12526 }
12527 else {
12528 /*%%%*/
12529 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
12530 /*% %*/
12531 /*% ripper: arg_paren!(args_add!($2, $4)) %*/
12532 }
12533 }
12534#line 12535 "parse.c"
12535 break;
12536
12537 case 288: /* paren_args: '(' args_forward rparen */
12538#line 3640 "parse.y"
12539 {
12540 if (!check_forwarding_args(p)) {
12541 (yyval.node) = Qnone;
12542 }
12543 else {
12544 /*%%%*/
12545 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
12546 /*% %*/
12547 /*% ripper: arg_paren!($2) %*/
12548 }
12549 }
12550#line 12551 "parse.c"
12551 break;
12552
12553 case 293: /* opt_call_args: args ',' */
12554#line 3660 "parse.y"
12555 {
12556 (yyval.node) = (yyvsp[-1].node);
12557 }
12558#line 12559 "parse.c"
12559 break;
12560
12561 case 294: /* opt_call_args: args ',' assocs ',' */
12562#line 3664 "parse.y"
12563 {
12564 /*%%%*/
12565 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
12566 /*% %*/
12567 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
12568 }
12569#line 12570 "parse.c"
12570 break;
12571
12572 case 295: /* opt_call_args: assocs ',' */
12573#line 3671 "parse.y"
12574 {
12575 /*%%%*/
12576 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
12577 /*% %*/
12578 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
12579 }
12580#line 12581 "parse.c"
12581 break;
12582
12583 case 296: /* call_args: command */
12584#line 3680 "parse.y"
12585 {
12586 /*%%%*/
12587 value_expr((yyvsp[0].node));
12588 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12589 /*% %*/
12590 /*% ripper: args_add!(args_new!, $1) %*/
12591 }
12592#line 12593 "parse.c"
12593 break;
12594
12595 case 297: /* call_args: args opt_block_arg */
12596#line 3688 "parse.y"
12597 {
12598 /*%%%*/
12599 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node_block_pass));
12600 /*% %*/
12601 /*% ripper: args_add_block!($1, $2) %*/
12602 }
12603#line 12604 "parse.c"
12604 break;
12605
12606 case 298: /* call_args: assocs opt_block_arg */
12607#line 3695 "parse.y"
12608 {
12609 /*%%%*/
12610 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
12611 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
12612 /*% %*/
12613 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/
12614 }
12615#line 12616 "parse.c"
12616 break;
12617
12618 case 299: /* call_args: args ',' assocs opt_block_arg */
12619#line 3703 "parse.y"
12620 {
12621 /*%%%*/
12622 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
12623 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node_block_pass));
12624 /*% %*/
12625 /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/
12626 }
12627#line 12628 "parse.c"
12628 break;
12629
12630 case 301: /* $@13: %empty */
12631#line 3714 "parse.y"
12632 {
12633 /* If call_args starts with a open paren '(' or '[',
12634 * look-ahead reading of the letters calls CMDARG_PUSH(0),
12635 * but the push must be done after CMDARG_PUSH(1).
12636 * So this code makes them consistent by first cancelling
12637 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
12638 * and finally redoing CMDARG_PUSH(0).
12639 */
12640 int lookahead = 0;
12641 switch (yychar) {
12642 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
12643 lookahead = 1;
12644 }
12645 if (lookahead) CMDARG_POP();
12646 CMDARG_PUSH(1);
12647 if (lookahead) CMDARG_PUSH(0);
12648 }
12649#line 12650 "parse.c"
12650 break;
12651
12652 case 302: /* command_args: $@13 call_args */
12653#line 3732 "parse.y"
12654 {
12655 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
12656 * but the push must be done after CMDARG_POP() in the parser.
12657 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
12658 * CMDARG_POP() to pop 1 pushed by command_args,
12659 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
12660 */
12661 int lookahead = 0;
12662 switch (yychar) {
12663 case tLBRACE_ARG:
12664 lookahead = 1;
12665 }
12666 if (lookahead) CMDARG_POP();
12667 CMDARG_POP();
12668 if (lookahead) CMDARG_PUSH(0);
12669 (yyval.node) = (yyvsp[0].node);
12670 }
12671#line 12672 "parse.c"
12672 break;
12673
12674 case 303: /* block_arg: "&" arg_value */
12675#line 3752 "parse.y"
12676 {
12677 /*%%%*/
12678 (yyval.node_block_pass) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc));
12679 /*% %*/
12680 /*% ripper: $2 %*/
12681 }
12682#line 12683 "parse.c"
12683 break;
12684
12685 case 304: /* block_arg: "&" */
12686#line 3759 "parse.y"
12687 {
12688 forwarding_arg_check(p, idFWD_BLOCK, 0, "block");
12689 /*%%%*/
12690 (yyval.node_block_pass) = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[0])), &(yyloc));
12691 /*% %*/
12692 /*% ripper: Qnil %*/
12693 }
12694#line 12695 "parse.c"
12695 break;
12696
12697 case 305: /* opt_block_arg: ',' block_arg */
12698#line 3769 "parse.y"
12699 {
12700 (yyval.node_block_pass) = (yyvsp[0].node_block_pass);
12701 }
12702#line 12703 "parse.c"
12703 break;
12704
12705 case 306: /* opt_block_arg: none */
12706#line 3773 "parse.y"
12707 {
12708 (yyval.node_block_pass) = 0;
12709 }
12710#line 12711 "parse.c"
12711 break;
12712
12713 case 307: /* args: arg_value */
12714#line 3780 "parse.y"
12715 {
12716 /*%%%*/
12717 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12718 /*% %*/
12719 /*% ripper: args_add!(args_new!, $1) %*/
12720 }
12721#line 12722 "parse.c"
12722 break;
12723
12724 case 308: /* args: arg_splat */
12725#line 3787 "parse.y"
12726 {
12727 /*%%%*/
12728 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
12729 /*% %*/
12730 /*% ripper: args_add_star!(args_new!, $arg_splat) %*/
12731 }
12732#line 12733 "parse.c"
12733 break;
12734
12735 case 309: /* args: args ',' arg_value */
12736#line 3794 "parse.y"
12737 {
12738 /*%%%*/
12739 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12740 /*% %*/
12741 /*% ripper: args_add!($1, $3) %*/
12742 }
12743#line 12744 "parse.c"
12744 break;
12745
12746 case 310: /* args: args ',' arg_splat */
12747#line 3801 "parse.y"
12748 {
12749 /*%%%*/
12750 (yyval.node) = rest_arg_append(p, (yyval.node), (yyvsp[0].node), &(yyloc));
12751 /*% %*/
12752 /*% ripper: args_add_star!($args, $arg_splat) %*/
12753 }
12754#line 12755 "parse.c"
12755 break;
12756
12757 case 311: /* arg_splat: "*" arg_value */
12758#line 3811 "parse.y"
12759 {
12760 (yyval.node) = (yyvsp[0].node);
12761 }
12762#line 12763 "parse.c"
12763 break;
12764
12765 case 312: /* arg_splat: "*" */
12766#line 3815 "parse.y"
12767 {
12768 forwarding_arg_check(p, idFWD_REST, idFWD_ALL, "rest");
12769 /*%%%*/
12770 (yyval.node) = NEW_LVAR(idFWD_REST, &(yylsp[0]));
12771 /*% %*/
12772 /*% ripper: Qnil %*/
12773 }
12774#line 12775 "parse.c"
12775 break;
12776
12777 case 315: /* mrhs: args ',' arg_value */
12778#line 3831 "parse.y"
12779 {
12780 /*%%%*/
12781 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12782 /*% %*/
12783 /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/
12784 }
12785#line 12786 "parse.c"
12786 break;
12787
12788 case 316: /* mrhs: args ',' "*" arg_value */
12789#line 3838 "parse.y"
12790 {
12791 /*%%%*/
12792 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
12793 /*% %*/
12794 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/
12795 }
12796#line 12797 "parse.c"
12797 break;
12798
12799 case 317: /* mrhs: "*" arg_value */
12800#line 3845 "parse.y"
12801 {
12802 /*%%%*/
12803 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
12804 /*% %*/
12805 /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/
12806 }
12807#line 12808 "parse.c"
12808 break;
12809
12810 case 328: /* primary: "method" */
12811#line 3864 "parse.y"
12812 {
12813 /*%%%*/
12814 (yyval.node) = (NODE *)NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
12815 /*% %*/
12816 /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/
12817 }
12818#line 12819 "parse.c"
12819 break;
12820
12821 case 329: /* $@14: %empty */
12822#line 3871 "parse.y"
12823 {
12824 CMDARG_PUSH(0);
12825 }
12826#line 12827 "parse.c"
12827 break;
12828
12829 case 330: /* primary: k_begin $@14 bodystmt k_end */
12830#line 3876 "parse.y"
12831 {
12832 CMDARG_POP();
12833 /*%%%*/
12834 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
12835 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
12836 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
12837 /*% %*/
12838 /*% ripper: begin!($3) %*/
12839 }
12840#line 12841 "parse.c"
12841 break;
12842
12843 case 331: /* $@15: %empty */
12844#line 3885 "parse.y"
12845 {SET_LEX_STATE(EXPR_ENDARG);}
12846#line 12847 "parse.c"
12847 break;
12848
12849 case 332: /* primary: "( arg" compstmt $@15 ')' */
12850#line 3886 "parse.y"
12851 {
12852 /*%%%*/
12853 if (nd_type_p((yyvsp[-2].node), NODE_SELF)) RNODE_SELF((yyvsp[-2].node))->nd_state = 0;
12854 (yyval.node) = (yyvsp[-2].node);
12855 /*% %*/
12856 /*% ripper: paren!($2) %*/
12857 }
12858#line 12859 "parse.c"
12859 break;
12860
12861 case 333: /* primary: "(" compstmt ')' */
12862#line 3894 "parse.y"
12863 {
12864 /*%%%*/
12865 if (nd_type_p((yyvsp[-1].node), NODE_SELF)) RNODE_SELF((yyvsp[-1].node))->nd_state = 0;
12866 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
12867 /*% %*/
12868 /*% ripper: paren!($2) %*/
12869 }
12870#line 12871 "parse.c"
12871 break;
12872
12873 case 334: /* primary: primary_value "::" "constant" */
12874#line 3902 "parse.y"
12875 {
12876 /*%%%*/
12877 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
12878 /*% %*/
12879 /*% ripper: const_path_ref!($1, $3) %*/
12880 }
12881#line 12882 "parse.c"
12882 break;
12883
12884 case 335: /* primary: ":: at EXPR_BEG" "constant" */
12885#line 3909 "parse.y"
12886 {
12887 /*%%%*/
12888 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
12889 /*% %*/
12890 /*% ripper: top_const_ref!($2) %*/
12891 }
12892#line 12893 "parse.c"
12893 break;
12894
12895 case 336: /* primary: "[" aref_args ']' */
12896#line 3916 "parse.y"
12897 {
12898 /*%%%*/
12899 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12900 /*% %*/
12901 /*% ripper: array!($2) %*/
12902 }
12903#line 12904 "parse.c"
12904 break;
12905
12906 case 337: /* primary: "{" assoc_list '}' */
12907#line 3923 "parse.y"
12908 {
12909 /*%%%*/
12910 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
12911 RNODE_HASH((yyval.node))->nd_brace = TRUE;
12912 /*% %*/
12913 /*% ripper: hash!($2) %*/
12914 }
12915#line 12916 "parse.c"
12916 break;
12917
12918 case 338: /* primary: k_return */
12919#line 3931 "parse.y"
12920 {
12921 /*%%%*/
12922 (yyval.node) = NEW_RETURN(0, &(yyloc));
12923 /*% %*/
12924 /*% ripper: return0! %*/
12925 }
12926#line 12927 "parse.c"
12927 break;
12928
12929 case 339: /* primary: k_yield '(' call_args rparen */
12930#line 3938 "parse.y"
12931 {
12932 /*%%%*/
12933 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
12934 /*% %*/
12935 /*% ripper: yield!(paren!($3)) %*/
12936 }
12937#line 12938 "parse.c"
12938 break;
12939
12940 case 340: /* primary: k_yield '(' rparen */
12941#line 3945 "parse.y"
12942 {
12943 /*%%%*/
12944 (yyval.node) = NEW_YIELD(0, &(yyloc));
12945 /*% %*/
12946 /*% ripper: yield!(paren!(args_new!)) %*/
12947 }
12948#line 12949 "parse.c"
12949 break;
12950
12951 case 341: /* primary: k_yield */
12952#line 3952 "parse.y"
12953 {
12954 /*%%%*/
12955 (yyval.node) = NEW_YIELD(0, &(yyloc));
12956 /*% %*/
12957 /*% ripper: yield0! %*/
12958 }
12959#line 12960 "parse.c"
12960 break;
12961
12962 case 342: /* primary: "`defined?'" opt_nl '(' begin_defined expr rparen */
12963#line 3959 "parse.y"
12964 {
12965 p->ctxt.in_defined = (yyvsp[-2].ctxt).in_defined;
12966 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
12967 }
12968#line 12969 "parse.c"
12969 break;
12970
12971 case 343: /* primary: "`not'" '(' expr rparen */
12972#line 3964 "parse.y"
12973 {
12974 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
12975 }
12976#line 12977 "parse.c"
12977 break;
12978
12979 case 344: /* primary: "`not'" '(' rparen */
12980#line 3968 "parse.y"
12981 {
12982 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12983 }
12984#line 12985 "parse.c"
12985 break;
12986
12987 case 345: /* primary: fcall brace_block */
12988#line 3972 "parse.y"
12989 {
12990 /*%%%*/
12991 (yyval.node) = method_add_block(p, (NODE *)(yyvsp[-1].node_fcall), (yyvsp[0].node), &(yyloc));
12992 /*% %*/
12993 /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/
12994 }
12995#line 12996 "parse.c"
12996 break;
12997
12998 case 347: /* primary: method_call brace_block */
12999#line 3980 "parse.y"
13000 {
13001 /*%%%*/
13002 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
13003 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13004 /*% %*/
13005 /*% ripper: method_add_block!($1, $2) %*/
13006 }
13007#line 13008 "parse.c"
13008 break;
13009
13010 case 349: /* primary: k_if expr_value then compstmt if_tail k_end */
13011#line 3992 "parse.y"
13012 {
13013 /*%%%*/
13014 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
13015 fixpos((yyval.node), (yyvsp[-4].node));
13016 /*% %*/
13017 /*% ripper: if!($2, $4, $5) %*/
13018 }
13019#line 13020 "parse.c"
13020 break;
13021
13022 case 350: /* primary: k_unless expr_value then compstmt opt_else k_end */
13023#line 4003 "parse.y"
13024 {
13025 /*%%%*/
13026 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
13027 fixpos((yyval.node), (yyvsp[-4].node));
13028 /*% %*/
13029 /*% ripper: unless!($2, $4, $5) %*/
13030 }
13031#line 13032 "parse.c"
13032 break;
13033
13034 case 351: /* primary: k_while expr_value_do compstmt k_end */
13035#line 4013 "parse.y"
13036 {
13037 restore_block_exit(p, (yyvsp[-3].node_exits));
13038 /*%%%*/
13039 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
13040 fixpos((yyval.node), (yyvsp[-2].node));
13041 /*% %*/
13042 /*% ripper: while!($2, $3) %*/
13043 }
13044#line 13045 "parse.c"
13045 break;
13046
13047 case 352: /* primary: k_until expr_value_do compstmt k_end */
13048#line 4024 "parse.y"
13049 {
13050 restore_block_exit(p, (yyvsp[-3].node_exits));
13051 /*%%%*/
13052 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
13053 fixpos((yyval.node), (yyvsp[-2].node));
13054 /*% %*/
13055 /*% ripper: until!($2, $3) %*/
13056 }
13057#line 13058 "parse.c"
13058 break;
13059
13060 case 353: /* @16: %empty */
13061#line 4033 "parse.y"
13062 {
13063 (yyval.val) = p->case_labels;
13064 p->case_labels = Qnil;
13065 }
13066#line 13067 "parse.c"
13067 break;
13068
13069 case 354: /* primary: k_case expr_value opt_terms @16 case_body k_end */
13070#line 4039 "parse.y"
13071 {
13072 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
13073 p->case_labels = (yyvsp[-2].val);
13074 /*%%%*/
13075 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
13076 fixpos((yyval.node), (yyvsp[-4].node));
13077 /*% %*/
13078 /*% ripper: case!($2, $5) %*/
13079 }
13080#line 13081 "parse.c"
13081 break;
13082
13083 case 355: /* @17: %empty */
13084#line 4049 "parse.y"
13085 {
13086 (yyval.val) = p->case_labels;
13087 p->case_labels = 0;
13088 }
13089#line 13090 "parse.c"
13090 break;
13091
13092 case 356: /* primary: k_case opt_terms @17 case_body k_end */
13093#line 4055 "parse.y"
13094 {
13095 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
13096 p->case_labels = (yyvsp[-2].val);
13097 /*%%%*/
13098 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc));
13099 /*% %*/
13100 /*% ripper: case!(Qnil, $4) %*/
13101 }
13102#line 13103 "parse.c"
13103 break;
13104
13105 case 357: /* primary: k_case expr_value opt_terms p_case_body k_end */
13106#line 4066 "parse.y"
13107 {
13108 /*%%%*/
13109 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13110 /*% %*/
13111 /*% ripper: case!($2, $4) %*/
13112 }
13113#line 13114 "parse.c"
13114 break;
13115
13116 case 358: /* primary: k_for for_var "`in'" expr_value_do compstmt k_end */
13117#line 4075 "parse.y"
13118 {
13119 restore_block_exit(p, (yyvsp[-5].node_exits));
13120 /*%%%*/
13121 /*
13122 * for a, b, c in e
13123 * #=>
13124 * e.each{|*x| a, b, c = x}
13125 *
13126 * for a in e
13127 * #=>
13128 * e.each{|x| a, = x}
13129 */
13130 ID id = internal_id(p);
13131 rb_node_args_aux_t *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
13132 rb_node_args_t *args;
13133 NODE *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
13134 rb_ast_id_table_t *tbl = rb_ast_new_local_table(p->ast, 1);
13135 tbl->ids[0] = id; /* internal id */
13136
13137 switch (nd_type((yyvsp[-4].node))) {
13138 case NODE_LASGN:
13139 case NODE_DASGN: /* e.each {|internal_var| a = internal_var; ... } */
13140 set_nd_value(p, (yyvsp[-4].node), internal_var);
13141 id = 0;
13142 m->nd_plen = 1;
13143 m->nd_next = (yyvsp[-4].node);
13144 break;
13145 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
13146 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
13147 break;
13148 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
13149 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]));
13150 }
13151 /* {|*internal_id| <m> = internal_id; ... } */
13152 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
13153 scope = NEW_SCOPE2(tbl, args, (yyvsp[-1].node), &(yyloc));
13154 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
13155 fixpos((yyval.node), (yyvsp[-4].node));
13156 /*% %*/
13157 /*% ripper: for!($2, $4, $5) %*/
13158 }
13159#line 13160 "parse.c"
13160 break;
13161
13162 case 359: /* $@18: %empty */
13163#line 4117 "parse.y"
13164 {
13165 begin_definition("class", &(yylsp[-2]), &(yylsp[-1]));
13166 }
13167#line 13168 "parse.c"
13168 break;
13169
13170 case 360: /* primary: k_class cpath superclass $@18 bodystmt k_end */
13171#line 4122 "parse.y"
13172 {
13173 /*%%%*/
13174 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
13175 nd_set_line(RNODE_CLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
13176 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
13177 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
13178 /*% %*/
13179 /*% ripper: class!($cpath, $superclass, $bodystmt) %*/
13180 local_pop(p);
13181 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
13182 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
13183 }
13184#line 13185 "parse.c"
13185 break;
13186
13187 case 361: /* $@19: %empty */
13188#line 4135 "parse.y"
13189 {
13190 begin_definition("", &(yylsp[-2]), &(yylsp[-1]));
13191 }
13192#line 13193 "parse.c"
13193 break;
13194
13195 case 362: /* primary: k_class "<<" expr_value $@19 term bodystmt k_end */
13196#line 4141 "parse.y"
13197 {
13198 /*%%%*/
13199 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
13200 nd_set_line(RNODE_SCLASS((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
13201 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
13202 fixpos((yyval.node), (yyvsp[-4].node));
13203 /*% %*/
13204 /*% ripper: sclass!($expr_value, $bodystmt) %*/
13205 local_pop(p);
13206 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
13207 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
13208 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
13209 }
13210#line 13211 "parse.c"
13211 break;
13212
13213 case 363: /* $@20: %empty */
13214#line 4155 "parse.y"
13215 {
13216 begin_definition("module", &(yylsp[-1]), &(yylsp[0]));
13217 }
13218#line 13219 "parse.c"
13219 break;
13220
13221 case 364: /* primary: k_module cpath $@20 bodystmt k_end */
13222#line 4160 "parse.y"
13223 {
13224 /*%%%*/
13225 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13226 nd_set_line(RNODE_MODULE((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
13227 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
13228 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
13229 /*% %*/
13230 /*% ripper: module!($cpath, $bodystmt) %*/
13231 local_pop(p);
13232 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
13233 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
13234 }
13235#line 13236 "parse.c"
13236 break;
13237
13238 case 365: /* $@21: %empty */
13239#line 4174 "parse.y"
13240 {
13241 /*%%%*/
13242 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13243 /*% %*/
13244 }
13245#line 13246 "parse.c"
13246 break;
13247
13248 case 366: /* primary: defn_head f_arglist $@21 bodystmt k_end */
13249#line 4181 "parse.y"
13250 {
13251 restore_defun(p, (yyvsp[-4].node_def_temp));
13252 /*%%%*/
13253 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
13254 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
13255 RNODE_DEFN((yyval.node))->nd_defn = (yyvsp[-1].node);
13256 /*% %*/
13257 /*% ripper: def!($head->nd_mid, $args, $bodystmt) %*/
13258 local_pop(p);
13259 }
13260#line 13261 "parse.c"
13261 break;
13262
13263 case 367: /* $@22: %empty */
13264#line 4193 "parse.y"
13265 {
13266 /*%%%*/
13267 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13268 /*% %*/
13269 }
13270#line 13271 "parse.c"
13271 break;
13272
13273 case 368: /* primary: defs_head f_arglist $@22 bodystmt k_end */
13274#line 4200 "parse.y"
13275 {
13276 restore_defun(p, (yyvsp[-4].node_def_temp));
13277 /*%%%*/
13278 (yyvsp[-1].node) = new_scope_body(p, (yyvsp[-3].node_args), (yyvsp[-1].node), &(yyloc));
13279 ((yyval.node) = (yyvsp[-4].node_def_temp)->nd_def)->nd_loc = (yyloc);
13280 RNODE_DEFS((yyval.node))->nd_defn = (yyvsp[-1].node);
13281 /*% %*/
13282 /*% ripper: defs!($head->nd_recv, $head->dot_or_colon, $head->nd_mid, $args, $bodystmt) %*/
13283 local_pop(p);
13284 }
13285#line 13286 "parse.c"
13286 break;
13287
13288 case 369: /* primary: "`break'" */
13289#line 4211 "parse.y"
13290 {
13291 (yyval.node) = add_block_exit(p, NEW_BREAK(0, &(yyloc)));
13292 /*% ripper: break!(args_new!) %*/
13293 }
13294#line 13295 "parse.c"
13295 break;
13296
13297 case 370: /* primary: "`next'" */
13298#line 4216 "parse.y"
13299 {
13300 (yyval.node) = add_block_exit(p, NEW_NEXT(0, &(yyloc)));
13301 /*% ripper: next!(args_new!) %*/
13302 }
13303#line 13304 "parse.c"
13304 break;
13305
13306 case 371: /* primary: "`redo'" */
13307#line 4221 "parse.y"
13308 {
13309 (yyval.node) = add_block_exit(p, NEW_REDO(&(yyloc)));
13310 /*% ripper: redo! %*/
13311 }
13312#line 13313 "parse.c"
13313 break;
13314
13315 case 372: /* primary: "`retry'" */
13316#line 4226 "parse.y"
13317 {
13318 if (!p->ctxt.in_defined) {
13319 switch (p->ctxt.in_rescue) {
13320 case before_rescue: yyerror1(&(yylsp[0]), "Invalid retry without rescue"); break;
13321 case after_rescue: /* ok */ break;
13322 case after_else: yyerror1(&(yylsp[0]), "Invalid retry after else"); break;
13323 case after_ensure: yyerror1(&(yylsp[0]), "Invalid retry after ensure"); break;
13324 }
13325 }
13326 /*%%%*/
13327 (yyval.node) = NEW_RETRY(&(yyloc));
13328 /*% %*/
13329 /*% ripper: retry! %*/
13330 }
13331#line 13332 "parse.c"
13332 break;
13333
13334 case 373: /* primary_value: primary */
13335#line 4243 "parse.y"
13336 {
13337 value_expr((yyvsp[0].node));
13338 (yyval.node) = (yyvsp[0].node);
13339 }
13340#line 13341 "parse.c"
13341 break;
13342
13343 case 374: /* k_begin: "`begin'" */
13344#line 4250 "parse.y"
13345 {
13346 token_info_push(p, "begin", &(yyloc));
13347 /*%%%*/
13348 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13349 /*% %*/
13350 }
13351#line 13352 "parse.c"
13352 break;
13353
13354 case 375: /* k_if: "`if'" */
13355#line 4259 "parse.y"
13356 {
13357 WARN_EOL("if");
13358 token_info_push(p, "if", &(yyloc));
13359 if (p->token_info && p->token_info->nonspc &&
13360 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
13361 const char *tok = p->lex.ptok - rb_strlen_lit("if");
13362 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
13363 beg += rb_strlen_lit("else");
13364 while (beg < tok && ISSPACE(*beg)) beg++;
13365 if (beg == tok) {
13366 p->token_info->nonspc = 0;
13367 }
13368 }
13369 /*%%%*/
13370 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13371 /*% %*/
13372 }
13373#line 13374 "parse.c"
13374 break;
13375
13376 case 376: /* k_unless: "`unless'" */
13377#line 4279 "parse.y"
13378 {
13379 token_info_push(p, "unless", &(yyloc));
13380 /*%%%*/
13381 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13382 /*% %*/
13383 }
13384#line 13385 "parse.c"
13385 break;
13386
13387 case 377: /* k_while: "`while'" allow_exits */
13388#line 4288 "parse.y"
13389 {
13390 (yyval.node_exits) = (yyvsp[0].node_exits);
13391 token_info_push(p, "while", &(yyloc));
13392 /*%%%*/
13393 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13394 /*% %*/
13395 }
13396#line 13397 "parse.c"
13397 break;
13398
13399 case 378: /* k_until: "`until'" allow_exits */
13400#line 4298 "parse.y"
13401 {
13402 (yyval.node_exits) = (yyvsp[0].node_exits);
13403 token_info_push(p, "until", &(yyloc));
13404 /*%%%*/
13405 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13406 /*% %*/
13407 }
13408#line 13409 "parse.c"
13409 break;
13410
13411 case 379: /* k_case: "`case'" */
13412#line 4308 "parse.y"
13413 {
13414 token_info_push(p, "case", &(yyloc));
13415 /*%%%*/
13416 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13417 /*% %*/
13418 }
13419#line 13420 "parse.c"
13420 break;
13421
13422 case 380: /* k_for: "`for'" allow_exits */
13423#line 4317 "parse.y"
13424 {
13425 (yyval.node_exits) = (yyvsp[0].node_exits);
13426 token_info_push(p, "for", &(yyloc));
13427 /*%%%*/
13428 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
13429 /*% %*/
13430 }
13431#line 13432 "parse.c"
13432 break;
13433
13434 case 381: /* k_class: "`class'" */
13435#line 4327 "parse.y"
13436 {
13437 token_info_push(p, "class", &(yyloc));
13438 (yyval.ctxt) = p->ctxt;
13439 p->ctxt.in_rescue = before_rescue;
13440 /*%%%*/
13441 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13442 /*% %*/
13443 }
13444#line 13445 "parse.c"
13445 break;
13446
13447 case 382: /* k_module: "`module'" */
13448#line 4338 "parse.y"
13449 {
13450 token_info_push(p, "module", &(yyloc));
13451 (yyval.ctxt) = p->ctxt;
13452 p->ctxt.in_rescue = before_rescue;
13453 /*%%%*/
13454 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13455 /*% %*/
13456 }
13457#line 13458 "parse.c"
13458 break;
13459
13460 case 383: /* k_def: "`def'" */
13461#line 4349 "parse.y"
13462 {
13463 token_info_push(p, "def", &(yyloc));
13464 (yyval.node_def_temp) = NEW_DEF_TEMP(&(yyloc));
13465 p->ctxt.in_argdef = 1;
13466 }
13467#line 13468 "parse.c"
13468 break;
13469
13470 case 384: /* k_do: "`do'" */
13471#line 4357 "parse.y"
13472 {
13473 token_info_push(p, "do", &(yyloc));
13474 /*%%%*/
13475 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13476 /*% %*/
13477 }
13478#line 13479 "parse.c"
13479 break;
13480
13481 case 385: /* k_do_block: "`do' for block" */
13482#line 4366 "parse.y"
13483 {
13484 token_info_push(p, "do", &(yyloc));
13485 /*%%%*/
13486 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13487 /*% %*/
13488 }
13489#line 13490 "parse.c"
13490 break;
13491
13492 case 386: /* k_rescue: "`rescue'" */
13493#line 4375 "parse.y"
13494 {
13495 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
13496 (yyval.ctxt) = p->ctxt;
13497 p->ctxt.in_rescue = after_rescue;
13498 }
13499#line 13500 "parse.c"
13500 break;
13501
13502 case 387: /* k_ensure: "`ensure'" */
13503#line 4383 "parse.y"
13504 {
13505 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
13506 (yyval.ctxt) = p->ctxt;
13507 }
13508#line 13509 "parse.c"
13509 break;
13510
13511 case 388: /* k_when: "`when'" */
13512#line 4390 "parse.y"
13513 {
13514 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
13515 }
13516#line 13517 "parse.c"
13517 break;
13518
13519 case 389: /* k_else: "`else'" */
13520#line 4396 "parse.y"
13521 {
13522 token_info *ptinfo_beg = p->token_info;
13523 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
13524 token_info_warn(p, "else", p->token_info, same, &(yyloc));
13525 if (same) {
13526 token_info e;
13527 e.next = ptinfo_beg->next;
13528 e.token = "else";
13529 token_info_setup(&e, p->lex.pbeg, &(yyloc));
13530 if (!e.nonspc) *ptinfo_beg = e;
13531 }
13532 }
13533#line 13534 "parse.c"
13534 break;
13535
13536 case 390: /* k_elsif: "`elsif'" */
13537#line 4411 "parse.y"
13538 {
13539 WARN_EOL("elsif");
13540 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
13541 }
13542#line 13543 "parse.c"
13543 break;
13544
13545 case 391: /* k_end: "`end'" */
13546#line 4418 "parse.y"
13547 {
13548 token_info_pop(p, "end", &(yyloc));
13549 /*%%%*/
13550 pop_end_expect_token_locations(p);
13551 /*% %*/
13552 }
13553#line 13554 "parse.c"
13554 break;
13555
13556 case 392: /* k_end: "dummy end" */
13557#line 4425 "parse.y"
13558 {
13559 compile_error(p, "syntax error, unexpected end-of-input");
13560 }
13561#line 13562 "parse.c"
13562 break;
13563
13564 case 393: /* k_return: "`return'" */
13565#line 4431 "parse.y"
13566 {
13567 if (p->ctxt.in_class && !p->ctxt.in_def && !dyna_in_block(p))
13568 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
13569 }
13570#line 13571 "parse.c"
13571 break;
13572
13573 case 394: /* k_yield: "`yield'" */
13574#line 4438 "parse.y"
13575 {
13576 if (!p->ctxt.in_defined && !p->ctxt.in_def && !compile_for_eval)
13577 yyerror1(&(yylsp[0]), "Invalid yield");
13578 }
13579#line 13580 "parse.c"
13580 break;
13581
13582 case 401: /* if_tail: k_elsif expr_value then compstmt if_tail */
13583#line 4457 "parse.y"
13584 {
13585 /*%%%*/
13586 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13587 fixpos((yyval.node), (yyvsp[-3].node));
13588 /*% %*/
13589 /*% ripper: elsif!($2, $4, $5) %*/
13590 }
13591#line 13592 "parse.c"
13592 break;
13593
13594 case 403: /* opt_else: k_else compstmt */
13595#line 4468 "parse.y"
13596 {
13597 /*%%%*/
13598 (yyval.node) = (yyvsp[0].node);
13599 /*% %*/
13600 /*% ripper: else!($2) %*/
13601 }
13602#line 13603 "parse.c"
13603 break;
13604
13605 case 406: /* f_marg: f_norm_arg */
13606#line 4481 "parse.y"
13607 {
13608 /*%%%*/
13609 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
13610 mark_lvar_used(p, (yyval.node));
13611 /*% %*/
13612 /*% ripper: assignable(p, $1) %*/
13613 }
13614#line 13615 "parse.c"
13615 break;
13616
13617 case 407: /* f_marg: "(" f_margs rparen */
13618#line 4489 "parse.y"
13619 {
13620 /*%%%*/
13621 (yyval.node) = (NODE *)(yyvsp[-1].node_masgn);
13622 /*% %*/
13623 /*% ripper: mlhs_paren!($2) %*/
13624 }
13625#line 13626 "parse.c"
13626 break;
13627
13628 case 408: /* f_marg_list: f_marg */
13629#line 4498 "parse.y"
13630 {
13631 /*%%%*/
13632 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13633 /*% %*/
13634 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
13635 }
13636#line 13637 "parse.c"
13637 break;
13638
13639 case 409: /* f_marg_list: f_marg_list ',' f_marg */
13640#line 4505 "parse.y"
13641 {
13642 /*%%%*/
13643 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
13644 /*% %*/
13645 /*% ripper: mlhs_add!($1, $3) %*/
13646 }
13647#line 13648 "parse.c"
13648 break;
13649
13650 case 410: /* f_margs: f_marg_list */
13651#line 4514 "parse.y"
13652 {
13653 /*%%%*/
13654 (yyval.node_masgn) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
13655 /*% %*/
13656 /*% ripper: $1 %*/
13657 }
13658#line 13659 "parse.c"
13659 break;
13660
13661 case 411: /* f_margs: f_marg_list ',' f_rest_marg */
13662#line 4521 "parse.y"
13663 {
13664 /*%%%*/
13665 (yyval.node_masgn) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13666 /*% %*/
13667 /*% ripper: mlhs_add_star!($1, $3) %*/
13668 }
13669#line 13670 "parse.c"
13670 break;
13671
13672 case 412: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
13673#line 4528 "parse.y"
13674 {
13675 /*%%%*/
13676 (yyval.node_masgn) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
13677 /*% %*/
13678 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
13679 }
13680#line 13681 "parse.c"
13681 break;
13682
13683 case 413: /* f_margs: f_rest_marg */
13684#line 4535 "parse.y"
13685 {
13686 /*%%%*/
13687 (yyval.node_masgn) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
13688 /*% %*/
13689 /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/
13690 }
13691#line 13692 "parse.c"
13692 break;
13693
13694 case 414: /* f_margs: f_rest_marg ',' f_marg_list */
13695#line 4542 "parse.y"
13696 {
13697 /*%%%*/
13698 (yyval.node_masgn) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
13699 /*% %*/
13700 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/
13701 }
13702#line 13703 "parse.c"
13703 break;
13704
13705 case 415: /* f_rest_marg: "*" f_norm_arg */
13706#line 4551 "parse.y"
13707 {
13708 /*%%%*/
13709 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
13710 mark_lvar_used(p, (yyval.node));
13711 /*% %*/
13712 /*% ripper: assignable(p, $2) %*/
13713 }
13714#line 13715 "parse.c"
13715 break;
13716
13717 case 416: /* f_rest_marg: "*" */
13718#line 4559 "parse.y"
13719 {
13720 /*%%%*/
13721 (yyval.node) = NODE_SPECIAL_NO_NAME_REST;
13722 /*% %*/
13723 /*% ripper: Qnil %*/
13724 }
13725#line 13726 "parse.c"
13726 break;
13727
13728 case 418: /* f_any_kwrest: f_no_kwarg */
13729#line 4568 "parse.y"
13730 {(yyval.id) = ID2VAL(idNil);}
13731#line 13732 "parse.c"
13732 break;
13733
13734 case 419: /* $@23: %empty */
13735#line 4571 "parse.y"
13736 {p->ctxt.in_argdef = 0;}
13737#line 13738 "parse.c"
13738 break;
13739
13740 case 421: /* block_args_tail: f_block_kwarg ',' f_kwrest opt_f_block_arg */
13741#line 4574 "parse.y"
13742 {
13743 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
13744 }
13745#line 13746 "parse.c"
13746 break;
13747
13748 case 422: /* block_args_tail: f_block_kwarg opt_f_block_arg */
13749#line 4578 "parse.y"
13750 {
13751 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), Qnone, (yyvsp[0].id), &(yylsp[-1]));
13752 }
13753#line 13754 "parse.c"
13754 break;
13755
13756 case 423: /* block_args_tail: f_any_kwrest opt_f_block_arg */
13757#line 4582 "parse.y"
13758 {
13759 (yyval.node_args) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
13760 }
13761#line 13762 "parse.c"
13762 break;
13763
13764 case 424: /* block_args_tail: f_block_arg */
13765#line 4586 "parse.y"
13766 {
13767 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
13768 }
13769#line 13770 "parse.c"
13770 break;
13771
13772 case 425: /* opt_block_args_tail: ',' block_args_tail */
13773#line 4592 "parse.y"
13774 {
13775 (yyval.node_args) = (yyvsp[0].node_args);
13776 }
13777#line 13778 "parse.c"
13778 break;
13779
13780 case 426: /* opt_block_args_tail: %empty */
13781#line 4596 "parse.y"
13782 {
13783 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
13784 }
13785#line 13786 "parse.c"
13786 break;
13787
13788 case 427: /* excessed_comma: ',' */
13789#line 4602 "parse.y"
13790 {
13791 /* magic number for rest_id in iseq_set_arguments() */
13792 /*%%%*/
13793 (yyval.id) = NODE_SPECIAL_EXCESSIVE_COMMA;
13794 /*% %*/
13795 /*% ripper: excessed_comma! %*/
13796 }
13797#line 13798 "parse.c"
13798 break;
13799
13800 case 428: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail */
13801#line 4612 "parse.y"
13802 {
13803 (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));
13804 }
13805#line 13806 "parse.c"
13806 break;
13807
13808 case 429: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
13809#line 4616 "parse.y"
13810 {
13811 (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));
13812 }
13813#line 13814 "parse.c"
13814 break;
13815
13816 case 430: /* block_param: f_arg ',' f_block_optarg opt_block_args_tail */
13817#line 4620 "parse.y"
13818 {
13819 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13820 }
13821#line 13822 "parse.c"
13822 break;
13823
13824 case 431: /* block_param: f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail */
13825#line 4624 "parse.y"
13826 {
13827 (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));
13828 }
13829#line 13830 "parse.c"
13830 break;
13831
13832 case 432: /* block_param: f_arg ',' f_rest_arg opt_block_args_tail */
13833#line 4628 "parse.y"
13834 {
13835 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
13836 }
13837#line 13838 "parse.c"
13838 break;
13839
13840 case 433: /* block_param: f_arg excessed_comma */
13841#line 4632 "parse.y"
13842 {
13843 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
13844 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), Qnone, (yyvsp[0].id), Qnone, (yyval.node_args), &(yyloc));
13845 }
13846#line 13847 "parse.c"
13847 break;
13848
13849 case 434: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail */
13850#line 4637 "parse.y"
13851 {
13852 (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));
13853 }
13854#line 13855 "parse.c"
13855 break;
13856
13857 case 435: /* block_param: f_arg opt_block_args_tail */
13858#line 4641 "parse.y"
13859 {
13860 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13861 }
13862#line 13863 "parse.c"
13863 break;
13864
13865 case 436: /* block_param: f_block_optarg ',' f_rest_arg opt_block_args_tail */
13866#line 4645 "parse.y"
13867 {
13868 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
13869 }
13870#line 13871 "parse.c"
13871 break;
13872
13873 case 437: /* block_param: f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
13874#line 4649 "parse.y"
13875 {
13876 (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));
13877 }
13878#line 13879 "parse.c"
13879 break;
13880
13881 case 438: /* block_param: f_block_optarg opt_block_args_tail */
13882#line 4653 "parse.y"
13883 {
13884 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13885 }
13886#line 13887 "parse.c"
13887 break;
13888
13889 case 439: /* block_param: f_block_optarg ',' f_arg opt_block_args_tail */
13890#line 4657 "parse.y"
13891 {
13892 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), Qnone, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
13893 }
13894#line 13895 "parse.c"
13895 break;
13896
13897 case 440: /* block_param: f_rest_arg opt_block_args_tail */
13898#line 4661 "parse.y"
13899 {
13900 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
13901 }
13902#line 13903 "parse.c"
13903 break;
13904
13905 case 441: /* block_param: f_rest_arg ',' f_arg opt_block_args_tail */
13906#line 4665 "parse.y"
13907 {
13908 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
13909 }
13910#line 13911 "parse.c"
13911 break;
13912
13913 case 442: /* block_param: block_args_tail */
13914#line 4669 "parse.y"
13915 {
13916 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
13917 }
13918#line 13919 "parse.c"
13919 break;
13920
13921 case 444: /* opt_block_param: block_param_def */
13922#line 4676 "parse.y"
13923 {
13924 p->command_start = TRUE;
13925 }
13926#line 13927 "parse.c"
13927 break;
13928
13929 case 445: /* block_param_def: '|' opt_bv_decl '|' */
13930#line 4682 "parse.y"
13931 {
13932 p->cur_arg = 0;
13933 p->max_numparam = ORDINAL_PARAM;
13934 p->ctxt.in_argdef = 0;
13935 /*%%%*/
13936 (yyval.node_args) = 0;
13937 /*% %*/
13938 /*% ripper: params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil) %*/
13939 /*% ripper: block_var!($$, $2) %*/
13940 }
13941#line 13942 "parse.c"
13942 break;
13943
13944 case 446: /* block_param_def: '|' block_param opt_bv_decl '|' */
13945#line 4693 "parse.y"
13946 {
13947 p->cur_arg = 0;
13948 p->max_numparam = ORDINAL_PARAM;
13949 p->ctxt.in_argdef = 0;
13950 /*%%%*/
13951 (yyval.node_args) = (yyvsp[-2].node_args);
13952 /*% %*/
13953 /*% ripper: block_var!($2, $3) %*/
13954 }
13955#line 13956 "parse.c"
13956 break;
13957
13958 case 447: /* opt_bv_decl: opt_nl */
13959#line 4706 "parse.y"
13960 {
13961 (yyval.node) = 0;
13962 }
13963#line 13964 "parse.c"
13964 break;
13965
13966 case 448: /* opt_bv_decl: opt_nl ';' bv_decls opt_nl */
13967#line 4710 "parse.y"
13968 {
13969 /*%%%*/
13970 (yyval.node) = 0;
13971 /*% %*/
13972 /*% ripper: $3 %*/
13973 }
13974#line 13975 "parse.c"
13975 break;
13976
13977 case 451: /* bvar: "local variable or method" */
13978#line 4725 "parse.y"
13979 {
13980 new_bv(p, get_id((yyvsp[0].id)));
13981 /*% ripper: get_value($1) %*/
13982 }
13983#line 13984 "parse.c"
13984 break;
13985
13986 case 452: /* bvar: f_bad_arg */
13987#line 4730 "parse.y"
13988 {
13989 (yyval.node) = 0;
13990 }
13991#line 13992 "parse.c"
13992 break;
13993
13994 case 453: /* max_numparam: %empty */
13995#line 4735 "parse.y"
13996 {
13997 (yyval.num) = p->max_numparam;
13998 p->max_numparam = 0;
13999 }
14000#line 14001 "parse.c"
14001 break;
14002
14003 case 454: /* numparam: %empty */
14004#line 4741 "parse.y"
14005 {
14006 (yyval.node) = numparam_push(p);
14007 }
14008#line 14009 "parse.c"
14009 break;
14010
14011 case 455: /* @24: %empty */
14012#line 4747 "parse.y"
14013 {
14014 token_info_push(p, "->", &(yylsp[0]));
14015 (yyvsp[0].vars) = dyna_push(p);
14016 (yyval.num) = p->lex.lpar_beg;
14017 p->lex.lpar_beg = p->lex.paren_nest;
14018 }
14019#line 14020 "parse.c"
14020 break;
14021
14022 case 456: /* $@25: %empty */
14023#line 4755 "parse.y"
14024 {
14025 CMDARG_PUSH(0);
14026 }
14027#line 14028 "parse.c"
14028 break;
14029
14030 case 457: /* lambda: "->" @24 max_numparam numparam allow_exits f_larglist $@25 lambda_body */
14031#line 4759 "parse.y"
14032 {
14033 int max_numparam = p->max_numparam;
14034 p->lex.lpar_beg = (yyvsp[-6].num);
14035 p->max_numparam = (yyvsp[-5].num);
14036 restore_block_exit(p, (yyvsp[-3].node_exits));
14037 CMDARG_POP();
14038 (yyvsp[-2].node_args) = args_with_numbered(p, (yyvsp[-2].node_args), max_numparam);
14039 /*%%%*/
14040 {
14041 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
14042 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node_args), (yyvsp[0].node), &loc);
14043 nd_set_line(RNODE_LAMBDA((yyval.node))->nd_body, (yylsp[0]).end_pos.lineno);
14044 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
14045 nd_set_first_loc((yyval.node), (yylsp[-7]).beg_pos);
14046 }
14047 /*% %*/
14048 /*% ripper: lambda!($args, $body) %*/
14049 numparam_pop(p, (yyvsp[-4].node));
14050 dyna_pop(p, (yyvsp[-7].vars));
14051 }
14052#line 14053 "parse.c"
14053 break;
14054
14055 case 458: /* f_larglist: '(' f_args opt_bv_decl ')' */
14056#line 4782 "parse.y"
14057 {
14058 p->ctxt.in_argdef = 0;
14059 /*%%%*/
14060 (yyval.node_args) = (yyvsp[-2].node_args);
14061 p->max_numparam = ORDINAL_PARAM;
14062 /*% %*/
14063 /*% ripper: paren!($2) %*/
14064 }
14065#line 14066 "parse.c"
14066 break;
14067
14068 case 459: /* f_larglist: f_args */
14069#line 4791 "parse.y"
14070 {
14071 p->ctxt.in_argdef = 0;
14072 /*%%%*/
14073 if (!args_info_empty_p(&(yyvsp[0].node_args)->nd_ainfo))
14074 p->max_numparam = ORDINAL_PARAM;
14075 /*% %*/
14076 (yyval.node_args) = (yyvsp[0].node_args);
14077 }
14078#line 14079 "parse.c"
14079 break;
14080
14081 case 460: /* lambda_body: tLAMBEG compstmt '}' */
14082#line 4802 "parse.y"
14083 {
14084 token_info_pop(p, "}", &(yylsp[0]));
14085 (yyval.node) = (yyvsp[-1].node);
14086 }
14087#line 14088 "parse.c"
14088 break;
14089
14090 case 461: /* $@26: %empty */
14091#line 4807 "parse.y"
14092 {
14093 /*%%%*/
14094 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
14095 /*% %*/
14096 }
14097#line 14098 "parse.c"
14098 break;
14099
14100 case 462: /* lambda_body: "`do' for lambda" $@26 bodystmt k_end */
14101#line 4813 "parse.y"
14102 {
14103 (yyval.node) = (yyvsp[-1].node);
14104 }
14105#line 14106 "parse.c"
14106 break;
14107
14108 case 463: /* do_block: k_do_block do_body k_end */
14109#line 4819 "parse.y"
14110 {
14111 (yyval.node) = (yyvsp[-1].node);
14112 /*%%%*/
14113 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
14114 /*% %*/
14115 }
14116#line 14117 "parse.c"
14117 break;
14118
14119 case 464: /* block_call: command do_block */
14120#line 4828 "parse.y"
14121 {
14122 /*%%%*/
14123 if (nd_type_p((yyvsp[-1].node), NODE_YIELD)) {
14124 compile_error(p, "block given to yield");
14125 }
14126 else {
14127 block_dup_check(p, get_nd_args(p, (yyvsp[-1].node)), (yyvsp[0].node));
14128 }
14129 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14130 fixpos((yyval.node), (yyvsp[-1].node));
14131 /*% %*/
14132 /*% ripper: method_add_block!($1, $2) %*/
14133 }
14134#line 14135 "parse.c"
14135 break;
14136
14137 case 465: /* block_call: block_call call_op2 operation2 opt_paren_args */
14138#line 4842 "parse.y"
14139 {
14140 /*%%%*/
14141 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14142 /*% %*/
14143 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
14144 }
14145#line 14146 "parse.c"
14146 break;
14147
14148 case 466: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
14149#line 4849 "parse.y"
14150 {
14151 /*%%%*/
14152 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
14153 /*% %*/
14154 /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/
14155 }
14156#line 14157 "parse.c"
14157 break;
14158
14159 case 467: /* block_call: block_call call_op2 operation2 command_args do_block */
14160#line 4856 "parse.y"
14161 {
14162 /*%%%*/
14163 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
14164 /*% %*/
14165 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
14166 }
14167#line 14168 "parse.c"
14168 break;
14169
14170 case 468: /* method_call: fcall paren_args */
14171#line 4865 "parse.y"
14172 {
14173 /*%%%*/
14174 (yyvsp[-1].node_fcall)->nd_args = (yyvsp[0].node);
14175 (yyval.node) = (NODE *)(yyvsp[-1].node_fcall);
14176 nd_set_last_loc((yyvsp[-1].node_fcall), (yylsp[0]).end_pos);
14177 /*% %*/
14178 /*% ripper: method_add_arg!(fcall!($1), $2) %*/
14179 }
14180#line 14181 "parse.c"
14181 break;
14182
14183 case 469: /* method_call: primary_value call_op operation2 opt_paren_args */
14184#line 4874 "parse.y"
14185 {
14186 /*%%%*/
14187 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14188 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14189 /*% %*/
14190 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
14191 }
14192#line 14193 "parse.c"
14193 break;
14194
14195 case 470: /* method_call: primary_value "::" operation2 paren_args */
14196#line 4882 "parse.y"
14197 {
14198 /*%%%*/
14199 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14200 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14201 /*% %*/
14202 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
14203 }
14204#line 14205 "parse.c"
14205 break;
14206
14207 case 471: /* method_call: primary_value "::" operation3 */
14208#line 4890 "parse.y"
14209 {
14210 /*%%%*/
14211 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), (yyvsp[0].id), Qnull, &(yylsp[0]), &(yyloc));
14212 /*% %*/
14213 /*% ripper: call!($1, $2, $3) %*/
14214 }
14215#line 14216 "parse.c"
14216 break;
14217
14218 case 472: /* method_call: primary_value call_op paren_args */
14219#line 4897 "parse.y"
14220 {
14221 /*%%%*/
14222 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14223 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14224 /*% %*/
14225 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
14226 }
14227#line 14228 "parse.c"
14228 break;
14229
14230 case 473: /* method_call: primary_value "::" paren_args */
14231#line 4905 "parse.y"
14232 {
14233 /*%%%*/
14234 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
14235 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
14236 /*% %*/
14237 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
14238 }
14239#line 14240 "parse.c"
14240 break;
14241
14242 case 474: /* method_call: "`super'" paren_args */
14243#line 4913 "parse.y"
14244 {
14245 /*%%%*/
14246 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
14247 /*% %*/
14248 /*% ripper: super!($2) %*/
14249 }
14250#line 14251 "parse.c"
14251 break;
14252
14253 case 475: /* method_call: "`super'" */
14254#line 4920 "parse.y"
14255 {
14256 /*%%%*/
14257 (yyval.node) = NEW_ZSUPER(&(yyloc));
14258 /*% %*/
14259 /*% ripper: zsuper! %*/
14260 }
14261#line 14262 "parse.c"
14262 break;
14263
14264 case 476: /* method_call: primary_value '[' opt_call_args rbracket */
14265#line 4927 "parse.y"
14266 {
14267 /*%%%*/
14268 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
14269 fixpos((yyval.node), (yyvsp[-3].node));
14270 /*% %*/
14271 /*% ripper: aref!($1, $3) %*/
14272 }
14273#line 14274 "parse.c"
14274 break;
14275
14276 case 477: /* brace_block: '{' brace_body '}' */
14277#line 4937 "parse.y"
14278 {
14279 (yyval.node) = (yyvsp[-1].node);
14280 /*%%%*/
14281 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
14282 /*% %*/
14283 }
14284#line 14285 "parse.c"
14285 break;
14286
14287 case 478: /* brace_block: k_do do_body k_end */
14288#line 4944 "parse.y"
14289 {
14290 (yyval.node) = (yyvsp[-1].node);
14291 /*%%%*/
14292 set_embraced_location((yyval.node), &(yylsp[-2]), &(yylsp[0]));
14293 /*% %*/
14294 }
14295#line 14296 "parse.c"
14296 break;
14297
14298 case 479: /* @27: %empty */
14299#line 4952 "parse.y"
14300 {(yyval.vars) = dyna_push(p);}
14301#line 14302 "parse.c"
14302 break;
14303
14304 case 480: /* brace_body: @27 max_numparam numparam allow_exits opt_block_param compstmt */
14305#line 4955 "parse.y"
14306 {
14307 int max_numparam = p->max_numparam;
14308 p->max_numparam = (yyvsp[-4].num);
14309 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam);
14310 /*%%%*/
14311 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
14312 /*% %*/
14313 /*% ripper: brace_block!($args, $compstmt) %*/
14314 restore_block_exit(p, (yyvsp[-2].node_exits));
14315 numparam_pop(p, (yyvsp[-3].node));
14316 dyna_pop(p, (yyvsp[-5].vars));
14317 }
14318#line 14319 "parse.c"
14319 break;
14320
14321 case 481: /* @28: %empty */
14322#line 4969 "parse.y"
14323 {
14324 (yyval.vars) = dyna_push(p);
14325 CMDARG_PUSH(0);
14326 }
14327#line 14328 "parse.c"
14328 break;
14329
14330 case 482: /* do_body: @28 max_numparam numparam allow_exits opt_block_param bodystmt */
14331#line 4975 "parse.y"
14332 {
14333 int max_numparam = p->max_numparam;
14334 p->max_numparam = (yyvsp[-4].num);
14335 (yyvsp[-1].node_args) = args_with_numbered(p, (yyvsp[-1].node_args), max_numparam);
14336 /*%%%*/
14337 (yyval.node) = NEW_ITER((yyvsp[-1].node_args), (yyvsp[0].node), &(yyloc));
14338 /*% %*/
14339 /*% ripper: do_block!($args, $bodystmt) %*/
14340 CMDARG_POP();
14341 restore_block_exit(p, (yyvsp[-2].node_exits));
14342 numparam_pop(p, (yyvsp[-3].node));
14343 dyna_pop(p, (yyvsp[-5].vars));
14344 }
14345#line 14346 "parse.c"
14346 break;
14347
14348 case 483: /* case_args: arg_value */
14349#line 4991 "parse.y"
14350 {
14351 /*%%%*/
14352 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
14353 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14354 /*% %*/
14355 /*% ripper: args_add!(args_new!, $1) %*/
14356 }
14357#line 14358 "parse.c"
14358 break;
14359
14360 case 484: /* case_args: "*" arg_value */
14361#line 4999 "parse.y"
14362 {
14363 /*%%%*/
14364 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
14365 /*% %*/
14366 /*% ripper: args_add_star!(args_new!, $2) %*/
14367 }
14368#line 14369 "parse.c"
14369 break;
14370
14371 case 485: /* case_args: case_args ',' arg_value */
14372#line 5006 "parse.y"
14373 {
14374 /*%%%*/
14375 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
14376 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14377 /*% %*/
14378 /*% ripper: args_add!($1, $3) %*/
14379 }
14380#line 14381 "parse.c"
14381 break;
14382
14383 case 486: /* case_args: case_args ',' "*" arg_value */
14384#line 5014 "parse.y"
14385 {
14386 /*%%%*/
14387 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
14388 /*% %*/
14389 /*% ripper: args_add_star!($1, $4) %*/
14390 }
14391#line 14392 "parse.c"
14392 break;
14393
14394 case 487: /* case_body: k_when case_args then compstmt cases */
14395#line 5025 "parse.y"
14396 {
14397 /*%%%*/
14398 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14399 fixpos((yyval.node), (yyvsp[-3].node));
14400 /*% %*/
14401 /*% ripper: when!($2, $4, $5) %*/
14402 }
14403#line 14404 "parse.c"
14404 break;
14405
14406 case 490: /* p_pvtbl: %empty */
14407#line 5038 "parse.y"
14408 {(yyval.tbl) = p->pvtbl; p->pvtbl = st_init_numtable();}
14409#line 14410 "parse.c"
14410 break;
14411
14412 case 491: /* p_pktbl: %empty */
14413#line 5039 "parse.y"
14414 {(yyval.tbl) = p->pktbl; p->pktbl = 0;}
14415#line 14416 "parse.c"
14416 break;
14417
14418 case 492: /* p_in_kwarg: %empty */
14419#line 5041 "parse.y"
14420 {
14421 (yyval.ctxt) = p->ctxt;
14422 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
14423 p->command_start = FALSE;
14424 p->ctxt.in_kwarg = 1;
14425 }
14426#line 14427 "parse.c"
14427 break;
14428
14429 case 493: /* $@29: %empty */
14430#line 5052 "parse.y"
14431 {
14432 pop_pktbl(p, (yyvsp[-2].tbl));
14433 pop_pvtbl(p, (yyvsp[-3].tbl));
14434 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
14435 }
14436#line 14437 "parse.c"
14437 break;
14438
14439 case 494: /* p_case_body: "`in'" p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@29 compstmt p_cases */
14440#line 5059 "parse.y"
14441 {
14442 /*%%%*/
14443 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14444 /*% %*/
14445 /*% ripper: in!($expr, $compstmt, $cases) %*/
14446 }
14447#line 14448 "parse.c"
14448 break;
14449
14450 case 498: /* p_top_expr: p_top_expr_body "`if' modifier" expr_value */
14451#line 5073 "parse.y"
14452 {
14453 /*%%%*/
14454 (yyval.node) = new_if(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
14455 fixpos((yyval.node), (yyvsp[0].node));
14456 /*% %*/
14457 /*% ripper: if_mod!($3, $1) %*/
14458 }
14459#line 14460 "parse.c"
14460 break;
14461
14462 case 499: /* p_top_expr: p_top_expr_body "`unless' modifier" expr_value */
14463#line 5081 "parse.y"
14464 {
14465 /*%%%*/
14466 (yyval.node) = new_unless(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
14467 fixpos((yyval.node), (yyvsp[0].node));
14468 /*% %*/
14469 /*% ripper: unless_mod!($3, $1) %*/
14470 }
14471#line 14472 "parse.c"
14472 break;
14473
14474 case 501: /* p_top_expr_body: p_expr ',' */
14475#line 5092 "parse.y"
14476 {
14477 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, Qnone, Qnone, &(yyloc));
14478 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-1].node)), (yyval.node), &(yyloc));
14479 }
14480#line 14481 "parse.c"
14481 break;
14482
14483 case 502: /* p_top_expr_body: p_expr ',' p_args */
14484#line 5097 "parse.y"
14485 {
14486 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-2].node)), (yyvsp[0].node), &(yyloc));
14487 /*%%%*/
14488 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
14489 /*%
14490 %*/
14491 }
14492#line 14493 "parse.c"
14493 break;
14494
14495 case 503: /* p_top_expr_body: p_find */
14496#line 5105 "parse.y"
14497 {
14498 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
14499 }
14500#line 14501 "parse.c"
14501 break;
14502
14503 case 504: /* p_top_expr_body: p_args_tail */
14504#line 5109 "parse.y"
14505 {
14506 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
14507 }
14508#line 14509 "parse.c"
14509 break;
14510
14511 case 505: /* p_top_expr_body: p_kwargs */
14512#line 5113 "parse.y"
14513 {
14514 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
14515 }
14516#line 14517 "parse.c"
14517 break;
14518
14519 case 507: /* p_as: p_expr "=>" p_variable */
14520#line 5122 "parse.y"
14521 {
14522 /*%%%*/
14523 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
14524 n = list_append(p, n, (yyvsp[0].node));
14525 (yyval.node) = new_hash(p, n, &(yyloc));
14526 /*% %*/
14527 /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/
14528 }
14529#line 14530 "parse.c"
14530 break;
14531
14532 case 509: /* p_alt: p_alt '|' p_expr_basic */
14533#line 5134 "parse.y"
14534 {
14535 /*%%%*/
14536 (yyval.node) = NEW_OR((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14537 /*% %*/
14538 /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/
14539 }
14540#line 14541 "parse.c"
14541 break;
14542
14543 case 511: /* p_lparen: '(' p_pktbl */
14544#line 5143 "parse.y"
14545 { (yyval.tbl) = (yyvsp[0].tbl);}
14546#line 14547 "parse.c"
14547 break;
14548
14549 case 512: /* p_lbracket: '[' p_pktbl */
14550#line 5144 "parse.y"
14551 { (yyval.tbl) = (yyvsp[0].tbl);}
14552#line 14553 "parse.c"
14553 break;
14554
14555 case 515: /* p_expr_basic: p_const p_lparen p_args rparen */
14556#line 5149 "parse.y"
14557 {
14558 pop_pktbl(p, (yyvsp[-2].tbl));
14559 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
14560 /*%%%*/
14561 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14562 /*%
14563 %*/
14564 }
14565#line 14566 "parse.c"
14566 break;
14567
14568 case 516: /* p_expr_basic: p_const p_lparen p_find rparen */
14569#line 5158 "parse.y"
14570 {
14571 pop_pktbl(p, (yyvsp[-2].tbl));
14572 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14573 /*%%%*/
14574 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14575 /*%
14576 %*/
14577 }
14578#line 14579 "parse.c"
14579 break;
14580
14581 case 517: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
14582#line 5167 "parse.y"
14583 {
14584 pop_pktbl(p, (yyvsp[-2].tbl));
14585 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14586 /*%%%*/
14587 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14588 /*%
14589 %*/
14590 }
14591#line 14592 "parse.c"
14592 break;
14593
14594 case 518: /* p_expr_basic: p_const '(' rparen */
14595#line 5176 "parse.y"
14596 {
14597 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, Qnone, Qnone, &(yyloc));
14598 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
14599 }
14600#line 14601 "parse.c"
14601 break;
14602
14603 case 519: /* p_expr_basic: p_const p_lbracket p_args rbracket */
14604#line 5181 "parse.y"
14605 {
14606 pop_pktbl(p, (yyvsp[-2].tbl));
14607 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
14608 /*%%%*/
14609 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14610 /*%
14611 %*/
14612 }
14613#line 14614 "parse.c"
14614 break;
14615
14616 case 520: /* p_expr_basic: p_const p_lbracket p_find rbracket */
14617#line 5190 "parse.y"
14618 {
14619 pop_pktbl(p, (yyvsp[-2].tbl));
14620 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14621 /*%%%*/
14622 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14623 /*%
14624 %*/
14625 }
14626#line 14627 "parse.c"
14627 break;
14628
14629 case 521: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
14630#line 5199 "parse.y"
14631 {
14632 pop_pktbl(p, (yyvsp[-2].tbl));
14633 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
14634 /*%%%*/
14635 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
14636 /*%
14637 %*/
14638 }
14639#line 14640 "parse.c"
14640 break;
14641
14642 case 522: /* p_expr_basic: p_const '[' rbracket */
14643#line 5208 "parse.y"
14644 {
14645 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, Qnone, Qnone, &(yyloc));
14646 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
14647 }
14648#line 14649 "parse.c"
14649 break;
14650
14651 case 523: /* p_expr_basic: "[" p_args rbracket */
14652#line 5213 "parse.y"
14653 {
14654 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[-1].node), &(yyloc));
14655 }
14656#line 14657 "parse.c"
14657 break;
14658
14659 case 524: /* p_expr_basic: "[" p_find rbracket */
14660#line 5217 "parse.y"
14661 {
14662 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
14663 }
14664#line 14665 "parse.c"
14665 break;
14666
14667 case 525: /* p_expr_basic: "[" rbracket */
14668#line 5221 "parse.y"
14669 {
14670 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, Qnone, Qnone, &(yyloc));
14671 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyval.node), &(yyloc));
14672 }
14673#line 14674 "parse.c"
14674 break;
14675
14676 case 526: /* $@30: %empty */
14677#line 5226 "parse.y"
14678 {
14679 p->ctxt.in_kwarg = 0;
14680 }
14681#line 14682 "parse.c"
14682 break;
14683
14684 case 527: /* p_expr_basic: "{" p_pktbl lex_ctxt $@30 p_kwargs rbrace */
14685#line 5230 "parse.y"
14686 {
14687 pop_pktbl(p, (yyvsp[-4].tbl));
14688 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
14689 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
14690 }
14691#line 14692 "parse.c"
14692 break;
14693
14694 case 528: /* p_expr_basic: "{" rbrace */
14695#line 5236 "parse.y"
14696 {
14697 (yyval.node) = new_hash_pattern_tail(p, Qnone, 0, &(yyloc));
14698 (yyval.node) = new_hash_pattern(p, Qnone, (yyval.node), &(yyloc));
14699 }
14700#line 14701 "parse.c"
14701 break;
14702
14703 case 529: /* p_expr_basic: "(" p_pktbl p_expr rparen */
14704#line 5241 "parse.y"
14705 {
14706 pop_pktbl(p, (yyvsp[-2].tbl));
14707 (yyval.node) = (yyvsp[-1].node);
14708 }
14709#line 14710 "parse.c"
14710 break;
14711
14712 case 530: /* p_args: p_expr */
14713#line 5248 "parse.y"
14714 {
14715 /*%%%*/
14716 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
14717 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, Qnone, Qnone, &(yyloc));
14718 /*%
14719 $$ = new_array_pattern_tail(p, rb_ary_new_from_args(1, get_value($1)), 0, Qnone, Qnone, &@$);
14720 %*/
14721 }
14722#line 14723 "parse.c"
14723 break;
14724
14725 case 531: /* p_args: p_args_head */
14726#line 5257 "parse.y"
14727 {
14728 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, Qnone, Qnone, &(yyloc));
14729 }
14730#line 14731 "parse.c"
14731 break;
14732
14733 case 532: /* p_args: p_args_head p_arg */
14734#line 5261 "parse.y"
14735 {
14736 /*%%%*/
14737 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, Qnone, Qnone, &(yyloc));
14738 /*%
14739 VALUE pre_args = rb_ary_concat($1, get_value($2));
14740 $$ = new_array_pattern_tail(p, pre_args, 0, Qnone, Qnone, &@$);
14741 %*/
14742 }
14743#line 14744 "parse.c"
14744 break;
14745
14746 case 533: /* p_args: p_args_head p_rest */
14747#line 5270 "parse.y"
14748 {
14749 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, (yyvsp[0].node), Qnone, &(yyloc));
14750 }
14751#line 14752 "parse.c"
14752 break;
14753
14754 case 534: /* p_args: p_args_head p_rest ',' p_args_post */
14755#line 5274 "parse.y"
14756 {
14757 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14758 }
14759#line 14760 "parse.c"
14760 break;
14761
14762 case 536: /* p_args_head: p_arg ',' */
14763#line 5281 "parse.y"
14764 {
14765 (yyval.node) = (yyvsp[-1].node);
14766 }
14767#line 14768 "parse.c"
14768 break;
14769
14770 case 537: /* p_args_head: p_args_head p_arg ',' */
14771#line 5285 "parse.y"
14772 {
14773 /*%%%*/
14774 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
14775 /*% %*/
14776 /*% ripper: rb_ary_concat($1, get_value($2)) %*/
14777 }
14778#line 14779 "parse.c"
14779 break;
14780
14781 case 538: /* p_args_tail: p_rest */
14782#line 5294 "parse.y"
14783 {
14784 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[0].node), Qnone, &(yyloc));
14785 }
14786#line 14787 "parse.c"
14787 break;
14788
14789 case 539: /* p_args_tail: p_rest ',' p_args_post */
14790#line 5298 "parse.y"
14791 {
14792 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14793 }
14794#line 14795 "parse.c"
14795 break;
14796
14797 case 540: /* p_find: p_rest ',' p_args_post ',' p_rest */
14798#line 5304 "parse.y"
14799 {
14800 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14801 }
14802#line 14803 "parse.c"
14803 break;
14804
14805 case 541: /* p_rest: "*" "local variable or method" */
14806#line 5311 "parse.y"
14807 {
14808 /*%%%*/
14809 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
14810 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14811 /*% %*/
14812 /*% ripper: assignable(p, var_field(p, $2)) %*/
14813 }
14814#line 14815 "parse.c"
14815 break;
14816
14817 case 542: /* p_rest: "*" */
14818#line 5319 "parse.y"
14819 {
14820 /*%%%*/
14821 (yyval.node) = 0;
14822 /*% %*/
14823 /*% ripper: var_field(p, Qnil) %*/
14824 }
14825#line 14826 "parse.c"
14826 break;
14827
14828 case 544: /* p_args_post: p_args_post ',' p_arg */
14829#line 5329 "parse.y"
14830 {
14831 /*%%%*/
14832 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
14833 /*% %*/
14834 /*% ripper: rb_ary_concat($1, get_value($3)) %*/
14835 }
14836#line 14837 "parse.c"
14837 break;
14838
14839 case 545: /* p_arg: p_expr */
14840#line 5338 "parse.y"
14841 {
14842 /*%%%*/
14843 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14844 /*% %*/
14845 /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/
14846 }
14847#line 14848 "parse.c"
14848 break;
14849
14850 case 546: /* p_kwargs: p_kwarg ',' p_any_kwrest */
14851#line 5347 "parse.y"
14852 {
14853 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
14854 }
14855#line 14856 "parse.c"
14856 break;
14857
14858 case 547: /* p_kwargs: p_kwarg */
14859#line 5351 "parse.y"
14860 {
14861 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
14862 }
14863#line 14864 "parse.c"
14864 break;
14865
14866 case 548: /* p_kwargs: p_kwarg ',' */
14867#line 5355 "parse.y"
14868 {
14869 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
14870 }
14871#line 14872 "parse.c"
14872 break;
14873
14874 case 549: /* p_kwargs: p_any_kwrest */
14875#line 5359 "parse.y"
14876 {
14877 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), (yyvsp[0].id), &(yyloc));
14878 }
14879#line 14880 "parse.c"
14880 break;
14881
14882 case 551: /* p_kwarg: p_kwarg ',' p_kw */
14883#line 5367 "parse.y"
14884 {
14885 /*%%%*/
14886 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
14887 /*% %*/
14888 /*% ripper: rb_ary_push($1, $3) %*/
14889 }
14890#line 14891 "parse.c"
14891 break;
14892
14893 case 552: /* p_kw: p_kw_label p_expr */
14894#line 5376 "parse.y"
14895 {
14896 error_duplicate_pattern_key(p, get_id((yyvsp[-1].id)), &(yylsp[-1]));
14897 /*%%%*/
14898 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
14899 /*% %*/
14900 /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/
14901 }
14902#line 14903 "parse.c"
14903 break;
14904
14905 case 553: /* p_kw: p_kw_label */
14906#line 5384 "parse.y"
14907 {
14908 error_duplicate_pattern_key(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14909 if ((yyvsp[0].id) && !is_local_id(get_id((yyvsp[0].id)))) {
14910 yyerror1(&(yylsp[0]), "key must be valid as local variables");
14911 }
14912 error_duplicate_pattern_variable(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14913 /*%%%*/
14914 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
14915 /*% %*/
14916 /*% ripper: rb_ary_new_from_args(2, get_value(assignable(p, $1)), Qnil) %*/
14917 }
14918#line 14919 "parse.c"
14919 break;
14920
14921 case 555: /* p_kw_label: "string literal" string_contents tLABEL_END */
14922#line 5399 "parse.y"
14923 {
14924 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
14925 /*%%%*/
14926 if (!(yyvsp[-1].node) || nd_type_p((yyvsp[-1].node), NODE_STR)) {
14927 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
14928 (yyval.id) = SYM2ID(RNODE_LIT(node)->nd_lit);
14929 }
14930 /*%
14931 if (ripper_is_node_yylval(p, $2) && RNODE_RIPPER($2)->nd_cval) {
14932 VALUE label = RNODE_RIPPER($2)->nd_cval;
14933 VALUE rval = RNODE_RIPPER($2)->nd_rval;
14934 $$ = ripper_new_yylval(p, rb_intern_str(label), rval, label);
14935 RNODE($$)->nd_loc = loc;
14936 }
14937 %*/
14938 else {
14939 yyerror1(&loc, "symbol literal with interpolation is not allowed");
14940 (yyval.id) = 0;
14941 }
14942 }
14943#line 14944 "parse.c"
14944 break;
14945
14946 case 556: /* p_kwrest: kwrest_mark "local variable or method" */
14947#line 5422 "parse.y"
14948 {
14949 (yyval.id) = (yyvsp[0].id);
14950 }
14951#line 14952 "parse.c"
14952 break;
14953
14954 case 557: /* p_kwrest: kwrest_mark */
14955#line 5426 "parse.y"
14956 {
14957 (yyval.id) = 0;
14958 }
14959#line 14960 "parse.c"
14960 break;
14961
14962 case 558: /* p_kwnorest: kwrest_mark "`nil'" */
14963#line 5432 "parse.y"
14964 {
14965 (yyval.id) = 0;
14966 }
14967#line 14968 "parse.c"
14968 break;
14969
14970 case 560: /* p_any_kwrest: p_kwnorest */
14971#line 5438 "parse.y"
14972 {(yyval.id) = ID2VAL(idNil);}
14973#line 14974 "parse.c"
14974 break;
14975
14976 case 562: /* p_value: p_primitive ".." p_primitive */
14977#line 5443 "parse.y"
14978 {
14979 /*%%%*/
14980 value_expr((yyvsp[-2].node));
14981 value_expr((yyvsp[0].node));
14982 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14983 /*% %*/
14984 /*% ripper: dot2!($1, $3) %*/
14985 }
14986#line 14987 "parse.c"
14987 break;
14988
14989 case 563: /* p_value: p_primitive "..." p_primitive */
14990#line 5452 "parse.y"
14991 {
14992 /*%%%*/
14993 value_expr((yyvsp[-2].node));
14994 value_expr((yyvsp[0].node));
14995 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14996 /*% %*/
14997 /*% ripper: dot3!($1, $3) %*/
14998 }
14999#line 15000 "parse.c"
15000 break;
15001
15002 case 564: /* p_value: p_primitive ".." */
15003#line 5461 "parse.y"
15004 {
15005 /*%%%*/
15006 value_expr((yyvsp[-1].node));
15007 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15008 /*% %*/
15009 /*% ripper: dot2!($1, Qnil) %*/
15010 }
15011#line 15012 "parse.c"
15012 break;
15013
15014 case 565: /* p_value: p_primitive "..." */
15015#line 5469 "parse.y"
15016 {
15017 /*%%%*/
15018 value_expr((yyvsp[-1].node));
15019 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
15020 /*% %*/
15021 /*% ripper: dot3!($1, Qnil) %*/
15022 }
15023#line 15024 "parse.c"
15024 break;
15025
15026 case 569: /* p_value: "(.." p_primitive */
15027#line 5480 "parse.y"
15028 {
15029 /*%%%*/
15030 value_expr((yyvsp[0].node));
15031 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15032 /*% %*/
15033 /*% ripper: dot2!(Qnil, $2) %*/
15034 }
15035#line 15036 "parse.c"
15036 break;
15037
15038 case 570: /* p_value: "(..." p_primitive */
15039#line 5488 "parse.y"
15040 {
15041 /*%%%*/
15042 value_expr((yyvsp[0].node));
15043 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
15044 /*% %*/
15045 /*% ripper: dot3!(Qnil, $2) %*/
15046 }
15047#line 15048 "parse.c"
15048 break;
15049
15050 case 579: /* p_primitive: keyword_variable */
15051#line 5506 "parse.y"
15052 {
15053 /*%%%*/
15054 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
15055 /*% %*/
15056 /*% ripper: var_ref!($1) %*/
15057 }
15058#line 15059 "parse.c"
15059 break;
15060
15061 case 581: /* p_variable: "local variable or method" */
15062#line 5516 "parse.y"
15063 {
15064 /*%%%*/
15065 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
15066 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15067 /*% %*/
15068 /*% ripper: assignable(p, var_field(p, $1)) %*/
15069 }
15070#line 15071 "parse.c"
15071 break;
15072
15073 case 582: /* p_var_ref: '^' "local variable or method" */
15074#line 5526 "parse.y"
15075 {
15076 /*%%%*/
15077 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
15078 if (!(nd_type_p(n, NODE_LVAR) || nd_type_p(n, NODE_DVAR))) {
15079 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
15080 }
15081 (yyval.node) = n;
15082 /*% %*/
15083 /*% ripper: var_ref!($2) %*/
15084 }
15085#line 15086 "parse.c"
15086 break;
15087
15088 case 583: /* p_var_ref: '^' nonlocal_var */
15089#line 5537 "parse.y"
15090 {
15091 /*%%%*/
15092 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
15093 /*% %*/
15094 /*% ripper: var_ref!($2) %*/
15095 }
15096#line 15097 "parse.c"
15097 break;
15098
15099 case 584: /* p_expr_ref: '^' "(" expr_value rparen */
15100#line 5546 "parse.y"
15101 {
15102 /*%%%*/
15103 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
15104 /*% %*/
15105 /*% ripper: begin!($3) %*/
15106 }
15107#line 15108 "parse.c"
15108 break;
15109
15110 case 585: /* p_const: ":: at EXPR_BEG" cname */
15111#line 5555 "parse.y"
15112 {
15113 /*%%%*/
15114 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
15115 /*% %*/
15116 /*% ripper: top_const_ref!($2) %*/
15117 }
15118#line 15119 "parse.c"
15119 break;
15120
15121 case 586: /* p_const: p_const "::" cname */
15122#line 5562 "parse.y"
15123 {
15124 /*%%%*/
15125 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
15126 /*% %*/
15127 /*% ripper: const_path_ref!($1, $3) %*/
15128 }
15129#line 15130 "parse.c"
15130 break;
15131
15132 case 587: /* p_const: "constant" */
15133#line 5569 "parse.y"
15134 {
15135 /*%%%*/
15136 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
15137 /*% %*/
15138 /*% ripper: var_ref!($1) %*/
15139 }
15140#line 15141 "parse.c"
15141 break;
15142
15143 case 588: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
15144#line 5580 "parse.y"
15145 {
15146 /*%%%*/
15147 NODE *body = (yyvsp[-1].node);
15148 if ((yyvsp[-3].node)) {
15149 NODE *err = NEW_ERRINFO(&(yylsp[-3]));
15150 err = node_assign(p, (yyvsp[-3].node), err, NO_LEX_CTXT, &(yylsp[-3]));
15151 body = block_append(p, err, body);
15152 }
15153 (yyval.node) = NEW_RESBODY((yyvsp[-4].node), body, (yyvsp[0].node), &(yyloc));
15154 if ((yyvsp[-4].node)) {
15155 fixpos((yyval.node), (yyvsp[-4].node));
15156 }
15157 else if ((yyvsp[-3].node)) {
15158 fixpos((yyval.node), (yyvsp[-3].node));
15159 }
15160 else {
15161 fixpos((yyval.node), (yyvsp[-1].node));
15162 }
15163 /*% %*/
15164 /*% ripper: rescue!($2, $3, $5, $6) %*/
15165 }
15166#line 15167 "parse.c"
15167 break;
15168
15169 case 590: /* exc_list: arg_value */
15170#line 5605 "parse.y"
15171 {
15172 /*%%%*/
15173 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
15174 /*% %*/
15175 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15176 }
15177#line 15178 "parse.c"
15178 break;
15179
15180 case 591: /* exc_list: mrhs */
15181#line 5612 "parse.y"
15182 {
15183 /*%%%*/
15184 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
15185 /*% %*/
15186 /*% ripper: $1 %*/
15187 }
15188#line 15189 "parse.c"
15189 break;
15190
15191 case 593: /* exc_var: "=>" lhs */
15192#line 5622 "parse.y"
15193 {
15194 (yyval.node) = (yyvsp[0].node);
15195 }
15196#line 15197 "parse.c"
15197 break;
15198
15199 case 595: /* opt_ensure: k_ensure compstmt */
15200#line 5629 "parse.y"
15201 {
15202 p->ctxt.in_rescue = (yyvsp[-1].ctxt).in_rescue;
15203 /*%%%*/
15204 (yyval.node) = (yyvsp[0].node);
15205 /*% %*/
15206 /*% ripper: ensure!($2) %*/
15207 }
15208#line 15209 "parse.c"
15209 break;
15210
15211 case 599: /* strings: string */
15212#line 5644 "parse.y"
15213 {
15214 /*%%%*/
15215 NODE *node = (yyvsp[0].node);
15216 if (!node) {
15217 node = NEW_STR(STR_NEW0(), &(yyloc));
15218 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(node)->nd_lit);
15219 }
15220 else {
15221 node = evstr2dstr(p, node);
15222 }
15223 (yyval.node) = node;
15224 /*% %*/
15225 /*% ripper: $1 %*/
15226 }
15227#line 15228 "parse.c"
15228 break;
15229
15230 case 602: /* string: string string1 */
15231#line 5663 "parse.y"
15232 {
15233 /*%%%*/
15234 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15235 /*% %*/
15236 /*% ripper: string_concat!($1, $2) %*/
15237 }
15238#line 15239 "parse.c"
15239 break;
15240
15241 case 603: /* string1: "string literal" string_contents "terminator" */
15242#line 5672 "parse.y"
15243 {
15244 /*%%%*/
15245 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
15246 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
15247 /*% %*/
15248 /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/
15249 }
15250#line 15251 "parse.c"
15251 break;
15252
15253 case 604: /* xstring: "backtick literal" xstring_contents "terminator" */
15254#line 5682 "parse.y"
15255 {
15256 /*%%%*/
15257 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
15258 /*% %*/
15259 /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/
15260 }
15261#line 15262 "parse.c"
15262 break;
15263
15264 case 605: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
15265#line 5691 "parse.y"
15266 {
15267 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
15268 }
15269#line 15270 "parse.c"
15270 break;
15271
15272 case 606: /* words_sep: ' ' */
15273#line 5696 "parse.y"
15274 {}
15275#line 15276 "parse.c"
15276 break;
15277
15278 case 608: /* words: "word list" words_sep word_list "terminator" */
15279#line 5701 "parse.y"
15280 {
15281 /*%%%*/
15282 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15283 /*% %*/
15284 /*% ripper: array!($3) %*/
15285 }
15286#line 15287 "parse.c"
15287 break;
15288
15289 case 609: /* word_list: %empty */
15290#line 5710 "parse.y"
15291 {
15292 /*%%%*/
15293 (yyval.node) = 0;
15294 /*% %*/
15295 /*% ripper: words_new! %*/
15296 }
15297#line 15298 "parse.c"
15298 break;
15299
15300 case 610: /* word_list: word_list word words_sep */
15301#line 5717 "parse.y"
15302 {
15303 /*%%%*/
15304 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
15305 /*% %*/
15306 /*% ripper: words_add!($1, $2) %*/
15307 }
15308#line 15309 "parse.c"
15309 break;
15310
15311 case 612: /* word: word string_content */
15312#line 5728 "parse.y"
15313 {
15314 /*%%%*/
15315 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15316 /*% %*/
15317 /*% ripper: word_add!($1, $2) %*/
15318 }
15319#line 15320 "parse.c"
15320 break;
15321
15322 case 613: /* symbols: "symbol list" words_sep symbol_list "terminator" */
15323#line 5737 "parse.y"
15324 {
15325 /*%%%*/
15326 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15327 /*% %*/
15328 /*% ripper: array!($3) %*/
15329 }
15330#line 15331 "parse.c"
15331 break;
15332
15333 case 614: /* symbol_list: %empty */
15334#line 5746 "parse.y"
15335 {
15336 /*%%%*/
15337 (yyval.node) = 0;
15338 /*% %*/
15339 /*% ripper: symbols_new! %*/
15340 }
15341#line 15342 "parse.c"
15342 break;
15343
15344 case 615: /* symbol_list: symbol_list word words_sep */
15345#line 5753 "parse.y"
15346 {
15347 /*%%%*/
15348 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
15349 /*% %*/
15350 /*% ripper: symbols_add!($1, $2) %*/
15351 }
15352#line 15353 "parse.c"
15353 break;
15354
15355 case 616: /* qwords: "verbatim word list" words_sep qword_list "terminator" */
15356#line 5762 "parse.y"
15357 {
15358 /*%%%*/
15359 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15360 /*% %*/
15361 /*% ripper: array!($3) %*/
15362 }
15363#line 15364 "parse.c"
15364 break;
15365
15366 case 617: /* qsymbols: "verbatim symbol list" words_sep qsym_list "terminator" */
15367#line 5771 "parse.y"
15368 {
15369 /*%%%*/
15370 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
15371 /*% %*/
15372 /*% ripper: array!($3) %*/
15373 }
15374#line 15375 "parse.c"
15375 break;
15376
15377 case 618: /* qword_list: %empty */
15378#line 5780 "parse.y"
15379 {
15380 /*%%%*/
15381 (yyval.node) = 0;
15382 /*% %*/
15383 /*% ripper: qwords_new! %*/
15384 }
15385#line 15386 "parse.c"
15386 break;
15387
15388 case 619: /* qword_list: qword_list "literal content" words_sep */
15389#line 5787 "parse.y"
15390 {
15391 /*%%%*/
15392 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
15393 /*% %*/
15394 /*% ripper: qwords_add!($1, $2) %*/
15395 }
15396#line 15397 "parse.c"
15397 break;
15398
15399 case 620: /* qsym_list: %empty */
15400#line 5796 "parse.y"
15401 {
15402 /*%%%*/
15403 (yyval.node) = 0;
15404 /*% %*/
15405 /*% ripper: qsymbols_new! %*/
15406 }
15407#line 15408 "parse.c"
15408 break;
15409
15410 case 621: /* qsym_list: qsym_list "literal content" words_sep */
15411#line 5803 "parse.y"
15412 {
15413 /*%%%*/
15414 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
15415 /*% %*/
15416 /*% ripper: qsymbols_add!($1, $2) %*/
15417 }
15418#line 15419 "parse.c"
15419 break;
15420
15421 case 622: /* string_contents: %empty */
15422#line 5812 "parse.y"
15423 {
15424 /*%%%*/
15425 (yyval.node) = 0;
15426 /*% %*/
15427 /*% ripper: string_content! %*/
15428 /*%%%*/
15429 /*%
15430 $$ = ripper_new_yylval(p, 0, $$, 0);
15431 %*/
15432 }
15433#line 15434 "parse.c"
15434 break;
15435
15436 case 623: /* string_contents: string_contents string_content */
15437#line 5823 "parse.y"
15438 {
15439 /*%%%*/
15440 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15441 /*% %*/
15442 /*% ripper: string_add!($1, $2) %*/
15443 /*%%%*/
15444 /*%
15445 if (ripper_is_node_yylval(p, $1) && ripper_is_node_yylval(p, $2) &&
15446 !RNODE_RIPPER($1)->nd_cval) {
15447 RNODE_RIPPER($1)->nd_cval = RNODE_RIPPER($2)->nd_cval;
15448 RNODE_RIPPER($1)->nd_rval = add_mark_object(p, $$);
15449 $$ = $1;
15450 }
15451 %*/
15452 }
15453#line 15454 "parse.c"
15454 break;
15455
15456 case 624: /* xstring_contents: %empty */
15457#line 5841 "parse.y"
15458 {
15459 /*%%%*/
15460 (yyval.node) = 0;
15461 /*% %*/
15462 /*% ripper: xstring_new! %*/
15463 }
15464#line 15465 "parse.c"
15465 break;
15466
15467 case 625: /* xstring_contents: xstring_contents string_content */
15468#line 5848 "parse.y"
15469 {
15470 /*%%%*/
15471 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15472 /*% %*/
15473 /*% ripper: xstring_add!($1, $2) %*/
15474 }
15475#line 15476 "parse.c"
15476 break;
15477
15478 case 626: /* regexp_contents: %empty */
15479#line 5857 "parse.y"
15480 {
15481 /*%%%*/
15482 (yyval.node) = 0;
15483 /*% %*/
15484 /*% ripper: regexp_new! %*/
15485 /*%%%*/
15486 /*%
15487 $$ = ripper_new_yylval(p, 0, $$, 0);
15488 %*/
15489 }
15490#line 15491 "parse.c"
15491 break;
15492
15493 case 627: /* regexp_contents: regexp_contents string_content */
15494#line 5868 "parse.y"
15495 {
15496 /*%%%*/
15497 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
15498 if (!head) {
15499 (yyval.node) = tail;
15500 }
15501 else if (!tail) {
15502 (yyval.node) = head;
15503 }
15504 else {
15505 switch (nd_type(head)) {
15506 case NODE_STR:
15507 head = str2dstr(p, head);
15508 break;
15509 case NODE_DSTR:
15510 break;
15511 default:
15512 head = list_append(p, NEW_DSTR(Qnil, &(yyloc)), head);
15513 break;
15514 }
15515 (yyval.node) = list_append(p, head, tail);
15516 }
15517 /*%
15518 VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
15519 if (ripper_is_node_yylval(p, n1)) {
15520 s1 = RNODE_RIPPER(n1)->nd_cval;
15521 n1 = RNODE_RIPPER(n1)->nd_rval;
15522 }
15523 if (ripper_is_node_yylval(p, n2)) {
15524 s2 = RNODE_RIPPER(n2)->nd_cval;
15525 n2 = RNODE_RIPPER(n2)->nd_rval;
15526 }
15527 $$ = dispatch2(regexp_add, n1, n2);
15528 if (!s1 && s2) {
15529 $$ = ripper_new_yylval(p, 0, $$, s2);
15530 }
15531 %*/
15532 }
15533#line 15534 "parse.c"
15534 break;
15535
15536 case 629: /* @31: %empty */
15537#line 5911 "parse.y"
15538 {
15539 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
15540 (yyval.strterm) = p->lex.strterm;
15541 p->lex.strterm = 0;
15542 SET_LEX_STATE(EXPR_BEG);
15543 }
15544#line 15545 "parse.c"
15545 break;
15546
15547 case 630: /* string_content: tSTRING_DVAR @31 string_dvar */
15548#line 5918 "parse.y"
15549 {
15550 p->lex.strterm = (yyvsp[-1].strterm);
15551 /*%%%*/
15552 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
15553 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
15554 /*% %*/
15555 /*% ripper: string_dvar!($3) %*/
15556 }
15557#line 15558 "parse.c"
15558 break;
15559
15560 case 631: /* @32: %empty */
15561#line 5927 "parse.y"
15562 {
15563 CMDARG_PUSH(0);
15564 COND_PUSH(0);
15565 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
15566 (yyvsp[0].strterm) = p->lex.strterm;
15567 p->lex.strterm = 0;
15568 (yyval.num) = p->lex.state;
15569 SET_LEX_STATE(EXPR_BEG);
15570 }
15571#line 15572 "parse.c"
15572 break;
15573
15574 case 632: /* @33: %empty */
15575#line 5936 "parse.y"
15576 {
15577 (yyval.num) = p->lex.brace_nest;
15578 p->lex.brace_nest = 0;
15579 }
15580#line 15581 "parse.c"
15581 break;
15582
15583 case 633: /* @34: %empty */
15584#line 5940 "parse.y"
15585 {
15586 (yyval.num) = p->heredoc_indent;
15587 p->heredoc_indent = 0;
15588 }
15589#line 15590 "parse.c"
15590 break;
15591
15592 case 634: /* string_content: tSTRING_DBEG @32 @33 @34 compstmt string_dend */
15593#line 5945 "parse.y"
15594 {
15595 COND_POP();
15596 CMDARG_POP();
15597 p->lex.strterm = (yyvsp[-5].strterm);
15598 SET_LEX_STATE((yyvsp[-4].num));
15599 p->lex.brace_nest = (yyvsp[-3].num);
15600 p->heredoc_indent = (yyvsp[-2].num);
15601 p->heredoc_line_indent = -1;
15602 /*%%%*/
15603 if ((yyvsp[-1].node)) nd_unset_fl_newline((yyvsp[-1].node));
15604 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
15605 /*% %*/
15606 /*% ripper: string_embexpr!($compstmt) %*/
15607 }
15608#line 15609 "parse.c"
15609 break;
15610
15611 case 637: /* string_dvar: nonlocal_var */
15612#line 5966 "parse.y"
15613 {
15614 /*%%%*/
15615 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
15616 /*% %*/
15617 /*% ripper: var_ref!($1) %*/
15618 }
15619#line 15620 "parse.c"
15620 break;
15621
15622 case 641: /* ssym: "symbol literal" sym */
15623#line 5980 "parse.y"
15624 {
15625 SET_LEX_STATE(EXPR_END);
15626 /*%%%*/
15627 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
15628 /*% %*/
15629 /*% ripper: symbol_literal!(symbol!($2)) %*/
15630 }
15631#line 15632 "parse.c"
15632 break;
15633
15634 case 644: /* dsym: "symbol literal" string_contents "terminator" */
15635#line 5994 "parse.y"
15636 {
15637 SET_LEX_STATE(EXPR_END);
15638 /*%%%*/
15639 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
15640 /*% %*/
15641 /*% ripper: dyna_symbol!($2) %*/
15642 }
15643#line 15644 "parse.c"
15644 break;
15645
15646 case 646: /* numeric: tUMINUS_NUM simple_numeric */
15647#line 6005 "parse.y"
15648 {
15649 /*%%%*/
15650 (yyval.node) = (yyvsp[0].node);
15651 RB_OBJ_WRITE(p->ast, &RNODE_LIT((yyval.node))->nd_lit, negate_lit(p, RNODE_LIT((yyval.node))->nd_lit));
15652 /*% %*/
15653 /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
15654 }
15655#line 15656 "parse.c"
15656 break;
15657
15658 case 657: /* keyword_variable: "`nil'" */
15659#line 6030 "parse.y"
15660 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
15661#line 15662 "parse.c"
15662 break;
15663
15664 case 658: /* keyword_variable: "`self'" */
15665#line 6031 "parse.y"
15666 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
15667#line 15668 "parse.c"
15668 break;
15669
15670 case 659: /* keyword_variable: "`true'" */
15671#line 6032 "parse.y"
15672 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
15673#line 15674 "parse.c"
15674 break;
15675
15676 case 660: /* keyword_variable: "`false'" */
15677#line 6033 "parse.y"
15678 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
15679#line 15680 "parse.c"
15680 break;
15681
15682 case 661: /* keyword_variable: "`__FILE__'" */
15683#line 6034 "parse.y"
15684 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
15685#line 15686 "parse.c"
15686 break;
15687
15688 case 662: /* keyword_variable: "`__LINE__'" */
15689#line 6035 "parse.y"
15690 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
15691#line 15692 "parse.c"
15692 break;
15693
15694 case 663: /* keyword_variable: "`__ENCODING__'" */
15695#line 6036 "parse.y"
15696 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
15697#line 15698 "parse.c"
15698 break;
15699
15700 case 664: /* var_ref: user_variable */
15701#line 6040 "parse.y"
15702 {
15703 /*%%%*/
15704 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
15705 /*%
15706 if (id_is_var(p, get_id($1))) {
15707 $$ = dispatch1(var_ref, $1);
15708 }
15709 else {
15710 $$ = dispatch1(vcall, $1);
15711 }
15712 %*/
15713 }
15714#line 15715 "parse.c"
15715 break;
15716
15717 case 665: /* var_ref: keyword_variable */
15718#line 6053 "parse.y"
15719 {
15720 /*%%%*/
15721 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
15722 /*% %*/
15723 /*% ripper: var_ref!($1) %*/
15724 }
15725#line 15726 "parse.c"
15726 break;
15727
15728 case 666: /* var_lhs: user_variable */
15729#line 6062 "parse.y"
15730 {
15731 /*%%%*/
15732 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15733 /*% %*/
15734 /*% ripper: assignable(p, var_field(p, $1)) %*/
15735 }
15736#line 15737 "parse.c"
15737 break;
15738
15739 case 667: /* var_lhs: keyword_variable */
15740#line 6069 "parse.y"
15741 {
15742 /*%%%*/
15743 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
15744 /*% %*/
15745 /*% ripper: assignable(p, var_field(p, $1)) %*/
15746 }
15747#line 15748 "parse.c"
15748 break;
15749
15750 case 670: /* $@35: %empty */
15751#line 6082 "parse.y"
15752 {
15753 SET_LEX_STATE(EXPR_BEG);
15754 p->command_start = TRUE;
15755 }
15756#line 15757 "parse.c"
15757 break;
15758
15759 case 671: /* superclass: '<' $@35 expr_value term */
15760#line 6087 "parse.y"
15761 {
15762 (yyval.node) = (yyvsp[-1].node);
15763 }
15764#line 15765 "parse.c"
15765 break;
15766
15767 case 672: /* superclass: %empty */
15768#line 6091 "parse.y"
15769 {
15770 /*%%%*/
15771 (yyval.node) = 0;
15772 /*% %*/
15773 /*% ripper: Qnil %*/
15774 }
15775#line 15776 "parse.c"
15776 break;
15777
15778 case 674: /* f_opt_paren_args: none */
15779#line 6101 "parse.y"
15780 {
15781 p->ctxt.in_argdef = 0;
15782 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[-1]));
15783 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node_args), &(yylsp[-1]));
15784 }
15785#line 15786 "parse.c"
15786 break;
15787
15788 case 675: /* f_paren_args: '(' f_args rparen */
15789#line 6109 "parse.y"
15790 {
15791 /*%%%*/
15792 (yyval.node_args) = (yyvsp[-1].node_args);
15793 /*% %*/
15794 /*% ripper: paren!($2) %*/
15795 SET_LEX_STATE(EXPR_BEG);
15796 p->command_start = TRUE;
15797 p->ctxt.in_argdef = 0;
15798 }
15799#line 15800 "parse.c"
15800 break;
15801
15802 case 677: /* @36: %empty */
15803#line 6121 "parse.y"
15804 {
15805 (yyval.ctxt) = p->ctxt;
15806 p->ctxt.in_kwarg = 1;
15807 p->ctxt.in_argdef = 1;
15808 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
15809 }
15810#line 15811 "parse.c"
15811 break;
15812
15813 case 678: /* f_arglist: @36 f_args term */
15814#line 6128 "parse.y"
15815 {
15816 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
15817 p->ctxt.in_argdef = 0;
15818 (yyval.node_args) = (yyvsp[-1].node_args);
15819 SET_LEX_STATE(EXPR_BEG);
15820 p->command_start = TRUE;
15821 }
15822#line 15823 "parse.c"
15823 break;
15824
15825 case 679: /* args_tail: f_kwarg ',' f_kwrest opt_f_block_arg */
15826#line 6138 "parse.y"
15827 {
15828 (yyval.node_args) = new_args_tail(p, (yyvsp[-3].node_kw_arg), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
15829 }
15830#line 15831 "parse.c"
15831 break;
15832
15833 case 680: /* args_tail: f_kwarg opt_f_block_arg */
15834#line 6142 "parse.y"
15835 {
15836 (yyval.node_args) = new_args_tail(p, (yyvsp[-1].node_kw_arg), Qnone, (yyvsp[0].id), &(yylsp[-1]));
15837 }
15838#line 15839 "parse.c"
15839 break;
15840
15841 case 681: /* args_tail: f_any_kwrest opt_f_block_arg */
15842#line 6146 "parse.y"
15843 {
15844 (yyval.node_args) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
15845 }
15846#line 15847 "parse.c"
15847 break;
15848
15849 case 682: /* args_tail: f_block_arg */
15850#line 6150 "parse.y"
15851 {
15852 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
15853 }
15854#line 15855 "parse.c"
15855 break;
15856
15857 case 683: /* args_tail: args_forward */
15858#line 6154 "parse.y"
15859 {
15860 add_forwarding_args(p);
15861 (yyval.node_args) = new_args_tail(p, Qnone, (yyvsp[0].id), arg_FWD_BLOCK, &(yylsp[0]));
15862 /*%%%*/
15863 (yyval.node_args)->nd_ainfo.forwarding = 1;
15864 /*% %*/
15865 }
15866#line 15867 "parse.c"
15867 break;
15868
15869 case 684: /* opt_args_tail: ',' args_tail */
15870#line 6164 "parse.y"
15871 {
15872 (yyval.node_args) = (yyvsp[0].node_args);
15873 }
15874#line 15875 "parse.c"
15875 break;
15876
15877 case 685: /* opt_args_tail: %empty */
15878#line 6168 "parse.y"
15879 {
15880 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
15881 }
15882#line 15883 "parse.c"
15883 break;
15884
15885 case 686: /* f_args: f_arg ',' f_optarg ',' f_rest_arg opt_args_tail */
15886#line 6174 "parse.y"
15887 {
15888 (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));
15889 }
15890#line 15891 "parse.c"
15891 break;
15892
15893 case 687: /* f_args: f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15894#line 6178 "parse.y"
15895 {
15896 (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));
15897 }
15898#line 15899 "parse.c"
15899 break;
15900
15901 case 688: /* f_args: f_arg ',' f_optarg opt_args_tail */
15902#line 6182 "parse.y"
15903 {
15904 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15905 }
15906#line 15907 "parse.c"
15907 break;
15908
15909 case 689: /* f_args: f_arg ',' f_optarg ',' f_arg opt_args_tail */
15910#line 6186 "parse.y"
15911 {
15912 (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));
15913 }
15914#line 15915 "parse.c"
15915 break;
15916
15917 case 690: /* f_args: f_arg ',' f_rest_arg opt_args_tail */
15918#line 6190 "parse.y"
15919 {
15920 (yyval.node_args) = new_args(p, (yyvsp[-3].node_args_aux), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
15921 }
15922#line 15923 "parse.c"
15923 break;
15924
15925 case 691: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail */
15926#line 6194 "parse.y"
15927 {
15928 (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));
15929 }
15930#line 15931 "parse.c"
15931 break;
15932
15933 case 692: /* f_args: f_arg opt_args_tail */
15934#line 6198 "parse.y"
15935 {
15936 (yyval.node_args) = new_args(p, (yyvsp[-1].node_args_aux), Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15937 }
15938#line 15939 "parse.c"
15939 break;
15940
15941 case 693: /* f_args: f_optarg ',' f_rest_arg opt_args_tail */
15942#line 6202 "parse.y"
15943 {
15944 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
15945 }
15946#line 15947 "parse.c"
15947 break;
15948
15949 case 694: /* f_args: f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15950#line 6206 "parse.y"
15951 {
15952 (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));
15953 }
15954#line 15955 "parse.c"
15955 break;
15956
15957 case 695: /* f_args: f_optarg opt_args_tail */
15958#line 6210 "parse.y"
15959 {
15960 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-1].node_opt_arg), Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15961 }
15962#line 15963 "parse.c"
15963 break;
15964
15965 case 696: /* f_args: f_optarg ',' f_arg opt_args_tail */
15966#line 6214 "parse.y"
15967 {
15968 (yyval.node_args) = new_args(p, Qnone, (yyvsp[-3].node_opt_arg), Qnone, (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
15969 }
15970#line 15971 "parse.c"
15971 break;
15972
15973 case 697: /* f_args: f_rest_arg opt_args_tail */
15974#line 6218 "parse.y"
15975 {
15976 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node_args), &(yyloc));
15977 }
15978#line 15979 "parse.c"
15979 break;
15980
15981 case 698: /* f_args: f_rest_arg ',' f_arg opt_args_tail */
15982#line 6222 "parse.y"
15983 {
15984 (yyval.node_args) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node_args_aux), (yyvsp[0].node_args), &(yyloc));
15985 }
15986#line 15987 "parse.c"
15987 break;
15988
15989 case 699: /* f_args: args_tail */
15990#line 6226 "parse.y"
15991 {
15992 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node_args), &(yyloc));
15993 }
15994#line 15995 "parse.c"
15995 break;
15996
15997 case 700: /* f_args: %empty */
15998#line 6230 "parse.y"
15999 {
16000 (yyval.node_args) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
16001 (yyval.node_args) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node_args), &(yylsp[0]));
16002 }
16003#line 16004 "parse.c"
16004 break;
16005
16006 case 701: /* args_forward: "(..." */
16007#line 6237 "parse.y"
16008 {
16009 /*%%%*/
16010#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
16011 (yyval.id) = 0;
16012#else
16013 (yyval.id) = idFWD_KWREST;
16014#endif
16015 /*% %*/
16016 /*% ripper: args_forward! %*/
16017 }
16018#line 16019 "parse.c"
16019 break;
16020
16021 case 702: /* f_bad_arg: "constant" */
16022#line 6250 "parse.y"
16023 {
16024 static const char mesg[] = "formal argument cannot be a constant";
16025 /*%%%*/
16026 yyerror1(&(yylsp[0]), mesg);
16027 (yyval.id) = 0;
16028 /*% %*/
16029 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16030 }
16031#line 16032 "parse.c"
16032 break;
16033
16034 case 703: /* f_bad_arg: "instance variable" */
16035#line 6259 "parse.y"
16036 {
16037 static const char mesg[] = "formal argument cannot be an instance variable";
16038 /*%%%*/
16039 yyerror1(&(yylsp[0]), mesg);
16040 (yyval.id) = 0;
16041 /*% %*/
16042 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16043 }
16044#line 16045 "parse.c"
16045 break;
16046
16047 case 704: /* f_bad_arg: "global variable" */
16048#line 6268 "parse.y"
16049 {
16050 static const char mesg[] = "formal argument cannot be a global variable";
16051 /*%%%*/
16052 yyerror1(&(yylsp[0]), mesg);
16053 (yyval.id) = 0;
16054 /*% %*/
16055 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16056 }
16057#line 16058 "parse.c"
16058 break;
16059
16060 case 705: /* f_bad_arg: "class variable" */
16061#line 6277 "parse.y"
16062 {
16063 static const char mesg[] = "formal argument cannot be a class variable";
16064 /*%%%*/
16065 yyerror1(&(yylsp[0]), mesg);
16066 (yyval.id) = 0;
16067 /*% %*/
16068 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
16069 }
16070#line 16071 "parse.c"
16071 break;
16072
16073 case 707: /* f_norm_arg: "local variable or method" */
16074#line 6289 "parse.y"
16075 {
16076 formal_argument(p, (yyvsp[0].id));
16077 p->max_numparam = ORDINAL_PARAM;
16078 (yyval.id) = (yyvsp[0].id);
16079 }
16080#line 16081 "parse.c"
16081 break;
16082
16083 case 708: /* f_arg_asgn: f_norm_arg */
16084#line 6297 "parse.y"
16085 {
16086 ID id = get_id((yyvsp[0].id));
16087 arg_var(p, id);
16088 p->cur_arg = id;
16089 (yyval.id) = (yyvsp[0].id);
16090 }
16091#line 16092 "parse.c"
16092 break;
16093
16094 case 709: /* f_arg_item: f_arg_asgn */
16095#line 6306 "parse.y"
16096 {
16097 p->cur_arg = 0;
16098 /*%%%*/
16099 (yyval.node_args_aux) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
16100 /*% %*/
16101 /*% ripper: get_value($1) %*/
16102 }
16103#line 16104 "parse.c"
16104 break;
16105
16106 case 710: /* f_arg_item: "(" f_margs rparen */
16107#line 6314 "parse.y"
16108 {
16109 /*%%%*/
16110 ID tid = internal_id(p);
16111 YYLTYPE loc;
16112 loc.beg_pos = (yylsp[-1]).beg_pos;
16113 loc.end_pos = (yylsp[-1]).beg_pos;
16114 arg_var(p, tid);
16115 if (dyna_in_block(p)) {
16116 (yyvsp[-1].node_masgn)->nd_value = NEW_DVAR(tid, &loc);
16117 }
16118 else {
16119 (yyvsp[-1].node_masgn)->nd_value = NEW_LVAR(tid, &loc);
16120 }
16121 (yyval.node_args_aux) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
16122 (yyval.node_args_aux)->nd_next = (NODE *)(yyvsp[-1].node_masgn);
16123 /*% %*/
16124 /*% ripper: mlhs_paren!($2) %*/
16125 }
16126#line 16127 "parse.c"
16127 break;
16128
16129 case 712: /* f_arg: f_arg ',' f_arg_item */
16130#line 6337 "parse.y"
16131 {
16132 /*%%%*/
16133 (yyval.node_args_aux) = (yyvsp[-2].node_args_aux);
16134 (yyval.node_args_aux)->nd_plen++;
16135 (yyval.node_args_aux)->nd_next = block_append(p, (yyval.node_args_aux)->nd_next, (yyvsp[0].node_args_aux)->nd_next);
16136 rb_discard_node(p, (NODE *)(yyvsp[0].node_args_aux));
16137 /*% %*/
16138 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16139 }
16140#line 16141 "parse.c"
16141 break;
16142
16143 case 713: /* f_label: "label" */
16144#line 6350 "parse.y"
16145 {
16146 arg_var(p, formal_argument(p, (yyvsp[0].id)));
16147 p->cur_arg = get_id((yyvsp[0].id));
16148 p->max_numparam = ORDINAL_PARAM;
16149 p->ctxt.in_argdef = 0;
16150 (yyval.id) = (yyvsp[0].id);
16151 }
16152#line 16153 "parse.c"
16153 break;
16154
16155 case 714: /* f_kw: f_label arg_value */
16156#line 6360 "parse.y"
16157 {
16158 p->cur_arg = 0;
16159 p->ctxt.in_argdef = 1;
16160 /*%%%*/
16161 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16162 /*% %*/
16163 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
16164 }
16165#line 16166 "parse.c"
16166 break;
16167
16168 case 715: /* f_kw: f_label */
16169#line 6369 "parse.y"
16170 {
16171 p->cur_arg = 0;
16172 p->ctxt.in_argdef = 1;
16173 /*%%%*/
16174 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
16175 /*% %*/
16176 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
16177 }
16178#line 16179 "parse.c"
16179 break;
16180
16181 case 716: /* f_block_kw: f_label primary_value */
16182#line 6380 "parse.y"
16183 {
16184 p->ctxt.in_argdef = 1;
16185 /*%%%*/
16186 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16187 /*% %*/
16188 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
16189 }
16190#line 16191 "parse.c"
16191 break;
16192
16193 case 717: /* f_block_kw: f_label */
16194#line 6388 "parse.y"
16195 {
16196 p->ctxt.in_argdef = 1;
16197 /*%%%*/
16198 (yyval.node_kw_arg) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
16199 /*% %*/
16200 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
16201 }
16202#line 16203 "parse.c"
16203 break;
16204
16205 case 718: /* f_block_kwarg: f_block_kw */
16206#line 6398 "parse.y"
16207 {
16208 /*%%%*/
16209 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
16210 /*% %*/
16211 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16212 }
16213#line 16214 "parse.c"
16214 break;
16215
16216 case 719: /* f_block_kwarg: f_block_kwarg ',' f_block_kw */
16217#line 6405 "parse.y"
16218 {
16219 /*%%%*/
16220 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
16221 /*% %*/
16222 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16223 }
16224#line 16225 "parse.c"
16225 break;
16226
16227 case 720: /* f_kwarg: f_kw */
16228#line 6415 "parse.y"
16229 {
16230 /*%%%*/
16231 (yyval.node_kw_arg) = (yyvsp[0].node_kw_arg);
16232 /*% %*/
16233 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16234 }
16235#line 16236 "parse.c"
16236 break;
16237
16238 case 721: /* f_kwarg: f_kwarg ',' f_kw */
16239#line 6422 "parse.y"
16240 {
16241 /*%%%*/
16242 (yyval.node_kw_arg) = kwd_append((yyvsp[-2].node_kw_arg), (yyvsp[0].node_kw_arg));
16243 /*% %*/
16244 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16245 }
16246#line 16247 "parse.c"
16247 break;
16248
16249 case 724: /* f_no_kwarg: p_kwnorest */
16250#line 6435 "parse.y"
16251 {
16252 /*%%%*/
16253 /*% %*/
16254 /*% ripper: nokw_param!(Qnil) %*/
16255 }
16256#line 16257 "parse.c"
16257 break;
16258
16259 case 725: /* f_kwrest: kwrest_mark "local variable or method" */
16260#line 6443 "parse.y"
16261 {
16262 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
16263 /*%%%*/
16264 (yyval.id) = (yyvsp[0].id);
16265 /*% %*/
16266 /*% ripper: kwrest_param!($2) %*/
16267 }
16268#line 16269 "parse.c"
16269 break;
16270
16271 case 726: /* f_kwrest: kwrest_mark */
16272#line 6451 "parse.y"
16273 {
16274 arg_var(p, idFWD_KWREST);
16275 /*%%%*/
16276 (yyval.id) = idFWD_KWREST;
16277 /*% %*/
16278 /*% ripper: kwrest_param!(Qnil) %*/
16279 }
16280#line 16281 "parse.c"
16281 break;
16282
16283 case 727: /* f_opt: f_arg_asgn f_eq arg_value */
16284#line 6461 "parse.y"
16285 {
16286 p->cur_arg = 0;
16287 p->ctxt.in_argdef = 1;
16288 /*%%%*/
16289 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16290 /*% %*/
16291 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
16292 }
16293#line 16294 "parse.c"
16294 break;
16295
16296 case 728: /* f_block_opt: f_arg_asgn f_eq primary_value */
16297#line 6472 "parse.y"
16298 {
16299 p->cur_arg = 0;
16300 p->ctxt.in_argdef = 1;
16301 /*%%%*/
16302 (yyval.node_opt_arg) = NEW_OPT_ARG(assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
16303 /*% %*/
16304 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
16305 }
16306#line 16307 "parse.c"
16307 break;
16308
16309 case 729: /* f_block_optarg: f_block_opt */
16310#line 6483 "parse.y"
16311 {
16312 /*%%%*/
16313 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
16314 /*% %*/
16315 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16316 }
16317#line 16318 "parse.c"
16318 break;
16319
16320 case 730: /* f_block_optarg: f_block_optarg ',' f_block_opt */
16321#line 6490 "parse.y"
16322 {
16323 /*%%%*/
16324 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
16325 /*% %*/
16326 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16327 }
16328#line 16329 "parse.c"
16329 break;
16330
16331 case 731: /* f_optarg: f_opt */
16332#line 6499 "parse.y"
16333 {
16334 /*%%%*/
16335 (yyval.node_opt_arg) = (yyvsp[0].node_opt_arg);
16336 /*% %*/
16337 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
16338 }
16339#line 16340 "parse.c"
16340 break;
16341
16342 case 732: /* f_optarg: f_optarg ',' f_opt */
16343#line 6506 "parse.y"
16344 {
16345 /*%%%*/
16346 (yyval.node_opt_arg) = opt_arg_append((yyvsp[-2].node_opt_arg), (yyvsp[0].node_opt_arg));
16347 /*% %*/
16348 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16349 }
16350#line 16351 "parse.c"
16351 break;
16352
16353 case 735: /* f_rest_arg: restarg_mark "local variable or method" */
16354#line 6519 "parse.y"
16355 {
16356 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
16357 /*%%%*/
16358 (yyval.id) = (yyvsp[0].id);
16359 /*% %*/
16360 /*% ripper: rest_param!($2) %*/
16361 }
16362#line 16363 "parse.c"
16363 break;
16364
16365 case 736: /* f_rest_arg: restarg_mark */
16366#line 6527 "parse.y"
16367 {
16368 arg_var(p, idFWD_REST);
16369 /*%%%*/
16370 (yyval.id) = idFWD_REST;
16371 /*% %*/
16372 /*% ripper: rest_param!(Qnil) %*/
16373 }
16374#line 16375 "parse.c"
16375 break;
16376
16377 case 739: /* f_block_arg: blkarg_mark "local variable or method" */
16378#line 6541 "parse.y"
16379 {
16380 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
16381 /*%%%*/
16382 (yyval.id) = (yyvsp[0].id);
16383 /*% %*/
16384 /*% ripper: blockarg!($2) %*/
16385 }
16386#line 16387 "parse.c"
16387 break;
16388
16389 case 740: /* f_block_arg: blkarg_mark */
16390#line 6549 "parse.y"
16391 {
16392 arg_var(p, idFWD_BLOCK);
16393 /*%%%*/
16394 (yyval.id) = idFWD_BLOCK;
16395 /*% %*/
16396 /*% ripper: blockarg!(Qnil) %*/
16397 }
16398#line 16399 "parse.c"
16399 break;
16400
16401 case 741: /* opt_f_block_arg: ',' f_block_arg */
16402#line 6559 "parse.y"
16403 {
16404 (yyval.id) = (yyvsp[0].id);
16405 }
16406#line 16407 "parse.c"
16407 break;
16408
16409 case 742: /* opt_f_block_arg: none */
16410#line 6563 "parse.y"
16411 {
16412 (yyval.id) = Qnull;
16413 }
16414#line 16415 "parse.c"
16415 break;
16416
16417 case 743: /* singleton: var_ref */
16418#line 6569 "parse.y"
16419 {
16420 value_expr((yyvsp[0].node));
16421 (yyval.node) = (yyvsp[0].node);
16422 }
16423#line 16424 "parse.c"
16424 break;
16425
16426 case 744: /* $@37: %empty */
16427#line 6573 "parse.y"
16428 {SET_LEX_STATE(EXPR_BEG);}
16429#line 16430 "parse.c"
16430 break;
16431
16432 case 745: /* singleton: '(' $@37 expr rparen */
16433#line 6574 "parse.y"
16434 {
16435 /*%%%*/
16436 NODE *expr = last_expr_node((yyvsp[-1].node));
16437 switch (nd_type(expr)) {
16438 case NODE_STR:
16439 case NODE_DSTR:
16440 case NODE_XSTR:
16441 case NODE_DXSTR:
16442 case NODE_DREGX:
16443 case NODE_LIT:
16444 case NODE_DSYM:
16445 case NODE_LIST:
16446 case NODE_ZLIST:
16447 yyerror1(&expr->nd_loc, "can't define singleton method for literals");
16448 break;
16449 default:
16450 value_expr((yyvsp[-1].node));
16451 break;
16452 }
16453 (yyval.node) = (yyvsp[-1].node);
16454 /*% %*/
16455 /*% ripper: paren!($3) %*/
16456 }
16457#line 16458 "parse.c"
16458 break;
16459
16460 case 747: /* assoc_list: assocs trailer */
16461#line 6601 "parse.y"
16462 {
16463 /*%%%*/
16464 (yyval.node) = (yyvsp[-1].node);
16465 /*% %*/
16466 /*% ripper: assoclist_from_args!($1) %*/
16467 }
16468#line 16469 "parse.c"
16469 break;
16470
16471 case 749: /* assocs: assocs ',' assoc */
16472#line 6612 "parse.y"
16473 {
16474 /*%%%*/
16475 NODE *assocs = (yyvsp[-2].node);
16476 NODE *tail = (yyvsp[0].node);
16477 if (!assocs) {
16478 assocs = tail;
16479 }
16480 else if (tail) {
16481 if (RNODE_LIST(assocs)->nd_head &&
16482 !RNODE_LIST(tail)->nd_head && nd_type_p(RNODE_LIST(tail)->nd_next, NODE_LIST) &&
16483 nd_type_p(RNODE_LIST(RNODE_LIST(tail)->nd_next)->nd_head, NODE_HASH)) {
16484 /* DSTAR */
16485 tail = RNODE_HASH(RNODE_LIST(RNODE_LIST(tail)->nd_next)->nd_head)->nd_head;
16486 }
16487 assocs = list_concat(assocs, tail);
16488 }
16489 (yyval.node) = assocs;
16490 /*% %*/
16491 /*% ripper: rb_ary_push($1, get_value($3)) %*/
16492 }
16493#line 16494 "parse.c"
16494 break;
16495
16496 case 750: /* assoc: arg_value "=>" arg_value */
16497#line 6635 "parse.y"
16498 {
16499 /*%%%*/
16500 if (nd_type_p((yyvsp[-2].node), NODE_STR)) {
16501 nd_set_type((yyvsp[-2].node), NODE_LIT);
16502 RB_OBJ_WRITE(p->ast, &RNODE_LIT((yyvsp[-2].node))->nd_lit, rb_fstring(RNODE_LIT((yyvsp[-2].node))->nd_lit));
16503 }
16504 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
16505 /*% %*/
16506 /*% ripper: assoc_new!($1, $3) %*/
16507 }
16508#line 16509 "parse.c"
16509 break;
16510
16511 case 751: /* assoc: "label" arg_value */
16512#line 6646 "parse.y"
16513 {
16514 /*%%%*/
16515 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
16516 /*% %*/
16517 /*% ripper: assoc_new!($1, $2) %*/
16518 }
16519#line 16520 "parse.c"
16520 break;
16521
16522 case 752: /* assoc: "label" */
16523#line 6653 "parse.y"
16524 {
16525 /*%%%*/
16526 NODE *val = gettable(p, (yyvsp[0].id), &(yyloc));
16527 if (!val) val = NEW_BEGIN(0, &(yyloc));
16528 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yylsp[0])), &(yyloc)), val);
16529 /*% %*/
16530 /*% ripper: assoc_new!($1, Qnil) %*/
16531 }
16532#line 16533 "parse.c"
16533 break;
16534
16535 case 753: /* assoc: "string literal" string_contents tLABEL_END arg_value */
16536#line 6662 "parse.y"
16537 {
16538 /*%%%*/
16539 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
16540 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
16541 /*% %*/
16542 /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/
16543 }
16544#line 16545 "parse.c"
16545 break;
16546
16547 case 754: /* assoc: "**arg" arg_value */
16548#line 6670 "parse.y"
16549 {
16550 /*%%%*/
16551 if (nd_type_p((yyvsp[0].node), NODE_HASH) &&
16552 !(RNODE_HASH((yyvsp[0].node))->nd_head && RNODE_LIST(RNODE_HASH((yyvsp[0].node))->nd_head)->as.nd_alen)) {
16553 static VALUE empty_hash;
16554 if (!empty_hash) {
16555 empty_hash = rb_obj_freeze(rb_hash_new());
16556 rb_gc_register_mark_object(empty_hash);
16557 }
16558 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), NEW_LIT(empty_hash, &(yyloc)));
16559 }
16560 else
16561 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
16562 /*% %*/
16563 /*% ripper: assoc_splat!($2) %*/
16564 }
16565#line 16566 "parse.c"
16566 break;
16567
16568 case 755: /* assoc: "**arg" */
16569#line 6687 "parse.y"
16570 {
16571 forwarding_arg_check(p, idFWD_KWREST, idFWD_ALL, "keyword rest");
16572 /*%%%*/
16573 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)),
16574 NEW_LVAR(idFWD_KWREST, &(yyloc)));
16575 /*% %*/
16576 /*% ripper: assoc_splat!(Qnil) %*/
16577 }
16578#line 16579 "parse.c"
16579 break;
16580
16581 case 779: /* term: ';' */
16582#line 6744 "parse.y"
16583 {yyerrok;token_flush(p);}
16584#line 16585 "parse.c"
16585 break;
16586
16587 case 780: /* term: '\n' */
16588#line 6746 "parse.y"
16589 {
16590 (yyloc).end_pos = (yyloc).beg_pos;
16591 token_flush(p);
16592 }
16593#line 16594 "parse.c"
16594 break;
16595
16596 case 782: /* terms: terms ';' */
16597#line 6753 "parse.y"
16598 {yyerrok;}
16599#line 16600 "parse.c"
16600 break;
16601
16602 case 783: /* none: %empty */
16603#line 6757 "parse.y"
16604 {
16605 (yyval.node) = Qnull;
16606 }
16607#line 16608 "parse.c"
16608 break;
16609
16610
16611#line 16612 "parse.c"
16612
16613 default: break;
16614 }
16615 /* User semantic actions sometimes alter yychar, and that requires
16616 that yytoken be updated with the new translation. We take the
16617 approach of translating immediately before every use of yytoken.
16618 One alternative is translating here after every semantic action,
16619 but that translation would be missed if the semantic action invokes
16620 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
16621 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
16622 incorrect destructor might then be invoked immediately. In the
16623 case of YYERROR or YYBACKUP, subsequent parser actions might lead
16624 to an incorrect destructor call or verbose syntax error message
16625 before the lookahead is translated. */
16626 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc, p);
16627
16628 YYPOPSTACK (yylen);
16629 yylen = 0;
16630
16631 *++yyvsp = yyval;
16632 *++yylsp = yyloc;
16633
16634 /* Now 'shift' the result of the reduction. Determine what state
16635 that goes to, based on the state we popped back to and the rule
16636 number reduced by. */
16637 {
16638 const int yylhs = yyr1[yyn] - YYNTOKENS;
16639 const int yyi = yypgoto[yylhs] + *yyssp;
16640 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
16641 ? yytable[yyi]
16642 : yydefgoto[yylhs]);
16643 }
16644
16645 goto yynewstate;
16646
16647
16648/*--------------------------------------.
16649| yyerrlab -- here on detecting error. |
16650`--------------------------------------*/
16651yyerrlab:
16652 /* Make sure we have latest lookahead translation. See comments at
16653 user semantic actions for why this is necessary. */
16654 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
16655 /* If not already recovering from an error, report this error. */
16656 if (!yyerrstatus)
16657 {
16658 ++yynerrs;
16659 {
16660 yypcontext_t yyctx
16661 = {yyssp, yytoken, &yylloc};
16662 char const *yymsgp = YY_("syntax error");
16663 int yysyntax_error_status;
16664 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
16665 if (yysyntax_error_status == 0)
16666 yymsgp = yymsg;
16667 else if (yysyntax_error_status == -1)
16668 {
16669 if (yymsg != yymsgbuf)
16670 YYSTACK_FREE (yymsg);
16671 yymsg = YY_CAST (char *,
16672 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
16673 if (yymsg)
16674 {
16675 yysyntax_error_status
16676 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx, p);
16677 yymsgp = yymsg;
16678 }
16679 else
16680 {
16681 yymsg = yymsgbuf;
16682 yymsg_alloc = sizeof yymsgbuf;
16683 yysyntax_error_status = YYENOMEM;
16684 }
16685 }
16686 yyerror (&yylloc, p, yymsgp);
16687 if (yysyntax_error_status == YYENOMEM)
16688 YYNOMEM;
16689 }
16690 }
16691
16692 yyerror_range[1] = yylloc;
16693 if (yyerrstatus == 3)
16694 {
16695 /* If just tried and failed to reuse lookahead token after an
16696 error, discard it. */
16697
16698 if (yychar <= END_OF_INPUT)
16699 {
16700 /* Return failure if at end of input. */
16701 if (yychar == END_OF_INPUT)
16702 YYABORT;
16703 }
16704 else
16705 {
16706 yydestruct ("Error: discarding",
16707 yytoken, &yylval, &yylloc, p);
16708 yychar = YYEMPTY;
16709 }
16710 }
16711
16712 /* Else will try to reuse lookahead token after shifting the error
16713 token. */
16714 goto yyerrlab1;
16715
16716
16717/*---------------------------------------------------.
16718| yyerrorlab -- error raised explicitly by YYERROR. |
16719`---------------------------------------------------*/
16720yyerrorlab:
16721 /* Pacify compilers when the user code never invokes YYERROR and the
16722 label yyerrorlab therefore never appears in user code. */
16723 if (0)
16724 YYERROR;
16725 ++yynerrs;
16726
16727 /* Do not reclaim the symbols of the rule whose action triggered
16728 this YYERROR. */
16729 YYPOPSTACK (yylen);
16730 yylen = 0;
16731 YY_STACK_PRINT (yyss, yyssp, p);
16732 yystate = *yyssp;
16733 goto yyerrlab1;
16734
16735
16736/*-------------------------------------------------------------.
16737| yyerrlab1 -- common code for both syntax error and YYERROR. |
16738`-------------------------------------------------------------*/
16739yyerrlab1:
16740 yyerrstatus = 3; /* Each real token shifted decrements this. */
16741
16742 /* Pop stack until we find a state that shifts the error token. */
16743 for (;;)
16744 {
16745 yyn = yypact[yystate];
16746 if (!yypact_value_is_default (yyn))
16747 {
16748 yyn += YYSYMBOL_YYerror;
16749 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
16750 {
16751 yyn = yytable[yyn];
16752 if (0 < yyn)
16753 break;
16754 }
16755 }
16756
16757 /* Pop the current state because it cannot handle the error token. */
16758 if (yyssp == yyss)
16759 YYABORT;
16760
16761 yyerror_range[1] = *yylsp;
16762 yydestruct ("Error: popping",
16763 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
16764 YYPOPSTACK (1);
16765 yystate = *yyssp;
16766 YY_STACK_PRINT (yyss, yyssp, p);
16767 }
16768
16769 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
16770 *++yyvsp = yylval;
16771 YY_IGNORE_MAYBE_UNINITIALIZED_END
16772
16773 yyerror_range[2] = yylloc;
16774 ++yylsp;
16775 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
16776
16777 /* Shift the error token. */
16778 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp, p);
16779
16780 yystate = yyn;
16781 goto yynewstate;
16782
16783
16784/*-------------------------------------.
16785| yyacceptlab -- YYACCEPT comes here. |
16786`-------------------------------------*/
16787yyacceptlab:
16788 yyresult = 0;
16789 goto yyreturnlab;
16790
16791
16792/*-----------------------------------.
16793| yyabortlab -- YYABORT comes here. |
16794`-----------------------------------*/
16795yyabortlab:
16796 yyresult = 1;
16797 goto yyreturnlab;
16798
16799
16800/*-----------------------------------------------------------.
16801| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
16802`-----------------------------------------------------------*/
16803yyexhaustedlab:
16804 yyerror (&yylloc, p, YY_("memory exhausted"));
16805 yyresult = 2;
16806 goto yyreturnlab;
16807
16808
16809/*----------------------------------------------------------.
16810| yyreturnlab -- parsing is finished, clean up and return. |
16811`----------------------------------------------------------*/
16812yyreturnlab:
16813 if (yychar != YYEMPTY)
16814 {
16815 /* Make sure we have latest lookahead translation. See comments at
16816 user semantic actions for why this is necessary. */
16817 yytoken = YYTRANSLATE (yychar);
16818 yydestruct ("Cleanup: discarding lookahead",
16819 yytoken, &yylval, &yylloc, p);
16820 }
16821 /* Do not reclaim the symbols of the rule whose action triggered
16822 this YYABORT or YYACCEPT. */
16823 YYPOPSTACK (yylen);
16824 YY_STACK_PRINT (yyss, yyssp, p);
16825 while (yyssp != yyss)
16826 {
16827 yydestruct ("Cleanup: popping",
16828 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
16829 YYPOPSTACK (1);
16830 }
16831#ifndef yyoverflow
16832 if (yyss != yyssa)
16833 YYSTACK_FREE (yyss);
16834#endif
16835 if (yymsg != yymsgbuf)
16836 YYSTACK_FREE (yymsg);
16837 return yyresult;
16838}
16839
16840#line 6761 "parse.y"
16841
16842# undef p
16843# undef yylex
16844# undef yylval
16845# define yylval (*p->lval)
16846
16847static int regx_options(struct parser_params*);
16848static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
16849static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
16850static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
16851static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
16852
16853#ifndef RIPPER
16854# define set_yylval_node(x) { \
16855 YYLTYPE _cur_loc; \
16856 rb_parser_set_location(p, &_cur_loc); \
16857 yylval.node = (x); \
16858}
16859# define set_yylval_str(x) \
16860do { \
16861 set_yylval_node(NEW_STR(x, &_cur_loc)); \
16862 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16863} while(0)
16864# define set_yylval_literal(x) \
16865do { \
16866 set_yylval_node(NEW_LIT(x, &_cur_loc)); \
16867 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16868} while(0)
16869# define set_yylval_num(x) (yylval.num = (x))
16870# define set_yylval_id(x) (yylval.id = (x))
16871# define set_yylval_name(x) (yylval.id = (x))
16872# define yylval_id() (yylval.id)
16873#else
16874static inline VALUE
16875ripper_yylval_id(struct parser_params *p, ID x)
16876{
16877 return ripper_new_yylval(p, x, ID2SYM(x), 0);
16878}
16879# define set_yylval_str(x) (yylval.val = add_mark_object(p, (x)))
16880# define set_yylval_num(x) (yylval.val = ripper_new_yylval(p, (x), 0, 0))
16881# define set_yylval_id(x) (void)(x)
16882# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(p, x))
16883# define set_yylval_literal(x) add_mark_object(p, (x))
16884# define set_yylval_node(x) (yylval.val = ripper_new_yylval(p, 0, 0, STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)))
16885# define yylval_id() yylval.id
16886# define _cur_loc NULL_LOC /* dummy */
16887#endif
16888
16889#define set_yylval_noname() set_yylval_id(keyword_nil)
16890#define has_delayed_token(p) (!NIL_P(p->delayed.token))
16891
16892#ifndef RIPPER
16893#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
16894#define dispatch_scan_event(p, t) parser_dispatch_scan_event(p, t, __LINE__)
16895
16896static bool
16897parser_has_token(struct parser_params *p)
16898{
16899 const char *const pcur = p->lex.pcur;
16900 const char *const ptok = p->lex.ptok;
16901 if (p->keep_tokens && (pcur < ptok)) {
16902 rb_bug("lex.pcur < lex.ptok. (line: %d) %"PRIdPTRDIFF"|%"PRIdPTRDIFF"|%"PRIdPTRDIFF"",
16903 p->ruby_sourceline, ptok - p->lex.pbeg, pcur - ptok, p->lex.pend - pcur);
16904 }
16905 return pcur > ptok;
16906}
16907
16908static VALUE
16909code_loc_to_ary(struct parser_params *p, const rb_code_location_t *loc)
16910{
16911 VALUE ary = rb_ary_new_from_args(4,
16912 INT2NUM(loc->beg_pos.lineno), INT2NUM(loc->beg_pos.column),
16913 INT2NUM(loc->end_pos.lineno), INT2NUM(loc->end_pos.column));
16914 rb_obj_freeze(ary);
16915
16916 return ary;
16917}
16918
16919static void
16920parser_append_tokens(struct parser_params *p, VALUE str, enum yytokentype t, int line)
16921{
16922 VALUE ary;
16923 int token_id;
16924
16925 ary = rb_ary_new2(4);
16926 token_id = p->token_id;
16927 rb_ary_push(ary, INT2FIX(token_id));
16928 rb_ary_push(ary, ID2SYM(parser_token2id(p, t)));
16929 rb_ary_push(ary, str);
16930 rb_ary_push(ary, code_loc_to_ary(p, p->yylloc));
16931 rb_obj_freeze(ary);
16932 rb_ary_push(p->tokens, ary);
16933 p->token_id++;
16934
16935 if (p->debug) {
16936 rb_parser_printf(p, "Append tokens (line: %d) %"PRIsVALUE"\n", line, ary);
16937 }
16938}
16939
16940static void
16941parser_dispatch_scan_event(struct parser_params *p, enum yytokentype t, int line)
16942{
16943 debug_token_line(p, "parser_dispatch_scan_event", line);
16944
16945 if (!parser_has_token(p)) return;
16946
16947 RUBY_SET_YYLLOC(*p->yylloc);
16948
16949 if (p->keep_tokens) {
16950 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16951 parser_append_tokens(p, str, t, line);
16952 }
16953
16954 token_flush(p);
16955}
16956
16957#define dispatch_delayed_token(p, t) parser_dispatch_delayed_token(p, t, __LINE__)
16958static void
16959parser_dispatch_delayed_token(struct parser_params *p, enum yytokentype t, int line)
16960{
16961 debug_token_line(p, "parser_dispatch_delayed_token", line);
16962
16963 if (!has_delayed_token(p)) return;
16964
16965 RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(*p->yylloc);
16966
16967 if (p->keep_tokens) {
16968 parser_append_tokens(p, p->delayed.token, t, line);
16969 }
16970
16971 p->delayed.token = Qnil;
16972}
16973#else
16974#define literal_flush(p, ptr) ((void)(ptr))
16975
16976#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &RNODE_RIPPER(yylval.node)->nd_rval : &yylval.val))
16977
16978static int
16979ripper_has_scan_event(struct parser_params *p)
16980{
16981 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
16982 return p->lex.pcur > p->lex.ptok;
16983}
16984
16985static VALUE
16986ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
16987{
16988 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16989 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
16990 RUBY_SET_YYLLOC(*p->yylloc);
16991 token_flush(p);
16992 return rval;
16993}
16994
16995static void
16996ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
16997{
16998 if (!ripper_has_scan_event(p)) return;
16999 add_mark_object(p, yylval_rval = ripper_scan_event_val(p, t));
17000}
17001#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
17002
17003static void
17004ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
17005{
17006 /* save and adjust the location to delayed token for callbacks */
17007 int saved_line = p->ruby_sourceline;
17008 const char *saved_tokp = p->lex.ptok;
17009
17010 if (!has_delayed_token(p)) return;
17011 p->ruby_sourceline = p->delayed.beg_line;
17012 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
17013 add_mark_object(p, yylval_rval = ripper_dispatch1(p, ripper_token2eventid(t), p->delayed.token));
17014 p->delayed.token = Qnil;
17015 p->ruby_sourceline = saved_line;
17016 p->lex.ptok = saved_tokp;
17017}
17018#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
17019#endif /* RIPPER */
17020
17021static inline int
17022is_identchar(struct parser_params *p, const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
17023{
17024 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
17025}
17026
17027static inline int
17028parser_is_identchar(struct parser_params *p)
17029{
17030 return !(p)->eofp && is_identchar(p, p->lex.pcur-1, p->lex.pend, p->enc);
17031}
17032
17033static inline int
17034parser_isascii(struct parser_params *p)
17035{
17036 return ISASCII(*(p->lex.pcur-1));
17037}
17038
17039static void
17040token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
17041{
17042 int column = 1, nonspc = 0, i;
17043 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
17044 if (*ptr == '\t') {
17045 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
17046 }
17047 column++;
17048 if (*ptr != ' ' && *ptr != '\t') {
17049 nonspc = 1;
17050 }
17051 }
17052
17053 ptinfo->beg = loc->beg_pos;
17054 ptinfo->indent = column;
17055 ptinfo->nonspc = nonspc;
17056}
17057
17058static void
17059token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17060{
17061 token_info *ptinfo;
17062
17063 if (!p->token_info_enabled) return;
17064 ptinfo = ALLOC(token_info);
17065 ptinfo->token = token;
17066 ptinfo->next = p->token_info;
17067 token_info_setup(ptinfo, p->lex.pbeg, loc);
17068
17069 p->token_info = ptinfo;
17070}
17071
17072static void
17073token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
17074{
17075 token_info *ptinfo_beg = p->token_info;
17076
17077 if (!ptinfo_beg) return;
17078 p->token_info = ptinfo_beg->next;
17079
17080 /* indentation check of matched keywords (begin..end, if..end, etc.) */
17081 token_info_warn(p, token, ptinfo_beg, 1, loc);
17082 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17083}
17084
17085static void
17086token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
17087{
17088 token_info *ptinfo_beg = p->token_info;
17089
17090 if (!ptinfo_beg) return;
17091 p->token_info = ptinfo_beg->next;
17092
17093 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
17094 ptinfo_beg->beg.column != beg_pos.column ||
17095 strcmp(ptinfo_beg->token, token)) {
17096 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
17097 beg_pos.lineno, beg_pos.column, token,
17098 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
17099 ptinfo_beg->token);
17100 }
17101
17102 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
17103}
17104
17105static void
17106token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
17107{
17108 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
17109 if (!p->token_info_enabled) return;
17110 if (!ptinfo_beg) return;
17111 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
17112 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
17113 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
17114 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
17115 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
17116 rb_warn3L(ptinfo_end->beg.lineno,
17117 "mismatched indentations at '%s' with '%s' at %d",
17118 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
17119}
17120
17121static int
17122parser_precise_mbclen(struct parser_params *p, const char *ptr)
17123{
17124 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
17125 if (!MBCLEN_CHARFOUND_P(len)) {
17126 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
17127 return -1;
17128 }
17129 return len;
17130}
17131
17132#ifndef RIPPER
17133static void ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str);
17134
17135static inline void
17136parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
17137{
17138 VALUE str;
17139 int lineno = p->ruby_sourceline;
17140 if (!yylloc) {
17141 return;
17142 }
17143 else if (yylloc->beg_pos.lineno == lineno) {
17144 str = p->lex.lastline;
17145 }
17146 else {
17147 return;
17148 }
17149 ruby_show_error_line(p, p->error_buffer, yylloc, lineno, str);
17150}
17151
17152static int
17153parser_yyerror(struct parser_params *p, const rb_code_location_t *yylloc, const char *msg)
17154{
17155#if 0
17156 YYLTYPE current;
17157
17158 if (!yylloc) {
17159 yylloc = RUBY_SET_YYLLOC(current);
17160 }
17161 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
17162 p->ruby_sourceline != yylloc->end_pos.lineno)) {
17163 yylloc = 0;
17164 }
17165#endif
17166 parser_compile_error(p, yylloc, "%s", msg);
17167 parser_show_error_line(p, yylloc);
17168 return 0;
17169}
17170
17171static int
17172parser_yyerror0(struct parser_params *p, const char *msg)
17173{
17174 YYLTYPE current;
17175 return parser_yyerror(p, RUBY_SET_YYLLOC(current), msg);
17176}
17177
17178static void
17179ruby_show_error_line(struct parser_params *p, VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str)
17180{
17181 VALUE mesg;
17182 const int max_line_margin = 30;
17183 const char *ptr, *ptr_end, *pt, *pb;
17184 const char *pre = "", *post = "", *pend;
17185 const char *code = "", *caret = "";
17186 const char *lim;
17187 const char *const pbeg = RSTRING_PTR(str);
17188 char *buf;
17189 long len;
17190 int i;
17191
17192 if (!yylloc) return;
17193 pend = RSTRING_END(str);
17194 if (pend > pbeg && pend[-1] == '\n') {
17195 if (--pend > pbeg && pend[-1] == '\r') --pend;
17196 }
17197
17198 pt = pend;
17199 if (lineno == yylloc->end_pos.lineno &&
17200 (pend - pbeg) > yylloc->end_pos.column) {
17201 pt = pbeg + yylloc->end_pos.column;
17202 }
17203
17204 ptr = ptr_end = pt;
17205 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
17206 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
17207
17208 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
17209 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
17210
17211 len = ptr_end - ptr;
17212 if (len > 4) {
17213 if (ptr > pbeg) {
17214 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_enc_get(str));
17215 if (ptr > pbeg) pre = "...";
17216 }
17217 if (ptr_end < pend) {
17218 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_enc_get(str));
17219 if (ptr_end < pend) post = "...";
17220 }
17221 }
17222 pb = pbeg;
17223 if (lineno == yylloc->beg_pos.lineno) {
17224 pb += yylloc->beg_pos.column;
17225 if (pb > pt) pb = pt;
17226 }
17227 if (pb < ptr) pb = ptr;
17228 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
17229 return;
17230 }
17231 if (RTEST(errbuf)) {
17232 mesg = rb_attr_get(errbuf, idMesg);
17233 if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
17234 rb_str_cat_cstr(mesg, "\n");
17235 }
17236 else {
17237 mesg = rb_enc_str_new(0, 0, rb_enc_get(str));
17238 }
17239 if (!errbuf && rb_stderr_tty_p()) {
17240#define CSI_BEGIN "\033["
17241#define CSI_SGR "m"
17242 rb_str_catf(mesg,
17243 CSI_BEGIN""CSI_SGR"%s" /* pre */
17244 CSI_BEGIN"1"CSI_SGR"%.*s"
17245 CSI_BEGIN"1;4"CSI_SGR"%.*s"
17246 CSI_BEGIN";1"CSI_SGR"%.*s"
17247 CSI_BEGIN""CSI_SGR"%s" /* post */
17248 "\n",
17249 pre,
17250 (int)(pb - ptr), ptr,
17251 (int)(pt - pb), pb,
17252 (int)(ptr_end - pt), pt,
17253 post);
17254 }
17255 else {
17256 char *p2;
17257
17258 len = ptr_end - ptr;
17259 lim = pt < pend ? pt : pend;
17260 i = (int)(lim - ptr);
17261 buf = ALLOCA_N(char, i+2);
17262 code = ptr;
17263 caret = p2 = buf;
17264 if (ptr <= pb) {
17265 while (ptr < pb) {
17266 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
17267 }
17268 *p2++ = '^';
17269 ptr++;
17270 }
17271 if (lim > ptr) {
17272 memset(p2, '~', (lim - ptr));
17273 p2 += (lim - ptr);
17274 }
17275 *p2 = '\0';
17276 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
17277 pre, (int)len, code, post,
17278 pre, caret);
17279 }
17280 if (!errbuf) rb_write_error_str(mesg);
17281}
17282#else
17283static int
17284parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
17285{
17286 const char *pcur = 0, *ptok = 0;
17287 if (p->ruby_sourceline == yylloc->beg_pos.lineno &&
17288 p->ruby_sourceline == yylloc->end_pos.lineno) {
17289 pcur = p->lex.pcur;
17290 ptok = p->lex.ptok;
17291 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
17292 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
17293 }
17294 parser_yyerror0(p, msg);
17295 if (pcur) {
17296 p->lex.ptok = ptok;
17297 p->lex.pcur = pcur;
17298 }
17299 return 0;
17300}
17301
17302static int
17303parser_yyerror0(struct parser_params *p, const char *msg)
17304{
17305 dispatch1(parse_error, STR_NEW2(msg));
17306 ripper_error(p);
17307 return 0;
17308}
17309
17310static inline void
17311parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
17312{
17313}
17314#endif /* !RIPPER */
17315
17316#ifndef RIPPER
17317static int
17318vtable_size(const struct vtable *tbl)
17319{
17320 if (!DVARS_TERMINAL_P(tbl)) {
17321 return tbl->pos;
17322 }
17323 else {
17324 return 0;
17325 }
17326}
17327#endif
17328
17329static struct vtable *
17330vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
17331{
17332 struct vtable *tbl = ALLOC(struct vtable);
17333 tbl->pos = 0;
17334 tbl->capa = 8;
17335 tbl->tbl = ALLOC_N(ID, tbl->capa);
17336 tbl->prev = prev;
17337#ifndef RIPPER
17338 if (p->debug) {
17339 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
17340 }
17341#endif
17342 return tbl;
17343}
17344#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
17345
17346static void
17347vtable_free_gen(struct parser_params *p, int line, const char *name,
17348 struct vtable *tbl)
17349{
17350#ifndef RIPPER
17351 if (p->debug) {
17352 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
17353 }
17354#endif
17355 if (!DVARS_TERMINAL_P(tbl)) {
17356 if (tbl->tbl) {
17357 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
17358 }
17359 ruby_sized_xfree(tbl, sizeof(*tbl));
17360 }
17361}
17362#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
17363
17364static void
17365vtable_add_gen(struct parser_params *p, int line, const char *name,
17366 struct vtable *tbl, ID id)
17367{
17368#ifndef RIPPER
17369 if (p->debug) {
17370 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
17371 line, name, (void *)tbl, rb_id2name(id));
17372 }
17373#endif
17374 if (DVARS_TERMINAL_P(tbl)) {
17375 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
17376 return;
17377 }
17378 if (tbl->pos == tbl->capa) {
17379 tbl->capa = tbl->capa * 2;
17380 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
17381 }
17382 tbl->tbl[tbl->pos++] = id;
17383}
17384#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
17385
17386#ifndef RIPPER
17387static void
17388vtable_pop_gen(struct parser_params *p, int line, const char *name,
17389 struct vtable *tbl, int n)
17390{
17391 if (p->debug) {
17392 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
17393 line, name, (void *)tbl, n);
17394 }
17395 if (tbl->pos < n) {
17396 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
17397 return;
17398 }
17399 tbl->pos -= n;
17400}
17401#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
17402#endif
17403
17404static int
17405vtable_included(const struct vtable * tbl, ID id)
17406{
17407 int i;
17408
17409 if (!DVARS_TERMINAL_P(tbl)) {
17410 for (i = 0; i < tbl->pos; i++) {
17411 if (tbl->tbl[i] == id) {
17412 return i+1;
17413 }
17414 }
17415 }
17416 return 0;
17417}
17418
17419static void parser_prepare(struct parser_params *p);
17420
17421#ifndef RIPPER
17422static NODE *parser_append_options(struct parser_params *p, NODE *node);
17423
17424static int
17425e_option_supplied(struct parser_params *p)
17426{
17427 return strcmp(p->ruby_sourcefile, "-e") == 0;
17428}
17429
17430static VALUE
17431yycompile0(VALUE arg)
17432{
17433 int n;
17434 NODE *tree;
17435 struct parser_params *p = (struct parser_params *)arg;
17436 int cov = FALSE;
17437
17438 if (!compile_for_eval && !NIL_P(p->ruby_sourcefile_string)) {
17439 if (p->debug_lines && p->ruby_sourceline > 0) {
17440 VALUE str = rb_default_rs;
17441 n = p->ruby_sourceline;
17442 do {
17443 rb_ary_push(p->debug_lines, str);
17444 } while (--n);
17445 }
17446
17447 if (!e_option_supplied(p)) {
17448 cov = TRUE;
17449 }
17450 }
17451
17452 if (p->debug_lines) {
17453 RB_OBJ_WRITE(p->ast, &p->ast->body.script_lines, p->debug_lines);
17454 }
17455
17456 parser_prepare(p);
17457#define RUBY_DTRACE_PARSE_HOOK(name) \
17458 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
17459 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
17460 }
17461 RUBY_DTRACE_PARSE_HOOK(BEGIN);
17462 n = yyparse(p);
17463 RUBY_DTRACE_PARSE_HOOK(END);
17464 p->debug_lines = 0;
17465
17466 p->lex.strterm = 0;
17467 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
17468 if (n || p->error_p) {
17469 VALUE mesg = p->error_buffer;
17470 if (!mesg) {
17471 mesg = syntax_error_new();
17472 }
17473 if (!p->error_tolerant) {
17474 rb_set_errinfo(mesg);
17475 return FALSE;
17476 }
17477 }
17478 tree = p->eval_tree;
17479 if (!tree) {
17480 tree = NEW_NIL(&NULL_LOC);
17481 }
17482 else {
17483 VALUE tokens = p->tokens;
17484 NODE *prelude;
17485 NODE *body = parser_append_options(p, RNODE_SCOPE(tree)->nd_body);
17486 prelude = block_append(p, p->eval_tree_begin, body);
17487 RNODE_SCOPE(tree)->nd_body = prelude;
17488 p->ast->body.frozen_string_literal = p->frozen_string_literal;
17489 p->ast->body.coverage_enabled = cov;
17490 if (p->keep_tokens) {
17491 rb_obj_freeze(tokens);
17492 rb_ast_set_tokens(p->ast, tokens);
17493 }
17494 }
17495 p->ast->body.root = tree;
17496 if (!p->ast->body.script_lines) p->ast->body.script_lines = INT2FIX(p->line_count);
17497 return TRUE;
17498}
17499
17500static rb_ast_t *
17501yycompile(struct parser_params *p, VALUE fname, int line)
17502{
17503 rb_ast_t *ast;
17504 if (NIL_P(fname)) {
17505 p->ruby_sourcefile_string = Qnil;
17506 p->ruby_sourcefile = "(none)";
17507 }
17508 else {
17509 p->ruby_sourcefile_string = rb_fstring(fname);
17510 p->ruby_sourcefile = StringValueCStr(fname);
17511 }
17512 p->ruby_sourceline = line - 1;
17513
17514 p->lvtbl = NULL;
17515
17516 p->ast = ast = rb_ast_new();
17517 compile_callback(yycompile0, (VALUE)p);
17518 p->ast = 0;
17519
17520 while (p->lvtbl) {
17521 local_pop(p);
17522 }
17523
17524 return ast;
17525}
17526#endif /* !RIPPER */
17527
17528static rb_encoding *
17529must_be_ascii_compatible(struct parser_params *p, VALUE s)
17530{
17531 rb_encoding *enc = rb_enc_get(s);
17532 if (!rb_enc_asciicompat(enc)) {
17533 rb_raise(rb_eArgError, "invalid source encoding");
17534 }
17535 return enc;
17536}
17537
17538static VALUE
17539lex_get_str(struct parser_params *p, VALUE s)
17540{
17541 char *beg, *end, *start;
17542 long len;
17543
17544 beg = RSTRING_PTR(s);
17545 len = RSTRING_LEN(s);
17546 start = beg;
17547 if (p->lex.gets_.ptr) {
17548 if (len == p->lex.gets_.ptr) return Qnil;
17549 beg += p->lex.gets_.ptr;
17550 len -= p->lex.gets_.ptr;
17551 }
17552 end = memchr(beg, '\n', len);
17553 if (end) len = ++end - beg;
17554 p->lex.gets_.ptr += len;
17555 return rb_str_subseq(s, beg - start, len);
17556}
17557
17558static VALUE
17559lex_getline(struct parser_params *p)
17560{
17561 VALUE line = (*p->lex.gets)(p, p->lex.input);
17562 if (NIL_P(line)) return line;
17563 must_be_ascii_compatible(p, line);
17564 if (RB_OBJ_FROZEN(line)) line = rb_str_dup(line); // needed for RubyVM::AST.of because script_lines in iseq is deep-frozen
17565 p->line_count++;
17566 return line;
17567}
17568
17569#ifndef RIPPER
17570static rb_ast_t*
17571parser_compile_string(rb_parser_t *p, VALUE fname, VALUE s, int line)
17572{
17573 p->lex.gets = lex_get_str;
17574 p->lex.gets_.ptr = 0;
17575 p->lex.input = rb_str_new_frozen(s);
17576 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
17577
17578 return yycompile(p, fname, line);
17579}
17580
17581rb_ast_t*
17582rb_ruby_parser_compile_string_path(rb_parser_t *p, VALUE f, VALUE s, int line)
17583{
17584 must_be_ascii_compatible(p, s);
17585 return parser_compile_string(p, f, s, line);
17586}
17587
17588rb_ast_t*
17589rb_ruby_parser_compile_string(rb_parser_t *p, const char *f, VALUE s, int line)
17590{
17591 return rb_ruby_parser_compile_string_path(p, rb_filesystem_str_new_cstr(f), s, line);
17592}
17593
17594static VALUE
17595lex_io_gets(struct parser_params *p, VALUE io)
17596{
17597 return rb_io_gets_internal(io);
17598}
17599
17600rb_ast_t*
17601rb_ruby_parser_compile_file_path(rb_parser_t *p, VALUE fname, VALUE file, int start)
17602{
17603 p->lex.gets = lex_io_gets;
17604 p->lex.input = file;
17605 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
17606
17607 return yycompile(p, fname, start);
17608}
17609
17610static VALUE
17611lex_generic_gets(struct parser_params *p, VALUE input)
17612{
17613 return (*p->lex.gets_.call)(input, p->line_count);
17614}
17615
17616rb_ast_t*
17617rb_ruby_parser_compile_generic(rb_parser_t *p, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
17618{
17619 p->lex.gets = lex_generic_gets;
17620 p->lex.gets_.call = lex_gets;
17621 p->lex.input = input;
17622 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
17623
17624 return yycompile(p, fname, start);
17625}
17626#endif /* !RIPPER */
17627
17628#define STR_FUNC_ESCAPE 0x01
17629#define STR_FUNC_EXPAND 0x02
17630#define STR_FUNC_REGEXP 0x04
17631#define STR_FUNC_QWORDS 0x08
17632#define STR_FUNC_SYMBOL 0x10
17633#define STR_FUNC_INDENT 0x20
17634#define STR_FUNC_LABEL 0x40
17635#define STR_FUNC_LIST 0x4000
17636#define STR_FUNC_TERM 0x8000
17637
17638enum string_type {
17639 str_label = STR_FUNC_LABEL,
17640 str_squote = (0),
17641 str_dquote = (STR_FUNC_EXPAND),
17642 str_xquote = (STR_FUNC_EXPAND),
17643 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
17644 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
17645 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
17646 str_ssym = (STR_FUNC_SYMBOL),
17647 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
17648};
17649
17650static VALUE
17651parser_str_new(struct parser_params *p, const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
17652{
17653 VALUE str;
17654
17655 str = rb_enc_str_new(ptr, len, enc);
17656 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
17657 if (is_ascii_string(str)) {
17658 }
17659 else if (rb_is_usascii_enc((void *)enc0) && enc != rb_utf8_encoding()) {
17660 rb_enc_associate(str, rb_ascii8bit_encoding());
17661 }
17662 }
17663
17664 return str;
17665}
17666
17667static int
17668strterm_is_heredoc(rb_strterm_t *strterm)
17669{
17670 return strterm->flags & STRTERM_HEREDOC;
17671}
17672
17673static rb_strterm_t *
17674new_strterm(struct parser_params *p, int func, int term, int paren)
17675{
17676 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
17677 strterm->u.literal.func = func;
17678 strterm->u.literal.term = term;
17679 strterm->u.literal.paren = paren;
17680 return strterm;
17681}
17682
17683static rb_strterm_t *
17684new_heredoc(struct parser_params *p)
17685{
17686 rb_strterm_t *strterm = ZALLOC(rb_strterm_t);
17687 strterm->flags |= STRTERM_HEREDOC;
17688 return strterm;
17689}
17690
17691#define peek(p,c) peek_n(p, (c), 0)
17692#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
17693#define peekc(p) peekc_n(p, 0)
17694#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
17695
17696static void
17697add_delayed_token(struct parser_params *p, const char *tok, const char *end, int line)
17698{
17699#ifndef RIPPER
17700 debug_token_line(p, "add_delayed_token", line);
17701#endif
17702
17703 if (tok < end) {
17704 if (has_delayed_token(p)) {
17705 bool next_line = end_with_newline_p(p, p->delayed.token);
17706 int end_line = (next_line ? 1 : 0) + p->delayed.end_line;
17707 int end_col = (next_line ? 0 : p->delayed.end_col);
17708 if (end_line != p->ruby_sourceline || end_col != tok - p->lex.pbeg) {
17709 dispatch_delayed_token(p, tSTRING_CONTENT);
17710 }
17711 }
17712 if (!has_delayed_token(p)) {
17713 p->delayed.token = rb_str_buf_new(end - tok);
17714 rb_enc_associate(p->delayed.token, p->enc);
17715 p->delayed.beg_line = p->ruby_sourceline;
17716 p->delayed.beg_col = rb_long2int(tok - p->lex.pbeg);
17717 }
17718 rb_str_buf_cat(p->delayed.token, tok, end - tok);
17719 p->delayed.end_line = p->ruby_sourceline;
17720 p->delayed.end_col = rb_long2int(end - p->lex.pbeg);
17721 p->lex.ptok = end;
17722 }
17723}
17724
17725static void
17726set_lastline(struct parser_params *p, VALUE v)
17727{
17728 p->lex.pbeg = p->lex.pcur = RSTRING_PTR(v);
17729 p->lex.pend = p->lex.pcur + RSTRING_LEN(v);
17730 p->lex.lastline = v;
17731}
17732
17733static int
17734nextline(struct parser_params *p, int set_encoding)
17735{
17736 VALUE v = p->lex.nextline;
17737 p->lex.nextline = 0;
17738 if (!v) {
17739 if (p->eofp)
17740 return -1;
17741
17742 if (!lex_eol_ptr_p(p, p->lex.pbeg) && *(p->lex.pend-1) != '\n') {
17743 goto end_of_input;
17744 }
17745
17746 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
17747 end_of_input:
17748 p->eofp = 1;
17749 lex_goto_eol(p);
17750 return -1;
17751 }
17752#ifndef RIPPER
17753 if (p->debug_lines) {
17754 if (set_encoding) rb_enc_associate(v, p->enc);
17755 rb_ary_push(p->debug_lines, v);
17756 }
17757#endif
17758 p->cr_seen = FALSE;
17759 }
17760 else if (NIL_P(v)) {
17761 /* after here-document without terminator */
17762 goto end_of_input;
17763 }
17764 add_delayed_token(p, p->lex.ptok, p->lex.pend, __LINE__);
17765 if (p->heredoc_end > 0) {
17766 p->ruby_sourceline = p->heredoc_end;
17767 p->heredoc_end = 0;
17768 }
17769 p->ruby_sourceline++;
17770 set_lastline(p, v);
17771 token_flush(p);
17772 return 0;
17773}
17774
17775static int
17776parser_cr(struct parser_params *p, int c)
17777{
17778 if (peek(p, '\n')) {
17779 p->lex.pcur++;
17780 c = '\n';
17781 }
17782 return c;
17783}
17784
17785static inline int
17786nextc0(struct parser_params *p, int set_encoding)
17787{
17788 int c;
17789
17790 if (UNLIKELY(lex_eol_p(p) || p->eofp || RTEST(p->lex.nextline))) {
17791 if (nextline(p, set_encoding)) return -1;
17792 }
17793 c = (unsigned char)*p->lex.pcur++;
17794 if (UNLIKELY(c == '\r')) {
17795 c = parser_cr(p, c);
17796 }
17797
17798 return c;
17799}
17800#define nextc(p) nextc0(p, TRUE)
17801
17802static void
17803pushback(struct parser_params *p, int c)
17804{
17805 if (c == -1) return;
17806 p->eofp = 0;
17807 p->lex.pcur--;
17808 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
17809 p->lex.pcur--;
17810 }
17811}
17812
17813#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
17814
17815#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
17816#define tok(p) (p)->tokenbuf
17817#define toklen(p) (p)->tokidx
17818
17819static int
17820looking_at_eol_p(struct parser_params *p)
17821{
17822 const char *ptr = p->lex.pcur;
17823 while (!lex_eol_ptr_p(p, ptr)) {
17824 int c = (unsigned char)*ptr++;
17825 int eol = (c == '\n' || c == '#');
17826 if (eol || !ISSPACE(c)) {
17827 return eol;
17828 }
17829 }
17830 return TRUE;
17831}
17832
17833static char*
17834newtok(struct parser_params *p)
17835{
17836 p->tokidx = 0;
17837 if (!p->tokenbuf) {
17838 p->toksiz = 60;
17839 p->tokenbuf = ALLOC_N(char, 60);
17840 }
17841 if (p->toksiz > 4096) {
17842 p->toksiz = 60;
17843 REALLOC_N(p->tokenbuf, char, 60);
17844 }
17845 return p->tokenbuf;
17846}
17847
17848static char *
17849tokspace(struct parser_params *p, int n)
17850{
17851 p->tokidx += n;
17852
17853 if (p->tokidx >= p->toksiz) {
17854 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
17855 REALLOC_N(p->tokenbuf, char, p->toksiz);
17856 }
17857 return &p->tokenbuf[p->tokidx-n];
17858}
17859
17860static void
17861tokadd(struct parser_params *p, int c)
17862{
17863 p->tokenbuf[p->tokidx++] = (char)c;
17864 if (p->tokidx >= p->toksiz) {
17865 p->toksiz *= 2;
17866 REALLOC_N(p->tokenbuf, char, p->toksiz);
17867 }
17868}
17869
17870static int
17871tok_hex(struct parser_params *p, size_t *numlen)
17872{
17873 int c;
17874
17875 c = (int)ruby_scan_hex(p->lex.pcur, 2, numlen);
17876 if (!*numlen) {
17877 yyerror0("invalid hex escape");
17878 dispatch_scan_event(p, tSTRING_CONTENT);
17879 return 0;
17880 }
17881 p->lex.pcur += *numlen;
17882 return c;
17883}
17884
17885#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
17886
17887static int
17888escaped_control_code(int c)
17889{
17890 int c2 = 0;
17891 switch (c) {
17892 case ' ':
17893 c2 = 's';
17894 break;
17895 case '\n':
17896 c2 = 'n';
17897 break;
17898 case '\t':
17899 c2 = 't';
17900 break;
17901 case '\v':
17902 c2 = 'v';
17903 break;
17904 case '\r':
17905 c2 = 'r';
17906 break;
17907 case '\f':
17908 c2 = 'f';
17909 break;
17910 }
17911 return c2;
17912}
17913
17914#define WARN_SPACE_CHAR(c, prefix) \
17915 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
17916
17917static int
17918tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
17919 int regexp_literal, int wide)
17920{
17921 size_t numlen;
17922 int codepoint = (int)ruby_scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
17923 p->lex.pcur += numlen;
17924 if (p->lex.strterm == NULL ||
17925 strterm_is_heredoc(p->lex.strterm) ||
17926 (p->lex.strterm->u.literal.func != str_regexp)) {
17927 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
17928 literal_flush(p, p->lex.pcur);
17929 yyerror0("invalid Unicode escape");
17930 return wide && numlen > 0;
17931 }
17932 if (codepoint > 0x10ffff) {
17933 literal_flush(p, p->lex.pcur);
17934 yyerror0("invalid Unicode codepoint (too large)");
17935 return wide;
17936 }
17937 if ((codepoint & 0xfffff800) == 0xd800) {
17938 literal_flush(p, p->lex.pcur);
17939 yyerror0("invalid Unicode codepoint");
17940 return wide;
17941 }
17942 }
17943 if (regexp_literal) {
17944 tokcopy(p, (int)numlen);
17945 }
17946 else if (codepoint >= 0x80) {
17947 rb_encoding *utf8 = rb_utf8_encoding();
17948 if (*encp && utf8 != *encp) {
17949 YYLTYPE loc = RUBY_INIT_YYLLOC();
17950 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
17951 parser_show_error_line(p, &loc);
17952 return wide;
17953 }
17954 *encp = utf8;
17955 tokaddmbc(p, codepoint, *encp);
17956 }
17957 else {
17958 tokadd(p, codepoint);
17959 }
17960 return TRUE;
17961}
17962
17963static int tokadd_mbchar(struct parser_params *p, int c);
17964
17965static int
17966tokskip_mbchar(struct parser_params *p)
17967{
17968 int len = parser_precise_mbclen(p, p->lex.pcur-1);
17969 if (len > 0) {
17970 p->lex.pcur += len - 1;
17971 }
17972 return len;
17973}
17974
17975/* return value is for ?\u3042 */
17976static void
17977tokadd_utf8(struct parser_params *p, rb_encoding **encp,
17978 int term, int symbol_literal, int regexp_literal)
17979{
17980 /*
17981 * If `term` is not -1, then we allow multiple codepoints in \u{}
17982 * upto `term` byte, otherwise we're parsing a character literal.
17983 * And then add the codepoints to the current token.
17984 */
17985 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
17986
17987 const int open_brace = '{', close_brace = '}';
17988
17989 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
17990
17991 if (peek(p, open_brace)) { /* handle \u{...} form */
17992 if (regexp_literal && p->lex.strterm->u.literal.func == str_regexp) {
17993 /*
17994 * Skip parsing validation code and copy bytes as-is until term or
17995 * closing brace, in order to correctly handle extended regexps where
17996 * invalid unicode escapes are allowed in comments. The regexp parser
17997 * does its own validation and will catch any issues.
17998 */
17999 tokadd(p, open_brace);
18000 while (!lex_eol_ptr_p(p, ++p->lex.pcur)) {
18001 int c = peekc(p);
18002 if (c == close_brace) {
18003 tokadd(p, c);
18004 ++p->lex.pcur;
18005 break;
18006 }
18007 else if (c == term) {
18008 break;
18009 }
18010 if (c == '\\' && !lex_eol_n_p(p, 1)) {
18011 tokadd(p, c);
18012 c = *++p->lex.pcur;
18013 }
18014 tokadd_mbchar(p, c);
18015 }
18016 }
18017 else {
18018 const char *second = NULL;
18019 int c, last = nextc(p);
18020 if (lex_eol_p(p)) goto unterminated;
18021 while (ISSPACE(c = peekc(p)) && !lex_eol_ptr_p(p, ++p->lex.pcur));
18022 while (c != close_brace) {
18023 if (c == term) goto unterminated;
18024 if (second == multiple_codepoints)
18025 second = p->lex.pcur;
18026 if (regexp_literal) tokadd(p, last);
18027 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
18028 break;
18029 }
18030 while (ISSPACE(c = peekc(p))) {
18031 if (lex_eol_ptr_p(p, ++p->lex.pcur)) goto unterminated;
18032 last = c;
18033 }
18034 if (term == -1 && !second)
18035 second = multiple_codepoints;
18036 }
18037
18038 if (c != close_brace) {
18039 unterminated:
18040 token_flush(p);
18041 yyerror0("unterminated Unicode escape");
18042 return;
18043 }
18044 if (second && second != multiple_codepoints) {
18045 const char *pcur = p->lex.pcur;
18046 p->lex.pcur = second;
18047 dispatch_scan_event(p, tSTRING_CONTENT);
18048 token_flush(p);
18049 p->lex.pcur = pcur;
18050 yyerror0(multiple_codepoints);
18051 token_flush(p);
18052 }
18053
18054 if (regexp_literal) tokadd(p, close_brace);
18055 nextc(p);
18056 }
18057 }
18058 else { /* handle \uxxxx form */
18059 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
18060 token_flush(p);
18061 return;
18062 }
18063 }
18064}
18065
18066#define ESCAPE_CONTROL 1
18067#define ESCAPE_META 2
18068
18069static int
18070read_escape(struct parser_params *p, int flags)
18071{
18072 int c;
18073 size_t numlen;
18074
18075 switch (c = nextc(p)) {
18076 case '\\': /* Backslash */
18077 return c;
18078
18079 case 'n': /* newline */
18080 return '\n';
18081
18082 case 't': /* horizontal tab */
18083 return '\t';
18084
18085 case 'r': /* carriage-return */
18086 return '\r';
18087
18088 case 'f': /* form-feed */
18089 return '\f';
18090
18091 case 'v': /* vertical tab */
18092 return '\13';
18093
18094 case 'a': /* alarm(bell) */
18095 return '\007';
18096
18097 case 'e': /* escape */
18098 return 033;
18099
18100 case '0': case '1': case '2': case '3': /* octal constant */
18101 case '4': case '5': case '6': case '7':
18102 pushback(p, c);
18103 c = (int)ruby_scan_oct(p->lex.pcur, 3, &numlen);
18104 p->lex.pcur += numlen;
18105 return c;
18106
18107 case 'x': /* hex constant */
18108 c = tok_hex(p, &numlen);
18109 if (numlen == 0) return 0;
18110 return c;
18111
18112 case 'b': /* backspace */
18113 return '\010';
18114
18115 case 's': /* space */
18116 return ' ';
18117
18118 case 'M':
18119 if (flags & ESCAPE_META) goto eof;
18120 if ((c = nextc(p)) != '-') {
18121 goto eof;
18122 }
18123 if ((c = nextc(p)) == '\\') {
18124 switch (peekc(p)) {
18125 case 'u': case 'U':
18126 nextc(p);
18127 goto eof;
18128 }
18129 return read_escape(p, flags|ESCAPE_META) | 0x80;
18130 }
18131 else if (c == -1 || !ISASCII(c)) goto eof;
18132 else {
18133 int c2 = escaped_control_code(c);
18134 if (c2) {
18135 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
18136 WARN_SPACE_CHAR(c2, "\\M-");
18137 }
18138 else {
18139 WARN_SPACE_CHAR(c2, "\\C-\\M-");
18140 }
18141 }
18142 else if (ISCNTRL(c)) goto eof;
18143 return ((c & 0xff) | 0x80);
18144 }
18145
18146 case 'C':
18147 if ((c = nextc(p)) != '-') {
18148 goto eof;
18149 }
18150 case 'c':
18151 if (flags & ESCAPE_CONTROL) goto eof;
18152 if ((c = nextc(p))== '\\') {
18153 switch (peekc(p)) {
18154 case 'u': case 'U':
18155 nextc(p);
18156 goto eof;
18157 }
18158 c = read_escape(p, flags|ESCAPE_CONTROL);
18159 }
18160 else if (c == '?')
18161 return 0177;
18162 else if (c == -1) goto eof;
18163 else if (!ISASCII(c)) {
18164 tokskip_mbchar(p);
18165 goto eof;
18166 }
18167 else {
18168 int c2 = escaped_control_code(c);
18169 if (c2) {
18170 if (ISCNTRL(c)) {
18171 if (flags & ESCAPE_META) {
18172 WARN_SPACE_CHAR(c2, "\\M-");
18173 }
18174 else {
18175 WARN_SPACE_CHAR(c2, "");
18176 }
18177 }
18178 else {
18179 if (flags & ESCAPE_META) {
18180 WARN_SPACE_CHAR(c2, "\\M-\\C-");
18181 }
18182 else {
18183 WARN_SPACE_CHAR(c2, "\\C-");
18184 }
18185 }
18186 }
18187 else if (ISCNTRL(c)) goto eof;
18188 }
18189 return c & 0x9f;
18190
18191 eof:
18192 case -1:
18193 yyerror0("Invalid escape character syntax");
18194 dispatch_scan_event(p, tSTRING_CONTENT);
18195 return '\0';
18196
18197 default:
18198 return c;
18199 }
18200}
18201
18202static void
18203tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
18204{
18205 int len = rb_enc_codelen(c, enc);
18206 rb_enc_mbcput(c, tokspace(p, len), enc);
18207}
18208
18209static int
18210tokadd_escape(struct parser_params *p)
18211{
18212 int c;
18213 size_t numlen;
18214
18215 switch (c = nextc(p)) {
18216 case '\n':
18217 return 0; /* just ignore */
18218
18219 case '0': case '1': case '2': case '3': /* octal constant */
18220 case '4': case '5': case '6': case '7':
18221 {
18222 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
18223 if (numlen == 0) goto eof;
18224 p->lex.pcur += numlen;
18225 tokcopy(p, (int)numlen + 1);
18226 }
18227 return 0;
18228
18229 case 'x': /* hex constant */
18230 {
18231 tok_hex(p, &numlen);
18232 if (numlen == 0) return -1;
18233 tokcopy(p, (int)numlen + 2);
18234 }
18235 return 0;
18236
18237 eof:
18238 case -1:
18239 yyerror0("Invalid escape character syntax");
18240 token_flush(p);
18241 return -1;
18242
18243 default:
18244 tokadd(p, '\\');
18245 tokadd(p, c);
18246 }
18247 return 0;
18248}
18249
18250static int
18251regx_options(struct parser_params *p)
18252{
18253 int kcode = 0;
18254 int kopt = 0;
18255 int options = 0;
18256 int c, opt, kc;
18257
18258 newtok(p);
18259 while (c = nextc(p), ISALPHA(c)) {
18260 if (c == 'o') {
18261 options |= RE_OPTION_ONCE;
18262 }
18263 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
18264 if (kc >= 0) {
18265 if (kc != rb_ascii8bit_encindex()) kcode = c;
18266 kopt = opt;
18267 }
18268 else {
18269 options |= opt;
18270 }
18271 }
18272 else {
18273 tokadd(p, c);
18274 }
18275 }
18276 options |= kopt;
18277 pushback(p, c);
18278 if (toklen(p)) {
18279 YYLTYPE loc = RUBY_INIT_YYLLOC();
18280 tokfix(p);
18281 compile_error(p, "unknown regexp option%s - %*s",
18282 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
18283 parser_show_error_line(p, &loc);
18284 }
18285 return options | RE_OPTION_ENCODING(kcode);
18286}
18287
18288static int
18289tokadd_mbchar(struct parser_params *p, int c)
18290{
18291 int len = parser_precise_mbclen(p, p->lex.pcur-1);
18292 if (len < 0) return -1;
18293 tokadd(p, c);
18294 p->lex.pcur += --len;
18295 if (len > 0) tokcopy(p, len);
18296 return c;
18297}
18298
18299static inline int
18300simple_re_meta(int c)
18301{
18302 switch (c) {
18303 case '$': case '*': case '+': case '.':
18304 case '?': case '^': case '|':
18305 case ')': case ']': case '}': case '>':
18306 return TRUE;
18307 default:
18308 return FALSE;
18309 }
18310}
18311
18312static int
18313parser_update_heredoc_indent(struct parser_params *p, int c)
18314{
18315 if (p->heredoc_line_indent == -1) {
18316 if (c == '\n') p->heredoc_line_indent = 0;
18317 }
18318 else {
18319 if (c == ' ') {
18320 p->heredoc_line_indent++;
18321 return TRUE;
18322 }
18323 else if (c == '\t') {
18324 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
18325 p->heredoc_line_indent = w * TAB_WIDTH;
18326 return TRUE;
18327 }
18328 else if (c != '\n') {
18329 if (p->heredoc_indent > p->heredoc_line_indent) {
18330 p->heredoc_indent = p->heredoc_line_indent;
18331 }
18332 p->heredoc_line_indent = -1;
18333 }
18334 }
18335 return FALSE;
18336}
18337
18338static void
18339parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
18340{
18341 YYLTYPE loc = RUBY_INIT_YYLLOC();
18342 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
18343 compile_error(p, "%s mixed within %s source", n1, n2);
18344 parser_show_error_line(p, &loc);
18345}
18346
18347static void
18348parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
18349{
18350 const char *pos = p->lex.pcur;
18351 p->lex.pcur = beg;
18352 parser_mixed_error(p, enc1, enc2);
18353 p->lex.pcur = pos;
18354}
18355
18356static inline char
18357nibble_char_upper(unsigned int c)
18358{
18359 c &= 0xf;
18360 return c + (c < 10 ? '0' : 'A' - 10);
18361}
18362
18363static int
18364tokadd_string(struct parser_params *p,
18365 int func, int term, int paren, long *nest,
18366 rb_encoding **encp, rb_encoding **enc)
18367{
18368 int c;
18369 bool erred = false;
18370#ifdef RIPPER
18371 const int heredoc_end = (p->heredoc_end ? p->heredoc_end + 1 : 0);
18372 int top_of_line = FALSE;
18373#endif
18374
18375#define mixed_error(enc1, enc2) \
18376 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
18377#define mixed_escape(beg, enc1, enc2) \
18378 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
18379
18380 while ((c = nextc(p)) != -1) {
18381 if (p->heredoc_indent > 0) {
18382 parser_update_heredoc_indent(p, c);
18383 }
18384#ifdef RIPPER
18385 if (top_of_line && heredoc_end == p->ruby_sourceline) {
18386 pushback(p, c);
18387 break;
18388 }
18389#endif
18390
18391 if (paren && c == paren) {
18392 ++*nest;
18393 }
18394 else if (c == term) {
18395 if (!nest || !*nest) {
18396 pushback(p, c);
18397 break;
18398 }
18399 --*nest;
18400 }
18401 else if ((func & STR_FUNC_EXPAND) && c == '#' && !lex_eol_p(p)) {
18402 unsigned char c2 = *p->lex.pcur;
18403 if (c2 == '$' || c2 == '@' || c2 == '{') {
18404 pushback(p, c);
18405 break;
18406 }
18407 }
18408 else if (c == '\\') {
18409 c = nextc(p);
18410 switch (c) {
18411 case '\n':
18412 if (func & STR_FUNC_QWORDS) break;
18413 if (func & STR_FUNC_EXPAND) {
18414 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
18415 continue;
18416 if (c == term) {
18417 c = '\\';
18418 goto terminate;
18419 }
18420 }
18421 tokadd(p, '\\');
18422 break;
18423
18424 case '\\':
18425 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
18426 break;
18427
18428 case 'u':
18429 if ((func & STR_FUNC_EXPAND) == 0) {
18430 tokadd(p, '\\');
18431 break;
18432 }
18433 tokadd_utf8(p, enc, term,
18434 func & STR_FUNC_SYMBOL,
18435 func & STR_FUNC_REGEXP);
18436 continue;
18437
18438 default:
18439 if (c == -1) return -1;
18440 if (!ISASCII(c)) {
18441 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
18442 goto non_ascii;
18443 }
18444 if (func & STR_FUNC_REGEXP) {
18445 switch (c) {
18446 case 'c':
18447 case 'C':
18448 case 'M': {
18449 pushback(p, c);
18450 c = read_escape(p, 0);
18451
18452 char *t = tokspace(p, rb_strlen_lit("\\x00"));
18453 *t++ = '\\';
18454 *t++ = 'x';
18455 *t++ = nibble_char_upper(c >> 4);
18456 *t++ = nibble_char_upper(c);
18457 continue;
18458 }
18459 }
18460
18461 if (c == term && !simple_re_meta(c)) {
18462 tokadd(p, c);
18463 continue;
18464 }
18465 pushback(p, c);
18466 if ((c = tokadd_escape(p)) < 0)
18467 return -1;
18468 if (*enc && *enc != *encp) {
18469 mixed_escape(p->lex.ptok+2, *enc, *encp);
18470 }
18471 continue;
18472 }
18473 else if (func & STR_FUNC_EXPAND) {
18474 pushback(p, c);
18475 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
18476 c = read_escape(p, 0);
18477 }
18478 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
18479 /* ignore backslashed spaces in %w */
18480 }
18481 else if (c != term && !(paren && c == paren)) {
18482 tokadd(p, '\\');
18483 pushback(p, c);
18484 continue;
18485 }
18486 }
18487 }
18488 else if (!parser_isascii(p)) {
18489 non_ascii:
18490 if (!*enc) {
18491 *enc = *encp;
18492 }
18493 else if (*enc != *encp) {
18494 mixed_error(*enc, *encp);
18495 continue;
18496 }
18497 if (tokadd_mbchar(p, c) == -1) return -1;
18498 continue;
18499 }
18500 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
18501 pushback(p, c);
18502 break;
18503 }
18504 if (c & 0x80) {
18505 if (!*enc) {
18506 *enc = *encp;
18507 }
18508 else if (*enc != *encp) {
18509 mixed_error(*enc, *encp);
18510 continue;
18511 }
18512 }
18513 tokadd(p, c);
18514#ifdef RIPPER
18515 top_of_line = (c == '\n');
18516#endif
18517 }
18518 terminate:
18519 if (*enc) *encp = *enc;
18520 return c;
18521}
18522
18523#define NEW_STRTERM(func, term, paren) new_strterm(p, func, term, paren)
18524
18525#ifdef RIPPER
18526static void
18527flush_string_content(struct parser_params *p, rb_encoding *enc)
18528{
18529 VALUE content = yylval.val;
18530 if (!ripper_is_node_yylval(p, content))
18531 content = ripper_new_yylval(p, 0, 0, content);
18532 if (has_delayed_token(p)) {
18533 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
18534 if (len > 0) {
18535 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
18536 }
18537 dispatch_delayed_token(p, tSTRING_CONTENT);
18538 p->lex.ptok = p->lex.pcur;
18539 RNODE_RIPPER(content)->nd_rval = yylval.val;
18540 }
18541 dispatch_scan_event(p, tSTRING_CONTENT);
18542 if (yylval.val != content)
18543 RNODE_RIPPER(content)->nd_rval = yylval.val;
18544 yylval.val = content;
18545}
18546#else
18547static void
18548flush_string_content(struct parser_params *p, rb_encoding *enc)
18549{
18550 if (has_delayed_token(p)) {
18551 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
18552 if (len > 0) {
18553 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
18554 p->delayed.end_line = p->ruby_sourceline;
18555 p->delayed.end_col = rb_long2int(p->lex.pcur - p->lex.pbeg);
18556 }
18557 dispatch_delayed_token(p, tSTRING_CONTENT);
18558 p->lex.ptok = p->lex.pcur;
18559 }
18560 dispatch_scan_event(p, tSTRING_CONTENT);
18561}
18562#endif
18563
18564RUBY_FUNC_EXPORTED const uint_least32_t ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
18565/* this can be shared with ripper, since it's independent from struct
18566 * parser_params. */
18567#ifndef RIPPER
18568#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
18569#define SPECIAL_PUNCT(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('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
18575 BIT('0', idx))
18576const uint_least32_t ruby_global_name_punct_bits[] = {
18577 SPECIAL_PUNCT(0),
18578 SPECIAL_PUNCT(1),
18579 SPECIAL_PUNCT(2),
18580};
18581#undef BIT
18582#undef SPECIAL_PUNCT
18583#endif
18584
18585static enum yytokentype
18586parser_peek_variable_name(struct parser_params *p)
18587{
18588 int c;
18589 const char *ptr = p->lex.pcur;
18590
18591 if (lex_eol_ptr_n_p(p, ptr, 1)) return 0;
18592 c = *ptr++;
18593 switch (c) {
18594 case '$':
18595 if ((c = *ptr) == '-') {
18596 if (lex_eol_ptr_p(p, ++ptr)) return 0;
18597 c = *ptr;
18598 }
18599 else if (is_global_name_punct(c) || ISDIGIT(c)) {
18600 return tSTRING_DVAR;
18601 }
18602 break;
18603 case '@':
18604 if ((c = *ptr) == '@') {
18605 if (lex_eol_ptr_p(p, ++ptr)) return 0;
18606 c = *ptr;
18607 }
18608 break;
18609 case '{':
18610 p->lex.pcur = ptr;
18611 p->command_start = TRUE;
18612 return tSTRING_DBEG;
18613 default:
18614 return 0;
18615 }
18616 if (!ISASCII(c) || c == '_' || ISALPHA(c))
18617 return tSTRING_DVAR;
18618 return 0;
18619}
18620
18621#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
18622#define IS_END() IS_lex_state(EXPR_END_ANY)
18623#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
18624#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
18625#define IS_LABEL_POSSIBLE() (\
18626 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
18627 IS_ARG())
18628#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
18629#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
18630
18631static inline enum yytokentype
18632parser_string_term(struct parser_params *p, int func)
18633{
18634 xfree(p->lex.strterm);
18635 p->lex.strterm = 0;
18636 if (func & STR_FUNC_REGEXP) {
18637 set_yylval_num(regx_options(p));
18638 dispatch_scan_event(p, tREGEXP_END);
18639 SET_LEX_STATE(EXPR_END);
18640 return tREGEXP_END;
18641 }
18642 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
18643 nextc(p);
18644 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
18645 return tLABEL_END;
18646 }
18647 SET_LEX_STATE(EXPR_END);
18648 return tSTRING_END;
18649}
18650
18651static enum yytokentype
18652parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
18653{
18654 int func = quote->func;
18655 int term = quote->term;
18656 int paren = quote->paren;
18657 int c, space = 0;
18658 rb_encoding *enc = p->enc;
18659 rb_encoding *base_enc = 0;
18660 VALUE lit;
18661
18662 if (func & STR_FUNC_TERM) {
18663 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
18664 SET_LEX_STATE(EXPR_END);
18665 xfree(p->lex.strterm);
18666 p->lex.strterm = 0;
18667 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
18668 }
18669 c = nextc(p);
18670 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
18671 while (c != '\n' && ISSPACE(c = nextc(p)));
18672 space = 1;
18673 }
18674 if (func & STR_FUNC_LIST) {
18675 quote->func &= ~STR_FUNC_LIST;
18676 space = 1;
18677 }
18678 if (c == term && !quote->nest) {
18679 if (func & STR_FUNC_QWORDS) {
18680 quote->func |= STR_FUNC_TERM;
18681 pushback(p, c); /* dispatch the term at tSTRING_END */
18682 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
18683 return ' ';
18684 }
18685 return parser_string_term(p, func);
18686 }
18687 if (space) {
18688 if (!ISSPACE(c)) pushback(p, c);
18689 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
18690 return ' ';
18691 }
18692 newtok(p);
18693 if ((func & STR_FUNC_EXPAND) && c == '#') {
18694 enum yytokentype t = parser_peek_variable_name(p);
18695 if (t) return t;
18696 tokadd(p, '#');
18697 c = nextc(p);
18698 }
18699 pushback(p, c);
18700 if (tokadd_string(p, func, term, paren, &quote->nest,
18701 &enc, &base_enc) == -1) {
18702 if (p->eofp) {
18703#ifndef RIPPER
18704# define unterminated_literal(mesg) yyerror0(mesg)
18705#else
18706# define unterminated_literal(mesg) compile_error(p, mesg)
18707#endif
18708 literal_flush(p, p->lex.pcur);
18709 if (func & STR_FUNC_QWORDS) {
18710 /* no content to add, bailing out here */
18711 unterminated_literal("unterminated list meets end of file");
18712 xfree(p->lex.strterm);
18713 p->lex.strterm = 0;
18714 return tSTRING_END;
18715 }
18716 if (func & STR_FUNC_REGEXP) {
18717 unterminated_literal("unterminated regexp meets end of file");
18718 }
18719 else {
18720 unterminated_literal("unterminated string meets end of file");
18721 }
18722 quote->func |= STR_FUNC_TERM;
18723 }
18724 }
18725
18726 tokfix(p);
18727 lit = STR_NEW3(tok(p), toklen(p), enc, func);
18728 set_yylval_str(lit);
18729 flush_string_content(p, enc);
18730
18731 return tSTRING_CONTENT;
18732}
18733
18734static enum yytokentype
18735heredoc_identifier(struct parser_params *p)
18736{
18737 /*
18738 * term_len is length of `<<"END"` except `END`,
18739 * in this case term_len is 4 (<, <, " and ").
18740 */
18741 long len, offset = p->lex.pcur - p->lex.pbeg;
18742 int c = nextc(p), term, func = 0, quote = 0;
18743 enum yytokentype token = tSTRING_BEG;
18744 int indent = 0;
18745
18746 if (c == '-') {
18747 c = nextc(p);
18748 func = STR_FUNC_INDENT;
18749 offset++;
18750 }
18751 else if (c == '~') {
18752 c = nextc(p);
18753 func = STR_FUNC_INDENT;
18754 offset++;
18755 indent = INT_MAX;
18756 }
18757 switch (c) {
18758 case '\'':
18759 func |= str_squote; goto quoted;
18760 case '"':
18761 func |= str_dquote; goto quoted;
18762 case '`':
18763 token = tXSTRING_BEG;
18764 func |= str_xquote; goto quoted;
18765
18766 quoted:
18767 quote++;
18768 offset++;
18769 term = c;
18770 len = 0;
18771 while ((c = nextc(p)) != term) {
18772 if (c == -1 || c == '\r' || c == '\n') {
18773 yyerror0("unterminated here document identifier");
18774 return -1;
18775 }
18776 }
18777 break;
18778
18779 default:
18780 if (!parser_is_identchar(p)) {
18781 pushback(p, c);
18782 if (func & STR_FUNC_INDENT) {
18783 pushback(p, indent > 0 ? '~' : '-');
18784 }
18785 return 0;
18786 }
18787 func |= str_dquote;
18788 do {
18789 int n = parser_precise_mbclen(p, p->lex.pcur-1);
18790 if (n < 0) return 0;
18791 p->lex.pcur += --n;
18792 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
18793 pushback(p, c);
18794 break;
18795 }
18796
18797 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
18798 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
18799 yyerror0("too long here document identifier");
18800 dispatch_scan_event(p, tHEREDOC_BEG);
18801 lex_goto_eol(p);
18802
18803 p->lex.strterm = new_heredoc(p);
18804 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
18805 here->offset = offset;
18806 here->sourceline = p->ruby_sourceline;
18807 here->length = (unsigned)len;
18808 here->quote = quote;
18809 here->func = func;
18810 here->lastline = p->lex.lastline;
18811 rb_ast_add_mark_object(p->ast, p->lex.lastline);
18812
18813 token_flush(p);
18814 p->heredoc_indent = indent;
18815 p->heredoc_line_indent = 0;
18816 return token;
18817}
18818
18819static void
18820heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
18821{
18822 VALUE line;
18823 rb_strterm_t *term = p->lex.strterm;
18824
18825 p->lex.strterm = 0;
18826 line = here->lastline;
18827 p->lex.lastline = line;
18828 p->lex.pbeg = RSTRING_PTR(line);
18829 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
18830 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
18831 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
18832 p->heredoc_end = p->ruby_sourceline;
18833 p->ruby_sourceline = (int)here->sourceline;
18834 if (p->eofp) p->lex.nextline = Qnil;
18835 p->eofp = 0;
18836 xfree(term);
18837 rb_ast_delete_mark_object(p->ast, line);
18838}
18839
18840static int
18841dedent_string(struct parser_params *p, VALUE string, int width)
18842{
18843 char *str;
18844 long len;
18845 int i, col = 0;
18846
18847 RSTRING_GETMEM(string, str, len);
18848 for (i = 0; i < len && col < width; i++) {
18849 if (str[i] == ' ') {
18850 col++;
18851 }
18852 else if (str[i] == '\t') {
18853 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
18854 if (n > width) break;
18855 col = n;
18856 }
18857 else {
18858 break;
18859 }
18860 }
18861 if (!i) return 0;
18862 rb_str_modify(string);
18863 str = RSTRING_PTR(string);
18864 if (RSTRING_LEN(string) != len)
18865 rb_fatal("literal string changed: %+"PRIsVALUE, string);
18866 MEMMOVE(str, str + i, char, len - i);
18867 rb_str_set_len(string, len - i);
18868 return i;
18869}
18870
18871#ifndef RIPPER
18872static NODE *
18873heredoc_dedent(struct parser_params *p, NODE *root)
18874{
18875 NODE *node, *str_node, *prev_node;
18876 int indent = p->heredoc_indent;
18877 VALUE prev_lit = 0;
18878
18879 if (indent <= 0) return root;
18880 p->heredoc_indent = 0;
18881 if (!root) return root;
18882
18883 prev_node = node = str_node = root;
18884 if (nd_type_p(root, NODE_LIST)) str_node = RNODE_LIST(root)->nd_head;
18885
18886 while (str_node) {
18887 VALUE lit = RNODE_LIT(str_node)->nd_lit;
18888 if (nd_fl_newline(str_node)) {
18889 dedent_string(p, lit, indent);
18890 }
18891 if (!prev_lit) {
18892 prev_lit = lit;
18893 }
18894 else if (!literal_concat0(p, prev_lit, lit)) {
18895 return 0;
18896 }
18897 else {
18898 NODE *end = RNODE_LIST(node)->as.nd_end;
18899 node = RNODE_LIST(prev_node)->nd_next = RNODE_LIST(node)->nd_next;
18900 if (!node) {
18901 if (nd_type_p(prev_node, NODE_DSTR))
18902 nd_set_type(prev_node, NODE_STR);
18903 break;
18904 }
18905 RNODE_LIST(node)->as.nd_end = end;
18906 goto next_str;
18907 }
18908
18909 str_node = 0;
18910 while ((nd_type_p(node, NODE_LIST) || nd_type_p(node, NODE_DSTR)) && (node = RNODE_LIST(prev_node = node)->nd_next) != 0) {
18911 next_str:
18912 if (!nd_type_p(node, NODE_LIST)) break;
18913 if ((str_node = RNODE_LIST(node)->nd_head) != 0) {
18914 enum node_type type = nd_type(str_node);
18915 if (type == NODE_STR || type == NODE_DSTR) break;
18916 prev_lit = 0;
18917 str_node = 0;
18918 }
18919 }
18920 }
18921 return root;
18922}
18923#else /* RIPPER */
18924static VALUE
18925heredoc_dedent(struct parser_params *p, VALUE array)
18926{
18927 int indent = p->heredoc_indent;
18928
18929 if (indent <= 0) return array;
18930 p->heredoc_indent = 0;
18931 dispatch2(heredoc_dedent, array, INT2NUM(indent));
18932 return array;
18933}
18934#endif
18935
18936static int
18937whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
18938{
18939 const char *beg = p->lex.pbeg;
18940 const char *ptr = p->lex.pend;
18941
18942 if (ptr - beg < len) return FALSE;
18943 if (ptr > beg && ptr[-1] == '\n') {
18944 if (--ptr > beg && ptr[-1] == '\r') --ptr;
18945 if (ptr - beg < len) return FALSE;
18946 }
18947 if (strncmp(eos, ptr -= len, len)) return FALSE;
18948 if (indent) {
18949 while (beg < ptr && ISSPACE(*beg)) beg++;
18950 }
18951 return beg == ptr;
18952}
18953
18954static int
18955word_match_p(struct parser_params *p, const char *word, long len)
18956{
18957 if (strncmp(p->lex.pcur, word, len)) return 0;
18958 if (lex_eol_n_p(p, len)) return 1;
18959 int c = (unsigned char)p->lex.pcur[len];
18960 if (ISSPACE(c)) return 1;
18961 switch (c) {
18962 case '\0': case '\004': case '\032': return 1;
18963 }
18964 return 0;
18965}
18966
18967#define NUM_SUFFIX_R (1<<0)
18968#define NUM_SUFFIX_I (1<<1)
18969#define NUM_SUFFIX_ALL 3
18970
18971static int
18972number_literal_suffix(struct parser_params *p, int mask)
18973{
18974 int c, result = 0;
18975 const char *lastp = p->lex.pcur;
18976
18977 while ((c = nextc(p)) != -1) {
18978 if ((mask & NUM_SUFFIX_I) && c == 'i') {
18979 result |= (mask & NUM_SUFFIX_I);
18980 mask &= ~NUM_SUFFIX_I;
18981 /* r after i, rational of complex is disallowed */
18982 mask &= ~NUM_SUFFIX_R;
18983 continue;
18984 }
18985 if ((mask & NUM_SUFFIX_R) && c == 'r') {
18986 result |= (mask & NUM_SUFFIX_R);
18987 mask &= ~NUM_SUFFIX_R;
18988 continue;
18989 }
18990 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
18991 p->lex.pcur = lastp;
18992 literal_flush(p, p->lex.pcur);
18993 return 0;
18994 }
18995 pushback(p, c);
18996 break;
18997 }
18998 return result;
18999}
19000
19001static enum yytokentype
19002set_number_literal(struct parser_params *p, VALUE v,
19003 enum yytokentype type, int suffix)
19004{
19005 if (suffix & NUM_SUFFIX_I) {
19006 v = rb_complex_raw(INT2FIX(0), v);
19007 type = tIMAGINARY;
19008 }
19009 set_yylval_literal(v);
19010 SET_LEX_STATE(EXPR_END);
19011 return type;
19012}
19013
19014static enum yytokentype
19015set_integer_literal(struct parser_params *p, VALUE v, int suffix)
19016{
19017 enum yytokentype type = tINTEGER;
19018 if (suffix & NUM_SUFFIX_R) {
19019 v = rb_rational_raw1(v);
19020 type = tRATIONAL;
19021 }
19022 return set_number_literal(p, v, type, suffix);
19023}
19024
19025#ifdef RIPPER
19026static void
19027dispatch_heredoc_end(struct parser_params *p)
19028{
19029 VALUE str;
19030 if (has_delayed_token(p))
19031 dispatch_delayed_token(p, tSTRING_CONTENT);
19032 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
19033 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
19034 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
19035 lex_goto_eol(p);
19036 token_flush(p);
19037}
19038
19039#else
19040#define dispatch_heredoc_end(p) parser_dispatch_heredoc_end(p, __LINE__)
19041static void
19042parser_dispatch_heredoc_end(struct parser_params *p, int line)
19043{
19044 if (has_delayed_token(p))
19045 dispatch_delayed_token(p, tSTRING_CONTENT);
19046
19047 if (p->keep_tokens) {
19048 VALUE str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
19049 RUBY_SET_YYLLOC_OF_HEREDOC_END(*p->yylloc);
19050 parser_append_tokens(p, str, tHEREDOC_END, line);
19051 }
19052
19053 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
19054 lex_goto_eol(p);
19055 token_flush(p);
19056}
19057#endif
19058
19059static enum yytokentype
19060here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
19061{
19062 int c, func, indent = 0;
19063 const char *eos, *ptr, *ptr_end;
19064 long len;
19065 VALUE str = 0;
19066 rb_encoding *enc = p->enc;
19067 rb_encoding *base_enc = 0;
19068 int bol;
19069
19070 eos = RSTRING_PTR(here->lastline) + here->offset;
19071 len = here->length;
19072 indent = (func = here->func) & STR_FUNC_INDENT;
19073
19074 if ((c = nextc(p)) == -1) {
19075 error:
19076#ifdef RIPPER
19077 if (!has_delayed_token(p)) {
19078 dispatch_scan_event(p, tSTRING_CONTENT);
19079 }
19080 else {
19081 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
19082 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
19083 int cr = ENC_CODERANGE_UNKNOWN;
19084 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
19085 if (cr != ENC_CODERANGE_7BIT &&
19086 rb_is_usascii_enc(p->enc) &&
19087 enc != rb_utf8_encoding()) {
19088 enc = rb_ascii8bit_encoding();
19089 }
19090 }
19091 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
19092 }
19093 dispatch_delayed_token(p, tSTRING_CONTENT);
19094 }
19095 lex_goto_eol(p);
19096#endif
19097 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19098 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
19099 (int)len, eos);
19100 token_flush(p);
19101 SET_LEX_STATE(EXPR_END);
19102 return tSTRING_END;
19103 }
19104 bol = was_bol(p);
19105 if (!bol) {
19106 /* not beginning of line, cannot be the terminator */
19107 }
19108 else if (p->heredoc_line_indent == -1) {
19109 /* `heredoc_line_indent == -1` means
19110 * - "after an interpolation in the same line", or
19111 * - "in a continuing line"
19112 */
19113 p->heredoc_line_indent = 0;
19114 }
19115 else if (whole_match_p(p, eos, len, indent)) {
19116 dispatch_heredoc_end(p);
19117 restore:
19118 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19119 token_flush(p);
19120 SET_LEX_STATE(EXPR_END);
19121 return tSTRING_END;
19122 }
19123
19124 if (!(func & STR_FUNC_EXPAND)) {
19125 do {
19126 ptr = RSTRING_PTR(p->lex.lastline);
19127 ptr_end = p->lex.pend;
19128 if (ptr_end > ptr) {
19129 switch (ptr_end[-1]) {
19130 case '\n':
19131 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
19132 ptr_end++;
19133 break;
19134 }
19135 case '\r':
19136 --ptr_end;
19137 }
19138 }
19139
19140 if (p->heredoc_indent > 0) {
19141 long i = 0;
19142 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
19143 i++;
19144 p->heredoc_line_indent = 0;
19145 }
19146
19147 if (str)
19148 rb_str_cat(str, ptr, ptr_end - ptr);
19149 else
19150 str = STR_NEW(ptr, ptr_end - ptr);
19151 if (!lex_eol_ptr_p(p, ptr_end)) rb_str_cat(str, "\n", 1);
19152 lex_goto_eol(p);
19153 if (p->heredoc_indent > 0) {
19154 goto flush_str;
19155 }
19156 if (nextc(p) == -1) {
19157 if (str) {
19158 str = 0;
19159 }
19160 goto error;
19161 }
19162 } while (!whole_match_p(p, eos, len, indent));
19163 }
19164 else {
19165 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
19166 newtok(p);
19167 if (c == '#') {
19168 enum yytokentype t = parser_peek_variable_name(p);
19169 if (p->heredoc_line_indent != -1) {
19170 if (p->heredoc_indent > p->heredoc_line_indent) {
19171 p->heredoc_indent = p->heredoc_line_indent;
19172 }
19173 p->heredoc_line_indent = -1;
19174 }
19175 if (t) return t;
19176 tokadd(p, '#');
19177 c = nextc(p);
19178 }
19179 do {
19180 pushback(p, c);
19181 enc = p->enc;
19182 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
19183 if (p->eofp) goto error;
19184 goto restore;
19185 }
19186 if (c != '\n') {
19187 if (c == '\\') p->heredoc_line_indent = -1;
19188 flush:
19189 str = STR_NEW3(tok(p), toklen(p), enc, func);
19190 flush_str:
19191 set_yylval_str(str);
19192#ifndef RIPPER
19193 if (bol) nd_set_fl_newline(yylval.node);
19194#endif
19195 flush_string_content(p, enc);
19196 return tSTRING_CONTENT;
19197 }
19198 tokadd(p, nextc(p));
19199 if (p->heredoc_indent > 0) {
19200 lex_goto_eol(p);
19201 goto flush;
19202 }
19203 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
19204 if ((c = nextc(p)) == -1) goto error;
19205 } while (!whole_match_p(p, eos, len, indent));
19206 str = STR_NEW3(tok(p), toklen(p), enc, func);
19207 }
19208 dispatch_heredoc_end(p);
19209#ifdef RIPPER
19210 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
19211 yylval.val, str);
19212#endif
19213 heredoc_restore(p, &p->lex.strterm->u.heredoc);
19214 token_flush(p);
19215 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
19216 set_yylval_str(str);
19217#ifndef RIPPER
19218 if (bol) nd_set_fl_newline(yylval.node);
19219#endif
19220 return tSTRING_CONTENT;
19221}
19222
19223#include "lex.c"
19224
19225static int
19226arg_ambiguous(struct parser_params *p, char c)
19227{
19228#ifndef RIPPER
19229 if (c == '/') {
19230 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
19231 }
19232 else {
19233 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
19234 }
19235#else
19236 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
19237#endif
19238 return TRUE;
19239}
19240
19241static ID
19242#ifndef RIPPER
19243formal_argument(struct parser_params *p, ID lhs)
19244#else
19245formal_argument(struct parser_params *p, VALUE lhs)
19246#endif
19247{
19248 ID id = get_id(lhs);
19249
19250 switch (id_type(id)) {
19251 case ID_LOCAL:
19252 break;
19253#ifndef RIPPER
19254# define ERR(mesg) yyerror0(mesg)
19255#else
19256# define ERR(mesg) (dispatch2(param_error, WARN_S(mesg), lhs), ripper_error(p))
19257#endif
19258 case ID_CONST:
19259 ERR("formal argument cannot be a constant");
19260 return 0;
19261 case ID_INSTANCE:
19262 ERR("formal argument cannot be an instance variable");
19263 return 0;
19264 case ID_GLOBAL:
19265 ERR("formal argument cannot be a global variable");
19266 return 0;
19267 case ID_CLASS:
19268 ERR("formal argument cannot be a class variable");
19269 return 0;
19270 default:
19271 ERR("formal argument must be local variable");
19272 return 0;
19273#undef ERR
19274 }
19275 shadowing_lvar(p, id);
19276 return lhs;
19277}
19278
19279static int
19280lvar_defined(struct parser_params *p, ID id)
19281{
19282 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
19283}
19284
19285/* emacsen -*- hack */
19286static long
19287parser_encode_length(struct parser_params *p, const char *name, long len)
19288{
19289 long nlen;
19290
19291 if (len > 5 && name[nlen = len - 5] == '-') {
19292 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
19293 return nlen;
19294 }
19295 if (len > 4 && name[nlen = len - 4] == '-') {
19296 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
19297 return nlen;
19298 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
19299 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
19300 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
19301 return nlen;
19302 }
19303 return len;
19304}
19305
19306static void
19307parser_set_encode(struct parser_params *p, const char *name)
19308{
19309 int idx = rb_enc_find_index(name);
19310 rb_encoding *enc;
19311 VALUE excargs[3];
19312
19313 if (idx < 0) {
19314 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
19315 error:
19316 excargs[0] = rb_eArgError;
19317 excargs[2] = rb_make_backtrace();
19318 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
19319 rb_exc_raise(rb_make_exception(3, excargs));
19320 }
19321 enc = rb_enc_from_index(idx);
19322 if (!rb_enc_asciicompat(enc)) {
19323 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
19324 goto error;
19325 }
19326 p->enc = enc;
19327#ifndef RIPPER
19328 if (p->debug_lines) {
19329 VALUE lines = p->debug_lines;
19330 long i, n = RARRAY_LEN(lines);
19331 for (i = 0; i < n; ++i) {
19332 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
19333 }
19334 }
19335#endif
19336}
19337
19338static int
19339comment_at_top(struct parser_params *p)
19340{
19341 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
19342 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
19343 while (ptr < ptr_end) {
19344 if (!ISSPACE(*ptr)) return 0;
19345 ptr++;
19346 }
19347 return 1;
19348}
19349
19350typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
19351typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
19352
19353static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
19354
19355static void
19356magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
19357{
19358 if (!comment_at_top(p)) {
19359 return;
19360 }
19361 parser_set_encode(p, val);
19362}
19363
19364static int
19365parser_get_bool(struct parser_params *p, const char *name, const char *val)
19366{
19367 switch (*val) {
19368 case 't': case 'T':
19369 if (STRCASECMP(val, "true") == 0) {
19370 return TRUE;
19371 }
19372 break;
19373 case 'f': case 'F':
19374 if (STRCASECMP(val, "false") == 0) {
19375 return FALSE;
19376 }
19377 break;
19378 }
19379 return parser_invalid_pragma_value(p, name, val);
19380}
19381
19382static int
19383parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
19384{
19385 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
19386 return -1;
19387}
19388
19389static void
19390parser_set_token_info(struct parser_params *p, const char *name, const char *val)
19391{
19392 int b = parser_get_bool(p, name, val);
19393 if (b >= 0) p->token_info_enabled = b;
19394}
19395
19396static void
19397parser_set_frozen_string_literal(struct parser_params *p, const char *name, const char *val)
19398{
19399 int b;
19400
19401 if (p->token_seen) {
19402 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
19403 return;
19404 }
19405
19406 b = parser_get_bool(p, name, val);
19407 if (b < 0) return;
19408
19409 p->frozen_string_literal = b;
19410}
19411
19412static void
19413parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
19414{
19415 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
19416 if (*s == ' ' || *s == '\t') continue;
19417 if (*s == '#') break;
19418 rb_warning1("`%s' is ignored unless in comment-only line", WARN_S(name));
19419 return;
19420 }
19421
19422 switch (*val) {
19423 case 'n': case 'N':
19424 if (STRCASECMP(val, "none") == 0) {
19425 p->ctxt.shareable_constant_value = shareable_none;
19426 return;
19427 }
19428 break;
19429 case 'l': case 'L':
19430 if (STRCASECMP(val, "literal") == 0) {
19431 p->ctxt.shareable_constant_value = shareable_literal;
19432 return;
19433 }
19434 break;
19435 case 'e': case 'E':
19436 if (STRCASECMP(val, "experimental_copy") == 0) {
19437 p->ctxt.shareable_constant_value = shareable_copy;
19438 return;
19439 }
19440 if (STRCASECMP(val, "experimental_everything") == 0) {
19441 p->ctxt.shareable_constant_value = shareable_everything;
19442 return;
19443 }
19444 break;
19445 }
19446 parser_invalid_pragma_value(p, name, val);
19447}
19448
19449# if WARN_PAST_SCOPE
19450static void
19451parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
19452{
19453 int b = parser_get_bool(p, name, val);
19454 if (b >= 0) p->past_scope_enabled = b;
19455}
19456# endif
19457
19459 const char *name;
19460 rb_magic_comment_setter_t func;
19461 rb_magic_comment_length_t length;
19462};
19463
19464static const struct magic_comment magic_comments[] = {
19465 {"coding", magic_comment_encoding, parser_encode_length},
19466 {"encoding", magic_comment_encoding, parser_encode_length},
19467 {"frozen_string_literal", parser_set_frozen_string_literal},
19468 {"shareable_constant_value", parser_set_shareable_constant_value},
19469 {"warn_indent", parser_set_token_info},
19470# if WARN_PAST_SCOPE
19471 {"warn_past_scope", parser_set_past_scope},
19472# endif
19473};
19474
19475static const char *
19476magic_comment_marker(const char *str, long len)
19477{
19478 long i = 2;
19479
19480 while (i < len) {
19481 switch (str[i]) {
19482 case '-':
19483 if (str[i-1] == '*' && str[i-2] == '-') {
19484 return str + i + 1;
19485 }
19486 i += 2;
19487 break;
19488 case '*':
19489 if (i + 1 >= len) return 0;
19490 if (str[i+1] != '-') {
19491 i += 4;
19492 }
19493 else if (str[i-1] != '-') {
19494 i += 2;
19495 }
19496 else {
19497 return str + i + 2;
19498 }
19499 break;
19500 default:
19501 i += 3;
19502 break;
19503 }
19504 }
19505 return 0;
19506}
19507
19508static int
19509parser_magic_comment(struct parser_params *p, const char *str, long len)
19510{
19511 int indicator = 0;
19512 VALUE name = 0, val = 0;
19513 const char *beg, *end, *vbeg, *vend;
19514#define str_copy(_s, _p, _n) ((_s) \
19515 ? (void)(rb_str_resize((_s), (_n)), \
19516 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
19517 : (void)((_s) = STR_NEW((_p), (_n))))
19518
19519 if (len <= 7) return FALSE;
19520 if (!!(beg = magic_comment_marker(str, len))) {
19521 if (!(end = magic_comment_marker(beg, str + len - beg)))
19522 return FALSE;
19523 indicator = TRUE;
19524 str = beg;
19525 len = end - beg - 3;
19526 }
19527
19528 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
19529 while (len > 0) {
19530 const struct magic_comment *mc = magic_comments;
19531 char *s;
19532 int i;
19533 long n = 0;
19534
19535 for (; len > 0 && *str; str++, --len) {
19536 switch (*str) {
19537 case '\'': case '"': case ':': case ';':
19538 continue;
19539 }
19540 if (!ISSPACE(*str)) break;
19541 }
19542 for (beg = str; len > 0; str++, --len) {
19543 switch (*str) {
19544 case '\'': case '"': case ':': case ';':
19545 break;
19546 default:
19547 if (ISSPACE(*str)) break;
19548 continue;
19549 }
19550 break;
19551 }
19552 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
19553 if (!len) break;
19554 if (*str != ':') {
19555 if (!indicator) return FALSE;
19556 continue;
19557 }
19558
19559 do str++; while (--len > 0 && ISSPACE(*str));
19560 if (!len) break;
19561 if (*str == '"') {
19562 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
19563 if (*str == '\\') {
19564 --len;
19565 ++str;
19566 }
19567 }
19568 vend = str;
19569 if (len) {
19570 --len;
19571 ++str;
19572 }
19573 }
19574 else {
19575 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
19576 vend = str;
19577 }
19578 if (indicator) {
19579 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
19580 }
19581 else {
19582 while (len > 0 && (ISSPACE(*str))) --len, str++;
19583 if (len) return FALSE;
19584 }
19585
19586 n = end - beg;
19587 str_copy(name, beg, n);
19588 s = RSTRING_PTR(name);
19589 for (i = 0; i < n; ++i) {
19590 if (s[i] == '-') s[i] = '_';
19591 }
19592 do {
19593 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
19594 n = vend - vbeg;
19595 if (mc->length) {
19596 n = (*mc->length)(p, vbeg, n);
19597 }
19598 str_copy(val, vbeg, n);
19599 (*mc->func)(p, mc->name, RSTRING_PTR(val));
19600 break;
19601 }
19602 } while (++mc < magic_comments + numberof(magic_comments));
19603#ifdef RIPPER
19604 str_copy(val, vbeg, vend - vbeg);
19605 dispatch2(magic_comment, name, val);
19606#endif
19607 }
19608
19609 return TRUE;
19610}
19611
19612static void
19613set_file_encoding(struct parser_params *p, const char *str, const char *send)
19614{
19615 int sep = 0;
19616 const char *beg = str;
19617 VALUE s;
19618
19619 for (;;) {
19620 if (send - str <= 6) return;
19621 switch (str[6]) {
19622 case 'C': case 'c': str += 6; continue;
19623 case 'O': case 'o': str += 5; continue;
19624 case 'D': case 'd': str += 4; continue;
19625 case 'I': case 'i': str += 3; continue;
19626 case 'N': case 'n': str += 2; continue;
19627 case 'G': case 'g': str += 1; continue;
19628 case '=': case ':':
19629 sep = 1;
19630 str += 6;
19631 break;
19632 default:
19633 str += 6;
19634 if (ISSPACE(*str)) break;
19635 continue;
19636 }
19637 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
19638 sep = 0;
19639 }
19640 for (;;) {
19641 do {
19642 if (++str >= send) return;
19643 } while (ISSPACE(*str));
19644 if (sep) break;
19645 if (*str != '=' && *str != ':') return;
19646 sep = 1;
19647 str++;
19648 }
19649 beg = str;
19650 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
19651 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
19652 parser_set_encode(p, RSTRING_PTR(s));
19653 rb_str_resize(s, 0);
19654}
19655
19656static void
19657parser_prepare(struct parser_params *p)
19658{
19659 int c = nextc0(p, FALSE);
19660 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
19661 switch (c) {
19662 case '#':
19663 if (peek(p, '!')) p->has_shebang = 1;
19664 break;
19665 case 0xef: /* UTF-8 BOM marker */
19666 if (!lex_eol_n_p(p, 2) &&
19667 (unsigned char)p->lex.pcur[0] == 0xbb &&
19668 (unsigned char)p->lex.pcur[1] == 0xbf) {
19669 p->enc = rb_utf8_encoding();
19670 p->lex.pcur += 2;
19671#ifndef RIPPER
19672 if (p->debug_lines) {
19673 rb_enc_associate(p->lex.lastline, p->enc);
19674 }
19675#endif
19676 p->lex.pbeg = p->lex.pcur;
19677 token_flush(p);
19678 return;
19679 }
19680 break;
19681 case EOF:
19682 return;
19683 }
19684 pushback(p, c);
19685 p->enc = rb_enc_get(p->lex.lastline);
19686}
19687
19688#ifndef RIPPER
19689#define ambiguous_operator(tok, op, syn) ( \
19690 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
19691 rb_warning0("even though it seems like "syn""))
19692#else
19693#define ambiguous_operator(tok, op, syn) \
19694 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
19695#endif
19696#define warn_balanced(tok, op, syn) ((void) \
19697 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
19698 space_seen && !ISSPACE(c) && \
19699 (ambiguous_operator(tok, op, syn), 0)), \
19700 (enum yytokentype)(tok))
19701
19702static VALUE
19703parse_rational(struct parser_params *p, char *str, int len, int seen_point)
19704{
19705 VALUE v;
19706 char *point = &str[seen_point];
19707 size_t fraclen = len-seen_point-1;
19708 memmove(point, point+1, fraclen+1);
19709 v = rb_cstr_to_inum(str, 10, FALSE);
19710 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
19711}
19712
19713static enum yytokentype
19714no_digits(struct parser_params *p)
19715{
19716 yyerror0("numeric literal without digits");
19717 if (peek(p, '_')) nextc(p);
19718 /* dummy 0, for tUMINUS_NUM at numeric */
19719 return set_integer_literal(p, INT2FIX(0), 0);
19720}
19721
19722static enum yytokentype
19723parse_numeric(struct parser_params *p, int c)
19724{
19725 int is_float, seen_point, seen_e, nondigit;
19726 int suffix;
19727
19728 is_float = seen_point = seen_e = nondigit = 0;
19729 SET_LEX_STATE(EXPR_END);
19730 newtok(p);
19731 if (c == '-' || c == '+') {
19732 tokadd(p, c);
19733 c = nextc(p);
19734 }
19735 if (c == '0') {
19736 int start = toklen(p);
19737 c = nextc(p);
19738 if (c == 'x' || c == 'X') {
19739 /* hexadecimal */
19740 c = nextc(p);
19741 if (c != -1 && ISXDIGIT(c)) {
19742 do {
19743 if (c == '_') {
19744 if (nondigit) break;
19745 nondigit = c;
19746 continue;
19747 }
19748 if (!ISXDIGIT(c)) break;
19749 nondigit = 0;
19750 tokadd(p, c);
19751 } while ((c = nextc(p)) != -1);
19752 }
19753 pushback(p, c);
19754 tokfix(p);
19755 if (toklen(p) == start) {
19756 return no_digits(p);
19757 }
19758 else if (nondigit) goto trailing_uc;
19759 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19760 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
19761 }
19762 if (c == 'b' || c == 'B') {
19763 /* binary */
19764 c = nextc(p);
19765 if (c == '0' || c == '1') {
19766 do {
19767 if (c == '_') {
19768 if (nondigit) break;
19769 nondigit = c;
19770 continue;
19771 }
19772 if (c != '0' && c != '1') break;
19773 nondigit = 0;
19774 tokadd(p, c);
19775 } while ((c = nextc(p)) != -1);
19776 }
19777 pushback(p, c);
19778 tokfix(p);
19779 if (toklen(p) == start) {
19780 return no_digits(p);
19781 }
19782 else if (nondigit) goto trailing_uc;
19783 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19784 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
19785 }
19786 if (c == 'd' || c == 'D') {
19787 /* decimal */
19788 c = nextc(p);
19789 if (c != -1 && ISDIGIT(c)) {
19790 do {
19791 if (c == '_') {
19792 if (nondigit) break;
19793 nondigit = c;
19794 continue;
19795 }
19796 if (!ISDIGIT(c)) break;
19797 nondigit = 0;
19798 tokadd(p, c);
19799 } while ((c = nextc(p)) != -1);
19800 }
19801 pushback(p, c);
19802 tokfix(p);
19803 if (toklen(p) == start) {
19804 return no_digits(p);
19805 }
19806 else if (nondigit) goto trailing_uc;
19807 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19808 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
19809 }
19810 if (c == '_') {
19811 /* 0_0 */
19812 goto octal_number;
19813 }
19814 if (c == 'o' || c == 'O') {
19815 /* prefixed octal */
19816 c = nextc(p);
19817 if (c == -1 || c == '_' || !ISDIGIT(c)) {
19818 return no_digits(p);
19819 }
19820 }
19821 if (c >= '0' && c <= '7') {
19822 /* octal */
19823 octal_number:
19824 do {
19825 if (c == '_') {
19826 if (nondigit) break;
19827 nondigit = c;
19828 continue;
19829 }
19830 if (c < '0' || c > '9') break;
19831 if (c > '7') goto invalid_octal;
19832 nondigit = 0;
19833 tokadd(p, c);
19834 } while ((c = nextc(p)) != -1);
19835 if (toklen(p) > start) {
19836 pushback(p, c);
19837 tokfix(p);
19838 if (nondigit) goto trailing_uc;
19839 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19840 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
19841 }
19842 if (nondigit) {
19843 pushback(p, c);
19844 goto trailing_uc;
19845 }
19846 }
19847 if (c > '7' && c <= '9') {
19848 invalid_octal:
19849 yyerror0("Invalid octal digit");
19850 }
19851 else if (c == '.' || c == 'e' || c == 'E') {
19852 tokadd(p, '0');
19853 }
19854 else {
19855 pushback(p, c);
19856 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19857 return set_integer_literal(p, INT2FIX(0), suffix);
19858 }
19859 }
19860
19861 for (;;) {
19862 switch (c) {
19863 case '0': case '1': case '2': case '3': case '4':
19864 case '5': case '6': case '7': case '8': case '9':
19865 nondigit = 0;
19866 tokadd(p, c);
19867 break;
19868
19869 case '.':
19870 if (nondigit) goto trailing_uc;
19871 if (seen_point || seen_e) {
19872 goto decode_num;
19873 }
19874 else {
19875 int c0 = nextc(p);
19876 if (c0 == -1 || !ISDIGIT(c0)) {
19877 pushback(p, c0);
19878 goto decode_num;
19879 }
19880 c = c0;
19881 }
19882 seen_point = toklen(p);
19883 tokadd(p, '.');
19884 tokadd(p, c);
19885 is_float++;
19886 nondigit = 0;
19887 break;
19888
19889 case 'e':
19890 case 'E':
19891 if (nondigit) {
19892 pushback(p, c);
19893 c = nondigit;
19894 goto decode_num;
19895 }
19896 if (seen_e) {
19897 goto decode_num;
19898 }
19899 nondigit = c;
19900 c = nextc(p);
19901 if (c != '-' && c != '+' && !ISDIGIT(c)) {
19902 pushback(p, c);
19903 c = nondigit;
19904 nondigit = 0;
19905 goto decode_num;
19906 }
19907 tokadd(p, nondigit);
19908 seen_e++;
19909 is_float++;
19910 tokadd(p, c);
19911 nondigit = (c == '-' || c == '+') ? c : 0;
19912 break;
19913
19914 case '_': /* `_' in number just ignored */
19915 if (nondigit) goto decode_num;
19916 nondigit = c;
19917 break;
19918
19919 default:
19920 goto decode_num;
19921 }
19922 c = nextc(p);
19923 }
19924
19925 decode_num:
19926 pushback(p, c);
19927 if (nondigit) {
19928 trailing_uc:
19929 literal_flush(p, p->lex.pcur - 1);
19930 YYLTYPE loc = RUBY_INIT_YYLLOC();
19931 compile_error(p, "trailing `%c' in number", nondigit);
19932 parser_show_error_line(p, &loc);
19933 }
19934 tokfix(p);
19935 if (is_float) {
19936 enum yytokentype type = tFLOAT;
19937 VALUE v;
19938
19939 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
19940 if (suffix & NUM_SUFFIX_R) {
19941 type = tRATIONAL;
19942 v = parse_rational(p, tok(p), toklen(p), seen_point);
19943 }
19944 else {
19945 double d = strtod(tok(p), 0);
19946 if (errno == ERANGE) {
19947 rb_warning1("Float %s out of range", WARN_S(tok(p)));
19948 errno = 0;
19949 }
19950 v = DBL2NUM(d);
19951 }
19952 return set_number_literal(p, v, type, suffix);
19953 }
19954 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19955 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
19956}
19957
19958static enum yytokentype
19959parse_qmark(struct parser_params *p, int space_seen)
19960{
19961 rb_encoding *enc;
19962 register int c;
19963 VALUE lit;
19964
19965 if (IS_END()) {
19966 SET_LEX_STATE(EXPR_VALUE);
19967 return '?';
19968 }
19969 c = nextc(p);
19970 if (c == -1) {
19971 compile_error(p, "incomplete character syntax");
19972 return 0;
19973 }
19974 if (rb_enc_isspace(c, p->enc)) {
19975 if (!IS_ARG()) {
19976 int c2 = escaped_control_code(c);
19977 if (c2) {
19978 WARN_SPACE_CHAR(c2, "?");
19979 }
19980 }
19981 ternary:
19982 pushback(p, c);
19983 SET_LEX_STATE(EXPR_VALUE);
19984 return '?';
19985 }
19986 newtok(p);
19987 enc = p->enc;
19988 if (!parser_isascii(p)) {
19989 if (tokadd_mbchar(p, c) == -1) return 0;
19990 }
19991 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
19992 !lex_eol_p(p) && is_identchar(p, p->lex.pcur, p->lex.pend, p->enc)) {
19993 if (space_seen) {
19994 const char *start = p->lex.pcur - 1, *ptr = start;
19995 do {
19996 int n = parser_precise_mbclen(p, ptr);
19997 if (n < 0) return -1;
19998 ptr += n;
19999 } while (!lex_eol_ptr_p(p, ptr) && is_identchar(p, ptr, p->lex.pend, p->enc));
20000 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
20001 " a conditional operator, put a space after `?'",
20002 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
20003 }
20004 goto ternary;
20005 }
20006 else if (c == '\\') {
20007 if (peek(p, 'u')) {
20008 nextc(p);
20009 enc = rb_utf8_encoding();
20010 tokadd_utf8(p, &enc, -1, 0, 0);
20011 }
20012 else if (!ISASCII(c = peekc(p))) {
20013 nextc(p);
20014 if (tokadd_mbchar(p, c) == -1) return 0;
20015 }
20016 else {
20017 c = read_escape(p, 0);
20018 tokadd(p, c);
20019 }
20020 }
20021 else {
20022 tokadd(p, c);
20023 }
20024 tokfix(p);
20025 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
20026 set_yylval_str(lit);
20027 SET_LEX_STATE(EXPR_END);
20028 return tCHAR;
20029}
20030
20031static enum yytokentype
20032parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
20033{
20034 register int c;
20035 const char *ptok = p->lex.pcur;
20036
20037 if (IS_BEG()) {
20038 int term;
20039 int paren;
20040
20041 c = nextc(p);
20042 quotation:
20043 if (c == -1) goto unterminated;
20044 if (!ISALNUM(c)) {
20045 term = c;
20046 if (!ISASCII(c)) goto unknown;
20047 c = 'Q';
20048 }
20049 else {
20050 term = nextc(p);
20051 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
20052 unknown:
20053 pushback(p, term);
20054 c = parser_precise_mbclen(p, p->lex.pcur);
20055 if (c < 0) return 0;
20056 p->lex.pcur += c;
20057 yyerror0("unknown type of %string");
20058 return 0;
20059 }
20060 }
20061 if (term == -1) {
20062 unterminated:
20063 compile_error(p, "unterminated quoted string meets end of file");
20064 return 0;
20065 }
20066 paren = term;
20067 if (term == '(') term = ')';
20068 else if (term == '[') term = ']';
20069 else if (term == '{') term = '}';
20070 else if (term == '<') term = '>';
20071 else paren = 0;
20072
20073 p->lex.ptok = ptok-1;
20074 switch (c) {
20075 case 'Q':
20076 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
20077 return tSTRING_BEG;
20078
20079 case 'q':
20080 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
20081 return tSTRING_BEG;
20082
20083 case 'W':
20084 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20085 return tWORDS_BEG;
20086
20087 case 'w':
20088 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20089 return tQWORDS_BEG;
20090
20091 case 'I':
20092 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
20093 return tSYMBOLS_BEG;
20094
20095 case 'i':
20096 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
20097 return tQSYMBOLS_BEG;
20098
20099 case 'x':
20100 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
20101 return tXSTRING_BEG;
20102
20103 case 'r':
20104 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
20105 return tREGEXP_BEG;
20106
20107 case 's':
20108 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
20109 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
20110 return tSYMBEG;
20111
20112 default:
20113 yyerror0("unknown type of %string");
20114 return 0;
20115 }
20116 }
20117 if ((c = nextc(p)) == '=') {
20118 set_yylval_id('%');
20119 SET_LEX_STATE(EXPR_BEG);
20120 return tOP_ASGN;
20121 }
20122 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
20123 goto quotation;
20124 }
20125 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20126 pushback(p, c);
20127 return warn_balanced('%', "%%", "string literal");
20128}
20129
20130static int
20131tokadd_ident(struct parser_params *p, int c)
20132{
20133 do {
20134 if (tokadd_mbchar(p, c) == -1) return -1;
20135 c = nextc(p);
20136 } while (parser_is_identchar(p));
20137 pushback(p, c);
20138 return 0;
20139}
20140
20141static ID
20142tokenize_ident(struct parser_params *p)
20143{
20144 ID ident = TOK_INTERN();
20145
20146 set_yylval_name(ident);
20147
20148 return ident;
20149}
20150
20151static int
20152parse_numvar(struct parser_params *p)
20153{
20154 size_t len;
20155 int overflow;
20156 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
20157 const unsigned long nth_ref_max =
20158 ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
20159 /* NTH_REF is left-shifted to be ORed with back-ref flag and
20160 * turned into a Fixnum, in compile.c */
20161
20162 if (overflow || n > nth_ref_max) {
20163 /* compile_error()? */
20164 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
20165 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
20166 }
20167 else {
20168 return (int)n;
20169 }
20170}
20171
20172static enum yytokentype
20173parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
20174{
20175 const char *ptr = p->lex.pcur;
20176 register int c;
20177
20178 SET_LEX_STATE(EXPR_END);
20179 p->lex.ptok = ptr - 1; /* from '$' */
20180 newtok(p);
20181 c = nextc(p);
20182 switch (c) {
20183 case '_': /* $_: last read line string */
20184 c = nextc(p);
20185 if (parser_is_identchar(p)) {
20186 tokadd(p, '$');
20187 tokadd(p, '_');
20188 break;
20189 }
20190 pushback(p, c);
20191 c = '_';
20192 /* fall through */
20193 case '~': /* $~: match-data */
20194 case '*': /* $*: argv */
20195 case '$': /* $$: pid */
20196 case '?': /* $?: last status */
20197 case '!': /* $!: error string */
20198 case '@': /* $@: error position */
20199 case '/': /* $/: input record separator */
20200 case '\\': /* $\: output record separator */
20201 case ';': /* $;: field separator */
20202 case ',': /* $,: output field separator */
20203 case '.': /* $.: last read line number */
20204 case '=': /* $=: ignorecase */
20205 case ':': /* $:: load path */
20206 case '<': /* $<: reading filename */
20207 case '>': /* $>: default output handle */
20208 case '\"': /* $": already loaded files */
20209 tokadd(p, '$');
20210 tokadd(p, c);
20211 goto gvar;
20212
20213 case '-':
20214 tokadd(p, '$');
20215 tokadd(p, c);
20216 c = nextc(p);
20217 if (parser_is_identchar(p)) {
20218 if (tokadd_mbchar(p, c) == -1) return 0;
20219 }
20220 else {
20221 pushback(p, c);
20222 pushback(p, '-');
20223 return '$';
20224 }
20225 gvar:
20226 set_yylval_name(TOK_INTERN());
20227 return tGVAR;
20228
20229 case '&': /* $&: last match */
20230 case '`': /* $`: string before last match */
20231 case '\'': /* $': string after last match */
20232 case '+': /* $+: string matches last paren. */
20233 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
20234 tokadd(p, '$');
20235 tokadd(p, c);
20236 goto gvar;
20237 }
20238 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
20239 return tBACK_REF;
20240
20241 case '1': case '2': case '3':
20242 case '4': case '5': case '6':
20243 case '7': case '8': case '9':
20244 tokadd(p, '$');
20245 do {
20246 tokadd(p, c);
20247 c = nextc(p);
20248 } while (c != -1 && ISDIGIT(c));
20249 pushback(p, c);
20250 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
20251 tokfix(p);
20252 c = parse_numvar(p);
20253 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
20254 return tNTH_REF;
20255
20256 default:
20257 if (!parser_is_identchar(p)) {
20258 YYLTYPE loc = RUBY_INIT_YYLLOC();
20259 if (c == -1 || ISSPACE(c)) {
20260 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
20261 }
20262 else {
20263 pushback(p, c);
20264 compile_error(p, "`$%c' is not allowed as a global variable name", c);
20265 }
20266 parser_show_error_line(p, &loc);
20267 set_yylval_noname();
20268 return tGVAR;
20269 }
20270 /* fall through */
20271 case '0':
20272 tokadd(p, '$');
20273 }
20274
20275 if (tokadd_ident(p, c)) return 0;
20276 SET_LEX_STATE(EXPR_END);
20277 if (VALID_SYMNAME_P(tok(p), toklen(p), p->enc, ID_GLOBAL)) {
20278 tokenize_ident(p);
20279 }
20280 else {
20281 compile_error(p, "`%.*s' is not allowed as a global variable name", toklen(p), tok(p));
20282 set_yylval_noname();
20283 }
20284 return tGVAR;
20285}
20286
20287#ifndef RIPPER
20288static bool
20289parser_numbered_param(struct parser_params *p, int n)
20290{
20291 if (n < 0) return false;
20292
20293 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
20294 return false;
20295 }
20296 if (p->max_numparam == ORDINAL_PARAM) {
20297 compile_error(p, "ordinary parameter is defined");
20298 return false;
20299 }
20300 struct vtable *args = p->lvtbl->args;
20301 if (p->max_numparam < n) {
20302 p->max_numparam = n;
20303 }
20304 while (n > args->pos) {
20305 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
20306 }
20307 return true;
20308}
20309#endif
20310
20311static enum yytokentype
20312parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
20313{
20314 const char *ptr = p->lex.pcur;
20315 enum yytokentype result = tIVAR;
20316 register int c = nextc(p);
20317 YYLTYPE loc;
20318
20319 p->lex.ptok = ptr - 1; /* from '@' */
20320 newtok(p);
20321 tokadd(p, '@');
20322 if (c == '@') {
20323 result = tCVAR;
20324 tokadd(p, '@');
20325 c = nextc(p);
20326 }
20327 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
20328 if (c == -1 || !parser_is_identchar(p)) {
20329 pushback(p, c);
20330 RUBY_SET_YYLLOC(loc);
20331 if (result == tIVAR) {
20332 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
20333 }
20334 else {
20335 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
20336 }
20337 parser_show_error_line(p, &loc);
20338 set_yylval_noname();
20339 SET_LEX_STATE(EXPR_END);
20340 return result;
20341 }
20342 else if (ISDIGIT(c)) {
20343 pushback(p, c);
20344 RUBY_SET_YYLLOC(loc);
20345 if (result == tIVAR) {
20346 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
20347 }
20348 else {
20349 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
20350 }
20351 parser_show_error_line(p, &loc);
20352 set_yylval_noname();
20353 SET_LEX_STATE(EXPR_END);
20354 return result;
20355 }
20356
20357 if (tokadd_ident(p, c)) return 0;
20358 tokenize_ident(p);
20359 return result;
20360}
20361
20362static enum yytokentype
20363parse_ident(struct parser_params *p, int c, int cmd_state)
20364{
20365 enum yytokentype result;
20366 int mb = ENC_CODERANGE_7BIT;
20367 const enum lex_state_e last_state = p->lex.state;
20368 ID ident;
20369 int enforce_keyword_end = 0;
20370
20371 do {
20372 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
20373 if (tokadd_mbchar(p, c) == -1) return 0;
20374 c = nextc(p);
20375 } while (parser_is_identchar(p));
20376 if ((c == '!' || c == '?') && !peek(p, '=')) {
20377 result = tFID;
20378 tokadd(p, c);
20379 }
20380 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
20381 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
20382 result = tIDENTIFIER;
20383 tokadd(p, c);
20384 }
20385 else {
20386 result = tCONSTANT; /* assume provisionally */
20387 pushback(p, c);
20388 }
20389 tokfix(p);
20390
20391 if (IS_LABEL_POSSIBLE()) {
20392 if (IS_LABEL_SUFFIX(0)) {
20393 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
20394 nextc(p);
20395 set_yylval_name(TOK_INTERN());
20396 return tLABEL;
20397 }
20398 }
20399
20400#ifndef RIPPER
20401 if (!NIL_P(peek_end_expect_token_locations(p))) {
20402 VALUE end_loc;
20403 int lineno, column;
20404 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
20405
20406 end_loc = peek_end_expect_token_locations(p);
20407 lineno = NUM2INT(rb_ary_entry(end_loc, 0));
20408 column = NUM2INT(rb_ary_entry(end_loc, 1));
20409
20410 if (p->debug) {
20411 rb_parser_printf(p, "enforce_keyword_end check. current: (%d, %d), peek: (%d, %d)\n",
20412 p->ruby_sourceline, beg_pos, lineno, column);
20413 }
20414
20415 if ((p->ruby_sourceline > lineno) && (beg_pos <= column)) {
20416 const struct kwtable *kw;
20417
20418 if ((IS_lex_state(EXPR_DOT)) && (kw = rb_reserved_word(tok(p), toklen(p))) && (kw && kw->id[0] == keyword_end)) {
20419 if (p->debug) rb_parser_printf(p, "enforce_keyword_end is enabled\n");
20420 enforce_keyword_end = 1;
20421 }
20422 }
20423 }
20424#endif
20425
20426 if (mb == ENC_CODERANGE_7BIT && (!IS_lex_state(EXPR_DOT) || enforce_keyword_end)) {
20427 const struct kwtable *kw;
20428
20429 /* See if it is a reserved word. */
20430 kw = rb_reserved_word(tok(p), toklen(p));
20431 if (kw) {
20432 enum lex_state_e state = p->lex.state;
20433 if (IS_lex_state_for(state, EXPR_FNAME)) {
20434 SET_LEX_STATE(EXPR_ENDFN);
20435 set_yylval_name(rb_intern2(tok(p), toklen(p)));
20436 return kw->id[0];
20437 }
20438 SET_LEX_STATE(kw->state);
20439 if (IS_lex_state(EXPR_BEG)) {
20440 p->command_start = TRUE;
20441 }
20442 if (kw->id[0] == keyword_do) {
20443 if (lambda_beginning_p()) {
20444 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
20445 return keyword_do_LAMBDA;
20446 }
20447 if (COND_P()) return keyword_do_cond;
20448 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
20449 return keyword_do_block;
20450 return keyword_do;
20451 }
20452 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED | EXPR_CLASS)))
20453 return kw->id[0];
20454 else {
20455 if (kw->id[0] != kw->id[1])
20456 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
20457 return kw->id[1];
20458 }
20459 }
20460 }
20461
20462 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
20463 if (cmd_state) {
20464 SET_LEX_STATE(EXPR_CMDARG);
20465 }
20466 else {
20467 SET_LEX_STATE(EXPR_ARG);
20468 }
20469 }
20470 else if (p->lex.state == EXPR_FNAME) {
20471 SET_LEX_STATE(EXPR_ENDFN);
20472 }
20473 else {
20474 SET_LEX_STATE(EXPR_END);
20475 }
20476
20477 ident = tokenize_ident(p);
20478 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
20479 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
20480 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
20481 (lvar_defined(p, ident) || NUMPARAM_ID_P(ident))) {
20482 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
20483 }
20484 return result;
20485}
20486
20487static void
20488warn_cr(struct parser_params *p)
20489{
20490 if (!p->cr_seen) {
20491 p->cr_seen = TRUE;
20492 /* carried over with p->lex.nextline for nextc() */
20493 rb_warn0("encountered \\r in middle of line, treated as a mere space");
20494 }
20495}
20496
20497static enum yytokentype
20498parser_yylex(struct parser_params *p)
20499{
20500 register int c;
20501 int space_seen = 0;
20502 int cmd_state;
20503 int label;
20504 enum lex_state_e last_state;
20505 int fallthru = FALSE;
20506 int token_seen = p->token_seen;
20507
20508 if (p->lex.strterm) {
20509 if (strterm_is_heredoc(p->lex.strterm)) {
20510 token_flush(p);
20511 return here_document(p, &p->lex.strterm->u.heredoc);
20512 }
20513 else {
20514 token_flush(p);
20515 return parse_string(p, &p->lex.strterm->u.literal);
20516 }
20517 }
20518 cmd_state = p->command_start;
20519 p->command_start = FALSE;
20520 p->token_seen = TRUE;
20521#ifndef RIPPER
20522 token_flush(p);
20523#endif
20524 retry:
20525 last_state = p->lex.state;
20526 switch (c = nextc(p)) {
20527 case '\0': /* NUL */
20528 case '\004': /* ^D */
20529 case '\032': /* ^Z */
20530 case -1: /* end of script. */
20531 p->eofp = 1;
20532#ifndef RIPPER
20533 if (!NIL_P(p->end_expect_token_locations) && RARRAY_LEN(p->end_expect_token_locations) > 0) {
20534 pop_end_expect_token_locations(p);
20535 RUBY_SET_YYLLOC_OF_DUMMY_END(*p->yylloc);
20536 return tDUMNY_END;
20537 }
20538#endif
20539 /* Set location for end-of-input because dispatch_scan_event is not called. */
20540 RUBY_SET_YYLLOC(*p->yylloc);
20541 return END_OF_INPUT;
20542
20543 /* white spaces */
20544 case '\r':
20545 warn_cr(p);
20546 /* fall through */
20547 case ' ': case '\t': case '\f':
20548 case '\13': /* '\v' */
20549 space_seen = 1;
20550 while ((c = nextc(p))) {
20551 switch (c) {
20552 case '\r':
20553 warn_cr(p);
20554 /* fall through */
20555 case ' ': case '\t': case '\f':
20556 case '\13': /* '\v' */
20557 break;
20558 default:
20559 goto outofloop;
20560 }
20561 }
20562 outofloop:
20563 pushback(p, c);
20564 dispatch_scan_event(p, tSP);
20565#ifndef RIPPER
20566 token_flush(p);
20567#endif
20568 goto retry;
20569
20570 case '#': /* it's a comment */
20571 p->token_seen = token_seen;
20572 /* no magic_comment in shebang line */
20573 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
20574 if (comment_at_top(p)) {
20575 set_file_encoding(p, p->lex.pcur, p->lex.pend);
20576 }
20577 }
20578 lex_goto_eol(p);
20579 dispatch_scan_event(p, tCOMMENT);
20580 fallthru = TRUE;
20581 /* fall through */
20582 case '\n':
20583 p->token_seen = token_seen;
20584 VALUE prevline = p->lex.lastline;
20585 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
20586 !IS_lex_state(EXPR_LABELED));
20587 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
20588 if (!fallthru) {
20589 dispatch_scan_event(p, tIGNORED_NL);
20590 }
20591 fallthru = FALSE;
20592 if (!c && p->ctxt.in_kwarg) {
20593 goto normal_newline;
20594 }
20595 goto retry;
20596 }
20597 while (1) {
20598 switch (c = nextc(p)) {
20599 case ' ': case '\t': case '\f': case '\r':
20600 case '\13': /* '\v' */
20601 space_seen = 1;
20602 break;
20603 case '#':
20604 pushback(p, c);
20605 if (space_seen) {
20606 dispatch_scan_event(p, tSP);
20607 token_flush(p);
20608 }
20609 goto retry;
20610 case '&':
20611 case '.': {
20612 dispatch_delayed_token(p, tIGNORED_NL);
20613 if (peek(p, '.') == (c == '&')) {
20614 pushback(p, c);
20615 dispatch_scan_event(p, tSP);
20616 goto retry;
20617 }
20618 }
20619 default:
20620 p->ruby_sourceline--;
20621 p->lex.nextline = p->lex.lastline;
20622 set_lastline(p, prevline);
20623 case -1: /* EOF no decrement*/
20624 lex_goto_eol(p);
20625 if (c != -1) {
20626 token_flush(p);
20627 RUBY_SET_YYLLOC(*p->yylloc);
20628 }
20629 goto normal_newline;
20630 }
20631 }
20632 normal_newline:
20633 p->command_start = TRUE;
20634 SET_LEX_STATE(EXPR_BEG);
20635 return '\n';
20636
20637 case '*':
20638 if ((c = nextc(p)) == '*') {
20639 if ((c = nextc(p)) == '=') {
20640 set_yylval_id(idPow);
20641 SET_LEX_STATE(EXPR_BEG);
20642 return tOP_ASGN;
20643 }
20644 pushback(p, c);
20645 if (IS_SPCARG(c)) {
20646 rb_warning0("`**' interpreted as argument prefix");
20647 c = tDSTAR;
20648 }
20649 else if (IS_BEG()) {
20650 c = tDSTAR;
20651 }
20652 else {
20653 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
20654 }
20655 }
20656 else {
20657 if (c == '=') {
20658 set_yylval_id('*');
20659 SET_LEX_STATE(EXPR_BEG);
20660 return tOP_ASGN;
20661 }
20662 pushback(p, c);
20663 if (IS_SPCARG(c)) {
20664 rb_warning0("`*' interpreted as argument prefix");
20665 c = tSTAR;
20666 }
20667 else if (IS_BEG()) {
20668 c = tSTAR;
20669 }
20670 else {
20671 c = warn_balanced('*', "*", "argument prefix");
20672 }
20673 }
20674 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20675 return c;
20676
20677 case '!':
20678 c = nextc(p);
20679 if (IS_AFTER_OPERATOR()) {
20680 SET_LEX_STATE(EXPR_ARG);
20681 if (c == '@') {
20682 return '!';
20683 }
20684 }
20685 else {
20686 SET_LEX_STATE(EXPR_BEG);
20687 }
20688 if (c == '=') {
20689 return tNEQ;
20690 }
20691 if (c == '~') {
20692 return tNMATCH;
20693 }
20694 pushback(p, c);
20695 return '!';
20696
20697 case '=':
20698 if (was_bol(p)) {
20699 /* skip embedded rd document */
20700 if (word_match_p(p, "begin", 5)) {
20701 int first_p = TRUE;
20702
20703 lex_goto_eol(p);
20704 dispatch_scan_event(p, tEMBDOC_BEG);
20705 for (;;) {
20706 lex_goto_eol(p);
20707 if (!first_p) {
20708 dispatch_scan_event(p, tEMBDOC);
20709 }
20710 first_p = FALSE;
20711 c = nextc(p);
20712 if (c == -1) {
20713 compile_error(p, "embedded document meets end of file");
20714 return END_OF_INPUT;
20715 }
20716 if (c == '=' && word_match_p(p, "end", 3)) {
20717 break;
20718 }
20719 pushback(p, c);
20720 }
20721 lex_goto_eol(p);
20722 dispatch_scan_event(p, tEMBDOC_END);
20723 goto retry;
20724 }
20725 }
20726
20727 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20728 if ((c = nextc(p)) == '=') {
20729 if ((c = nextc(p)) == '=') {
20730 return tEQQ;
20731 }
20732 pushback(p, c);
20733 return tEQ;
20734 }
20735 if (c == '~') {
20736 return tMATCH;
20737 }
20738 else if (c == '>') {
20739 return tASSOC;
20740 }
20741 pushback(p, c);
20742 return '=';
20743
20744 case '<':
20745 c = nextc(p);
20746 if (c == '<' &&
20747 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
20748 !IS_END() &&
20749 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
20750 enum yytokentype token = heredoc_identifier(p);
20751 if (token) return token < 0 ? 0 : token;
20752 }
20753 if (IS_AFTER_OPERATOR()) {
20754 SET_LEX_STATE(EXPR_ARG);
20755 }
20756 else {
20757 if (IS_lex_state(EXPR_CLASS))
20758 p->command_start = TRUE;
20759 SET_LEX_STATE(EXPR_BEG);
20760 }
20761 if (c == '=') {
20762 if ((c = nextc(p)) == '>') {
20763 return tCMP;
20764 }
20765 pushback(p, c);
20766 return tLEQ;
20767 }
20768 if (c == '<') {
20769 if ((c = nextc(p)) == '=') {
20770 set_yylval_id(idLTLT);
20771 SET_LEX_STATE(EXPR_BEG);
20772 return tOP_ASGN;
20773 }
20774 pushback(p, c);
20775 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
20776 }
20777 pushback(p, c);
20778 return '<';
20779
20780 case '>':
20781 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20782 if ((c = nextc(p)) == '=') {
20783 return tGEQ;
20784 }
20785 if (c == '>') {
20786 if ((c = nextc(p)) == '=') {
20787 set_yylval_id(idGTGT);
20788 SET_LEX_STATE(EXPR_BEG);
20789 return tOP_ASGN;
20790 }
20791 pushback(p, c);
20792 return tRSHFT;
20793 }
20794 pushback(p, c);
20795 return '>';
20796
20797 case '"':
20798 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
20799 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
20800 p->lex.ptok = p->lex.pcur-1;
20801 return tSTRING_BEG;
20802
20803 case '`':
20804 if (IS_lex_state(EXPR_FNAME)) {
20805 SET_LEX_STATE(EXPR_ENDFN);
20806 return c;
20807 }
20808 if (IS_lex_state(EXPR_DOT)) {
20809 if (cmd_state)
20810 SET_LEX_STATE(EXPR_CMDARG);
20811 else
20812 SET_LEX_STATE(EXPR_ARG);
20813 return c;
20814 }
20815 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
20816 return tXSTRING_BEG;
20817
20818 case '\'':
20819 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
20820 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
20821 p->lex.ptok = p->lex.pcur-1;
20822 return tSTRING_BEG;
20823
20824 case '?':
20825 return parse_qmark(p, space_seen);
20826
20827 case '&':
20828 if ((c = nextc(p)) == '&') {
20829 SET_LEX_STATE(EXPR_BEG);
20830 if ((c = nextc(p)) == '=') {
20831 set_yylval_id(idANDOP);
20832 SET_LEX_STATE(EXPR_BEG);
20833 return tOP_ASGN;
20834 }
20835 pushback(p, c);
20836 return tANDOP;
20837 }
20838 else if (c == '=') {
20839 set_yylval_id('&');
20840 SET_LEX_STATE(EXPR_BEG);
20841 return tOP_ASGN;
20842 }
20843 else if (c == '.') {
20844 set_yylval_id(idANDDOT);
20845 SET_LEX_STATE(EXPR_DOT);
20846 return tANDDOT;
20847 }
20848 pushback(p, c);
20849 if (IS_SPCARG(c)) {
20850 if ((c != ':') ||
20851 (c = peekc_n(p, 1)) == -1 ||
20852 !(c == '\'' || c == '"' ||
20853 is_identchar(p, (p->lex.pcur+1), p->lex.pend, p->enc))) {
20854 rb_warning0("`&' interpreted as argument prefix");
20855 }
20856 c = tAMPER;
20857 }
20858 else if (IS_BEG()) {
20859 c = tAMPER;
20860 }
20861 else {
20862 c = warn_balanced('&', "&", "argument prefix");
20863 }
20864 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20865 return c;
20866
20867 case '|':
20868 if ((c = nextc(p)) == '|') {
20869 SET_LEX_STATE(EXPR_BEG);
20870 if ((c = nextc(p)) == '=') {
20871 set_yylval_id(idOROP);
20872 SET_LEX_STATE(EXPR_BEG);
20873 return tOP_ASGN;
20874 }
20875 pushback(p, c);
20876 if (IS_lex_state_for(last_state, EXPR_BEG)) {
20877 c = '|';
20878 pushback(p, '|');
20879 return c;
20880 }
20881 return tOROP;
20882 }
20883 if (c == '=') {
20884 set_yylval_id('|');
20885 SET_LEX_STATE(EXPR_BEG);
20886 return tOP_ASGN;
20887 }
20888 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
20889 pushback(p, c);
20890 return '|';
20891
20892 case '+':
20893 c = nextc(p);
20894 if (IS_AFTER_OPERATOR()) {
20895 SET_LEX_STATE(EXPR_ARG);
20896 if (c == '@') {
20897 return tUPLUS;
20898 }
20899 pushback(p, c);
20900 return '+';
20901 }
20902 if (c == '=') {
20903 set_yylval_id('+');
20904 SET_LEX_STATE(EXPR_BEG);
20905 return tOP_ASGN;
20906 }
20907 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
20908 SET_LEX_STATE(EXPR_BEG);
20909 pushback(p, c);
20910 if (c != -1 && ISDIGIT(c)) {
20911 return parse_numeric(p, '+');
20912 }
20913 return tUPLUS;
20914 }
20915 SET_LEX_STATE(EXPR_BEG);
20916 pushback(p, c);
20917 return warn_balanced('+', "+", "unary operator");
20918
20919 case '-':
20920 c = nextc(p);
20921 if (IS_AFTER_OPERATOR()) {
20922 SET_LEX_STATE(EXPR_ARG);
20923 if (c == '@') {
20924 return tUMINUS;
20925 }
20926 pushback(p, c);
20927 return '-';
20928 }
20929 if (c == '=') {
20930 set_yylval_id('-');
20931 SET_LEX_STATE(EXPR_BEG);
20932 return tOP_ASGN;
20933 }
20934 if (c == '>') {
20935 SET_LEX_STATE(EXPR_ENDFN);
20936 return tLAMBDA;
20937 }
20938 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
20939 SET_LEX_STATE(EXPR_BEG);
20940 pushback(p, c);
20941 if (c != -1 && ISDIGIT(c)) {
20942 return tUMINUS_NUM;
20943 }
20944 return tUMINUS;
20945 }
20946 SET_LEX_STATE(EXPR_BEG);
20947 pushback(p, c);
20948 return warn_balanced('-', "-", "unary operator");
20949
20950 case '.': {
20951 int is_beg = IS_BEG();
20952 SET_LEX_STATE(EXPR_BEG);
20953 if ((c = nextc(p)) == '.') {
20954 if ((c = nextc(p)) == '.') {
20955 if (p->ctxt.in_argdef) {
20956 SET_LEX_STATE(EXPR_ENDARG);
20957 return tBDOT3;
20958 }
20959 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
20960 rb_warn0("... at EOL, should be parenthesized?");
20961 }
20962 else if (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest) {
20963 if (IS_lex_state_for(last_state, EXPR_LABEL))
20964 return tDOT3;
20965 }
20966 return is_beg ? tBDOT3 : tDOT3;
20967 }
20968 pushback(p, c);
20969 return is_beg ? tBDOT2 : tDOT2;
20970 }
20971 pushback(p, c);
20972 if (c != -1 && ISDIGIT(c)) {
20973 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
20974 parse_numeric(p, '.');
20975 if (ISDIGIT(prev)) {
20976 yyerror0("unexpected fraction part after numeric literal");
20977 }
20978 else {
20979 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
20980 }
20981 SET_LEX_STATE(EXPR_END);
20982 p->lex.ptok = p->lex.pcur;
20983 goto retry;
20984 }
20985 set_yylval_id('.');
20986 SET_LEX_STATE(EXPR_DOT);
20987 return '.';
20988 }
20989
20990 case '0': case '1': case '2': case '3': case '4':
20991 case '5': case '6': case '7': case '8': case '9':
20992 return parse_numeric(p, c);
20993
20994 case ')':
20995 COND_POP();
20996 CMDARG_POP();
20997 SET_LEX_STATE(EXPR_ENDFN);
20998 p->lex.paren_nest--;
20999 return c;
21000
21001 case ']':
21002 COND_POP();
21003 CMDARG_POP();
21004 SET_LEX_STATE(EXPR_END);
21005 p->lex.paren_nest--;
21006 return c;
21007
21008 case '}':
21009 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
21010 if (!p->lex.brace_nest--) return tSTRING_DEND;
21011 COND_POP();
21012 CMDARG_POP();
21013 SET_LEX_STATE(EXPR_END);
21014 p->lex.paren_nest--;
21015 return c;
21016
21017 case ':':
21018 c = nextc(p);
21019 if (c == ':') {
21020 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
21021 SET_LEX_STATE(EXPR_BEG);
21022 return tCOLON3;
21023 }
21024 set_yylval_id(idCOLON2);
21025 SET_LEX_STATE(EXPR_DOT);
21026 return tCOLON2;
21027 }
21028 if (IS_END() || ISSPACE(c) || c == '#') {
21029 pushback(p, c);
21030 c = warn_balanced(':', ":", "symbol literal");
21031 SET_LEX_STATE(EXPR_BEG);
21032 return c;
21033 }
21034 switch (c) {
21035 case '\'':
21036 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
21037 break;
21038 case '"':
21039 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
21040 break;
21041 default:
21042 pushback(p, c);
21043 break;
21044 }
21045 SET_LEX_STATE(EXPR_FNAME);
21046 return tSYMBEG;
21047
21048 case '/':
21049 if (IS_BEG()) {
21050 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21051 return tREGEXP_BEG;
21052 }
21053 if ((c = nextc(p)) == '=') {
21054 set_yylval_id('/');
21055 SET_LEX_STATE(EXPR_BEG);
21056 return tOP_ASGN;
21057 }
21058 pushback(p, c);
21059 if (IS_SPCARG(c)) {
21060 arg_ambiguous(p, '/');
21061 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
21062 return tREGEXP_BEG;
21063 }
21064 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21065 return warn_balanced('/', "/", "regexp literal");
21066
21067 case '^':
21068 if ((c = nextc(p)) == '=') {
21069 set_yylval_id('^');
21070 SET_LEX_STATE(EXPR_BEG);
21071 return tOP_ASGN;
21072 }
21073 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
21074 pushback(p, c);
21075 return '^';
21076
21077 case ';':
21078 SET_LEX_STATE(EXPR_BEG);
21079 p->command_start = TRUE;
21080 return ';';
21081
21082 case ',':
21083 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21084 return ',';
21085
21086 case '~':
21087 if (IS_AFTER_OPERATOR()) {
21088 if ((c = nextc(p)) != '@') {
21089 pushback(p, c);
21090 }
21091 SET_LEX_STATE(EXPR_ARG);
21092 }
21093 else {
21094 SET_LEX_STATE(EXPR_BEG);
21095 }
21096 return '~';
21097
21098 case '(':
21099 if (IS_BEG()) {
21100 c = tLPAREN;
21101 }
21102 else if (!space_seen) {
21103 /* foo( ... ) => method call, no ambiguity */
21104 }
21105 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
21106 c = tLPAREN_ARG;
21107 }
21108 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
21109 rb_warning0("parentheses after method name is interpreted as "
21110 "an argument list, not a decomposed argument");
21111 }
21112 p->lex.paren_nest++;
21113 COND_PUSH(0);
21114 CMDARG_PUSH(0);
21115 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21116 return c;
21117
21118 case '[':
21119 p->lex.paren_nest++;
21120 if (IS_AFTER_OPERATOR()) {
21121 if ((c = nextc(p)) == ']') {
21122 p->lex.paren_nest--;
21123 SET_LEX_STATE(EXPR_ARG);
21124 if ((c = nextc(p)) == '=') {
21125 return tASET;
21126 }
21127 pushback(p, c);
21128 return tAREF;
21129 }
21130 pushback(p, c);
21131 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
21132 return '[';
21133 }
21134 else if (IS_BEG()) {
21135 c = tLBRACK;
21136 }
21137 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
21138 c = tLBRACK;
21139 }
21140 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21141 COND_PUSH(0);
21142 CMDARG_PUSH(0);
21143 return c;
21144
21145 case '{':
21146 ++p->lex.brace_nest;
21147 if (lambda_beginning_p())
21148 c = tLAMBEG;
21149 else if (IS_lex_state(EXPR_LABELED))
21150 c = tLBRACE; /* hash */
21151 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
21152 c = '{'; /* block (primary) */
21153 else if (IS_lex_state(EXPR_ENDARG))
21154 c = tLBRACE_ARG; /* block (expr) */
21155 else
21156 c = tLBRACE; /* hash */
21157 if (c != tLBRACE) {
21158 p->command_start = TRUE;
21159 SET_LEX_STATE(EXPR_BEG);
21160 }
21161 else {
21162 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
21163 }
21164 ++p->lex.paren_nest; /* after lambda_beginning_p() */
21165 COND_PUSH(0);
21166 CMDARG_PUSH(0);
21167 return c;
21168
21169 case '\\':
21170 c = nextc(p);
21171 if (c == '\n') {
21172 space_seen = 1;
21173 dispatch_scan_event(p, tSP);
21174 goto retry; /* skip \\n */
21175 }
21176 if (c == ' ') return tSP;
21177 if (ISSPACE(c)) return c;
21178 pushback(p, c);
21179 return '\\';
21180
21181 case '%':
21182 return parse_percent(p, space_seen, last_state);
21183
21184 case '$':
21185 return parse_gvar(p, last_state);
21186
21187 case '@':
21188 return parse_atmark(p, last_state);
21189
21190 case '_':
21191 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
21192 p->ruby__end__seen = 1;
21193 p->eofp = 1;
21194#ifdef RIPPER
21195 lex_goto_eol(p);
21196 dispatch_scan_event(p, k__END__);
21197#endif
21198 return END_OF_INPUT;
21199 }
21200 newtok(p);
21201 break;
21202
21203 default:
21204 if (!parser_is_identchar(p)) {
21205 compile_error(p, "Invalid char `\\x%02X' in expression", c);
21206 token_flush(p);
21207 goto retry;
21208 }
21209
21210 newtok(p);
21211 break;
21212 }
21213
21214 return parse_ident(p, c, cmd_state);
21215}
21216
21217static enum yytokentype
21218yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
21219{
21220 enum yytokentype t;
21221
21222 p->lval = lval;
21223 lval->val = Qundef;
21224 p->yylloc = yylloc;
21225
21226 t = parser_yylex(p);
21227
21228 if (has_delayed_token(p))
21229 dispatch_delayed_token(p, t);
21230 else if (t != END_OF_INPUT)
21231 dispatch_scan_event(p, t);
21232
21233 return t;
21234}
21235
21236#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
21237
21238static NODE*
21239node_new_internal(struct parser_params *p, enum node_type type, size_t size, size_t alignment)
21240{
21241 NODE *n = rb_ast_newnode(p->ast, type, size, alignment);
21242
21243 rb_node_init(n, type);
21244 return n;
21245}
21246
21247static NODE *
21248nd_set_loc(NODE *nd, const YYLTYPE *loc)
21249{
21250 nd->nd_loc = *loc;
21251 nd_set_line(nd, loc->beg_pos.lineno);
21252 return nd;
21253}
21254
21255static NODE*
21256node_newnode(struct parser_params *p, enum node_type type, size_t size, size_t alignment, const rb_code_location_t *loc)
21257{
21258 NODE *n = node_new_internal(p, type, size, alignment);
21259
21260 nd_set_loc(n, loc);
21261 nd_set_node_id(n, parser_get_node_id(p));
21262 return n;
21263}
21264
21265#define NODE_NEWNODE(node_type, type, loc) (type *)(node_newnode(p, node_type, sizeof(type), RUBY_ALIGNOF(type), loc))
21266
21267#ifndef RIPPER
21268
21269static rb_node_scope_t *
21270rb_node_scope_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
21271{
21272 rb_ast_id_table_t *nd_tbl;
21273 nd_tbl = local_tbl(p);
21274 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
21275 n->nd_tbl = nd_tbl;
21276 n->nd_body = nd_body;
21277 n->nd_args = nd_args;
21278
21279 return n;
21280}
21281
21282static rb_node_scope_t *
21283rb_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)
21284{
21285 rb_node_scope_t *n = NODE_NEWNODE(NODE_SCOPE, rb_node_scope_t, loc);
21286 n->nd_tbl = nd_tbl;
21287 n->nd_body = nd_body;
21288 n->nd_args = nd_args;
21289
21290 return n;
21291}
21292
21293static rb_node_defn_t *
21294rb_node_defn_new(struct parser_params *p, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
21295{
21296 rb_node_defn_t *n = NODE_NEWNODE(NODE_DEFN, rb_node_defn_t, loc);
21297 n->nd_mid = nd_mid;
21298 n->nd_defn = nd_defn;
21299
21300 return n;
21301}
21302
21303static rb_node_defs_t *
21304rb_node_defs_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_defn, const YYLTYPE *loc)
21305{
21306 rb_node_defs_t *n = NODE_NEWNODE(NODE_DEFS, rb_node_defs_t, loc);
21307 n->nd_recv = nd_recv;
21308 n->nd_mid = nd_mid;
21309 n->nd_defn = nd_defn;
21310
21311 return n;
21312}
21313
21314static rb_node_block_t *
21315rb_node_block_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21316{
21317 rb_node_block_t *n = NODE_NEWNODE(NODE_BLOCK, rb_node_block_t, loc);
21318 n->nd_head = nd_head;
21319 n->nd_end = 0;
21320 n->nd_next = 0;
21321
21322 return n;
21323}
21324
21325static rb_node_for_t *
21326rb_node_for_new(struct parser_params *p, NODE *nd_iter, NODE *nd_body, const YYLTYPE *loc)
21327{
21328 rb_node_for_t *n = NODE_NEWNODE(NODE_FOR, rb_node_for_t, loc);
21329 n->nd_body = nd_body;
21330 n->nd_iter = nd_iter;
21331
21332 return n;
21333}
21334
21335static rb_node_for_masgn_t *
21336rb_node_for_masgn_new(struct parser_params *p, NODE *nd_var, const YYLTYPE *loc)
21337{
21338 rb_node_for_masgn_t *n = NODE_NEWNODE(NODE_FOR_MASGN, rb_node_for_masgn_t, loc);
21339 n->nd_var = nd_var;
21340
21341 return n;
21342}
21343
21344static rb_node_retry_t *
21345rb_node_retry_new(struct parser_params *p, const YYLTYPE *loc)
21346{
21347 rb_node_retry_t *n = NODE_NEWNODE(NODE_RETRY, rb_node_retry_t, loc);
21348
21349 return n;
21350}
21351
21352static rb_node_begin_t *
21353rb_node_begin_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
21354{
21355 rb_node_begin_t *n = NODE_NEWNODE(NODE_BEGIN, rb_node_begin_t, loc);
21356 n->nd_body = nd_body;
21357
21358 return n;
21359}
21360
21361static rb_node_rescue_t *
21362rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *nd_else, const YYLTYPE *loc)
21363{
21364 rb_node_rescue_t *n = NODE_NEWNODE(NODE_RESCUE, rb_node_rescue_t, loc);
21365 n->nd_head = nd_head;
21366 n->nd_resq = nd_resq;
21367 n->nd_else = nd_else;
21368
21369 return n;
21370}
21371
21372static rb_node_resbody_t *
21373rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_body, NODE *nd_head, const YYLTYPE *loc)
21374{
21375 rb_node_resbody_t *n = NODE_NEWNODE(NODE_RESBODY, rb_node_resbody_t, loc);
21376 n->nd_head = nd_head;
21377 n->nd_body = nd_body;
21378 n->nd_args = nd_args;
21379
21380 return n;
21381}
21382
21383static rb_node_ensure_t *
21384rb_node_ensure_new(struct parser_params *p, NODE *nd_head, NODE *nd_ensr, const YYLTYPE *loc)
21385{
21386 rb_node_ensure_t *n = NODE_NEWNODE(NODE_ENSURE, rb_node_ensure_t, loc);
21387 n->nd_head = nd_head;
21388 n->nd_resq = 0;
21389 n->nd_ensr = nd_ensr;
21390
21391 return n;
21392}
21393
21394static rb_node_and_t *
21395rb_node_and_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
21396{
21397 rb_node_and_t *n = NODE_NEWNODE(NODE_AND, rb_node_and_t, loc);
21398 n->nd_1st = nd_1st;
21399 n->nd_2nd = nd_2nd;
21400
21401 return n;
21402}
21403
21404static rb_node_or_t *
21405rb_node_or_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
21406{
21407 rb_node_or_t *n = NODE_NEWNODE(NODE_OR, rb_node_or_t, loc);
21408 n->nd_1st = nd_1st;
21409 n->nd_2nd = nd_2nd;
21410
21411 return n;
21412}
21413
21414static rb_node_return_t *
21415rb_node_return_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc)
21416{
21417 rb_node_return_t *n = NODE_NEWNODE(NODE_RETURN, rb_node_return_t, loc);
21418 n->nd_stts = nd_stts;
21419 return n;
21420}
21421
21422static rb_node_yield_t *
21423rb_node_yield_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21424{
21425 rb_node_yield_t *n = NODE_NEWNODE(NODE_YIELD, rb_node_yield_t, loc);
21426 n->nd_head = nd_head;
21427
21428 return n;
21429}
21430
21431static rb_node_if_t *
21432rb_node_if_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc)
21433{
21434 rb_node_if_t *n = NODE_NEWNODE(NODE_IF, rb_node_if_t, loc);
21435 n->nd_cond = nd_cond;
21436 n->nd_body = nd_body;
21437 n->nd_else = nd_else;
21438
21439 return n;
21440}
21441
21442static rb_node_unless_t *
21443rb_node_unless_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, NODE *nd_else, const YYLTYPE *loc)
21444{
21445 rb_node_unless_t *n = NODE_NEWNODE(NODE_UNLESS, rb_node_unless_t, loc);
21446 n->nd_cond = nd_cond;
21447 n->nd_body = nd_body;
21448 n->nd_else = nd_else;
21449
21450 return n;
21451}
21452
21453static rb_node_class_t *
21454rb_node_class_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, NODE *nd_super, const YYLTYPE *loc)
21455{
21456 /* Keep the order of node creation */
21457 NODE *scope = NEW_SCOPE(0, nd_body, loc);
21458 rb_node_class_t *n = NODE_NEWNODE(NODE_CLASS, rb_node_class_t, loc);
21459 n->nd_cpath = nd_cpath;
21460 n->nd_body = scope;
21461 n->nd_super = nd_super;
21462
21463 return n;
21464}
21465
21466static rb_node_sclass_t *
21467rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const YYLTYPE *loc)
21468{
21469 /* Keep the order of node creation */
21470 NODE *scope = NEW_SCOPE(0, nd_body, loc);
21471 rb_node_sclass_t *n = NODE_NEWNODE(NODE_SCLASS, rb_node_sclass_t, loc);
21472 n->nd_recv = nd_recv;
21473 n->nd_body = scope;
21474
21475 return n;
21476}
21477
21478static rb_node_module_t *
21479rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc)
21480{
21481 /* Keep the order of node creation */
21482 NODE *scope = NEW_SCOPE(0, nd_body, loc);
21483 rb_node_module_t *n = NODE_NEWNODE(NODE_MODULE, rb_node_module_t, loc);
21484 n->nd_cpath = nd_cpath;
21485 n->nd_body = scope;
21486
21487 return n;
21488}
21489
21490static rb_node_iter_t *
21491rb_node_iter_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
21492{
21493 /* Keep the order of node creation */
21494 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
21495 rb_node_iter_t *n = NODE_NEWNODE(NODE_ITER, rb_node_iter_t, loc);
21496 n->nd_body = scope;
21497 n->nd_iter = 0;
21498
21499 return n;
21500}
21501
21502static rb_node_lambda_t *
21503rb_node_lambda_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc)
21504{
21505 /* Keep the order of node creation */
21506 NODE *scope = NEW_SCOPE(nd_args, nd_body, loc);
21507 rb_node_lambda_t *n = NODE_NEWNODE(NODE_LAMBDA, rb_node_lambda_t, loc);
21508 n->nd_body = scope;
21509
21510 return n;
21511}
21512
21513static rb_node_case_t *
21514rb_node_case_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
21515{
21516 rb_node_case_t *n = NODE_NEWNODE(NODE_CASE, rb_node_case_t, loc);
21517 n->nd_head = nd_head;
21518 n->nd_body = nd_body;
21519
21520 return n;
21521}
21522
21523static rb_node_case2_t *
21524rb_node_case2_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
21525{
21526 rb_node_case2_t *n = NODE_NEWNODE(NODE_CASE2, rb_node_case2_t, loc);
21527 n->nd_head = 0;
21528 n->nd_body = nd_body;
21529
21530 return n;
21531}
21532
21533static rb_node_case3_t *
21534rb_node_case3_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
21535{
21536 rb_node_case3_t *n = NODE_NEWNODE(NODE_CASE3, rb_node_case3_t, loc);
21537 n->nd_head = nd_head;
21538 n->nd_body = nd_body;
21539
21540 return n;
21541}
21542
21543static rb_node_when_t *
21544rb_node_when_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
21545{
21546 rb_node_when_t *n = NODE_NEWNODE(NODE_WHEN, rb_node_when_t, loc);
21547 n->nd_head = nd_head;
21548 n->nd_body = nd_body;
21549 n->nd_next = nd_next;
21550
21551 return n;
21552}
21553
21554static rb_node_in_t *
21555rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
21556{
21557 rb_node_in_t *n = NODE_NEWNODE(NODE_IN, rb_node_in_t, loc);
21558 n->nd_head = nd_head;
21559 n->nd_body = nd_body;
21560 n->nd_next = nd_next;
21561
21562 return n;
21563}
21564
21565static rb_node_while_t *
21566rb_node_while_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc)
21567{
21568 rb_node_while_t *n = NODE_NEWNODE(NODE_WHILE, rb_node_while_t, loc);
21569 n->nd_cond = nd_cond;
21570 n->nd_body = nd_body;
21571 n->nd_state = nd_state;
21572
21573 return n;
21574}
21575
21576static rb_node_until_t *
21577rb_node_until_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc)
21578{
21579 rb_node_until_t *n = NODE_NEWNODE(NODE_UNTIL, rb_node_until_t, loc);
21580 n->nd_cond = nd_cond;
21581 n->nd_body = nd_body;
21582 n->nd_state = nd_state;
21583
21584 return n;
21585}
21586
21587static rb_node_colon2_t *
21588rb_node_colon2_new(struct parser_params *p, NODE *nd_head, ID nd_mid, const YYLTYPE *loc)
21589{
21590 rb_node_colon2_t *n = NODE_NEWNODE(NODE_COLON2, rb_node_colon2_t, loc);
21591 n->nd_head = nd_head;
21592 n->nd_mid = nd_mid;
21593
21594 return n;
21595}
21596
21597static rb_node_colon3_t *
21598rb_node_colon3_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
21599{
21600 rb_node_colon3_t *n = NODE_NEWNODE(NODE_COLON3, rb_node_colon3_t, loc);
21601 n->nd_mid = nd_mid;
21602
21603 return n;
21604}
21605
21606static rb_node_dot2_t *
21607rb_node_dot2_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
21608{
21609 rb_node_dot2_t *n = NODE_NEWNODE(NODE_DOT2, rb_node_dot2_t, loc);
21610 n->nd_beg = nd_beg;
21611 n->nd_end = nd_end;
21612
21613 return n;
21614}
21615
21616static rb_node_dot3_t *
21617rb_node_dot3_new(struct parser_params *p, NODE *nd_beg, NODE *nd_end, const YYLTYPE *loc)
21618{
21619 rb_node_dot3_t *n = NODE_NEWNODE(NODE_DOT3, rb_node_dot3_t, loc);
21620 n->nd_beg = nd_beg;
21621 n->nd_end = nd_end;
21622
21623 return n;
21624}
21625
21626static rb_node_self_t *
21627rb_node_self_new(struct parser_params *p, const YYLTYPE *loc)
21628{
21629 rb_node_self_t *n = NODE_NEWNODE(NODE_SELF, rb_node_self_t, loc);
21630 n->nd_state = 1;
21631
21632 return n;
21633}
21634
21635static rb_node_nil_t *
21636rb_node_nil_new(struct parser_params *p, const YYLTYPE *loc)
21637{
21638 rb_node_nil_t *n = NODE_NEWNODE(NODE_NIL, rb_node_nil_t, loc);
21639
21640 return n;
21641}
21642
21643static rb_node_true_t *
21644rb_node_true_new(struct parser_params *p, const YYLTYPE *loc)
21645{
21646 rb_node_true_t *n = NODE_NEWNODE(NODE_TRUE, rb_node_true_t, loc);
21647
21648 return n;
21649}
21650
21651static rb_node_false_t *
21652rb_node_false_new(struct parser_params *p, const YYLTYPE *loc)
21653{
21654 rb_node_false_t *n = NODE_NEWNODE(NODE_FALSE, rb_node_false_t, loc);
21655
21656 return n;
21657}
21658
21659static rb_node_super_t *
21660rb_node_super_new(struct parser_params *p, NODE *nd_args, const YYLTYPE *loc)
21661{
21662 rb_node_super_t *n = NODE_NEWNODE(NODE_SUPER, rb_node_super_t, loc);
21663 n->nd_args = nd_args;
21664
21665 return n;
21666}
21667
21668static rb_node_zsuper_t *
21669rb_node_zsuper_new(struct parser_params *p, const YYLTYPE *loc)
21670{
21671 rb_node_zsuper_t *n = NODE_NEWNODE(NODE_ZSUPER, rb_node_zsuper_t, loc);
21672
21673 return n;
21674}
21675
21676static rb_node_match2_t *
21677rb_node_match2_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
21678{
21679 rb_node_match2_t *n = NODE_NEWNODE(NODE_MATCH2, rb_node_match2_t, loc);
21680 n->nd_recv = nd_recv;
21681 n->nd_value = nd_value;
21682 n->nd_args = 0;
21683
21684 return n;
21685}
21686
21687static rb_node_match3_t *
21688rb_node_match3_new(struct parser_params *p, NODE *nd_recv, NODE *nd_value, const YYLTYPE *loc)
21689{
21690 rb_node_match3_t *n = NODE_NEWNODE(NODE_MATCH3, rb_node_match3_t, loc);
21691 n->nd_recv = nd_recv;
21692 n->nd_value = nd_value;
21693
21694 return n;
21695}
21696
21697/* TODO: Use union for NODE_LIST2 */
21698static rb_node_list_t *
21699rb_node_list_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21700{
21701 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
21702 n->nd_head = nd_head;
21703 n->as.nd_alen = 1;
21704 n->nd_next = 0;
21705
21706 return n;
21707}
21708
21709static rb_node_list_t *
21710rb_node_list_new2(struct parser_params *p, NODE *nd_head, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21711{
21712 rb_node_list_t *n = NODE_NEWNODE(NODE_LIST, rb_node_list_t, loc);
21713 n->nd_head = nd_head;
21714 n->as.nd_alen = nd_alen;
21715 n->nd_next = nd_next;
21716
21717 return n;
21718}
21719
21720static rb_node_zlist_t *
21721rb_node_zlist_new(struct parser_params *p, const YYLTYPE *loc)
21722{
21723 rb_node_zlist_t *n = NODE_NEWNODE(NODE_ZLIST, rb_node_zlist_t, loc);
21724
21725 return n;
21726}
21727
21728static rb_node_hash_t *
21729rb_node_hash_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
21730{
21731 rb_node_hash_t *n = NODE_NEWNODE(NODE_HASH, rb_node_hash_t, loc);
21732 n->nd_head = nd_head;
21733 n->nd_brace = 0;
21734
21735 return n;
21736}
21737
21738static rb_node_masgn_t *
21739rb_node_masgn_new(struct parser_params *p, NODE *nd_head, NODE *nd_args, const YYLTYPE *loc)
21740{
21741 rb_node_masgn_t *n = NODE_NEWNODE(NODE_MASGN, rb_node_masgn_t, loc);
21742 n->nd_head = nd_head;
21743 n->nd_value = 0;
21744 n->nd_args = nd_args;
21745
21746 return n;
21747}
21748
21749static rb_node_gasgn_t *
21750rb_node_gasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21751{
21752 rb_node_gasgn_t *n = NODE_NEWNODE(NODE_GASGN, rb_node_gasgn_t, loc);
21753 n->nd_vid = nd_vid;
21754 n->nd_value = nd_value;
21755
21756 return n;
21757}
21758
21759static rb_node_lasgn_t *
21760rb_node_lasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21761{
21762 rb_node_lasgn_t *n = NODE_NEWNODE(NODE_LASGN, rb_node_lasgn_t, loc);
21763 n->nd_vid = nd_vid;
21764 n->nd_value = nd_value;
21765
21766 return n;
21767}
21768
21769static rb_node_dasgn_t *
21770rb_node_dasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21771{
21772 rb_node_dasgn_t *n = NODE_NEWNODE(NODE_DASGN, rb_node_dasgn_t, loc);
21773 n->nd_vid = nd_vid;
21774 n->nd_value = nd_value;
21775
21776 return n;
21777}
21778
21779static rb_node_iasgn_t *
21780rb_node_iasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21781{
21782 rb_node_iasgn_t *n = NODE_NEWNODE(NODE_IASGN, rb_node_iasgn_t, loc);
21783 n->nd_vid = nd_vid;
21784 n->nd_value = nd_value;
21785
21786 return n;
21787}
21788
21789static rb_node_cvasgn_t *
21790rb_node_cvasgn_new(struct parser_params *p, ID nd_vid, NODE *nd_value, const YYLTYPE *loc)
21791{
21792 rb_node_cvasgn_t *n = NODE_NEWNODE(NODE_CVASGN, rb_node_cvasgn_t, loc);
21793 n->nd_vid = nd_vid;
21794 n->nd_value = nd_value;
21795
21796 return n;
21797}
21798
21799static rb_node_op_asgn1_t *
21800rb_node_op_asgn1_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *index, NODE *rvalue, const YYLTYPE *loc)
21801{
21802 rb_node_op_asgn1_t *n = NODE_NEWNODE(NODE_OP_ASGN1, rb_node_op_asgn1_t, loc);
21803 n->nd_recv = nd_recv;
21804 n->nd_mid = nd_mid;
21805 n->nd_index = index;
21806 n->nd_rvalue = rvalue;
21807
21808 return n;
21809}
21810
21811static rb_node_op_asgn2_t *
21812rb_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)
21813{
21814 rb_node_op_asgn2_t *n = NODE_NEWNODE(NODE_OP_ASGN2, rb_node_op_asgn2_t, loc);
21815 n->nd_recv = nd_recv;
21816 n->nd_value = nd_value;
21817 n->nd_vid = nd_vid;
21818 n->nd_mid = nd_mid;
21819 n->nd_aid = nd_aid;
21820
21821 return n;
21822}
21823
21824static rb_node_op_asgn_or_t *
21825rb_node_op_asgn_or_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
21826{
21827 rb_node_op_asgn_or_t *n = NODE_NEWNODE(NODE_OP_ASGN_OR, rb_node_op_asgn_or_t, loc);
21828 n->nd_head = nd_head;
21829 n->nd_value = nd_value;
21830
21831 return n;
21832}
21833
21834static rb_node_op_asgn_and_t *
21835rb_node_op_asgn_and_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, const YYLTYPE *loc)
21836{
21837 rb_node_op_asgn_and_t *n = NODE_NEWNODE(NODE_OP_ASGN_AND, rb_node_op_asgn_and_t, loc);
21838 n->nd_head = nd_head;
21839 n->nd_value = nd_value;
21840
21841 return n;
21842}
21843
21844static rb_node_gvar_t *
21845rb_node_gvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21846{
21847 rb_node_gvar_t *n = NODE_NEWNODE(NODE_GVAR, rb_node_gvar_t, loc);
21848 n->nd_vid = nd_vid;
21849
21850 return n;
21851}
21852
21853static rb_node_lvar_t *
21854rb_node_lvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21855{
21856 rb_node_lvar_t *n = NODE_NEWNODE(NODE_LVAR, rb_node_lvar_t, loc);
21857 n->nd_vid = nd_vid;
21858
21859 return n;
21860}
21861
21862static rb_node_dvar_t *
21863rb_node_dvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21864{
21865 rb_node_dvar_t *n = NODE_NEWNODE(NODE_DVAR, rb_node_dvar_t, loc);
21866 n->nd_vid = nd_vid;
21867
21868 return n;
21869}
21870
21871static rb_node_ivar_t *
21872rb_node_ivar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21873{
21874 rb_node_ivar_t *n = NODE_NEWNODE(NODE_IVAR, rb_node_ivar_t, loc);
21875 n->nd_vid = nd_vid;
21876
21877 return n;
21878}
21879
21880static rb_node_const_t *
21881rb_node_const_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21882{
21883 rb_node_const_t *n = NODE_NEWNODE(NODE_CONST, rb_node_const_t, loc);
21884 n->nd_vid = nd_vid;
21885
21886 return n;
21887}
21888
21889static rb_node_cvar_t *
21890rb_node_cvar_new(struct parser_params *p, ID nd_vid, const YYLTYPE *loc)
21891{
21892 rb_node_cvar_t *n = NODE_NEWNODE(NODE_CVAR, rb_node_cvar_t, loc);
21893 n->nd_vid = nd_vid;
21894
21895 return n;
21896}
21897
21898static rb_node_nth_ref_t *
21899rb_node_nth_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
21900{
21901 rb_node_nth_ref_t *n = NODE_NEWNODE(NODE_NTH_REF, rb_node_nth_ref_t, loc);
21902 n->nd_nth = nd_nth;
21903
21904 return n;
21905}
21906
21907static rb_node_back_ref_t *
21908rb_node_back_ref_new(struct parser_params *p, long nd_nth, const YYLTYPE *loc)
21909{
21910 rb_node_back_ref_t *n = NODE_NEWNODE(NODE_BACK_REF, rb_node_back_ref_t, loc);
21911 n->nd_nth = nd_nth;
21912
21913 return n;
21914}
21915
21916static rb_node_lit_t *
21917rb_node_lit_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21918{
21919 rb_node_lit_t *n = NODE_NEWNODE(NODE_LIT, rb_node_lit_t, loc);
21920 n->nd_lit = nd_lit;
21921
21922 return n;
21923}
21924
21925static rb_node_str_t *
21926rb_node_str_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21927{
21928 rb_node_str_t *n = NODE_NEWNODE(NODE_STR, rb_node_str_t, loc);
21929 n->nd_lit = nd_lit;
21930
21931 return n;
21932}
21933
21934/* TODO; Use union for NODE_DSTR2 */
21935static rb_node_dstr_t *
21936rb_node_dstr_new0(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21937{
21938 rb_node_dstr_t *n = NODE_NEWNODE(NODE_DSTR, rb_node_dstr_t, loc);
21939 n->nd_lit = nd_lit;
21940 n->as.nd_alen = nd_alen;
21941 n->nd_next = (rb_node_list_t *)nd_next;
21942
21943 return n;
21944}
21945
21946static rb_node_dstr_t *
21947rb_node_dstr_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21948{
21949 return rb_node_dstr_new0(p, nd_lit, 1, 0, loc);
21950}
21951
21952static rb_node_xstr_t *
21953rb_node_xstr_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
21954{
21955 rb_node_xstr_t *n = NODE_NEWNODE(NODE_XSTR, rb_node_xstr_t, loc);
21956 n->nd_lit = nd_lit;
21957
21958 return n;
21959}
21960
21961static rb_node_dxstr_t *
21962rb_node_dxstr_new(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21963{
21964 rb_node_dxstr_t *n = NODE_NEWNODE(NODE_DXSTR, rb_node_dxstr_t, loc);
21965 n->nd_lit = nd_lit;
21966 n->nd_alen = nd_alen;
21967 n->nd_next = (rb_node_list_t *)nd_next;
21968
21969 return n;
21970}
21971
21972static rb_node_dsym_t *
21973rb_node_dsym_new(struct parser_params *p, VALUE nd_lit, long nd_alen, NODE *nd_next, const YYLTYPE *loc)
21974{
21975 rb_node_dsym_t *n = NODE_NEWNODE(NODE_DSYM, rb_node_dsym_t, loc);
21976 n->nd_lit = nd_lit;
21977 n->nd_alen = nd_alen;
21978 n->nd_next = (rb_node_list_t *)nd_next;
21979
21980 return n;
21981}
21982
21983static rb_node_evstr_t *
21984rb_node_evstr_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
21985{
21986 rb_node_evstr_t *n = NODE_NEWNODE(NODE_EVSTR, rb_node_evstr_t, loc);
21987 n->nd_body = nd_body;
21988
21989 return n;
21990}
21991
21992static rb_node_call_t *
21993rb_node_call_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
21994{
21995 rb_node_call_t *n = NODE_NEWNODE(NODE_CALL, rb_node_call_t, loc);
21996 n->nd_recv = nd_recv;
21997 n->nd_mid = nd_mid;
21998 n->nd_args = nd_args;
21999
22000 return n;
22001}
22002
22003static rb_node_opcall_t *
22004rb_node_opcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22005{
22006 rb_node_opcall_t *n = NODE_NEWNODE(NODE_OPCALL, rb_node_opcall_t, loc);
22007 n->nd_recv = nd_recv;
22008 n->nd_mid = nd_mid;
22009 n->nd_args = nd_args;
22010
22011 return n;
22012}
22013
22014static rb_node_fcall_t *
22015rb_node_fcall_new(struct parser_params *p, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22016{
22017 rb_node_fcall_t *n = NODE_NEWNODE(NODE_FCALL, rb_node_fcall_t, loc);
22018 n->nd_mid = nd_mid;
22019 n->nd_args = nd_args;
22020
22021 return n;
22022}
22023
22024static rb_node_qcall_t *
22025rb_node_qcall_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22026{
22027 rb_node_qcall_t *n = NODE_NEWNODE(NODE_QCALL, rb_node_qcall_t, loc);
22028 n->nd_recv = nd_recv;
22029 n->nd_mid = nd_mid;
22030 n->nd_args = nd_args;
22031
22032 return n;
22033}
22034
22035static rb_node_vcall_t *
22036rb_node_vcall_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc)
22037{
22038 rb_node_vcall_t *n = NODE_NEWNODE(NODE_VCALL, rb_node_vcall_t, loc);
22039 n->nd_mid = nd_mid;
22040
22041 return n;
22042}
22043
22044static rb_node_once_t *
22045rb_node_once_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22046{
22047 rb_node_once_t *n = NODE_NEWNODE(NODE_ONCE, rb_node_once_t, loc);
22048 n->nd_body = nd_body;
22049
22050 return n;
22051}
22052
22053static rb_node_args_t *
22054rb_node_args_new(struct parser_params *p, const YYLTYPE *loc)
22055{
22056 rb_node_args_t *n = NODE_NEWNODE(NODE_ARGS, rb_node_args_t, loc);
22057 MEMZERO(&n->nd_ainfo, struct rb_args_info, 1);
22058
22059 return n;
22060}
22061
22062static rb_node_args_aux_t *
22063rb_node_args_aux_new(struct parser_params *p, ID nd_pid, long nd_plen, const YYLTYPE *loc)
22064{
22065 rb_node_args_aux_t *n = NODE_NEWNODE(NODE_ARGS_AUX, rb_node_args_aux_t, loc);
22066 n->nd_pid = nd_pid;
22067 n->nd_plen = nd_plen;
22068 n->nd_next = 0;
22069
22070 return n;
22071}
22072
22073static rb_node_opt_arg_t *
22074rb_node_opt_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22075{
22076 rb_node_opt_arg_t *n = NODE_NEWNODE(NODE_OPT_ARG, rb_node_opt_arg_t, loc);
22077 n->nd_body = nd_body;
22078 n->nd_next = 0;
22079
22080 return n;
22081}
22082
22083static rb_node_kw_arg_t *
22084rb_node_kw_arg_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22085{
22086 rb_node_kw_arg_t *n = NODE_NEWNODE(NODE_KW_ARG, rb_node_kw_arg_t, loc);
22087 n->nd_body = nd_body;
22088 n->nd_next = 0;
22089
22090 return n;
22091}
22092
22093static rb_node_postarg_t *
22094rb_node_postarg_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
22095{
22096 rb_node_postarg_t *n = NODE_NEWNODE(NODE_POSTARG, rb_node_postarg_t, loc);
22097 n->nd_1st = nd_1st;
22098 n->nd_2nd = nd_2nd;
22099
22100 return n;
22101}
22102
22103static rb_node_argscat_t *
22104rb_node_argscat_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22105{
22106 rb_node_argscat_t *n = NODE_NEWNODE(NODE_ARGSCAT, rb_node_argscat_t, loc);
22107 n->nd_head = nd_head;
22108 n->nd_body = nd_body;
22109
22110 return n;
22111}
22112
22113static rb_node_argspush_t *
22114rb_node_argspush_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc)
22115{
22116 rb_node_argspush_t *n = NODE_NEWNODE(NODE_ARGSPUSH, rb_node_argspush_t, loc);
22117 n->nd_head = nd_head;
22118 n->nd_body = nd_body;
22119
22120 return n;
22121}
22122
22123static rb_node_splat_t *
22124rb_node_splat_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22125{
22126 rb_node_splat_t *n = NODE_NEWNODE(NODE_SPLAT, rb_node_splat_t, loc);
22127 n->nd_head = nd_head;
22128
22129 return n;
22130}
22131
22132static rb_node_block_pass_t *
22133rb_node_block_pass_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22134{
22135 rb_node_block_pass_t *n = NODE_NEWNODE(NODE_BLOCK_PASS, rb_node_block_pass_t, loc);
22136 n->nd_head = 0;
22137 n->nd_body = nd_body;
22138
22139 return n;
22140}
22141
22142static rb_node_alias_t *
22143rb_node_alias_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc)
22144{
22145 rb_node_alias_t *n = NODE_NEWNODE(NODE_ALIAS, rb_node_alias_t, loc);
22146 n->nd_1st = nd_1st;
22147 n->nd_2nd = nd_2nd;
22148
22149 return n;
22150}
22151
22152static rb_node_valias_t *
22153rb_node_valias_new(struct parser_params *p, ID nd_alias, ID nd_orig, const YYLTYPE *loc)
22154{
22155 rb_node_valias_t *n = NODE_NEWNODE(NODE_VALIAS, rb_node_valias_t, loc);
22156 n->nd_alias = nd_alias;
22157 n->nd_orig = nd_orig;
22158
22159 return n;
22160}
22161
22162static rb_node_undef_t *
22163rb_node_undef_new(struct parser_params *p, NODE *nd_undef, const YYLTYPE *loc)
22164{
22165 rb_node_undef_t *n = NODE_NEWNODE(NODE_UNDEF, rb_node_undef_t, loc);
22166 n->nd_undef = nd_undef;
22167
22168 return n;
22169}
22170
22171static rb_node_errinfo_t *
22172rb_node_errinfo_new(struct parser_params *p, const YYLTYPE *loc)
22173{
22174 rb_node_errinfo_t *n = NODE_NEWNODE(NODE_ERRINFO, rb_node_errinfo_t, loc);
22175
22176 return n;
22177}
22178
22179static rb_node_defined_t *
22180rb_node_defined_new(struct parser_params *p, NODE *nd_head, const YYLTYPE *loc)
22181{
22182 rb_node_defined_t *n = NODE_NEWNODE(NODE_DEFINED, rb_node_defined_t, loc);
22183 n->nd_head = nd_head;
22184
22185 return n;
22186}
22187
22188static rb_node_postexe_t *
22189rb_node_postexe_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc)
22190{
22191 rb_node_postexe_t *n = NODE_NEWNODE(NODE_POSTEXE, rb_node_postexe_t, loc);
22192 n->nd_body = nd_body;
22193
22194 return n;
22195}
22196
22197static rb_node_attrasgn_t *
22198rb_node_attrasgn_new(struct parser_params *p, NODE *nd_recv, ID nd_mid, NODE *nd_args, const YYLTYPE *loc)
22199{
22200 rb_node_attrasgn_t *n = NODE_NEWNODE(NODE_ATTRASGN, rb_node_attrasgn_t, loc);
22201 n->nd_recv = nd_recv;
22202 n->nd_mid = nd_mid;
22203 n->nd_args = nd_args;
22204
22205 return n;
22206}
22207
22208static rb_node_aryptn_t *
22209rb_node_aryptn_new(struct parser_params *p, NODE *pre_args, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
22210{
22211 rb_node_aryptn_t *n = NODE_NEWNODE(NODE_ARYPTN, rb_node_aryptn_t, loc);
22212 n->nd_pconst = 0;
22213 n->pre_args = pre_args;
22214 n->rest_arg = rest_arg;
22215 n->post_args = post_args;
22216
22217 return n;
22218}
22219
22220static rb_node_hshptn_t *
22221rb_node_hshptn_new(struct parser_params *p, NODE *nd_pconst, NODE *nd_pkwargs, NODE *nd_pkwrestarg, const YYLTYPE *loc)
22222{
22223 rb_node_hshptn_t *n = NODE_NEWNODE(NODE_HSHPTN, rb_node_hshptn_t, loc);
22224 n->nd_pconst = nd_pconst;
22225 n->nd_pkwargs = nd_pkwargs;
22226 n->nd_pkwrestarg = nd_pkwrestarg;
22227
22228 return n;
22229}
22230
22231static rb_node_fndptn_t *
22232rb_node_fndptn_new(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
22233{
22234 rb_node_fndptn_t *n = NODE_NEWNODE(NODE_FNDPTN, rb_node_fndptn_t, loc);
22235 n->nd_pconst = 0;
22236 n->pre_rest_arg = pre_rest_arg;
22237 n->args = args;
22238 n->post_rest_arg = post_rest_arg;
22239
22240 return n;
22241}
22242
22243static rb_node_cdecl_t *
22244rb_node_cdecl_new(struct parser_params *p, ID nd_vid, NODE *nd_value, NODE *nd_else, const YYLTYPE *loc)
22245{
22246 rb_node_cdecl_t *n = NODE_NEWNODE(NODE_CDECL, rb_node_cdecl_t, loc);
22247 n->nd_vid = nd_vid;
22248 n->nd_value = nd_value;
22249 n->nd_else = nd_else;
22250
22251 return n;
22252}
22253
22254static rb_node_op_cdecl_t *
22255rb_node_op_cdecl_new(struct parser_params *p, NODE *nd_head, NODE *nd_value, ID nd_aid, const YYLTYPE *loc)
22256{
22257 rb_node_op_cdecl_t *n = NODE_NEWNODE(NODE_OP_CDECL, rb_node_op_cdecl_t, loc);
22258 n->nd_head = nd_head;
22259 n->nd_value = nd_value;
22260 n->nd_aid = nd_aid;
22261
22262 return n;
22263}
22264
22265static rb_node_error_t *
22266rb_node_error_new(struct parser_params *p, const YYLTYPE *loc)
22267{
22268 rb_node_error_t *n = NODE_NEWNODE(NODE_ERROR, rb_node_error_t, loc);
22269
22270 return n;
22271}
22272
22273#else
22274
22275static rb_node_ripper_t *
22276rb_node_ripper_new(struct parser_params *p, ID nd_vid, VALUE nd_rval, VALUE nd_cval, const YYLTYPE *loc)
22277{
22278 rb_node_ripper_t *n = NODE_NEWNODE(NODE_RIPPER, rb_node_ripper_t, loc);
22279 n->nd_vid = nd_vid;
22280 n->nd_rval = nd_rval;
22281 n->nd_cval = nd_cval;
22282
22283 return n;
22284}
22285
22286static rb_node_ripper_values_t *
22287rb_node_ripper_values_new(struct parser_params *p, VALUE nd_val1, VALUE nd_val2, VALUE nd_val3, const YYLTYPE *loc)
22288{
22289 rb_node_ripper_values_t *n = NODE_NEWNODE(NODE_RIPPER_VALUES, rb_node_ripper_values_t, loc);
22290 n->nd_val1 = nd_val1;
22291 n->nd_val2 = nd_val2;
22292 n->nd_val3 = nd_val3;
22293
22294 return n;
22295}
22296
22297#endif
22298
22299static rb_node_break_t *
22300rb_node_break_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc)
22301{
22302 rb_node_break_t *n = NODE_NEWNODE(NODE_BREAK, rb_node_break_t, loc);
22303 n->nd_stts = nd_stts;
22304 n->nd_chain = 0;
22305
22306 return n;
22307}
22308
22309static rb_node_next_t *
22310rb_node_next_new(struct parser_params *p, NODE *nd_stts, const YYLTYPE *loc)
22311{
22312 rb_node_next_t *n = NODE_NEWNODE(NODE_NEXT, rb_node_next_t, loc);
22313 n->nd_stts = nd_stts;
22314 n->nd_chain = 0;
22315
22316 return n;
22317}
22318
22319static rb_node_redo_t *
22320rb_node_redo_new(struct parser_params *p, const YYLTYPE *loc)
22321{
22322 rb_node_redo_t *n = NODE_NEWNODE(NODE_REDO, rb_node_redo_t, loc);
22323 n->nd_chain = 0;
22324
22325 return n;
22326}
22327
22328static rb_node_def_temp_t *
22329rb_node_def_temp_new(struct parser_params *p, const YYLTYPE *loc)
22330{
22331 rb_node_def_temp_t *n = NODE_NEWNODE((enum node_type)NODE_DEF_TEMP, rb_node_def_temp_t, loc);
22332 n->save.cur_arg = p->cur_arg;
22333 n->save.numparam_save = 0;
22334 n->save.max_numparam = 0;
22335 n->save.ctxt = p->ctxt;
22336#ifdef RIPPER
22337 n->nd_recv = Qnil;
22338 n->nd_mid = Qnil;
22339 n->dot_or_colon = Qnil;
22340#else
22341 n->nd_def = 0;
22342 n->nd_mid = 0;
22343#endif
22344
22345 return n;
22346}
22347
22348static rb_node_def_temp_t *
22349def_head_save(struct parser_params *p, rb_node_def_temp_t *n)
22350{
22351 n->save.numparam_save = numparam_push(p);
22352 n->save.max_numparam = p->max_numparam;
22353 return n;
22354}
22355
22356#ifndef RIPPER
22357static enum node_type
22358nodetype(NODE *node) /* for debug */
22359{
22360 return (enum node_type)nd_type(node);
22361}
22362
22363static int
22364nodeline(NODE *node)
22365{
22366 return nd_line(node);
22367}
22368
22369static NODE*
22370newline_node(NODE *node)
22371{
22372 if (node) {
22373 node = remove_begin(node);
22374 nd_set_fl_newline(node);
22375 }
22376 return node;
22377}
22378
22379static void
22380fixpos(NODE *node, NODE *orig)
22381{
22382 if (!node) return;
22383 if (!orig) return;
22384 nd_set_line(node, nd_line(orig));
22385}
22386
22387static void
22388parser_warning(struct parser_params *p, NODE *node, const char *mesg)
22389{
22390 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
22391}
22392
22393static void
22394parser_warn(struct parser_params *p, NODE *node, const char *mesg)
22395{
22396 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
22397}
22398
22399static NODE*
22400block_append(struct parser_params *p, NODE *head, NODE *tail)
22401{
22402 NODE *end, *h = head, *nd;
22403
22404 if (tail == 0) return head;
22405
22406 if (h == 0) return tail;
22407 switch (nd_type(h)) {
22408 default:
22409 h = end = NEW_BLOCK(head, &head->nd_loc);
22410 RNODE_BLOCK(end)->nd_end = end;
22411 head = end;
22412 break;
22413 case NODE_BLOCK:
22414 end = RNODE_BLOCK(h)->nd_end;
22415 break;
22416 }
22417
22418 nd = RNODE_BLOCK(end)->nd_head;
22419 switch (nd_type(nd)) {
22420 case NODE_RETURN:
22421 case NODE_BREAK:
22422 case NODE_NEXT:
22423 case NODE_REDO:
22424 case NODE_RETRY:
22425 if (RTEST(ruby_verbose)) {
22426 parser_warning(p, tail, "statement not reached");
22427 }
22428 break;
22429
22430 default:
22431 break;
22432 }
22433
22434 if (!nd_type_p(tail, NODE_BLOCK)) {
22435 tail = NEW_BLOCK(tail, &tail->nd_loc);
22436 RNODE_BLOCK(tail)->nd_end = tail;
22437 }
22438 RNODE_BLOCK(end)->nd_next = tail;
22439 RNODE_BLOCK(h)->nd_end = RNODE_BLOCK(tail)->nd_end;
22440 nd_set_last_loc(head, nd_last_loc(tail));
22441 return head;
22442}
22443
22444/* append item to the list */
22445static NODE*
22446list_append(struct parser_params *p, NODE *list, NODE *item)
22447{
22448 NODE *last;
22449
22450 if (list == 0) return NEW_LIST(item, &item->nd_loc);
22451 if (RNODE_LIST(list)->nd_next) {
22452 last = RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end;
22453 }
22454 else {
22455 last = list;
22456 }
22457
22458 RNODE_LIST(list)->as.nd_alen += 1;
22459 RNODE_LIST(last)->nd_next = NEW_LIST(item, &item->nd_loc);
22460 RNODE_LIST(RNODE_LIST(list)->nd_next)->as.nd_end = RNODE_LIST(last)->nd_next;
22461
22462 nd_set_last_loc(list, nd_last_loc(item));
22463
22464 return list;
22465}
22466
22467/* concat two lists */
22468static NODE*
22469list_concat(NODE *head, NODE *tail)
22470{
22471 NODE *last;
22472
22473 if (RNODE_LIST(head)->nd_next) {
22474 last = RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end;
22475 }
22476 else {
22477 last = head;
22478 }
22479
22480 RNODE_LIST(head)->as.nd_alen += RNODE_LIST(tail)->as.nd_alen;
22481 RNODE_LIST(last)->nd_next = tail;
22482 if (RNODE_LIST(tail)->nd_next) {
22483 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = RNODE_LIST(RNODE_LIST(tail)->nd_next)->as.nd_end;
22484 }
22485 else {
22486 RNODE_LIST(RNODE_LIST(head)->nd_next)->as.nd_end = tail;
22487 }
22488
22489 nd_set_last_loc(head, nd_last_loc(tail));
22490
22491 return head;
22492}
22493
22494static int
22495literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
22496{
22497 if (NIL_P(tail)) return 1;
22498 if (!rb_enc_compatible(head, tail)) {
22499 compile_error(p, "string literal encodings differ (%s / %s)",
22500 rb_enc_name(rb_enc_get(head)),
22501 rb_enc_name(rb_enc_get(tail)));
22502 rb_str_resize(head, 0);
22503 rb_str_resize(tail, 0);
22504 return 0;
22505 }
22506 rb_str_buf_append(head, tail);
22507 return 1;
22508}
22509
22510static VALUE
22511string_literal_head(struct parser_params *p, enum node_type htype, NODE *head)
22512{
22513 if (htype != NODE_DSTR) return Qfalse;
22514 if (RNODE_DSTR(head)->nd_next) {
22515 head = RNODE_LIST(RNODE_LIST(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_head;
22516 if (!head || !nd_type_p(head, NODE_STR)) return Qfalse;
22517 }
22518 const VALUE lit = RNODE_DSTR(head)->nd_lit;
22519 ASSUME(lit != Qfalse);
22520 return lit;
22521}
22522
22523/* concat two string literals */
22524static NODE *
22525literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
22526{
22527 enum node_type htype;
22528 VALUE lit;
22529
22530 if (!head) return tail;
22531 if (!tail) return head;
22532
22533 htype = nd_type(head);
22534 if (htype == NODE_EVSTR) {
22535 head = new_dstr(p, head, loc);
22536 htype = NODE_DSTR;
22537 }
22538 if (p->heredoc_indent > 0) {
22539 switch (htype) {
22540 case NODE_STR:
22541 head = str2dstr(p, head);
22542 case NODE_DSTR:
22543 return list_append(p, head, tail);
22544 default:
22545 break;
22546 }
22547 }
22548 switch (nd_type(tail)) {
22549 case NODE_STR:
22550 if ((lit = string_literal_head(p, htype, head)) != Qfalse) {
22551 htype = NODE_STR;
22552 }
22553 else {
22554 lit = RNODE_DSTR(head)->nd_lit;
22555 }
22556 if (htype == NODE_STR) {
22557 if (!literal_concat0(p, lit, RNODE_STR(tail)->nd_lit)) {
22558 error:
22559 rb_discard_node(p, head);
22560 rb_discard_node(p, tail);
22561 return 0;
22562 }
22563 rb_discard_node(p, tail);
22564 }
22565 else {
22566 list_append(p, head, tail);
22567 }
22568 break;
22569
22570 case NODE_DSTR:
22571 if (htype == NODE_STR) {
22572 if (!literal_concat0(p, RNODE_STR(head)->nd_lit, RNODE_DSTR(tail)->nd_lit))
22573 goto error;
22574 RNODE_DSTR(tail)->nd_lit = RNODE_STR(head)->nd_lit;
22575 rb_discard_node(p, head);
22576 head = tail;
22577 }
22578 else if (NIL_P(RNODE_DSTR(tail)->nd_lit)) {
22579 append:
22580 RNODE_DSTR(head)->as.nd_alen += RNODE_DSTR(tail)->as.nd_alen - 1;
22581 if (!RNODE_DSTR(head)->nd_next) {
22582 RNODE_DSTR(head)->nd_next = RNODE_DSTR(tail)->nd_next;
22583 }
22584 else if (RNODE_DSTR(tail)->nd_next) {
22585 RNODE_DSTR(RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end)->nd_next = RNODE_DSTR(tail)->nd_next;
22586 RNODE_DSTR(RNODE_DSTR(head)->nd_next)->as.nd_end = RNODE_DSTR(RNODE_DSTR(tail)->nd_next)->as.nd_end;
22587 }
22588 rb_discard_node(p, tail);
22589 }
22590 else if ((lit = string_literal_head(p, htype, head)) != Qfalse) {
22591 if (!literal_concat0(p, lit, RNODE_DSTR(tail)->nd_lit))
22592 goto error;
22593 RNODE_DSTR(tail)->nd_lit = Qnil;
22594 goto append;
22595 }
22596 else {
22597 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));
22598 }
22599 break;
22600
22601 case NODE_EVSTR:
22602 if (htype == NODE_STR) {
22603 head = str2dstr(p, head);
22604 RNODE_DSTR(head)->as.nd_alen = 1;
22605 }
22606 list_append(p, head, tail);
22607 break;
22608 }
22609 return head;
22610}
22611
22612static void
22613nd_copy_flag(NODE *new_node, NODE *old_node)
22614{
22615 if (nd_fl_newline(old_node)) nd_set_fl_newline(new_node);
22616 nd_set_line(new_node, nd_line(old_node));
22617 new_node->nd_loc = old_node->nd_loc;
22618 new_node->node_id = old_node->node_id;
22619}
22620
22621static NODE *
22622str2dstr(struct parser_params *p, NODE *node)
22623{
22624 NODE *new_node = (NODE *)NODE_NEW_INTERNAL(NODE_DSTR, rb_node_dstr_t);
22625 nd_copy_flag(new_node, node);
22626 RNODE_DSTR(new_node)->nd_lit = RNODE_STR(node)->nd_lit;
22627 RNODE_DSTR(new_node)->as.nd_alen = 0;
22628 RNODE_DSTR(new_node)->nd_next = 0;
22629 RNODE_STR(node)->nd_lit = 0;
22630
22631 return new_node;
22632}
22633
22634static NODE *
22635evstr2dstr(struct parser_params *p, NODE *node)
22636{
22637 if (nd_type_p(node, NODE_EVSTR)) {
22638 node = new_dstr(p, node, &node->nd_loc);
22639 }
22640 return node;
22641}
22642
22643static NODE *
22644new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22645{
22646 NODE *head = node;
22647
22648 if (node) {
22649 switch (nd_type(node)) {
22650 case NODE_STR:
22651 return str2dstr(p, node);
22652 case NODE_DSTR:
22653 break;
22654 case NODE_EVSTR:
22655 return node;
22656 }
22657 }
22658 return NEW_EVSTR(head, loc);
22659}
22660
22661static NODE *
22662new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22663{
22664 VALUE lit = STR_NEW0();
22665 NODE *dstr = NEW_DSTR(lit, loc);
22666 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
22667 return list_append(p, dstr, node);
22668}
22669
22670static NODE *
22671call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
22672 const YYLTYPE *op_loc, const YYLTYPE *loc)
22673{
22674 NODE *expr;
22675 value_expr(recv);
22676 value_expr(arg1);
22677 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
22678 nd_set_line(expr, op_loc->beg_pos.lineno);
22679 return expr;
22680}
22681
22682static NODE *
22683call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
22684{
22685 NODE *opcall;
22686 value_expr(recv);
22687 opcall = NEW_OPCALL(recv, id, 0, loc);
22688 nd_set_line(opcall, op_loc->beg_pos.lineno);
22689 return opcall;
22690}
22691
22692static NODE *
22693new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
22694{
22695 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
22696 nd_set_line(qcall, op_loc->beg_pos.lineno);
22697 return qcall;
22698}
22699
22700static NODE*
22701new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
22702{
22703 NODE *ret;
22704 if (block) block_dup_check(p, args, block);
22705 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
22706 if (block) ret = method_add_block(p, ret, block, loc);
22707 fixpos(ret, recv);
22708 return ret;
22709}
22710
22711#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? RNODE_ONCE(node)->nd_body : node)
22712
22713static NODE*
22714last_expr_once_body(NODE *node)
22715{
22716 if (!node) return 0;
22717 return nd_once_body(node);
22718}
22719
22720static NODE*
22721match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
22722{
22723 NODE *n;
22724 int line = op_loc->beg_pos.lineno;
22725
22726 value_expr(node1);
22727 value_expr(node2);
22728
22729 if ((n = last_expr_once_body(node1)) != 0) {
22730 switch (nd_type(n)) {
22731 case NODE_DREGX:
22732 {
22733 NODE *match = NEW_MATCH2(node1, node2, loc);
22734 nd_set_line(match, line);
22735 return match;
22736 }
22737
22738 case NODE_LIT:
22739 if (RB_TYPE_P(RNODE_LIT(n)->nd_lit, T_REGEXP)) {
22740 const VALUE lit = RNODE_LIT(n)->nd_lit;
22741 NODE *match = NEW_MATCH2(node1, node2, loc);
22742 RNODE_MATCH2(match)->nd_args = reg_named_capture_assign(p, lit, loc);
22743 nd_set_line(match, line);
22744 return match;
22745 }
22746 }
22747 }
22748
22749 if ((n = last_expr_once_body(node2)) != 0) {
22750 NODE *match3;
22751
22752 switch (nd_type(n)) {
22753 case NODE_LIT:
22754 if (!RB_TYPE_P(RNODE_LIT(n)->nd_lit, T_REGEXP)) break;
22755 /* fallthru */
22756 case NODE_DREGX:
22757 match3 = NEW_MATCH3(node2, node1, loc);
22758 return match3;
22759 }
22760 }
22761
22762 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
22763 nd_set_line(n, line);
22764 return n;
22765}
22766
22767# if WARN_PAST_SCOPE
22768static int
22769past_dvar_p(struct parser_params *p, ID id)
22770{
22771 struct vtable *past = p->lvtbl->past;
22772 while (past) {
22773 if (vtable_included(past, id)) return 1;
22774 past = past->prev;
22775 }
22776 return 0;
22777}
22778# endif
22779
22780static int
22781numparam_nested_p(struct parser_params *p)
22782{
22783 struct local_vars *local = p->lvtbl;
22784 NODE *outer = local->numparam.outer;
22785 NODE *inner = local->numparam.inner;
22786 if (outer || inner) {
22787 NODE *used = outer ? outer : inner;
22788 compile_error(p, "numbered parameter is already used in\n"
22789 "%s:%d: %s block here",
22790 p->ruby_sourcefile, nd_line(used),
22791 outer ? "outer" : "inner");
22792 parser_show_error_line(p, &used->nd_loc);
22793 return 1;
22794 }
22795 return 0;
22796}
22797
22798static NODE*
22799gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
22800{
22801 ID *vidp = NULL;
22802 NODE *node;
22803 switch (id) {
22804 case keyword_self:
22805 return NEW_SELF(loc);
22806 case keyword_nil:
22807 return NEW_NIL(loc);
22808 case keyword_true:
22809 return NEW_TRUE(loc);
22810 case keyword_false:
22811 return NEW_FALSE(loc);
22812 case keyword__FILE__:
22813 {
22814 VALUE file = p->ruby_sourcefile_string;
22815 if (NIL_P(file))
22816 file = rb_str_new(0, 0);
22817 else
22818 file = rb_str_dup(file);
22819 node = NEW_STR(file, loc);
22820 RB_OBJ_WRITTEN(p->ast, Qnil, file);
22821 }
22822 return node;
22823 case keyword__LINE__:
22824 return NEW_LIT(INT2FIX(loc->beg_pos.lineno), loc);
22825 case keyword__ENCODING__:
22826 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
22827 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit);
22828 return node;
22829
22830 }
22831 switch (id_type(id)) {
22832 case ID_LOCAL:
22833 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
22834 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
22835 if (id == p->cur_arg) {
22836 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
22837 return 0;
22838 }
22839 if (vidp) *vidp |= LVAR_USED;
22840 node = NEW_DVAR(id, loc);
22841 return node;
22842 }
22843 if (local_id_ref(p, id, &vidp)) {
22844 if (id == p->cur_arg) {
22845 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
22846 return 0;
22847 }
22848 if (vidp) *vidp |= LVAR_USED;
22849 node = NEW_LVAR(id, loc);
22850 return node;
22851 }
22852 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
22853 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
22854 if (numparam_nested_p(p)) return 0;
22855 node = NEW_DVAR(id, loc);
22856 struct local_vars *local = p->lvtbl;
22857 if (!local->numparam.current) local->numparam.current = node;
22858 return node;
22859 }
22860# if WARN_PAST_SCOPE
22861 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
22862 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
22863 }
22864# endif
22865 /* method call without arguments */
22866 if (dyna_in_block(p) && id == rb_intern("it")
22867 && !(DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev))
22868 && p->max_numparam != ORDINAL_PARAM) {
22869 rb_warn0("`it` calls without arguments will refer to the first block param in Ruby 3.4; use it() or self.it");
22870 }
22871 return NEW_VCALL(id, loc);
22872 case ID_GLOBAL:
22873 return NEW_GVAR(id, loc);
22874 case ID_INSTANCE:
22875 return NEW_IVAR(id, loc);
22876 case ID_CONST:
22877 return NEW_CONST(id, loc);
22878 case ID_CLASS:
22879 return NEW_CVAR(id, loc);
22880 }
22881 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
22882 return 0;
22883}
22884
22885static rb_node_opt_arg_t *
22886opt_arg_append(rb_node_opt_arg_t *opt_list, rb_node_opt_arg_t *opt)
22887{
22888 rb_node_opt_arg_t *opts = opt_list;
22889 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
22890
22891 while (opts->nd_next) {
22892 opts = opts->nd_next;
22893 RNODE(opts)->nd_loc.end_pos = RNODE(opt)->nd_loc.end_pos;
22894 }
22895 opts->nd_next = opt;
22896
22897 return opt_list;
22898}
22899
22900static rb_node_kw_arg_t *
22901kwd_append(rb_node_kw_arg_t *kwlist, rb_node_kw_arg_t *kw)
22902{
22903 if (kwlist) {
22904 /* Assume rb_node_kw_arg_t and rb_node_opt_arg_t has same structure */
22905 opt_arg_append(RNODE_OPT_ARG(kwlist), RNODE_OPT_ARG(kw));
22906 }
22907 return kwlist;
22908}
22909
22910static NODE *
22911new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
22912{
22913 return NEW_DEFINED(remove_begin_all(expr), loc);
22914}
22915
22916static NODE*
22917symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
22918{
22919 enum node_type type = nd_type(symbol);
22920 switch (type) {
22921 case NODE_DSTR:
22922 nd_set_type(symbol, NODE_DSYM);
22923 break;
22924 case NODE_STR:
22925 nd_set_type(symbol, NODE_LIT);
22926 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(symbol)->nd_lit = rb_str_intern(RNODE_LIT(symbol)->nd_lit));
22927 break;
22928 default:
22929 compile_error(p, "unexpected node as symbol: %s", parser_node_name(type));
22930 }
22931 return list_append(p, symbols, symbol);
22932}
22933
22934static NODE *
22935new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
22936{
22937 struct RNode_LIST *list;
22938 NODE *prev;
22939 VALUE lit;
22940
22941 if (!node) {
22942 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
22943 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit);
22944 return node;
22945 }
22946 switch (nd_type(node)) {
22947 case NODE_STR:
22948 {
22949 VALUE src = RNODE_STR(node)->nd_lit;
22950 nd_set_type(node, NODE_LIT);
22951 nd_set_loc(node, loc);
22952 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit = reg_compile(p, src, options));
22953 }
22954 break;
22955 default:
22956 lit = STR_NEW0();
22957 node = NEW_DSTR0(lit, 1, NEW_LIST(node, loc), loc);
22958 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
22959 /* fall through */
22960 case NODE_DSTR:
22961 nd_set_type(node, NODE_DREGX);
22962 nd_set_loc(node, loc);
22963 RNODE_DREGX(node)->nd_cflag = options & RE_OPTION_MASK;
22964 if (!NIL_P(RNODE_DREGX(node)->nd_lit)) reg_fragment_check(p, RNODE_DREGX(node)->nd_lit, options);
22965 for (list = RNODE_DREGX(prev = node)->nd_next; list; list = RNODE_LIST(list->nd_next)) {
22966 NODE *frag = list->nd_head;
22967 enum node_type type = nd_type(frag);
22968 if (type == NODE_STR || (type == NODE_DSTR && !RNODE_DSTR(frag)->nd_next)) {
22969 VALUE tail = RNODE_STR(frag)->nd_lit;
22970 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(RNODE_DREGX(prev)->nd_lit)) {
22971 VALUE lit = prev == node ? RNODE_DREGX(prev)->nd_lit : RNODE_LIT(RNODE_LIST(prev)->nd_head)->nd_lit;
22972 if (!literal_concat0(p, lit, tail)) {
22973 return NEW_NIL(loc); /* dummy node on error */
22974 }
22975 rb_str_resize(tail, 0);
22976 RNODE_LIST(prev)->nd_next = list->nd_next;
22977 rb_discard_node(p, list->nd_head);
22978 rb_discard_node(p, (NODE *)list);
22979 list = RNODE_LIST(prev);
22980 }
22981 else {
22982 prev = (NODE *)list;
22983 }
22984 }
22985 else {
22986 prev = 0;
22987 }
22988 }
22989 if (!RNODE_DREGX(node)->nd_next) {
22990 VALUE src = RNODE_DREGX(node)->nd_lit;
22991 VALUE re = reg_compile(p, src, options);
22992 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_DREGX(node)->nd_lit = re);
22993 }
22994 if (options & RE_OPTION_ONCE) {
22995 node = NEW_ONCE(node, loc);
22996 }
22997 break;
22998 }
22999 return node;
23000}
23001
23002static rb_node_kw_arg_t *
23003new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
23004{
23005 if (!k) return 0;
23006 return NEW_KW_ARG((k), loc);
23007}
23008
23009static NODE *
23010new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
23011{
23012 if (!node) {
23013 VALUE lit = STR_NEW0();
23014 NODE *xstr = NEW_XSTR(lit, loc);
23015 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
23016 return xstr;
23017 }
23018 switch (nd_type(node)) {
23019 case NODE_STR:
23020 nd_set_type(node, NODE_XSTR);
23021 nd_set_loc(node, loc);
23022 break;
23023 case NODE_DSTR:
23024 nd_set_type(node, NODE_DXSTR);
23025 nd_set_loc(node, loc);
23026 break;
23027 default:
23028 node = NEW_DXSTR(Qnil, 1, NEW_LIST(node, loc), loc);
23029 break;
23030 }
23031 return node;
23032}
23033
23034static void
23035check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
23036{
23037 VALUE lit;
23038
23039 if (!arg || !p->case_labels) return;
23040
23041 lit = rb_node_case_when_optimizable_literal(arg);
23042 if (UNDEF_P(lit)) return;
23043 if (nd_type_p(arg, NODE_STR)) {
23044 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(arg)->nd_lit = lit);
23045 }
23046
23047 if (NIL_P(p->case_labels)) {
23048 p->case_labels = rb_obj_hide(rb_hash_new());
23049 }
23050 else {
23051 VALUE line = rb_hash_lookup(p->case_labels, lit);
23052 if (!NIL_P(line)) {
23053 rb_warning1("duplicated `when' clause with line %d is ignored",
23054 WARN_IVAL(line));
23055 return;
23056 }
23057 }
23058 rb_hash_aset(p->case_labels, lit, INT2NUM(p->ruby_sourceline));
23059}
23060
23061#else /* !RIPPER */
23062static int
23063id_is_var(struct parser_params *p, ID id)
23064{
23065 if (is_notop_id(id)) {
23066 switch (id & ID_SCOPE_MASK) {
23067 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
23068 return 1;
23069 case ID_LOCAL:
23070 if (dyna_in_block(p)) {
23071 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
23072 }
23073 if (local_id(p, id)) return 1;
23074 /* method call without arguments */
23075 return 0;
23076 }
23077 }
23078 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
23079 return 0;
23080}
23081
23082static VALUE
23083new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
23084{
23085 VALUE src = 0, err = 0;
23086 int options = 0;
23087 if (ripper_is_node_yylval(p, re)) {
23088 src = RNODE_RIPPER(re)->nd_cval;
23089 re = RNODE_RIPPER(re)->nd_rval;
23090 }
23091 if (ripper_is_node_yylval(p, opt)) {
23092 options = (int)RNODE_RIPPER(opt)->nd_vid;
23093 opt = RNODE_RIPPER(opt)->nd_rval;
23094 }
23095 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
23096 compile_error(p, "%"PRIsVALUE, err);
23097 }
23098 return dispatch2(regexp_literal, re, opt);
23099}
23100#endif /* !RIPPER */
23101
23102static inline enum lex_state_e
23103parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
23104{
23105 if (p->debug) {
23106 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
23107 }
23108 return p->lex.state = ls;
23109}
23110
23111#ifndef RIPPER
23112static const char rb_parser_lex_state_names[][8] = {
23113 "BEG", "END", "ENDARG", "ENDFN", "ARG",
23114 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
23115 "LABEL", "LABELED","FITEM",
23116};
23117
23118static VALUE
23119append_lex_state_name(struct parser_params *p, enum lex_state_e state, VALUE buf)
23120{
23121 int i, sep = 0;
23122 unsigned int mask = 1;
23123 static const char none[] = "NONE";
23124
23125 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
23126 if ((unsigned)state & mask) {
23127 if (sep) {
23128 rb_str_cat(buf, "|", 1);
23129 }
23130 sep = 1;
23131 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
23132 }
23133 }
23134 if (!sep) {
23135 rb_str_cat(buf, none, sizeof(none)-1);
23136 }
23137 return buf;
23138}
23139
23140static void
23141flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
23142{
23143 VALUE mesg = p->debug_buffer;
23144
23145 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
23146 p->debug_buffer = Qnil;
23147 rb_io_puts(1, &mesg, out);
23148 }
23149 if (!NIL_P(str) && RSTRING_LEN(str)) {
23150 rb_io_write(p->debug_output, str);
23151 }
23152}
23153
23154enum lex_state_e
23155rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
23156 enum lex_state_e to, int line)
23157{
23158 VALUE mesg;
23159 mesg = rb_str_new_cstr("lex_state: ");
23160 append_lex_state_name(p, from, mesg);
23161 rb_str_cat_cstr(mesg, " -> ");
23162 append_lex_state_name(p, to, mesg);
23163 rb_str_catf(mesg, " at line %d\n", line);
23164 flush_debug_buffer(p, p->debug_output, mesg);
23165 return to;
23166}
23167
23168VALUE
23169rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state)
23170{
23171 return rb_fstring(append_lex_state_name(p, state, rb_str_new(0, 0)));
23172}
23173
23174static void
23175append_bitstack_value(struct parser_params *p, stack_type stack, VALUE mesg)
23176{
23177 if (stack == 0) {
23178 rb_str_cat_cstr(mesg, "0");
23179 }
23180 else {
23181 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
23182 for (; mask && !(stack & mask); mask >>= 1) continue;
23183 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
23184 }
23185}
23186
23187void
23188rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
23189 const char *name, int line)
23190{
23191 VALUE mesg = rb_sprintf("%s: ", name);
23192 append_bitstack_value(p, stack, mesg);
23193 rb_str_catf(mesg, " at line %d\n", line);
23194 flush_debug_buffer(p, p->debug_output, mesg);
23195}
23196
23197void
23198rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
23199{
23200 va_list ap;
23201 VALUE mesg = rb_str_new_cstr("internal parser error: ");
23202
23203 va_start(ap, fmt);
23204 rb_str_vcatf(mesg, fmt, ap);
23205 va_end(ap);
23206 yyerror0(RSTRING_PTR(mesg));
23207 RB_GC_GUARD(mesg);
23208
23209 mesg = rb_str_new(0, 0);
23210 append_lex_state_name(p, p->lex.state, mesg);
23211 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
23212 rb_str_resize(mesg, 0);
23213 append_bitstack_value(p, p->cond_stack, mesg);
23214 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
23215 rb_str_resize(mesg, 0);
23216 append_bitstack_value(p, p->cmdarg_stack, mesg);
23217 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
23218 if (p->debug_output == rb_ractor_stdout())
23219 p->debug_output = rb_ractor_stderr();
23220 p->debug = TRUE;
23221}
23222
23223static YYLTYPE *
23224rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
23225{
23226 yylloc->beg_pos.lineno = sourceline;
23227 yylloc->beg_pos.column = beg_pos;
23228 yylloc->end_pos.lineno = sourceline;
23229 yylloc->end_pos.column = end_pos;
23230 return yylloc;
23231}
23232
23233YYLTYPE *
23234rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
23235{
23236 int sourceline = here->sourceline;
23237 int beg_pos = (int)here->offset - here->quote
23238 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
23239 int end_pos = (int)here->offset + here->length + here->quote;
23240
23241 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23242}
23243
23244YYLTYPE *
23245rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc)
23246{
23247 yylloc->beg_pos.lineno = p->delayed.beg_line;
23248 yylloc->beg_pos.column = p->delayed.beg_col;
23249 yylloc->end_pos.lineno = p->delayed.end_line;
23250 yylloc->end_pos.column = p->delayed.end_col;
23251
23252 return yylloc;
23253}
23254
23255YYLTYPE *
23256rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc)
23257{
23258 int sourceline = p->ruby_sourceline;
23259 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
23260 int end_pos = (int)(p->lex.pend - p->lex.pbeg);
23261 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23262}
23263
23264YYLTYPE *
23265rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc)
23266{
23267 yylloc->end_pos = yylloc->beg_pos;
23268
23269 return yylloc;
23270}
23271
23272YYLTYPE *
23273rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
23274{
23275 int sourceline = p->ruby_sourceline;
23276 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
23277 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
23278 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23279}
23280
23281YYLTYPE *
23282rb_parser_set_location(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.pcur - p->lex.pbeg);
23287 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
23288}
23289#endif /* !RIPPER */
23290
23291static int
23292assignable0(struct parser_params *p, ID id, const char **err)
23293{
23294 if (!id) return -1;
23295 switch (id) {
23296 case keyword_self:
23297 *err = "Can't change the value of self";
23298 return -1;
23299 case keyword_nil:
23300 *err = "Can't assign to nil";
23301 return -1;
23302 case keyword_true:
23303 *err = "Can't assign to true";
23304 return -1;
23305 case keyword_false:
23306 *err = "Can't assign to false";
23307 return -1;
23308 case keyword__FILE__:
23309 *err = "Can't assign to __FILE__";
23310 return -1;
23311 case keyword__LINE__:
23312 *err = "Can't assign to __LINE__";
23313 return -1;
23314 case keyword__ENCODING__:
23315 *err = "Can't assign to __ENCODING__";
23316 return -1;
23317 }
23318 switch (id_type(id)) {
23319 case ID_LOCAL:
23320 if (dyna_in_block(p)) {
23321 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
23322 compile_error(p, "Can't assign to numbered parameter _%d",
23323 NUMPARAM_ID_TO_IDX(id));
23324 return -1;
23325 }
23326 if (dvar_curr(p, id)) return NODE_DASGN;
23327 if (dvar_defined(p, id)) return NODE_DASGN;
23328 if (local_id(p, id)) return NODE_LASGN;
23329 dyna_var(p, id);
23330 return NODE_DASGN;
23331 }
23332 else {
23333 if (!local_id(p, id)) local_var(p, id);
23334 return NODE_LASGN;
23335 }
23336 break;
23337 case ID_GLOBAL: return NODE_GASGN;
23338 case ID_INSTANCE: return NODE_IASGN;
23339 case ID_CONST:
23340 if (!p->ctxt.in_def) return NODE_CDECL;
23341 *err = "dynamic constant assignment";
23342 return -1;
23343 case ID_CLASS: return NODE_CVASGN;
23344 default:
23345 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
23346 }
23347 return -1;
23348}
23349
23350#ifndef RIPPER
23351static NODE*
23352assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
23353{
23354 const char *err = 0;
23355 int node_type = assignable0(p, id, &err);
23356 switch (node_type) {
23357 case NODE_DASGN: return NEW_DASGN(id, val, loc);
23358 case NODE_LASGN: return NEW_LASGN(id, val, loc);
23359 case NODE_GASGN: return NEW_GASGN(id, val, loc);
23360 case NODE_IASGN: return NEW_IASGN(id, val, loc);
23361 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
23362 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
23363 }
23364 if (err) yyerror1(loc, err);
23365 return NEW_BEGIN(0, loc);
23366}
23367#else
23368static VALUE
23369assignable(struct parser_params *p, VALUE lhs)
23370{
23371 const char *err = 0;
23372 assignable0(p, get_id(lhs), &err);
23373 if (err) lhs = assign_error(p, err, lhs);
23374 return lhs;
23375}
23376#endif
23377
23378static int
23379is_private_local_id(struct parser_params *p, ID name)
23380{
23381 VALUE s;
23382 if (name == idUScore) return 1;
23383 if (!is_local_id(name)) return 0;
23384 s = rb_id2str(name);
23385 if (!s) return 0;
23386 return RSTRING_PTR(s)[0] == '_';
23387}
23388
23389static int
23390shadowing_lvar_0(struct parser_params *p, ID name)
23391{
23392 if (dyna_in_block(p)) {
23393 if (dvar_curr(p, name)) {
23394 if (is_private_local_id(p, name)) return 1;
23395 yyerror0("duplicated argument name");
23396 }
23397 else if (dvar_defined(p, name) || local_id(p, name)) {
23398 vtable_add(p->lvtbl->vars, name);
23399 if (p->lvtbl->used) {
23400 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
23401 }
23402 return 0;
23403 }
23404 }
23405 else {
23406 if (local_id(p, name)) {
23407 if (is_private_local_id(p, name)) return 1;
23408 yyerror0("duplicated argument name");
23409 }
23410 }
23411 return 1;
23412}
23413
23414static ID
23415shadowing_lvar(struct parser_params *p, ID name)
23416{
23417 shadowing_lvar_0(p, name);
23418 return name;
23419}
23420
23421static void
23422new_bv(struct parser_params *p, ID name)
23423{
23424 if (!name) return;
23425 if (!is_local_id(name)) {
23426 compile_error(p, "invalid local variable - %"PRIsVALUE,
23427 rb_id2str(name));
23428 return;
23429 }
23430 if (!shadowing_lvar_0(p, name)) return;
23431 dyna_var(p, name);
23432}
23433
23434#ifndef RIPPER
23435static NODE *
23436aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
23437{
23438 return NEW_ATTRASGN(recv, tASET, idx, loc);
23439}
23440
23441static void
23442block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
23443{
23444 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
23445 compile_error(p, "both block arg and actual block given");
23446 }
23447}
23448
23449static NODE *
23450attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
23451{
23452 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
23453 return NEW_ATTRASGN(recv, id, 0, loc);
23454}
23455
23456static void
23457rb_backref_error(struct parser_params *p, NODE *node)
23458{
23459 switch (nd_type(node)) {
23460 case NODE_NTH_REF:
23461 compile_error(p, "Can't set variable $%ld", RNODE_NTH_REF(node)->nd_nth);
23462 break;
23463 case NODE_BACK_REF:
23464 compile_error(p, "Can't set variable $%c", (int)RNODE_BACK_REF(node)->nd_nth);
23465 break;
23466 }
23467}
23468#else
23469static VALUE
23470backref_error(struct parser_params *p, NODE *ref, VALUE expr)
23471{
23472 VALUE mesg = rb_str_new_cstr("Can't set variable ");
23473 rb_str_append(mesg, RNODE_RIPPER(ref)->nd_cval);
23474 return dispatch2(assign_error, mesg, expr);
23475}
23476#endif
23477
23478#ifndef RIPPER
23479static NODE *
23480arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
23481{
23482 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
23483 switch (nd_type(node1)) {
23484 case NODE_LIST:
23485 return list_append(p, node1, node2);
23486 case NODE_BLOCK_PASS:
23487 RNODE_BLOCK_PASS(node1)->nd_head = arg_append(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
23488 node1->nd_loc.end_pos = RNODE_BLOCK_PASS(node1)->nd_head->nd_loc.end_pos;
23489 return node1;
23490 case NODE_ARGSPUSH:
23491 RNODE_ARGSPUSH(node1)->nd_body = list_append(p, NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, &RNODE_ARGSPUSH(node1)->nd_body->nd_loc), node2);
23492 node1->nd_loc.end_pos = RNODE_ARGSPUSH(node1)->nd_body->nd_loc.end_pos;
23493 nd_set_type(node1, NODE_ARGSCAT);
23494 return node1;
23495 case NODE_ARGSCAT:
23496 if (!nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
23497 RNODE_ARGSCAT(node1)->nd_body = list_append(p, RNODE_ARGSCAT(node1)->nd_body, node2);
23498 node1->nd_loc.end_pos = RNODE_ARGSCAT(node1)->nd_body->nd_loc.end_pos;
23499 return node1;
23500 }
23501 return NEW_ARGSPUSH(node1, node2, loc);
23502}
23503
23504static NODE *
23505arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
23506{
23507 if (!node2) return node1;
23508 switch (nd_type(node1)) {
23509 case NODE_BLOCK_PASS:
23510 if (RNODE_BLOCK_PASS(node1)->nd_head)
23511 RNODE_BLOCK_PASS(node1)->nd_head = arg_concat(p, RNODE_BLOCK_PASS(node1)->nd_head, node2, loc);
23512 else
23513 RNODE_LIST(node1)->nd_head = NEW_LIST(node2, loc);
23514 return node1;
23515 case NODE_ARGSPUSH:
23516 if (!nd_type_p(node2, NODE_LIST)) break;
23517 RNODE_ARGSPUSH(node1)->nd_body = list_concat(NEW_LIST(RNODE_ARGSPUSH(node1)->nd_body, loc), node2);
23518 nd_set_type(node1, NODE_ARGSCAT);
23519 return node1;
23520 case NODE_ARGSCAT:
23521 if (!nd_type_p(node2, NODE_LIST) ||
23522 !nd_type_p(RNODE_ARGSCAT(node1)->nd_body, NODE_LIST)) break;
23523 RNODE_ARGSCAT(node1)->nd_body = list_concat(RNODE_ARGSCAT(node1)->nd_body, node2);
23524 return node1;
23525 }
23526 return NEW_ARGSCAT(node1, node2, loc);
23527}
23528
23529static NODE *
23530last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
23531{
23532 NODE *n1;
23533 if ((n1 = splat_array(args)) != 0) {
23534 return list_append(p, n1, last_arg);
23535 }
23536 return arg_append(p, args, last_arg, loc);
23537}
23538
23539static NODE *
23540rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
23541{
23542 NODE *n1;
23543 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
23544 return list_concat(n1, rest_arg);
23545 }
23546 return arg_concat(p, args, rest_arg, loc);
23547}
23548
23549static NODE *
23550splat_array(NODE* node)
23551{
23552 if (nd_type_p(node, NODE_SPLAT)) node = RNODE_SPLAT(node)->nd_head;
23553 if (nd_type_p(node, NODE_LIST)) return node;
23554 return 0;
23555}
23556
23557static void
23558mark_lvar_used(struct parser_params *p, NODE *rhs)
23559{
23560 ID *vidp = NULL;
23561 if (!rhs) return;
23562 switch (nd_type(rhs)) {
23563 case NODE_LASGN:
23564 if (local_id_ref(p, RNODE_LASGN(rhs)->nd_vid, &vidp)) {
23565 if (vidp) *vidp |= LVAR_USED;
23566 }
23567 break;
23568 case NODE_DASGN:
23569 if (dvar_defined_ref(p, RNODE_DASGN(rhs)->nd_vid, &vidp)) {
23570 if (vidp) *vidp |= LVAR_USED;
23571 }
23572 break;
23573#if 0
23574 case NODE_MASGN:
23575 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
23576 mark_lvar_used(p, rhs->nd_head);
23577 }
23578 break;
23579#endif
23580 }
23581}
23582
23583static NODE *
23584const_decl_path(struct parser_params *p, NODE **dest)
23585{
23586 NODE *n = *dest;
23587 if (!nd_type_p(n, NODE_CALL)) {
23588 const YYLTYPE *loc = &n->nd_loc;
23589 VALUE path;
23590 if (RNODE_CDECL(n)->nd_vid) {
23591 path = rb_id2str(RNODE_CDECL(n)->nd_vid);
23592 }
23593 else {
23594 n = RNODE_CDECL(n)->nd_else;
23595 path = rb_ary_new();
23596 for (; n && nd_type_p(n, NODE_COLON2); n = RNODE_COLON2(n)->nd_head) {
23597 rb_ary_push(path, rb_id2str(RNODE_COLON2(n)->nd_mid));
23598 }
23599 if (n && nd_type_p(n, NODE_CONST)) {
23600 // Const::Name
23601 rb_ary_push(path, rb_id2str(RNODE_CONST(n)->nd_vid));
23602 }
23603 else if (n && nd_type_p(n, NODE_COLON3)) {
23604 // ::Const::Name
23605 rb_ary_push(path, rb_str_new(0, 0));
23606 }
23607 else {
23608 // expression::Name
23609 rb_ary_push(path, rb_str_new_cstr("..."));
23610 }
23611 path = rb_ary_join(rb_ary_reverse(path), rb_str_new_cstr("::"));
23612 path = rb_fstring(path);
23613 }
23614 *dest = n = NEW_LIT(path, loc);
23615 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(n)->nd_lit);
23616 }
23617 return n;
23618}
23619
23620static NODE *
23621make_shareable_node(struct parser_params *p, NODE *value, bool copy, const YYLTYPE *loc)
23622{
23623 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
23624
23625 if (copy) {
23626 return NEW_CALL(fcore, rb_intern("make_shareable_copy"),
23627 NEW_LIST(value, loc), loc);
23628 }
23629 else {
23630 return NEW_CALL(fcore, rb_intern("make_shareable"),
23631 NEW_LIST(value, loc), loc);
23632 }
23633}
23634
23635static NODE *
23636ensure_shareable_node(struct parser_params *p, NODE **dest, NODE *value, const YYLTYPE *loc)
23637{
23638 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
23639 NODE *args = NEW_LIST(value, loc);
23640 args = list_append(p, args, const_decl_path(p, dest));
23641 return NEW_CALL(fcore, rb_intern("ensure_shareable"), args, loc);
23642}
23643
23644static int is_static_content(NODE *node);
23645
23646static VALUE
23647shareable_literal_value(struct parser_params *p, NODE *node)
23648{
23649 if (!node) return Qnil;
23650 enum node_type type = nd_type(node);
23651 switch (type) {
23652 case NODE_TRUE:
23653 return Qtrue;
23654 case NODE_FALSE:
23655 return Qfalse;
23656 case NODE_NIL:
23657 return Qnil;
23658 case NODE_LIT:
23659 return RNODE_LIT(node)->nd_lit;
23660 default:
23661 return Qundef;
23662 }
23663}
23664
23665#ifndef SHAREABLE_BARE_EXPRESSION
23666#define SHAREABLE_BARE_EXPRESSION 1
23667#endif
23668
23669static NODE *
23670shareable_literal_constant(struct parser_params *p, enum shareability shareable,
23671 NODE **dest, NODE *value, const YYLTYPE *loc, size_t level)
23672{
23673# define shareable_literal_constant_next(n) \
23674 shareable_literal_constant(p, shareable, dest, (n), &(n)->nd_loc, level+1)
23675 VALUE lit = Qnil;
23676
23677 if (!value) return 0;
23678 enum node_type type = nd_type(value);
23679 switch (type) {
23680 case NODE_TRUE:
23681 case NODE_FALSE:
23682 case NODE_NIL:
23683 case NODE_LIT:
23684 return value;
23685
23686 case NODE_DSTR:
23687 if (shareable == shareable_literal) {
23688 value = NEW_CALL(value, idUMinus, 0, loc);
23689 }
23690 return value;
23691
23692 case NODE_STR:
23693 lit = rb_fstring(RNODE_STR(value)->nd_lit);
23694 nd_set_type(value, NODE_LIT);
23695 RB_OBJ_WRITE(p->ast, &RNODE_LIT(value)->nd_lit, lit);
23696 return value;
23697
23698 case NODE_ZLIST:
23699 lit = rb_ary_new();
23700 OBJ_FREEZE_RAW(lit);
23701 NODE *n = NEW_LIT(lit, loc);
23702 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(n)->nd_lit);
23703 return n;
23704
23705 case NODE_LIST:
23706 lit = rb_ary_new();
23707 for (NODE *n = value; n; n = RNODE_LIST(n)->nd_next) {
23708 NODE *elt = RNODE_LIST(n)->nd_head;
23709 if (elt) {
23710 elt = shareable_literal_constant_next(elt);
23711 if (elt) {
23712 RNODE_LIST(n)->nd_head = elt;
23713 }
23714 else if (RTEST(lit)) {
23715 rb_ary_clear(lit);
23716 lit = Qfalse;
23717 }
23718 }
23719 if (RTEST(lit)) {
23720 VALUE e = shareable_literal_value(p, elt);
23721 if (!UNDEF_P(e)) {
23722 rb_ary_push(lit, e);
23723 }
23724 else {
23725 rb_ary_clear(lit);
23726 lit = Qnil; /* make shareable at runtime */
23727 }
23728 }
23729 }
23730 break;
23731
23732 case NODE_HASH:
23733 if (!RNODE_HASH(value)->nd_brace) return 0;
23734 lit = rb_hash_new();
23735 for (NODE *n = RNODE_HASH(value)->nd_head; n; n = RNODE_LIST(RNODE_LIST(n)->nd_next)->nd_next) {
23736 NODE *key = RNODE_LIST(n)->nd_head;
23737 NODE *val = RNODE_LIST(RNODE_LIST(n)->nd_next)->nd_head;
23738 if (key) {
23739 key = shareable_literal_constant_next(key);
23740 if (key) {
23741 RNODE_LIST(n)->nd_head = key;
23742 }
23743 else if (RTEST(lit)) {
23744 rb_hash_clear(lit);
23745 lit = Qfalse;
23746 }
23747 }
23748 if (val) {
23749 val = shareable_literal_constant_next(val);
23750 if (val) {
23751 RNODE_LIST(RNODE_LIST(n)->nd_next)->nd_head = val;
23752 }
23753 else if (RTEST(lit)) {
23754 rb_hash_clear(lit);
23755 lit = Qfalse;
23756 }
23757 }
23758 if (RTEST(lit)) {
23759 VALUE k = shareable_literal_value(p, key);
23760 VALUE v = shareable_literal_value(p, val);
23761 if (!UNDEF_P(k) && !UNDEF_P(v)) {
23762 rb_hash_aset(lit, k, v);
23763 }
23764 else {
23765 rb_hash_clear(lit);
23766 lit = Qnil; /* make shareable at runtime */
23767 }
23768 }
23769 }
23770 break;
23771
23772 default:
23773 if (shareable == shareable_literal &&
23774 (SHAREABLE_BARE_EXPRESSION || level > 0)) {
23775 return ensure_shareable_node(p, dest, value, loc);
23776 }
23777 return 0;
23778 }
23779
23780 /* Array or Hash */
23781 if (!lit) return 0;
23782 if (NIL_P(lit)) {
23783 // if shareable_literal, all elements should have been ensured
23784 // as shareable
23785 value = make_shareable_node(p, value, false, loc);
23786 }
23787 else {
23788 value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
23789 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(value)->nd_lit);
23790 }
23791
23792 return value;
23793# undef shareable_literal_constant_next
23794}
23795
23796static NODE *
23797shareable_constant_value(struct parser_params *p, enum shareability shareable,
23798 NODE *lhs, NODE *value, const YYLTYPE *loc)
23799{
23800 if (!value) return 0;
23801 switch (shareable) {
23802 case shareable_none:
23803 return value;
23804
23805 case shareable_literal:
23806 {
23807 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
23808 if (lit) return lit;
23809 return value;
23810 }
23811 break;
23812
23813 case shareable_copy:
23814 case shareable_everything:
23815 {
23816 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
23817 if (lit) return lit;
23818 return make_shareable_node(p, value, shareable == shareable_copy, loc);
23819 }
23820 break;
23821
23822 default:
23824 }
23825}
23826
23827static NODE *
23828node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
23829{
23830 if (!lhs) return 0;
23831
23832 switch (nd_type(lhs)) {
23833 case NODE_CDECL:
23834 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
23835 /* fallthru */
23836
23837 case NODE_GASGN:
23838 case NODE_IASGN:
23839 case NODE_LASGN:
23840 case NODE_DASGN:
23841 case NODE_MASGN:
23842 case NODE_CVASGN:
23843 set_nd_value(p, lhs, rhs);
23844 nd_set_loc(lhs, loc);
23845 break;
23846
23847 case NODE_ATTRASGN:
23848 RNODE_ATTRASGN(lhs)->nd_args = arg_append(p, RNODE_ATTRASGN(lhs)->nd_args, rhs, loc);
23849 nd_set_loc(lhs, loc);
23850 break;
23851
23852 default:
23853 /* should not happen */
23854 break;
23855 }
23856
23857 return lhs;
23858}
23859
23860static NODE *
23861value_expr_check(struct parser_params *p, NODE *node)
23862{
23863 NODE *void_node = 0, *vn;
23864
23865 if (!node) {
23866 rb_warning0("empty expression");
23867 }
23868 while (node) {
23869 switch (nd_type(node)) {
23870 case NODE_RETURN:
23871 case NODE_BREAK:
23872 case NODE_NEXT:
23873 case NODE_REDO:
23874 case NODE_RETRY:
23875 return void_node ? void_node : node;
23876
23877 case NODE_CASE3:
23878 if (!RNODE_CASE3(node)->nd_body || !nd_type_p(RNODE_CASE3(node)->nd_body, NODE_IN)) {
23879 compile_error(p, "unexpected node");
23880 return NULL;
23881 }
23882 if (RNODE_IN(RNODE_CASE3(node)->nd_body)->nd_body) {
23883 return NULL;
23884 }
23885 /* single line pattern matching with "=>" operator */
23886 return void_node ? void_node : node;
23887
23888 case NODE_BLOCK:
23889 while (RNODE_BLOCK(node)->nd_next) {
23890 node = RNODE_BLOCK(node)->nd_next;
23891 }
23892 node = RNODE_BLOCK(node)->nd_head;
23893 break;
23894
23895 case NODE_BEGIN:
23896 node = RNODE_BEGIN(node)->nd_body;
23897 break;
23898
23899 case NODE_IF:
23900 case NODE_UNLESS:
23901 if (!RNODE_IF(node)->nd_body) {
23902 return NULL;
23903 }
23904 else if (!RNODE_IF(node)->nd_else) {
23905 return NULL;
23906 }
23907 vn = value_expr_check(p, RNODE_IF(node)->nd_body);
23908 if (!vn) return NULL;
23909 if (!void_node) void_node = vn;
23910 node = RNODE_IF(node)->nd_else;
23911 break;
23912
23913 case NODE_AND:
23914 case NODE_OR:
23915 node = RNODE_AND(node)->nd_1st;
23916 break;
23917
23918 case NODE_LASGN:
23919 case NODE_DASGN:
23920 case NODE_MASGN:
23921 mark_lvar_used(p, node);
23922 return NULL;
23923
23924 default:
23925 return NULL;
23926 }
23927 }
23928
23929 return NULL;
23930}
23931
23932static int
23933value_expr_gen(struct parser_params *p, NODE *node)
23934{
23935 NODE *void_node = value_expr_check(p, node);
23936 if (void_node) {
23937 yyerror1(&void_node->nd_loc, "void value expression");
23938 /* or "control never reach"? */
23939 return FALSE;
23940 }
23941 return TRUE;
23942}
23943
23944static void
23945void_expr(struct parser_params *p, NODE *node)
23946{
23947 const char *useless = 0;
23948
23949 if (!RTEST(ruby_verbose)) return;
23950
23951 if (!node || !(node = nd_once_body(node))) return;
23952 switch (nd_type(node)) {
23953 case NODE_OPCALL:
23954 switch (RNODE_OPCALL(node)->nd_mid) {
23955 case '+':
23956 case '-':
23957 case '*':
23958 case '/':
23959 case '%':
23960 case tPOW:
23961 case tUPLUS:
23962 case tUMINUS:
23963 case '|':
23964 case '^':
23965 case '&':
23966 case tCMP:
23967 case '>':
23968 case tGEQ:
23969 case '<':
23970 case tLEQ:
23971 case tEQ:
23972 case tNEQ:
23973 useless = rb_id2name(RNODE_OPCALL(node)->nd_mid);
23974 break;
23975 }
23976 break;
23977
23978 case NODE_LVAR:
23979 case NODE_DVAR:
23980 case NODE_GVAR:
23981 case NODE_IVAR:
23982 case NODE_CVAR:
23983 case NODE_NTH_REF:
23984 case NODE_BACK_REF:
23985 useless = "a variable";
23986 break;
23987 case NODE_CONST:
23988 useless = "a constant";
23989 break;
23990 case NODE_LIT:
23991 case NODE_STR:
23992 case NODE_DSTR:
23993 case NODE_DREGX:
23994 useless = "a literal";
23995 break;
23996 case NODE_COLON2:
23997 case NODE_COLON3:
23998 useless = "::";
23999 break;
24000 case NODE_DOT2:
24001 useless = "..";
24002 break;
24003 case NODE_DOT3:
24004 useless = "...";
24005 break;
24006 case NODE_SELF:
24007 useless = "self";
24008 break;
24009 case NODE_NIL:
24010 useless = "nil";
24011 break;
24012 case NODE_TRUE:
24013 useless = "true";
24014 break;
24015 case NODE_FALSE:
24016 useless = "false";
24017 break;
24018 case NODE_DEFINED:
24019 useless = "defined?";
24020 break;
24021 }
24022
24023 if (useless) {
24024 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
24025 }
24026}
24027
24028static NODE *
24029void_stmts(struct parser_params *p, NODE *node)
24030{
24031 NODE *const n = node;
24032 if (!RTEST(ruby_verbose)) return n;
24033 if (!node) return n;
24034 if (!nd_type_p(node, NODE_BLOCK)) return n;
24035
24036 while (RNODE_BLOCK(node)->nd_next) {
24037 void_expr(p, RNODE_BLOCK(node)->nd_head);
24038 node = RNODE_BLOCK(node)->nd_next;
24039 }
24040 return n;
24041}
24042
24043static NODE *
24044remove_begin(NODE *node)
24045{
24046 NODE **n = &node, *n1 = node;
24047 while (n1 && nd_type_p(n1, NODE_BEGIN) && RNODE_BEGIN(n1)->nd_body) {
24048 *n = n1 = RNODE_BEGIN(n1)->nd_body;
24049 }
24050 return node;
24051}
24052
24053static NODE *
24054remove_begin_all(NODE *node)
24055{
24056 NODE **n = &node, *n1 = node;
24057 while (n1 && nd_type_p(n1, NODE_BEGIN)) {
24058 *n = n1 = RNODE_BEGIN(n1)->nd_body;
24059 }
24060 return node;
24061}
24062
24063static void
24064reduce_nodes(struct parser_params *p, NODE **body)
24065{
24066 NODE *node = *body;
24067
24068 if (!node) {
24069 *body = NEW_NIL(&NULL_LOC);
24070 return;
24071 }
24072#define subnodes(type, n1, n2) \
24073 ((!type(node)->n1) ? (type(node)->n2 ? (body = &type(node)->n2, 1) : 0) : \
24074 (!type(node)->n2) ? (body = &type(node)->n1, 1) : \
24075 (reduce_nodes(p, &type(node)->n1), body = &type(node)->n2, 1))
24076
24077 while (node) {
24078 int newline = (int)(nd_fl_newline(node));
24079 switch (nd_type(node)) {
24080 end:
24081 case NODE_NIL:
24082 *body = 0;
24083 return;
24084 case NODE_RETURN:
24085 *body = node = RNODE_RETURN(node)->nd_stts;
24086 if (newline && node) nd_set_fl_newline(node);
24087 continue;
24088 case NODE_BEGIN:
24089 *body = node = RNODE_BEGIN(node)->nd_body;
24090 if (newline && node) nd_set_fl_newline(node);
24091 continue;
24092 case NODE_BLOCK:
24093 body = &RNODE_BLOCK(RNODE_BLOCK(node)->nd_end)->nd_head;
24094 break;
24095 case NODE_IF:
24096 case NODE_UNLESS:
24097 if (subnodes(RNODE_IF, nd_body, nd_else)) break;
24098 return;
24099 case NODE_CASE:
24100 body = &RNODE_CASE(node)->nd_body;
24101 break;
24102 case NODE_WHEN:
24103 if (!subnodes(RNODE_WHEN, nd_body, nd_next)) goto end;
24104 break;
24105 case NODE_ENSURE:
24106 if (!subnodes(RNODE_ENSURE, nd_head, nd_resq)) goto end;
24107 break;
24108 case NODE_RESCUE:
24109 newline = 0; // RESBODY should not be a NEWLINE
24110 if (RNODE_RESCUE(node)->nd_else) {
24111 body = &RNODE_RESCUE(node)->nd_resq;
24112 break;
24113 }
24114 if (!subnodes(RNODE_RESCUE, nd_head, nd_resq)) goto end;
24115 break;
24116 default:
24117 return;
24118 }
24119 node = *body;
24120 if (newline && node) nd_set_fl_newline(node);
24121 }
24122
24123#undef subnodes
24124}
24125
24126static int
24127is_static_content(NODE *node)
24128{
24129 if (!node) return 1;
24130 switch (nd_type(node)) {
24131 case NODE_HASH:
24132 if (!(node = RNODE_HASH(node)->nd_head)) break;
24133 case NODE_LIST:
24134 do {
24135 if (!is_static_content(RNODE_LIST(node)->nd_head)) return 0;
24136 } while ((node = RNODE_LIST(node)->nd_next) != 0);
24137 case NODE_LIT:
24138 case NODE_STR:
24139 case NODE_NIL:
24140 case NODE_TRUE:
24141 case NODE_FALSE:
24142 case NODE_ZLIST:
24143 break;
24144 default:
24145 return 0;
24146 }
24147 return 1;
24148}
24149
24150static int
24151assign_in_cond(struct parser_params *p, NODE *node)
24152{
24153 switch (nd_type(node)) {
24154 case NODE_MASGN:
24155 case NODE_LASGN:
24156 case NODE_DASGN:
24157 case NODE_GASGN:
24158 case NODE_IASGN:
24159 case NODE_CVASGN:
24160 case NODE_CDECL:
24161 break;
24162
24163 default:
24164 return 0;
24165 }
24166
24167 if (!get_nd_value(p, node)) return 1;
24168 if (is_static_content(get_nd_value(p, node))) {
24169 /* reports always */
24170 parser_warn(p, get_nd_value(p, node), "found `= literal' in conditional, should be ==");
24171 }
24172 return 1;
24173}
24174
24175enum cond_type {
24176 COND_IN_OP,
24177 COND_IN_COND,
24178 COND_IN_FF
24179};
24180
24181#define SWITCH_BY_COND_TYPE(t, w, arg) do { \
24182 switch (t) { \
24183 case COND_IN_OP: break; \
24184 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
24185 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
24186 } \
24187} while (0)
24188
24189static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*,bool);
24190
24191static NODE*
24192range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24193{
24194 enum node_type type;
24195
24196 if (node == 0) return 0;
24197
24198 type = nd_type(node);
24199 value_expr(node);
24200 if (type == NODE_LIT && FIXNUM_P(RNODE_LIT(node)->nd_lit)) {
24201 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
24202 ID lineno = rb_intern("$.");
24203 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
24204 }
24205 return cond0(p, node, COND_IN_FF, loc, true);
24206}
24207
24208static NODE*
24209cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc, bool top)
24210{
24211 if (node == 0) return 0;
24212 if (!(node = nd_once_body(node))) return 0;
24213 assign_in_cond(p, node);
24214
24215 switch (nd_type(node)) {
24216 case NODE_BEGIN:
24217 RNODE_BEGIN(node)->nd_body = cond0(p, RNODE_BEGIN(node)->nd_body, type, loc, top);
24218 break;
24219
24220 case NODE_DSTR:
24221 case NODE_EVSTR:
24222 case NODE_STR:
24223 SWITCH_BY_COND_TYPE(type, warn, "string ");
24224 break;
24225
24226 case NODE_DREGX:
24227 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ");
24228
24229 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
24230
24231 case NODE_BLOCK:
24232 RNODE_BLOCK(RNODE_BLOCK(node)->nd_end)->nd_head = cond0(p, RNODE_BLOCK(RNODE_BLOCK(node)->nd_end)->nd_head, type, loc, false);
24233 break;
24234
24235 case NODE_AND:
24236 case NODE_OR:
24237 RNODE_AND(node)->nd_1st = cond0(p, RNODE_AND(node)->nd_1st, COND_IN_COND, loc, true);
24238 RNODE_AND(node)->nd_2nd = cond0(p, RNODE_AND(node)->nd_2nd, COND_IN_COND, loc, true);
24239 break;
24240
24241 case NODE_DOT2:
24242 case NODE_DOT3:
24243 if (!top) break;
24244 RNODE_DOT2(node)->nd_beg = range_op(p, RNODE_DOT2(node)->nd_beg, loc);
24245 RNODE_DOT2(node)->nd_end = range_op(p, RNODE_DOT2(node)->nd_end, loc);
24246 if (nd_type_p(node, NODE_DOT2)) nd_set_type(node,NODE_FLIP2);
24247 else if (nd_type_p(node, NODE_DOT3)) nd_set_type(node, NODE_FLIP3);
24248 break;
24249
24250 case NODE_DSYM:
24251 warn_symbol:
24252 SWITCH_BY_COND_TYPE(type, warning, "symbol ");
24253 break;
24254
24255 case NODE_LIT:
24256 if (RB_TYPE_P(RNODE_LIT(node)->nd_lit, T_REGEXP)) {
24257 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ");
24258 nd_set_type(node, NODE_MATCH);
24259 }
24260 else if (RNODE_LIT(node)->nd_lit == Qtrue ||
24261 RNODE_LIT(node)->nd_lit == Qfalse) {
24262 /* booleans are OK, e.g., while true */
24263 }
24264 else if (SYMBOL_P(RNODE_LIT(node)->nd_lit)) {
24265 goto warn_symbol;
24266 }
24267 else {
24268 SWITCH_BY_COND_TYPE(type, warning, "");
24269 }
24270 default:
24271 break;
24272 }
24273 return node;
24274}
24275
24276static NODE*
24277cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24278{
24279 if (node == 0) return 0;
24280 return cond0(p, node, COND_IN_COND, loc, true);
24281}
24282
24283static NODE*
24284method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24285{
24286 if (node == 0) return 0;
24287 return cond0(p, node, COND_IN_OP, loc, true);
24288}
24289
24290static NODE*
24291new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
24292{
24293 YYLTYPE loc = {*pos, *pos};
24294 return NEW_NIL(&loc);
24295}
24296
24297static NODE*
24298new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
24299{
24300 if (!cc) return right;
24301 cc = cond0(p, cc, COND_IN_COND, loc, true);
24302 return newline_node(NEW_IF(cc, left, right, loc));
24303}
24304
24305static NODE*
24306new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
24307{
24308 if (!cc) return right;
24309 cc = cond0(p, cc, COND_IN_COND, loc, true);
24310 return newline_node(NEW_UNLESS(cc, left, right, loc));
24311}
24312
24313#define NEW_AND_OR(type, f, s, loc) (type == NODE_AND ? NEW_AND(f,s,loc) : NEW_OR(f,s,loc))
24314
24315static NODE*
24316logop(struct parser_params *p, ID id, NODE *left, NODE *right,
24317 const YYLTYPE *op_loc, const YYLTYPE *loc)
24318{
24319 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
24320 NODE *op;
24321 value_expr(left);
24322 if (left && nd_type_p(left, type)) {
24323 NODE *node = left, *second;
24324 while ((second = RNODE_AND(node)->nd_2nd) != 0 && nd_type_p(second, type)) {
24325 node = second;
24326 }
24327 RNODE_AND(node)->nd_2nd = NEW_AND_OR(type, second, right, loc);
24328 nd_set_line(RNODE_AND(node)->nd_2nd, op_loc->beg_pos.lineno);
24329 left->nd_loc.end_pos = loc->end_pos;
24330 return left;
24331 }
24332 op = NEW_AND_OR(type, left, right, loc);
24333 nd_set_line(op, op_loc->beg_pos.lineno);
24334 return op;
24335}
24336
24337#undef NEW_AND_OR
24338
24339static void
24340no_blockarg(struct parser_params *p, NODE *node)
24341{
24342 if (nd_type_p(node, NODE_BLOCK_PASS)) {
24343 compile_error(p, "block argument should not be given");
24344 }
24345}
24346
24347static NODE *
24348ret_args(struct parser_params *p, NODE *node)
24349{
24350 if (node) {
24351 no_blockarg(p, node);
24352 if (nd_type_p(node, NODE_LIST) && !RNODE_LIST(node)->nd_next) {
24353 node = RNODE_LIST(node)->nd_head;
24354 }
24355 }
24356 return node;
24357}
24358
24359static NODE *
24360new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24361{
24362 if (node) no_blockarg(p, node);
24363
24364 return NEW_YIELD(node, loc);
24365}
24366
24367static VALUE
24368negate_lit(struct parser_params *p, VALUE lit)
24369{
24370 if (FIXNUM_P(lit)) {
24371 return LONG2FIX(-FIX2LONG(lit));
24372 }
24373 if (SPECIAL_CONST_P(lit)) {
24374#if USE_FLONUM
24375 if (FLONUM_P(lit)) {
24376 return DBL2NUM(-RFLOAT_VALUE(lit));
24377 }
24378#endif
24379 goto unknown;
24380 }
24381 switch (BUILTIN_TYPE(lit)) {
24382 case T_BIGNUM:
24383 bignum_negate(lit);
24384 lit = rb_big_norm(lit);
24385 break;
24386 case T_RATIONAL:
24387 rational_set_num(lit, negate_lit(p, rational_get_num(lit)));
24388 break;
24389 case T_COMPLEX:
24390 rcomplex_set_real(lit, negate_lit(p, rcomplex_get_real(lit)));
24391 rcomplex_set_imag(lit, negate_lit(p, rcomplex_get_imag(lit)));
24392 break;
24393 case T_FLOAT:
24394 lit = DBL2NUM(-RFLOAT_VALUE(lit));
24395 break;
24396 unknown:
24397 default:
24398 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
24399 rb_builtin_class_name(lit));
24400 break;
24401 }
24402 return lit;
24403}
24404
24405static NODE *
24406arg_blk_pass(NODE *node1, rb_node_block_pass_t *node2)
24407{
24408 if (node2) {
24409 if (!node1) return (NODE *)node2;
24410 node2->nd_head = node1;
24411 nd_set_first_lineno(node2, nd_first_lineno(node1));
24412 nd_set_first_column(node2, nd_first_column(node1));
24413 return (NODE *)node2;
24414 }
24415 return node1;
24416}
24417
24418static bool
24419args_info_empty_p(struct rb_args_info *args)
24420{
24421 if (args->pre_args_num) return false;
24422 if (args->post_args_num) return false;
24423 if (args->rest_arg) return false;
24424 if (args->opt_args) return false;
24425 if (args->block_arg) return false;
24426 if (args->kw_args) return false;
24427 if (args->kw_rest_arg) return false;
24428 return true;
24429}
24430
24431static rb_node_args_t *
24432new_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)
24433{
24434 struct rb_args_info *args = &tail->nd_ainfo;
24435
24436 if (args->forwarding) {
24437 if (rest_arg) {
24438 yyerror1(&RNODE(tail)->nd_loc, "... after rest argument");
24439 return tail;
24440 }
24441 rest_arg = idFWD_REST;
24442 }
24443
24444 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
24445 args->pre_init = pre_args ? pre_args->nd_next : 0;
24446
24447 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
24448 args->post_init = post_args ? post_args->nd_next : 0;
24449 args->first_post_arg = post_args ? post_args->nd_pid : 0;
24450
24451 args->rest_arg = rest_arg;
24452
24453 args->opt_args = opt_args;
24454
24455#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
24456 args->ruby2_keywords = args->forwarding;
24457#else
24458 args->ruby2_keywords = 0;
24459#endif
24460
24461 nd_set_loc(RNODE(tail), loc);
24462
24463 return tail;
24464}
24465
24466static rb_node_args_t *
24467new_args_tail(struct parser_params *p, rb_node_kw_arg_t *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
24468{
24469 rb_node_args_t *node = NEW_ARGS(&NULL_LOC);
24470 struct rb_args_info *args = &node->nd_ainfo;
24471 if (p->error_p) return node;
24472
24473 args->block_arg = block;
24474 args->kw_args = kw_args;
24475
24476 if (kw_args) {
24477 /*
24478 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
24479 * variable order: k1, kr1, k2, &b, internal_id, krest
24480 * #=> <reorder>
24481 * variable order: kr1, k1, k2, internal_id, krest, &b
24482 */
24483 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
24484 struct vtable *vtargs = p->lvtbl->args;
24485 rb_node_kw_arg_t *kwn = kw_args;
24486
24487 if (block) block = vtargs->tbl[vtargs->pos-1];
24488 vtable_pop(vtargs, !!block + !!kw_rest_arg);
24489 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
24490 while (kwn) {
24491 if (!NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body)))
24492 --kw_vars;
24493 --required_kw_vars;
24494 kwn = kwn->nd_next;
24495 }
24496
24497 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
24498 ID vid = get_nd_vid(p, kwn->nd_body);
24499 if (NODE_REQUIRED_KEYWORD_P(get_nd_value(p, kwn->nd_body))) {
24500 *required_kw_vars++ = vid;
24501 }
24502 else {
24503 *kw_vars++ = vid;
24504 }
24505 }
24506
24507 arg_var(p, kw_bits);
24508 if (kw_rest_arg) arg_var(p, kw_rest_arg);
24509 if (block) arg_var(p, block);
24510
24511 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
24512 }
24513 else if (kw_rest_arg == idNil) {
24514 args->no_kwarg = 1;
24515 }
24516 else if (kw_rest_arg) {
24517 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
24518 }
24519
24520 return node;
24521}
24522
24523static rb_node_args_t *
24524args_with_numbered(struct parser_params *p, rb_node_args_t *args, int max_numparam)
24525{
24526 if (max_numparam > NO_PARAM) {
24527 if (!args) {
24528 YYLTYPE loc = RUBY_INIT_YYLLOC();
24529 args = new_args_tail(p, 0, 0, 0, 0);
24530 nd_set_loc(RNODE(args), &loc);
24531 }
24532 args->nd_ainfo.pre_args_num = max_numparam;
24533 }
24534 return args;
24535}
24536
24537static NODE*
24538new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
24539{
24540 RNODE_ARYPTN(aryptn)->nd_pconst = constant;
24541
24542 if (pre_arg) {
24543 NODE *pre_args = NEW_LIST(pre_arg, loc);
24544 if (RNODE_ARYPTN(aryptn)->pre_args) {
24545 RNODE_ARYPTN(aryptn)->pre_args = list_concat(pre_args, RNODE_ARYPTN(aryptn)->pre_args);
24546 }
24547 else {
24548 RNODE_ARYPTN(aryptn)->pre_args = pre_args;
24549 }
24550 }
24551 return aryptn;
24552}
24553
24554static NODE*
24555new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc)
24556{
24557 if (has_rest) {
24558 rest_arg = rest_arg ? rest_arg : NODE_SPECIAL_NO_NAME_REST;
24559 }
24560 else {
24561 rest_arg = NULL;
24562 }
24563 NODE *node = NEW_ARYPTN(pre_args, rest_arg, post_args, loc);
24564
24565 return node;
24566}
24567
24568static NODE*
24569new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
24570{
24571 RNODE_FNDPTN(fndptn)->nd_pconst = constant;
24572
24573 return fndptn;
24574}
24575
24576static NODE*
24577new_find_pattern_tail(struct parser_params *p, NODE *pre_rest_arg, NODE *args, NODE *post_rest_arg, const YYLTYPE *loc)
24578{
24579 pre_rest_arg = pre_rest_arg ? pre_rest_arg : NODE_SPECIAL_NO_NAME_REST;
24580 post_rest_arg = post_rest_arg ? post_rest_arg : NODE_SPECIAL_NO_NAME_REST;
24581 NODE *node = NEW_FNDPTN(pre_rest_arg, args, post_rest_arg, loc);
24582
24583 return node;
24584}
24585
24586static NODE*
24587new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
24588{
24589 RNODE_HSHPTN(hshptn)->nd_pconst = constant;
24590 return hshptn;
24591}
24592
24593static NODE*
24594new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
24595{
24596 NODE *node, *kw_rest_arg_node;
24597
24598 if (kw_rest_arg == idNil) {
24599 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
24600 }
24601 else if (kw_rest_arg) {
24602 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
24603 }
24604 else {
24605 kw_rest_arg_node = NULL;
24606 }
24607
24608 node = NEW_HSHPTN(0, kw_args, kw_rest_arg_node, loc);
24609
24610 return node;
24611}
24612
24613static NODE*
24614dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
24615{
24616 VALUE lit;
24617
24618 if (!node) {
24619 return NEW_LIT(ID2SYM(idNULL), loc);
24620 }
24621
24622 switch (nd_type(node)) {
24623 case NODE_DSTR:
24624 nd_set_type(node, NODE_DSYM);
24625 nd_set_loc(node, loc);
24626 break;
24627 case NODE_STR:
24628 lit = RNODE_STR(node)->nd_lit;
24629 RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(node)->nd_lit = ID2SYM(rb_intern_str(lit)));
24630 nd_set_type(node, NODE_LIT);
24631 nd_set_loc(node, loc);
24632 break;
24633 default:
24634 node = NEW_DSYM(Qnil, 1, NEW_LIST(node, loc), loc);
24635 break;
24636 }
24637 return node;
24638}
24639
24640static int
24641append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
24642{
24643 NODE *node = (NODE *)v;
24644 NODE **result = (NODE **)h;
24645 RNODE_LIST(node)->as.nd_alen = 2;
24646 RNODE_LIST(RNODE_LIST(node)->nd_next)->as.nd_end = RNODE_LIST(node)->nd_next;
24647 RNODE_LIST(RNODE_LIST(node)->nd_next)->nd_next = 0;
24648 if (*result)
24649 list_concat(*result, node);
24650 else
24651 *result = node;
24652 return ST_CONTINUE;
24653}
24654
24655static NODE *
24656remove_duplicate_keys(struct parser_params *p, NODE *hash)
24657{
24658 struct st_hash_type literal_type = {
24659 literal_cmp,
24660 literal_hash,
24661 };
24662
24663 st_table *literal_keys = st_init_table_with_size(&literal_type, RNODE_LIST(hash)->as.nd_alen / 2);
24664 NODE *result = 0;
24665 NODE *last_expr = 0;
24666 rb_code_location_t loc = hash->nd_loc;
24667 while (hash && RNODE_LIST(hash)->nd_next) {
24668 NODE *head = RNODE_LIST(hash)->nd_head;
24669 NODE *value = RNODE_LIST(hash)->nd_next;
24670 NODE *next = RNODE_LIST(value)->nd_next;
24671 st_data_t key = (st_data_t)head;
24672 st_data_t data;
24673 RNODE_LIST(value)->nd_next = 0;
24674 if (!head) {
24675 key = (st_data_t)value;
24676 }
24677 else if (nd_type_p(head, NODE_LIT) &&
24678 st_delete(literal_keys, (key = (st_data_t)RNODE_LIT(head)->nd_lit, &key), &data)) {
24679 NODE *dup_value = (RNODE_LIST((NODE *)data))->nd_next;
24680 rb_compile_warn(p->ruby_sourcefile, nd_line((NODE *)data),
24681 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
24682 RNODE_LIT(head)->nd_lit, nd_line(head));
24683 if (dup_value == last_expr) {
24684 RNODE_LIST(value)->nd_head = block_append(p, RNODE_LIST(dup_value)->nd_head, RNODE_LIST(value)->nd_head);
24685 }
24686 else {
24687 RNODE_LIST(last_expr)->nd_head = block_append(p, RNODE_LIST(dup_value)->nd_head, RNODE_LIST(last_expr)->nd_head);
24688 }
24689 }
24690 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
24691 last_expr = !head || nd_type_p(head, NODE_LIT) ? value : head;
24692 hash = next;
24693 }
24694 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
24695 st_free_table(literal_keys);
24696 if (hash) {
24697 if (!result) result = hash;
24698 else list_concat(result, hash);
24699 }
24700 result->nd_loc = loc;
24701 return result;
24702}
24703
24704static NODE *
24705new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
24706{
24707 if (hash) hash = remove_duplicate_keys(p, hash);
24708 return NEW_HASH(hash, loc);
24709}
24710#endif
24711
24712static void
24713error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
24714{
24715 if (is_private_local_id(p, id)) {
24716 return;
24717 }
24718 if (st_is_member(p->pvtbl, id)) {
24719 yyerror1(loc, "duplicated variable name");
24720 }
24721 else {
24722 st_insert(p->pvtbl, (st_data_t)id, 0);
24723 }
24724}
24725
24726static void
24727error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
24728{
24729 if (!p->pktbl) {
24730 p->pktbl = st_init_numtable();
24731 }
24732 else if (st_is_member(p->pktbl, key)) {
24733 yyerror1(loc, "duplicated key name");
24734 return;
24735 }
24736 st_insert(p->pktbl, (st_data_t)key, 0);
24737}
24738
24739#ifndef RIPPER
24740static NODE *
24741new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
24742{
24743 return NEW_HASH(hash, loc);
24744}
24745#endif /* !RIPPER */
24746
24747#ifndef RIPPER
24748static NODE *
24749new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
24750{
24751 NODE *asgn;
24752
24753 if (lhs) {
24754 ID vid = get_nd_vid(p, lhs);
24755 YYLTYPE lhs_loc = lhs->nd_loc;
24756 int shareable = ctxt.shareable_constant_value;
24757 if (shareable) {
24758 switch (nd_type(lhs)) {
24759 case NODE_CDECL:
24760 case NODE_COLON2:
24761 case NODE_COLON3:
24762 break;
24763 default:
24764 shareable = 0;
24765 break;
24766 }
24767 }
24768 if (op == tOROP) {
24769 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
24770 set_nd_value(p, lhs, rhs);
24771 nd_set_loc(lhs, loc);
24772 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
24773 }
24774 else if (op == tANDOP) {
24775 if (shareable) {
24776 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
24777 }
24778 set_nd_value(p, lhs, rhs);
24779 nd_set_loc(lhs, loc);
24780 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
24781 }
24782 else {
24783 asgn = lhs;
24784 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
24785 if (shareable) {
24786 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
24787 }
24788 set_nd_value(p, asgn, rhs);
24789 nd_set_loc(asgn, loc);
24790 }
24791 }
24792 else {
24793 asgn = NEW_BEGIN(0, loc);
24794 }
24795 return asgn;
24796}
24797
24798static NODE *
24799new_ary_op_assign(struct parser_params *p, NODE *ary,
24800 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
24801{
24802 NODE *asgn;
24803
24804 args = make_list(args, args_loc);
24805 asgn = NEW_OP_ASGN1(ary, op, args, rhs, loc);
24806 fixpos(asgn, ary);
24807 return asgn;
24808}
24809
24810static NODE *
24811new_attr_op_assign(struct parser_params *p, NODE *lhs,
24812 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
24813{
24814 NODE *asgn;
24815
24816 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
24817 fixpos(asgn, lhs);
24818 return asgn;
24819}
24820
24821static NODE *
24822new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
24823{
24824 NODE *asgn;
24825
24826 if (lhs) {
24827 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
24828 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
24829 }
24830 else {
24831 asgn = NEW_BEGIN(0, loc);
24832 }
24833 fixpos(asgn, lhs);
24834 return asgn;
24835}
24836
24837static NODE *
24838const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
24839{
24840 if (p->ctxt.in_def) {
24841 yyerror1(loc, "dynamic constant assignment");
24842 }
24843 return NEW_CDECL(0, 0, (path), loc);
24844}
24845#else
24846static VALUE
24847const_decl(struct parser_params *p, VALUE path)
24848{
24849 if (p->ctxt.in_def) {
24850 path = assign_error(p, "dynamic constant assignment", path);
24851 }
24852 return path;
24853}
24854
24855static VALUE
24856assign_error(struct parser_params *p, const char *mesg, VALUE a)
24857{
24858 a = dispatch2(assign_error, ERR_MESG(), a);
24859 ripper_error(p);
24860 return a;
24861}
24862
24863static VALUE
24864var_field(struct parser_params *p, VALUE a)
24865{
24866 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
24867}
24868#endif
24869
24870#ifndef RIPPER
24871static NODE *
24872new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
24873{
24874 NODE *result = head;
24875 if (rescue) {
24876 NODE *tmp = rescue_else ? rescue_else : rescue;
24877 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
24878
24879 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
24880 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
24881 }
24882 else if (rescue_else) {
24883 result = block_append(p, result, rescue_else);
24884 }
24885 if (ensure) {
24886 result = NEW_ENSURE(result, ensure, loc);
24887 }
24888 fixpos(result, head);
24889 return result;
24890}
24891#endif
24892
24893static void
24894warn_unused_var(struct parser_params *p, struct local_vars *local)
24895{
24896 int cnt;
24897
24898 if (!local->used) return;
24899 cnt = local->used->pos;
24900 if (cnt != local->vars->pos) {
24901 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
24902 }
24903#ifndef RIPPER
24904 ID *v = local->vars->tbl;
24905 ID *u = local->used->tbl;
24906 for (int i = 0; i < cnt; ++i) {
24907 if (!v[i] || (u[i] & LVAR_USED)) continue;
24908 if (is_private_local_id(p, v[i])) continue;
24909 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
24910 }
24911#endif
24912}
24913
24914static void
24915local_push(struct parser_params *p, int toplevel_scope)
24916{
24917 struct local_vars *local;
24918 int inherits_dvars = toplevel_scope && compile_for_eval;
24919 int warn_unused_vars = RTEST(ruby_verbose);
24920
24921 local = ALLOC(struct local_vars);
24922 local->prev = p->lvtbl;
24923 local->args = vtable_alloc(0);
24924 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
24925#ifndef RIPPER
24926 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
24927 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
24928 local->numparam.outer = 0;
24929 local->numparam.inner = 0;
24930 local->numparam.current = 0;
24931#endif
24932 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
24933
24934# if WARN_PAST_SCOPE
24935 local->past = 0;
24936# endif
24937 CMDARG_PUSH(0);
24938 COND_PUSH(0);
24939 p->lvtbl = local;
24940}
24941
24942static void
24943vtable_chain_free(struct parser_params *p, struct vtable *table)
24944{
24945 while (!DVARS_TERMINAL_P(table)) {
24946 struct vtable *cur_table = table;
24947 table = cur_table->prev;
24948 vtable_free(cur_table);
24949 }
24950}
24951
24952static void
24953local_free(struct parser_params *p, struct local_vars *local)
24954{
24955 vtable_chain_free(p, local->used);
24956
24957# if WARN_PAST_SCOPE
24958 vtable_chain_free(p, local->past);
24959# endif
24960
24961 vtable_chain_free(p, local->args);
24962 vtable_chain_free(p, local->vars);
24963
24964 ruby_sized_xfree(local, sizeof(struct local_vars));
24965}
24966
24967static void
24968local_pop(struct parser_params *p)
24969{
24970 struct local_vars *local = p->lvtbl->prev;
24971 if (p->lvtbl->used) {
24972 warn_unused_var(p, p->lvtbl);
24973 }
24974
24975 local_free(p, p->lvtbl);
24976 p->lvtbl = local;
24977
24978 CMDARG_POP();
24979 COND_POP();
24980}
24981
24982#ifndef RIPPER
24983static rb_ast_id_table_t *
24984local_tbl(struct parser_params *p)
24985{
24986 int cnt_args = vtable_size(p->lvtbl->args);
24987 int cnt_vars = vtable_size(p->lvtbl->vars);
24988 int cnt = cnt_args + cnt_vars;
24989 int i, j;
24990 rb_ast_id_table_t *tbl;
24991
24992 if (cnt <= 0) return 0;
24993 tbl = rb_ast_new_local_table(p->ast, cnt);
24994 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
24995 /* remove IDs duplicated to warn shadowing */
24996 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
24997 ID id = p->lvtbl->vars->tbl[i];
24998 if (!vtable_included(p->lvtbl->args, id)) {
24999 tbl->ids[j++] = id;
25000 }
25001 }
25002 if (j < cnt) {
25003 tbl = rb_ast_resize_latest_local_table(p->ast, j);
25004 }
25005
25006 return tbl;
25007}
25008
25009#endif
25010
25011static void
25012numparam_name(struct parser_params *p, ID id)
25013{
25014 if (!NUMPARAM_ID_P(id)) return;
25015 compile_error(p, "_%d is reserved for numbered parameter",
25016 NUMPARAM_ID_TO_IDX(id));
25017}
25018
25019static void
25020arg_var(struct parser_params *p, ID id)
25021{
25022 numparam_name(p, id);
25023 vtable_add(p->lvtbl->args, id);
25024}
25025
25026static void
25027local_var(struct parser_params *p, ID id)
25028{
25029 numparam_name(p, id);
25030 vtable_add(p->lvtbl->vars, id);
25031 if (p->lvtbl->used) {
25032 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
25033 }
25034}
25035
25036static int
25037local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
25038{
25039 struct vtable *vars, *args, *used;
25040
25041 vars = p->lvtbl->vars;
25042 args = p->lvtbl->args;
25043 used = p->lvtbl->used;
25044
25045 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25046 vars = vars->prev;
25047 args = args->prev;
25048 if (used) used = used->prev;
25049 }
25050
25051 if (vars && vars->prev == DVARS_INHERIT) {
25052 return rb_local_defined(id, p->parent_iseq);
25053 }
25054 else if (vtable_included(args, id)) {
25055 return 1;
25056 }
25057 else {
25058 int i = vtable_included(vars, id);
25059 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
25060 return i != 0;
25061 }
25062}
25063
25064static int
25065local_id(struct parser_params *p, ID id)
25066{
25067 return local_id_ref(p, id, NULL);
25068}
25069
25070static int
25071check_forwarding_args(struct parser_params *p)
25072{
25073 if (local_id(p, idFWD_ALL)) return TRUE;
25074 compile_error(p, "unexpected ...");
25075 return FALSE;
25076}
25077
25078static void
25079add_forwarding_args(struct parser_params *p)
25080{
25081 arg_var(p, idFWD_REST);
25082#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25083 arg_var(p, idFWD_KWREST);
25084#endif
25085 arg_var(p, idFWD_BLOCK);
25086 arg_var(p, idFWD_ALL);
25087}
25088
25089static void
25090forwarding_arg_check(struct parser_params *p, ID arg, ID all, const char *var)
25091{
25092 bool conflict = false;
25093
25094 struct vtable *vars, *args;
25095
25096 vars = p->lvtbl->vars;
25097 args = p->lvtbl->args;
25098
25099 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
25100 vars = vars->prev;
25101 args = args->prev;
25102 conflict |= (vtable_included(args, arg) && !(all && vtable_included(args, all)));
25103 }
25104
25105 bool found = false;
25106 if (vars && vars->prev == DVARS_INHERIT) {
25107 found = (rb_local_defined(arg, p->parent_iseq) &&
25108 !(all && rb_local_defined(all, p->parent_iseq)));
25109 }
25110 else {
25111 found = (vtable_included(args, arg) &&
25112 !(all && vtable_included(args, all)));
25113 }
25114
25115 if (!found) {
25116 compile_error(p, "no anonymous %s parameter", var);
25117 }
25118 else if (conflict) {
25119 compile_error(p, "anonymous %s parameter is also used within block", var);
25120 }
25121}
25122
25123#ifndef RIPPER
25124static NODE *
25125new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
25126{
25127 NODE *rest = NEW_LVAR(idFWD_REST, loc);
25128#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25129 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
25130#endif
25131 rb_node_block_pass_t *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), loc);
25132 NODE *args = leading ? rest_arg_append(p, leading, rest, argsloc) : NEW_SPLAT(rest, loc);
25133#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
25134 args = arg_append(p, args, new_hash(p, kwrest, loc), loc);
25135#endif
25136 return arg_blk_pass(args, block);
25137}
25138#endif
25139
25140static NODE *
25141numparam_push(struct parser_params *p)
25142{
25143#ifndef RIPPER
25144 struct local_vars *local = p->lvtbl;
25145 NODE *inner = local->numparam.inner;
25146 if (!local->numparam.outer) {
25147 local->numparam.outer = local->numparam.current;
25148 }
25149 local->numparam.inner = 0;
25150 local->numparam.current = 0;
25151 return inner;
25152#else
25153 return 0;
25154#endif
25155}
25156
25157static void
25158numparam_pop(struct parser_params *p, NODE *prev_inner)
25159{
25160#ifndef RIPPER
25161 struct local_vars *local = p->lvtbl;
25162 if (prev_inner) {
25163 /* prefer first one */
25164 local->numparam.inner = prev_inner;
25165 }
25166 else if (local->numparam.current) {
25167 /* current and inner are exclusive */
25168 local->numparam.inner = local->numparam.current;
25169 }
25170 if (p->max_numparam > NO_PARAM) {
25171 /* current and outer are exclusive */
25172 local->numparam.current = local->numparam.outer;
25173 local->numparam.outer = 0;
25174 }
25175 else {
25176 /* no numbered parameter */
25177 local->numparam.current = 0;
25178 }
25179#endif
25180}
25181
25182static const struct vtable *
25183dyna_push(struct parser_params *p)
25184{
25185 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
25186 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
25187 if (p->lvtbl->used) {
25188 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
25189 }
25190 return p->lvtbl->args;
25191}
25192
25193static void
25194dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
25195{
25196 struct vtable *tmp = *vtblp;
25197 *vtblp = tmp->prev;
25198# if WARN_PAST_SCOPE
25199 if (p->past_scope_enabled) {
25200 tmp->prev = p->lvtbl->past;
25201 p->lvtbl->past = tmp;
25202 return;
25203 }
25204# endif
25205 vtable_free(tmp);
25206}
25207
25208static void
25209dyna_pop_1(struct parser_params *p)
25210{
25211 struct vtable *tmp;
25212
25213 if ((tmp = p->lvtbl->used) != 0) {
25214 warn_unused_var(p, p->lvtbl);
25215 p->lvtbl->used = p->lvtbl->used->prev;
25216 vtable_free(tmp);
25217 }
25218 dyna_pop_vtable(p, &p->lvtbl->args);
25219 dyna_pop_vtable(p, &p->lvtbl->vars);
25220}
25221
25222static void
25223dyna_pop(struct parser_params *p, const struct vtable *lvargs)
25224{
25225 while (p->lvtbl->args != lvargs) {
25226 dyna_pop_1(p);
25227 if (!p->lvtbl->args) {
25228 struct local_vars *local = p->lvtbl->prev;
25229 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
25230 p->lvtbl = local;
25231 }
25232 }
25233 dyna_pop_1(p);
25234}
25235
25236static int
25237dyna_in_block(struct parser_params *p)
25238{
25239 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
25240}
25241
25242static int
25243dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
25244{
25245 struct vtable *vars, *args, *used;
25246 int i;
25247
25248 args = p->lvtbl->args;
25249 vars = p->lvtbl->vars;
25250 used = p->lvtbl->used;
25251
25252 while (!DVARS_TERMINAL_P(vars)) {
25253 if (vtable_included(args, id)) {
25254 return 1;
25255 }
25256 if ((i = vtable_included(vars, id)) != 0) {
25257 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
25258 return 1;
25259 }
25260 args = args->prev;
25261 vars = vars->prev;
25262 if (!vidrefp) used = 0;
25263 if (used) used = used->prev;
25264 }
25265
25266 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
25267 return rb_dvar_defined(id, p->parent_iseq);
25268 }
25269
25270 return 0;
25271}
25272
25273static int
25274dvar_defined(struct parser_params *p, ID id)
25275{
25276 return dvar_defined_ref(p, id, NULL);
25277}
25278
25279static int
25280dvar_curr(struct parser_params *p, ID id)
25281{
25282 return (vtable_included(p->lvtbl->args, id) ||
25283 vtable_included(p->lvtbl->vars, id));
25284}
25285
25286static void
25287reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
25288{
25289 compile_error(p,
25290 "regexp encoding option '%c' differs from source encoding '%s'",
25291 c, rb_enc_name(rb_enc_get(str)));
25292}
25293
25294#ifndef RIPPER
25295int
25296rb_reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
25297{
25298 int c = RE_OPTION_ENCODING_IDX(options);
25299
25300 if (c) {
25301 int opt, idx;
25302 rb_char_to_option_kcode(c, &opt, &idx);
25303 if (idx != ENCODING_GET(str) &&
25304 !is_ascii_string(str)) {
25305 goto error;
25306 }
25307 ENCODING_SET(str, idx);
25308 }
25309 else if (RE_OPTION_ENCODING_NONE(options)) {
25310 if (!ENCODING_IS_ASCII8BIT(str) &&
25311 !is_ascii_string(str)) {
25312 c = 'n';
25313 goto error;
25314 }
25315 rb_enc_associate(str, rb_ascii8bit_encoding());
25316 }
25317 else if (rb_is_usascii_enc(p->enc)) {
25318 if (!is_ascii_string(str)) {
25319 /* raise in re.c */
25320 rb_enc_associate(str, rb_usascii_encoding());
25321 }
25322 else {
25323 rb_enc_associate(str, rb_ascii8bit_encoding());
25324 }
25325 }
25326 return 0;
25327
25328 error:
25329 return c;
25330}
25331
25332static void
25333reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
25334{
25335 int c = rb_reg_fragment_setenc(p, str, options);
25336 if (c) reg_fragment_enc_error(p, str, c);
25337}
25338
25339static int
25340reg_fragment_check(struct parser_params* p, VALUE str, int options)
25341{
25342 VALUE err;
25343 reg_fragment_setenc(p, str, options);
25344 err = rb_reg_check_preprocess(str);
25345 if (err != Qnil) {
25346 err = rb_obj_as_string(err);
25347 compile_error(p, "%"PRIsVALUE, err);
25348 return 0;
25349 }
25350 return 1;
25351}
25352
25353#ifndef UNIVERSAL_PARSER
25354typedef struct {
25355 struct parser_params* parser;
25356 rb_encoding *enc;
25357 NODE *succ_block;
25358 const YYLTYPE *loc;
25360
25361static int
25362reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
25363 int back_num, int *back_refs, OnigRegex regex, void *arg0)
25364{
25366 struct parser_params* p = arg->parser;
25367 rb_encoding *enc = arg->enc;
25368 long len = name_end - name;
25369 const char *s = (const char *)name;
25370
25371 return rb_reg_named_capture_assign_iter_impl(p, s, len, enc, &arg->succ_block, arg->loc);
25372}
25373
25374static NODE *
25375reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
25376{
25378
25379 arg.parser = p;
25380 arg.enc = rb_enc_get(regexp);
25381 arg.succ_block = 0;
25382 arg.loc = loc;
25383 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
25384
25385 if (!arg.succ_block) return 0;
25386 return RNODE_BLOCK(arg.succ_block)->nd_next;
25387}
25388#endif
25389
25390int
25391rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len,
25392 rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc)
25393{
25394 ID var;
25395 NODE *node, *succ;
25396
25397 if (!len) return ST_CONTINUE;
25398 if (!VALID_SYMNAME_P(s, len, enc, ID_LOCAL))
25399 return ST_CONTINUE;
25400
25401 var = intern_cstr(s, len, enc);
25402 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
25403 if (!lvar_defined(p, var)) return ST_CONTINUE;
25404 }
25405 node = node_assign(p, assignable(p, var, 0, loc), NEW_LIT(ID2SYM(var), loc), NO_LEX_CTXT, loc);
25406 succ = *succ_block;
25407 if (!succ) succ = NEW_BEGIN(0, loc);
25408 succ = block_append(p, succ, node);
25409 *succ_block = succ;
25410 return ST_CONTINUE;
25411}
25412
25413static VALUE
25414parser_reg_compile(struct parser_params* p, VALUE str, int options)
25415{
25416 reg_fragment_setenc(p, str, options);
25417 return rb_parser_reg_compile(p, str, options);
25418}
25419
25420VALUE
25421rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
25422{
25423 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
25424}
25425
25426static VALUE
25427reg_compile(struct parser_params* p, VALUE str, int options)
25428{
25429 VALUE re;
25430 VALUE err;
25431
25432 err = rb_errinfo();
25433 re = parser_reg_compile(p, str, options);
25434 if (NIL_P(re)) {
25435 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
25436 rb_set_errinfo(err);
25437 compile_error(p, "%"PRIsVALUE, m);
25438 return Qnil;
25439 }
25440 return re;
25441}
25442#else
25443static VALUE
25444parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
25445{
25446 VALUE err = rb_errinfo();
25447 VALUE re;
25448 str = ripper_is_node_yylval(p, str) ? RNODE_RIPPER(str)->nd_cval : str;
25449 int c = rb_reg_fragment_setenc(p, str, options);
25450 if (c) reg_fragment_enc_error(p, str, c);
25451 re = rb_parser_reg_compile(p, str, options);
25452 if (NIL_P(re)) {
25453 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
25454 rb_set_errinfo(err);
25455 }
25456 return re;
25457}
25458#endif
25459
25460#ifndef RIPPER
25461void
25462rb_ruby_parser_set_options(struct parser_params *p, int print, int loop, int chomp, int split)
25463{
25464 p->do_print = print;
25465 p->do_loop = loop;
25466 p->do_chomp = chomp;
25467 p->do_split = split;
25468}
25469
25470static NODE *
25471parser_append_options(struct parser_params *p, NODE *node)
25472{
25473 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
25474 const YYLTYPE *const LOC = &default_location;
25475
25476 if (p->do_print) {
25477 NODE *print = (NODE *)NEW_FCALL(rb_intern("print"),
25478 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
25479 LOC);
25480 node = block_append(p, node, print);
25481 }
25482
25483 if (p->do_loop) {
25484 NODE *irs = NEW_LIST(NEW_GVAR(rb_intern("$/"), LOC), LOC);
25485
25486 if (p->do_split) {
25487 ID ifs = rb_intern("$;");
25488 ID fields = rb_intern("$F");
25489 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
25490 NODE *split = NEW_GASGN(fields,
25491 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
25492 rb_intern("split"), args, LOC),
25493 LOC);
25494 node = block_append(p, split, node);
25495 }
25496 if (p->do_chomp) {
25497 NODE *chomp = NEW_LIT(ID2SYM(rb_intern("chomp")), LOC);
25498 chomp = list_append(p, NEW_LIST(chomp, LOC), NEW_TRUE(LOC));
25499 irs = list_append(p, irs, NEW_HASH(chomp, LOC));
25500 }
25501
25502 node = NEW_WHILE((NODE *)NEW_FCALL(idGets, irs, LOC), node, 1, LOC);
25503 }
25504
25505 return node;
25506}
25507
25508void
25509rb_init_parse(void)
25510{
25511 /* just to suppress unused-function warnings */
25512 (void)nodetype;
25513 (void)nodeline;
25514}
25515
25516static ID
25517internal_id(struct parser_params *p)
25518{
25519 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
25520}
25521#endif /* !RIPPER */
25522
25523static void
25524parser_initialize(struct parser_params *p)
25525{
25526 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
25527 p->command_start = TRUE;
25528 p->ruby_sourcefile_string = Qnil;
25529 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
25530 p->node_id = 0;
25531 p->delayed.token = Qnil;
25532 p->frozen_string_literal = -1; /* not specified */
25533#ifdef RIPPER
25534 p->result = Qnil;
25535 p->parsing_thread = Qnil;
25536#else
25537 p->error_buffer = Qfalse;
25538 p->end_expect_token_locations = Qnil;
25539 p->token_id = 0;
25540 p->tokens = Qnil;
25541#endif
25542 p->debug_buffer = Qnil;
25543 p->debug_output = rb_ractor_stdout();
25544 p->enc = rb_utf8_encoding();
25545 p->exits = 0;
25546}
25547
25548#ifdef RIPPER
25549#define rb_ruby_parser_mark ripper_parser_mark
25550#define rb_ruby_parser_free ripper_parser_free
25551#define rb_ruby_parser_memsize ripper_parser_memsize
25552#endif
25553
25554void
25555rb_ruby_parser_mark(void *ptr)
25556{
25557 struct parser_params *p = (struct parser_params*)ptr;
25558
25559 rb_gc_mark(p->lex.input);
25560 rb_gc_mark(p->lex.lastline);
25561 rb_gc_mark(p->lex.nextline);
25562 rb_gc_mark(p->ruby_sourcefile_string);
25563 rb_gc_mark((VALUE)p->ast);
25564 rb_gc_mark(p->case_labels);
25565 rb_gc_mark(p->delayed.token);
25566#ifndef RIPPER
25567 rb_gc_mark(p->debug_lines);
25568 rb_gc_mark(p->error_buffer);
25569 rb_gc_mark(p->end_expect_token_locations);
25570 rb_gc_mark(p->tokens);
25571#else
25572 rb_gc_mark(p->value);
25573 rb_gc_mark(p->result);
25574 rb_gc_mark(p->parsing_thread);
25575#endif
25576 rb_gc_mark(p->debug_buffer);
25577 rb_gc_mark(p->debug_output);
25578#ifdef YYMALLOC
25579 rb_gc_mark((VALUE)p->heap);
25580#endif
25581}
25582
25583void
25584rb_ruby_parser_free(void *ptr)
25585{
25586 struct parser_params *p = (struct parser_params*)ptr;
25587 struct local_vars *local, *prev;
25588#ifdef UNIVERSAL_PARSER
25589 rb_parser_config_t *config = p->config;
25590#endif
25591
25592 if (p->tokenbuf) {
25593 ruby_sized_xfree(p->tokenbuf, p->toksiz);
25594 }
25595
25596 for (local = p->lvtbl; local; local = prev) {
25597 prev = local->prev;
25598 local_free(p, local);
25599 }
25600
25601 {
25602 token_info *ptinfo;
25603 while ((ptinfo = p->token_info) != 0) {
25604 p->token_info = ptinfo->next;
25605 xfree(ptinfo);
25606 }
25607 }
25608 xfree(ptr);
25609
25610#ifdef UNIVERSAL_PARSER
25611 config->counter--;
25612 if (config->counter <= 0) {
25613 rb_ruby_parser_config_free(config);
25614 }
25615#endif
25616}
25617
25618size_t
25619rb_ruby_parser_memsize(const void *ptr)
25620{
25621 struct parser_params *p = (struct parser_params*)ptr;
25622 struct local_vars *local;
25623 size_t size = sizeof(*p);
25624
25625 size += p->toksiz;
25626 for (local = p->lvtbl; local; local = local->prev) {
25627 size += sizeof(*local);
25628 if (local->vars) size += local->vars->capa * sizeof(ID);
25629 }
25630 return size;
25631}
25632
25633#ifdef UNIVERSAL_PARSER
25634rb_parser_config_t *
25635rb_ruby_parser_config_new(void *(*malloc)(size_t size))
25636{
25637 return (rb_parser_config_t *)malloc(sizeof(rb_parser_config_t));
25638}
25639
25640void
25641rb_ruby_parser_config_free(rb_parser_config_t *config)
25642{
25643 config->free(config);
25644}
25645#endif
25646
25647#ifndef UNIVERSAL_PARSER
25648#ifndef RIPPER
25649static const rb_data_type_t parser_data_type = {
25650 "parser",
25651 {
25652 rb_ruby_parser_mark,
25653 rb_ruby_parser_free,
25654 rb_ruby_parser_memsize,
25655 },
25656 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
25657};
25658#endif
25659#endif
25660
25661#ifndef RIPPER
25662#undef rb_reserved_word
25663
25664const struct kwtable *
25665rb_reserved_word(const char *str, unsigned int len)
25666{
25667 return reserved_word(str, len);
25668}
25669
25670#ifdef UNIVERSAL_PARSER
25672rb_ruby_parser_allocate(rb_parser_config_t *config)
25673{
25674 /* parser_initialize expects fields to be set to 0 */
25675 rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t));
25676 p->config = config;
25677 p->config->counter++;
25678 return p;
25679}
25680
25682rb_ruby_parser_new(rb_parser_config_t *config)
25683{
25684 /* parser_initialize expects fields to be set to 0 */
25685 rb_parser_t *p = rb_ruby_parser_allocate(config);
25686 parser_initialize(p);
25687 return p;
25688}
25689#endif
25690
25692rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main)
25693{
25694 p->error_buffer = main ? Qfalse : Qnil;
25695 p->parent_iseq = base;
25696 return p;
25697}
25698
25699void
25700rb_ruby_parser_set_script_lines(rb_parser_t *p, VALUE lines)
25701{
25702 if (!RTEST(lines)) {
25703 lines = Qfalse;
25704 }
25705 else if (lines == Qtrue) {
25706 lines = rb_ary_new();
25707 }
25708 else {
25709 Check_Type(lines, T_ARRAY);
25710 rb_ary_modify(lines);
25711 }
25712 p->debug_lines = lines;
25713}
25714
25715void
25716rb_ruby_parser_error_tolerant(rb_parser_t *p)
25717{
25718 p->error_tolerant = 1;
25719 // TODO
25720 p->end_expect_token_locations = rb_ary_new();
25721}
25722
25723void
25724rb_ruby_parser_keep_tokens(rb_parser_t *p)
25725{
25726 p->keep_tokens = 1;
25727 // TODO
25728 p->tokens = rb_ary_new();
25729}
25730
25731#ifndef UNIVERSAL_PARSER
25732rb_ast_t*
25733rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
25734{
25735 struct parser_params *p;
25736
25737 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25738 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25739 return rb_ruby_parser_compile_file_path(p, fname, file, start);
25740}
25741
25742rb_ast_t*
25743rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
25744{
25745 struct parser_params *p;
25746
25747 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25748 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25749 return rb_ruby_parser_compile_generic(p, lex_gets, fname, input, start);
25750}
25751
25752rb_ast_t*
25753rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
25754{
25755 struct parser_params *p;
25756
25757 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25758 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25759 return rb_ruby_parser_compile_string(p, f, s, line);
25760}
25761
25762rb_ast_t*
25763rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
25764{
25765 struct parser_params *p;
25766
25767 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25768 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
25769 return rb_ruby_parser_compile_string_path(p, f, s, line);
25770}
25771
25772VALUE
25773rb_parser_encoding(VALUE vparser)
25774{
25775 struct parser_params *p;
25776
25777 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25778 return rb_ruby_parser_encoding(p);
25779}
25780
25781VALUE
25782rb_parser_end_seen_p(VALUE vparser)
25783{
25784 struct parser_params *p;
25785
25786 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25787 return RBOOL(rb_ruby_parser_end_seen_p(p));
25788}
25789
25790void
25791rb_parser_error_tolerant(VALUE vparser)
25792{
25793 struct parser_params *p;
25794
25795 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25796 rb_ruby_parser_error_tolerant(p);
25797}
25798
25799void
25800rb_parser_set_script_lines(VALUE vparser, VALUE lines)
25801{
25802 struct parser_params *p;
25803
25804 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25805 rb_ruby_parser_set_script_lines(p, lines);
25806}
25807
25808void
25809rb_parser_keep_tokens(VALUE vparser)
25810{
25811 struct parser_params *p;
25812
25813 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25814 rb_ruby_parser_keep_tokens(p);
25815}
25816
25817VALUE
25818rb_parser_new(void)
25819{
25820 struct parser_params *p;
25821 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
25822 &parser_data_type, p);
25823 parser_initialize(p);
25824 return parser;
25825}
25826
25827VALUE
25828rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
25829{
25830 struct parser_params *p;
25831
25832 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25833 rb_ruby_parser_set_context(p, base, main);
25834 return vparser;
25835}
25836
25837void
25838rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
25839{
25840 struct parser_params *p;
25841
25842 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
25843 rb_ruby_parser_set_options(p, print, loop, chomp, split);
25844}
25845
25846VALUE
25847rb_parser_set_yydebug(VALUE self, VALUE flag)
25848{
25849 struct parser_params *p;
25850
25851 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
25852 rb_ruby_parser_set_yydebug(p, RTEST(flag));
25853 return flag;
25854}
25855#endif /* !UNIVERSAL_PARSER */
25856
25857VALUE
25858rb_ruby_parser_encoding(rb_parser_t *p)
25859{
25860 return rb_enc_from_encoding(p->enc);
25861}
25862
25863int
25864rb_ruby_parser_end_seen_p(rb_parser_t *p)
25865{
25866 return p->ruby__end__seen;
25867}
25868
25869int
25870rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag)
25871{
25872 p->debug = flag;
25873 return flag;
25874}
25875#endif /* !RIPPER */
25876
25877#ifdef RIPPER
25878int
25879rb_ruby_parser_get_yydebug(rb_parser_t *p)
25880{
25881 return p->debug;
25882}
25883
25884void
25885rb_ruby_parser_set_value(rb_parser_t *p, VALUE value)
25886{
25887 p->value = value;
25888}
25889
25890int
25891rb_ruby_parser_error_p(rb_parser_t *p)
25892{
25893 return p->error_p;
25894}
25895
25896VALUE
25897rb_ruby_parser_debug_output(rb_parser_t *p)
25898{
25899 return p->debug_output;
25900}
25901
25902void
25903rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output)
25904{
25905 p->debug_output = output;
25906}
25907
25908VALUE
25909rb_ruby_parser_parsing_thread(rb_parser_t *p)
25910{
25911 return p->parsing_thread;
25912}
25913
25914void
25915rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread)
25916{
25917 p->parsing_thread = parsing_thread;
25918}
25919
25920void
25921rb_ruby_parser_ripper_initialize(rb_parser_t *p, VALUE (*gets)(struct parser_params*,VALUE), VALUE input, VALUE sourcefile_string, const char *sourcefile, int sourceline)
25922{
25923 p->lex.gets = gets;
25924 p->lex.input = input;
25925 p->eofp = 0;
25926 p->ruby_sourcefile_string = sourcefile_string;
25927 p->ruby_sourcefile = sourcefile;
25928 p->ruby_sourceline = sourceline;
25929}
25930
25931VALUE
25932rb_ruby_parser_result(rb_parser_t *p)
25933{
25934 return p->result;
25935}
25936
25938rb_ruby_parser_enc(rb_parser_t *p)
25939{
25940 return p->enc;
25941}
25942
25943VALUE
25944rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p)
25945{
25946 return p->ruby_sourcefile_string;
25947}
25948
25949int
25950rb_ruby_parser_ruby_sourceline(rb_parser_t *p)
25951{
25952 return p->ruby_sourceline;
25953}
25954
25955int
25956rb_ruby_parser_lex_state(rb_parser_t *p)
25957{
25958 return p->lex.state;
25959}
25960
25961void
25962rb_ruby_ripper_parse0(rb_parser_t *p)
25963{
25964 parser_prepare(p);
25965 p->ast = rb_ast_new();
25966 ripper_yyparse((void*)p);
25967 rb_ast_dispose(p->ast);
25968 p->ast = 0;
25969}
25970
25971int
25972rb_ruby_ripper_dedent_string(rb_parser_t *p, VALUE string, int width)
25973{
25974 return dedent_string(p, string, width);
25975}
25976
25977VALUE
25978rb_ruby_ripper_lex_get_str(rb_parser_t *p, VALUE s)
25979{
25980 return lex_get_str(p, s);
25981}
25982
25983int
25984rb_ruby_ripper_initialized_p(rb_parser_t *p)
25985{
25986 return p->lex.input != 0;
25987}
25988
25989void
25990rb_ruby_ripper_parser_initialize(rb_parser_t *p)
25991{
25992 parser_initialize(p);
25993}
25994
25995long
25996rb_ruby_ripper_column(rb_parser_t *p)
25997{
25998 return p->lex.ptok - p->lex.pbeg;
25999}
26000
26001long
26002rb_ruby_ripper_token_len(rb_parser_t *p)
26003{
26004 return p->lex.pcur - p->lex.ptok;
26005}
26006
26007VALUE
26008rb_ruby_ripper_lex_lastline(rb_parser_t *p)
26009{
26010 return p->lex.lastline;
26011}
26012
26013VALUE
26014rb_ruby_ripper_lex_state_name(struct parser_params *p, int state)
26015{
26016 return rb_parser_lex_state_name(p, (enum lex_state_e)state);
26017}
26018
26019struct parser_params*
26020rb_ruby_ripper_parser_allocate(void)
26021{
26022 return (struct parser_params *)ruby_xcalloc(1, sizeof(struct parser_params));
26023}
26024#endif /* RIPPER */
26025
26026#ifndef RIPPER
26027#ifdef YYMALLOC
26028#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
26029/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
26030 * potential memory leak */
26031#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
26032#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
26033 (new)->cnt = (cnt), (ptr))
26034
26035void *
26036rb_parser_malloc(struct parser_params *p, size_t size)
26037{
26038 size_t cnt = HEAPCNT(1, size);
26039 rb_imemo_tmpbuf_t *n = NEWHEAP();
26040 void *ptr = xmalloc(size);
26041
26042 return ADD2HEAP(n, cnt, ptr);
26043}
26044
26045void *
26046rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
26047{
26048 size_t cnt = HEAPCNT(nelem, size);
26049 rb_imemo_tmpbuf_t *n = NEWHEAP();
26050 void *ptr = xcalloc(nelem, size);
26051
26052 return ADD2HEAP(n, cnt, ptr);
26053}
26054
26055void *
26056rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
26057{
26059 size_t cnt = HEAPCNT(1, size);
26060
26061 if (ptr && (n = p->heap) != NULL) {
26062 do {
26063 if (n->ptr == ptr) {
26064 n->ptr = ptr = xrealloc(ptr, size);
26065 if (n->cnt) n->cnt = cnt;
26066 return ptr;
26067 }
26068 } while ((n = n->next) != NULL);
26069 }
26070 n = NEWHEAP();
26071 ptr = xrealloc(ptr, size);
26072 return ADD2HEAP(n, cnt, ptr);
26073}
26074
26075void
26076rb_parser_free(struct parser_params *p, void *ptr)
26077{
26078 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
26079
26080 while ((n = *prev) != NULL) {
26081 if (n->ptr == ptr) {
26082 *prev = n->next;
26083 break;
26084 }
26085 prev = &n->next;
26086 }
26087}
26088#endif
26089
26090void
26091rb_parser_printf(struct parser_params *p, const char *fmt, ...)
26092{
26093 va_list ap;
26094 VALUE mesg = p->debug_buffer;
26095
26096 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
26097 va_start(ap, fmt);
26098 rb_str_vcatf(mesg, fmt, ap);
26099 va_end(ap);
26100 if (end_with_newline_p(p, mesg)) {
26101 rb_io_write(p->debug_output, mesg);
26102 p->debug_buffer = Qnil;
26103 }
26104}
26105
26106static void
26107parser_compile_error(struct parser_params *p, const rb_code_location_t *loc, const char *fmt, ...)
26108{
26109 va_list ap;
26110 int lineno, column;
26111
26112 if (loc) {
26113 lineno = loc->end_pos.lineno;
26114 column = loc->end_pos.column;
26115 }
26116 else {
26117 lineno = p->ruby_sourceline;
26118 column = rb_long2int(p->lex.pcur - p->lex.pbeg);
26119 }
26120
26121 rb_io_flush(p->debug_output);
26122 p->error_p = 1;
26123 va_start(ap, fmt);
26124 p->error_buffer =
26125 rb_syntax_error_append(p->error_buffer,
26126 p->ruby_sourcefile_string,
26127 lineno, column,
26128 p->enc, fmt, ap);
26129 va_end(ap);
26130}
26131
26132static size_t
26133count_char(const char *str, int c)
26134{
26135 int n = 0;
26136 while (str[n] == c) ++n;
26137 return n;
26138}
26139
26140/*
26141 * strip enclosing double-quotes, same as the default yytnamerr except
26142 * for that single-quotes matching back-quotes do not stop stripping.
26143 *
26144 * "\"`class' keyword\"" => "`class' keyword"
26145 */
26146RUBY_FUNC_EXPORTED size_t
26147rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
26148{
26149 if (*yystr == '"') {
26150 size_t yyn = 0, bquote = 0;
26151 const char *yyp = yystr;
26152
26153 while (*++yyp) {
26154 switch (*yyp) {
26155 case '`':
26156 if (!bquote) {
26157 bquote = count_char(yyp+1, '`') + 1;
26158 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
26159 yyn += bquote;
26160 yyp += bquote - 1;
26161 break;
26162 }
26163 goto default_char;
26164
26165 case '\'':
26166 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
26167 if (yyres) memcpy(yyres + yyn, yyp, bquote);
26168 yyn += bquote;
26169 yyp += bquote - 1;
26170 bquote = 0;
26171 break;
26172 }
26173 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
26174 if (yyres) memcpy(yyres + yyn, yyp, 3);
26175 yyn += 3;
26176 yyp += 2;
26177 break;
26178 }
26179 goto do_not_strip_quotes;
26180
26181 case ',':
26182 goto do_not_strip_quotes;
26183
26184 case '\\':
26185 if (*++yyp != '\\')
26186 goto do_not_strip_quotes;
26187 /* Fall through. */
26188 default_char:
26189 default:
26190 if (yyres)
26191 yyres[yyn] = *yyp;
26192 yyn++;
26193 break;
26194
26195 case '"':
26196 case '\0':
26197 if (yyres)
26198 yyres[yyn] = '\0';
26199 return yyn;
26200 }
26201 }
26202 do_not_strip_quotes: ;
26203 }
26204
26205 if (!yyres) return strlen(yystr);
26206
26207 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
26208}
26209#endif
26210
26211#ifdef RIPPER
26212#ifdef RIPPER_DEBUG
26213/* :nodoc: */
26214static VALUE
26215ripper_validate_object(VALUE self, VALUE x)
26216{
26217 if (x == Qfalse) return x;
26218 if (x == Qtrue) return x;
26219 if (NIL_P(x)) return x;
26220 if (UNDEF_P(x))
26221 rb_raise(rb_eArgError, "Qundef given");
26222 if (FIXNUM_P(x)) return x;
26223 if (SYMBOL_P(x)) return x;
26224 switch (BUILTIN_TYPE(x)) {
26225 case T_STRING:
26226 case T_OBJECT:
26227 case T_ARRAY:
26228 case T_BIGNUM:
26229 case T_FLOAT:
26230 case T_COMPLEX:
26231 case T_RATIONAL:
26232 break;
26233 case T_NODE:
26234 if (!nd_type_p((NODE *)x, NODE_RIPPER)) {
26235 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
26236 }
26237 x = ((NODE *)x)->nd_rval;
26238 break;
26239 default:
26240 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
26241 (void *)x, rb_obj_classname(x));
26242 }
26243 if (!RBASIC_CLASS(x)) {
26244 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
26245 (void *)x, rb_builtin_type_name(TYPE(x)));
26246 }
26247 return x;
26248}
26249#endif
26250
26251#define validate(x) ((x) = get_value(x))
26252
26253static VALUE
26254ripper_dispatch0(struct parser_params *p, ID mid)
26255{
26256 return rb_funcall(p->value, mid, 0);
26257}
26258
26259static VALUE
26260ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
26261{
26262 validate(a);
26263 return rb_funcall(p->value, mid, 1, a);
26264}
26265
26266static VALUE
26267ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
26268{
26269 validate(a);
26270 validate(b);
26271 return rb_funcall(p->value, mid, 2, a, b);
26272}
26273
26274static VALUE
26275ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
26276{
26277 validate(a);
26278 validate(b);
26279 validate(c);
26280 return rb_funcall(p->value, mid, 3, a, b, c);
26281}
26282
26283static VALUE
26284ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
26285{
26286 validate(a);
26287 validate(b);
26288 validate(c);
26289 validate(d);
26290 return rb_funcall(p->value, mid, 4, a, b, c, d);
26291}
26292
26293static VALUE
26294ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
26295{
26296 validate(a);
26297 validate(b);
26298 validate(c);
26299 validate(d);
26300 validate(e);
26301 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
26302}
26303
26304static VALUE
26305ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
26306{
26307 validate(a);
26308 validate(b);
26309 validate(c);
26310 validate(d);
26311 validate(e);
26312 validate(f);
26313 validate(g);
26314 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
26315}
26316
26317void
26318ripper_error(struct parser_params *p)
26319{
26320 p->error_p = TRUE;
26321}
26322
26323VALUE
26324ripper_value(struct parser_params *p)
26325{
26326 (void)yystpcpy; /* may not used in newer bison */
26327
26328 return p->value;
26329}
26330
26331#endif /* RIPPER */
26332/*
26333 * Local variables:
26334 * mode: c
26335 * c-file-style: "ruby"
26336 * End:
26337 */
#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 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:2090
#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:3382
#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.